2008年11月1日

摘要: Now that you have a sense of what HLSL vertex and pixel shaders look like and how they interact with the low-level assembly shaders, we can discuss some of the details of the language itself. 现在你已经... 阅读全文

posted @ 2008-11-01 21:35 活着就是幸福 阅读(227) 评论(0) 推荐(0)

摘要: Ignored. 阅读全文

posted @ 2008-11-01 20:46 活着就是幸福 阅读(159) 评论(0) 推荐(0)

摘要: Below, we see a simple HLSL procedural wood pixel shader. This pixel shader, which is written to work with the vertex shader we just described, will be compiled for the ps_2_0 target. 下面,我们看看一个简单的用程序... 阅读全文

posted @ 2008-11-01 18:53 活着就是幸福 阅读(338) 评论(0) 推荐(0)

摘要: A Simple Example 一个简单的例程 Before presenting an exhaustive description of the HLSL, let's first have a look at one HLSL vertex shader and one HLSL pixel shader taken from an application which renders ... 阅读全文

posted @ 2008-11-01 18:16 活着就是幸福 阅读(323) 评论(0) 推荐(0)

摘要: Introduction 介绍 One of the most empowering new components of DirectX 9 is the High Level Shading Language (HLSL). Using this standard high level language, shader writers are able to think at the alg... 阅读全文

posted @ 2008-11-01 17:39 活着就是幸福 阅读(297) 评论(0) 推荐(0)

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 活着就是幸福 阅读(236) 评论(1) 推荐(0)

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

posted @ 2008-10-25 14:56 活着就是幸福 阅读(264) 评论(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 活着就是幸福 阅读(300) 评论(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 活着就是幸福 阅读(671) 评论(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 活着就是幸福 阅读(407) 评论(0) 推荐(0)

摘要: 阅读全文

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

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

posted @ 2008-10-25 13:07 活着就是幸福 阅读(1323) 评论(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)