Posted by zhkza99c on 07月 1, 2010


厄。。无聊把卡通渲染写了一下…一次就成功了 – -||这值得高兴么…一个是从光照方向看前面,一个是后面。
shader写的很屎
uniform extern float3 gLightVecW;
uniform extern float4x4 gWorldViewMatrix;
uniform extern float4 gColor;
struct OutPutCartoonVS
{
float4 position: POSITION;
float2 uvCoords: TEXCOORD;
float4 diffuse: COLOR;
};
OutPutCartoonVS CartoonVS(float4 p:POSITION,float4 n: NORMAL)
{
OutPutCartoonVS outPut = (OutPutCartoonVS)0;
outPut.position = mul(p,gWVP);
float4 LightDir = float4(gLightVecW,0.0f);
n.w = 0.0f;
LightDir = mul(LightDir,gWorldViewMatrix);
n = mul(n,gWorldViewMatrix);
float u = dot(LightDir,n);
if(u<0.0f)
u = 0.0f;
float v = 0.5f;
outPut.uvCoords.x = u;
outPut.uvCoords.y = v;
outPut.diffuse = gColor;
return outPut;
}
technique CartoonTech
{
pass P0
{
vertexShader = compile vs_2_0 CartoonVS();
}
}
Posted by zhkza99c on 06月 29, 2010

e..My second shader program。。。use effect technique,diffuseLight+ambientLight+specularLight+Texture
,so shit for Master,but i enjoy it…..
Posted by zhkza99c on 06月 28, 2010
今天用vs05调个程序,结果一直蹦”debugging information for LightTextureCube.exe’ cannot be found or does not match. No symbols loaded”这个13点的提示,当时我就木了,不能debug?怎么可能?我检查了很多遍。。还是没发现哪儿有问题。。最后才发现Project->Property->Configuration Properties->Linker->Debugging->Generate Debug Info里的yes变成no了 = =。。我发誓我没动过这里,不知道为什么工程自己突然变动了…
Posted by zhkza99c on 11月 3, 2009
prepering for my graduate school entrance examination ..
nothing ,…maybe i’ll spend some spare time on reading 3d tech books,but i know it’s harm to my exams..
so….i ‘ll continue this blog after the exam.
see u,my blog and my favorate game programing
Posted by zhkza99c on 02月 3, 2009
All core codes comes from <<Focus On 3D Terrain Programming>>,with the help of this book ,i can do some easy cool terrain~~
Posted by zhkza99c on 12月 24, 2008
the first pic is the effect that haven’t set texture,and the second is the one that set texture.
just load a texture and show it on different position and set alpha blend effect,make it like in a dream,
all codes come from Programming Role Playing Games with DirectX.
Posted by zhkza99c on 09月 12, 2008
父母 Parents
十年前我们是父母的孩子
10 years ago, we were children of our parents;
十年后我们是孩子的父母
10 years later, we become parents of our children.
十年前我有温暖的家
10 years ago, I had a home full of joys and affection ;
十年后我才体会家的温暖
10 years later, I feel warmth of family then and not till then.
十年前我渴望离家去远方
10 years ago, I yearned for leaving far away from home,
十年后我渴望从远方回家
10 years later, I am longing to return my drifting heart home.
Read the rest of this entry »
Posted by zhkza99c on 09月 7, 2008
now i have finished reading <<Tricks of the windows game programing gurus>>,few weeks before,i said i will write a 2D game,but right now ,i changed my mind…..
here is the time to speed up to study 3D,there’s no time…
so come on…keep fighting.
Posted by zhkza99c on 08月 9, 2008
After read capter 1 ofProgramming Game AI by Example,i write a 2DVector class,
// Vector2D .h
class Vector2D
{
public:
//求反向量
Vector2D GetReverse()const;
//求两个向量距离的乘方
double DistanceSq(const Vector2D &other)const;
//求两个向量的距离
double Distance(const Vector2D& other)const;
//调整x,y的长度不超过dMax
void Truncate(double dMax);
Read the rest of this entry »
Posted by zhkza99c on 08月 2, 2008
chinese edition,p275
特殊的语法–”替换调配(swizzles)”来专门用来完成这类不关心顺序的复制操作。
vector u = {1.0f,2.0f,3.0f,4.0f};
vector v = {0.0f,0.0f,5.0f,6.0f}
v = U.xyzw; //v = {1.0f,2.0f,2.0f,4.0f} ———> should be v = {1.0f,2.0f,3.0f,4.0f}
==========================
english edition is right,ok, i hate QingHua Press。