2008年10月25日

摘要: 话说谁也有不会的东西,尤其是搞计算机这种【高科技】玩意,任谁也有不懂的地方。高手都是从菜鸟成长起来的,多学多练,不懂就问是正确的方法。 像我等搞游戏的新手,做图形方向的东西,不懂的实在太多,慢慢学来,有不会的就问,无非几种途径,搜索引擎,公司的前辈,QQ技术群,论坛,新闻组。 搜索引擎倒是离不了手的,但凡有事情总是先去搜的,但不幸的是,过于偏一点的东西,尤其是技术上的事 情,每每总有一点和自己不太... 阅读全文

posted @ 2008-10-25 14:59 活着就是幸福 阅读(202) 评论(0) 推荐(0)

摘要: 最近想看的几本书都没有货,那本很好的3D游戏编程大师技巧缺货,下边的评论一个劲叫唤说要出版社重印(我也呻吟了一声),不知道为什么出版社不肯重印,也许过于专业了吧。也没有人卖,有的话倒是宁可全价买回来也值得了。 另外一本Advanced Animation with DirectX倒是有电子书,不错的,可惜没有影印版。China-pub上看到了翻译版,可惜看看评论就知道有多烂了,国内一向如此,好好的... 阅读全文

posted @ 2008-10-25 14:58 活着就是幸福 阅读(237) 评论(1) 推荐(0)

摘要: 1.时间戳自动检测和覆盖 2.颜色提示 3.双平台 4.XBOX360自动产生UPDB文件 不足: 1.产生的UPDB文件都在根目录下 2.错误信息混在编译警告中 3.360版必须打开工程使用DEBUG版进行编译。PC可以使用命令行。 阅读全文

posted @ 2008-10-25 14:56 活着就是幸福 阅读(265) 评论(0) 推荐(0)

摘要: Each shader will have it's own constant table, since each has to be compiled seperately with a call to D3DXD3DXCompileShaderFromFile. Therefore changes to shader constants for one shader will not affe... 阅读全文

posted @ 2008-10-25 14:52 活着就是幸福 阅读(203) 评论(0) 推荐(0)

摘要: 非static 定义的变量在shader里面不会使用初始值。 比如float screen_width = 1280.0; 运行时并不会等于1280,貌似会变成0. 好像要调用SetDefault()方法。 阅读全文

posted @ 2008-10-25 14:50 活着就是幸福 阅读(273) 评论(0) 推荐(0)

摘要: 目前新版DXSDK 2008.6以后的BorderColor是使用float4类型,而在360里仍然使用DWORD,如果不做转换则通过词法分析后会导致unhandled exception. 另外360上编译shader速度相当慢,最好读取编译过的shader,但是不能在PC上编,因为POWERPC和X86字节序不同。 编译函数如下 Code highlighting produced b... 阅读全文

posted @ 2008-10-25 13:37 活着就是幸福 阅读(383) 评论(0) 推荐(0)

摘要: 1. Datatype misalignment: 指针地址未对齐(float必须为4字节对齐) 解决方法:拷贝源数据到新的float数组里,使用数组里的副本进行运算,对于PC上原始未对齐的数据可以免于修改。2. PC上由于可以直接将Texture作为RenderTarget进行渲染,所以在切换RenderTarget时只要保存当前的 RenderTarget的指针即可。但在XBOX360上... 阅读全文

posted @ 2008-10-25 13:34 活着就是幸福 阅读(301) 评论(0) 推荐(0)

摘要: 1. Xbox 360 does not support the creation of lockable render-targets. Using the IDirect3DDevice9::Resolve method, render-targets can be copied to a texture that, in turn, can be locked. When using E... 阅读全文

posted @ 2008-10-25 13:33 活着就是幸福 阅读(673) 评论(0) 推荐(0)

摘要: 1. The function [ IDirect3DDevice9::CololorFill() ] is removed, so use [ IDirect3DDevice9::Clear() ] and [ IDirect3DDevice9::Resolve() ] to get the same result. 2. Fixed pipeline is removed, so had ... 阅读全文

posted @ 2008-10-25 13:27 活着就是幸福 阅读(408) 评论(0) 推荐(0)

摘要: 阅读全文

posted @ 2008-10-25 13:09 活着就是幸福 阅读(10894) 评论(0) 推荐(0)

摘要: 在两者功能冲突的状态下,好像设置了SetPixelShader以后就按照PixelShader进行输 出,而忽略掉SetTextureStageState的设置。如果想要SetTextureStageState起作用,必须 SetPixelShader( NULL )或者不设置。 比如顶点有Diffuse,加一张Texture SetTextureStageState要使用顶点颜色,而Pixel... 阅读全文

posted @ 2008-10-25 13:07 活着就是幸福 阅读(1324) 评论(0) 推荐(1)

