2008年10月25日

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

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

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

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

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

posted @ 2008-10-25 14:56 活着就是幸福 阅读(259) 评论(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 活着就是幸福 阅读(200) 评论(0) 推荐(0) 编辑

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

posted @ 2008-10-25 14:50 活着就是幸福 阅读(269) 评论(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 活着就是幸福 阅读(375) 评论(0) 推荐(0) 编辑

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

posted @ 2008-10-25 13:34 活着就是幸福 阅读(288) 评论(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 活着就是幸福 阅读(664) 评论(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 活着就是幸福 阅读(401) 评论(0) 推荐(0) 编辑

摘要: 阅读全文

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

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

posted @ 2008-10-25 13:07 活着就是幸福 阅读(1307) 评论(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 活着就是幸福 阅读(907) 评论(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 活着就是幸福 阅读(183) 评论(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 活着就是幸福 阅读(945) 评论(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 活着就是幸福 阅读(237) 评论(0) 推荐(0) 编辑

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

posted @ 2008-10-25 12:31 活着就是幸福 阅读(979) 评论(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 活着就是幸福 阅读(226) 评论(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 活着就是幸福 阅读(795) 评论(0) 推荐(0) 编辑

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

posted @ 2008-10-25 12:23 活着就是幸福 阅读(7821) 评论(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 活着就是幸福 阅读(1264) 评论(0) 推荐(0) 编辑