摘要: 如果SetFVF()里用了D3DFVF_TEX[N]的话,等于前面的D3DFVF_TEX[N-1]都设置过了,在写 vertex declaration的时候,也要把相应的tex写上.GameDev上各位Gurus回答的原文摘抄如下: 1. D3DFVF_TEXCOORD2 counts as "this vertex has TWO texcoordinates". It's not "Th... 阅读全文

posted @ 2008-10-25 13:06 活着就是幸福 阅读(918) 评论(0) 推荐(0)

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#undef __STR2__ #undef __STR1__ #undef __WARNING_MESSAGE__ #undef __NORMAL_MESSAGE__ #define __S... 阅读全文

posted @ 2008-10-25 13:01 活着就是幸福 阅读(190) 评论(0) 推荐(0)

摘要: 实在找不到好用的HLSL编辑器,FX Composer大的要死,还有一堆莫名其妙的BUG, UltraEdit也找不到好的语法加亮的列表, 干脆自己动手丰衣足食吧. 1.建立名字叫做"usertype.dat"的纯文本文件, 把以下关键字Copy到里面,一个关键字一行. 2.把此文件放到和VS IDE同目录下.(..\Microsoft Visual Studio X.0\Common... 阅读全文

posted @ 2008-10-25 12:55 活着就是幸福 阅读(950) 评论(3) 推荐(0)

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->D3DVERTEXELEMENT9 vertexelement[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT... 阅读全文

posted @ 2008-10-25 12:39 活着就是幸福 阅读(243) 评论(0) 推荐(0)

摘要: 模板类的函数定义最好写在类体里面或者写在紧紧跟随类体定义的后面,如果写在CPP里就会发生"warning LNK4221: no public symbols found; archive member will be inaccessible" 警告.当然还有一种方法是写在.inc文件里,在头文件的最后include 这个inc文件.算半个隐藏方法吧. 阅读全文

posted @ 2008-10-25 12:31 活着就是幸福 阅读(985) 评论(0) 推荐(0)

摘要: CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->inline bool IsSpace(Char c) // Space, tabulation, line feed or return { return(c == TEXT(... 阅读全文

posted @ 2008-10-25 12:29 活着就是幸福 阅读(246) 评论(0) 推荐(0)

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->std::wofstream fout( filename.c_str(), std::ios::out ); fout.imbue(std::locale("chs"));fout<<somes... 阅读全文

posted @ 2008-10-25 12:24 活着就是幸福 阅读(804) 评论(0) 推荐(0)

摘要: CString转std::wstring std::wstring str = filename.GetString(); std::wstring转CString CString str( filename.c_str() ); 阅读全文

posted @ 2008-10-25 12:23 活着就是幸福 阅读(7927) 评论(0) 推荐(0)

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1#include 2using namespace std; 3 4template 5class sample 6{ 7public: 8 9 friend ost... 阅读全文

posted @ 2008-10-25 12:05 活着就是幸福 阅读(1283) 评论(0) 推荐(0)

摘要: 下载地址:http://files.cnblogs.com/wswqwps/CharAnim.zip 其实可以读入N幅连续的图片,识别, 转换,保存成字符数组文件,读取,播放。 这就是个super mini的另类引擎了。 阅读全文

posted @ 2008-10-25 11:57 活着就是幸福 阅读(240) 评论(0) 推荐(0)

摘要: 4. 非类型模板参数 4.1 非类型类模板参数 1.非类型参数里面,比如Stack;每个模板实例是自己的类型 Stack 和Stack是不同类型 2.可以给非参数类型指定默认参数(参数类型也仍然可以指定),但从设计上来说可能 不太好 4.2 非类型函数模板参数 模板参数不能被用来进行模板参数推演(意思就是把函数作为参数放在别... 阅读全文

posted @ 2008-10-25 11:29 活着就是幸福 阅读(167) 评论(0) 推荐(0)

摘要: 3 类模板 3.1类模板声明 1.可以使用typename 或者class 关键字,不能使用struct 2.在头部放置template 3.使用模板类作为类型来声明时,要使用classname的形式 4.定义类成员函数时应该说明是函数模板(使用template) 同时使用类模板的完全类型限定 【插曲:源代码说明... 阅读全文

posted @ 2008-10-25 11:24 活着就是幸福 阅读(255) 评论(0) 推荐(0)

摘要: 2.1 函数模板 1.template参数定义中,typename 和class 可以互换,尽量使用typename,不可以使用struct 2.模板参数可以使用任意类型,包括内置类型,自定义类,枚举等 3.模板参数名称可以使用任意名称 4.函数模板不是只编译一份满足多重需要,而是为每一种实例化类型编译一份 5.只有函数模板的使用才会引发实例化 6.为某种类型实例化模板,而此类型不完全支持模... 阅读全文

posted @ 2008-10-25 11:20 活着就是幸福 阅读(329) 评论(0) 推荐(0)