转到正文

存档

标签: DirectX10

When you want to write DirectX10 program in your project, you should add .fx files. Article [1] introduces one method about how to build project with .fx files.

After that, you will get a perfect project which can compile and build .fx file, and you will run your DX10 program very well.

However, you may get some warmings about "Compiling" for every .fx files in your projects when you run your program every time. It's very disgusting for us because it costs us a lot of time.

The method how to avoid these "Repeat Compiling" information is : Make the FXC rule not selected:

And then, you will get no warming about "Compiling .fxc file" when you run you program.

继续阅读

There are some confusions about the Microsoft's DirectX10 SDK document about D3DXVec3TransformNormal.

The correct meaning of "D3DXVec3TransformNormal" is that "D3DXVec3TransformNormal transforms a normal using the transpose of the inverse of the given matrix". However, the DirectX SDK says: "If you want to transform a normal, the matrix you pass to this function should be the transpose of the inverse of the matrix you would use to transform a point.". The SDK document means that you should inverse your input matrix and then transpose it manually and then give it as parameter to the function "D3DXVec3TransformNormal". But as a matter of fact, you just have to input the transformation matix, and DirectX would do inversion/transpotion for you.

There are some details as follows for the function of "D3DXVec3TransformNormal" if you want to know:

Normals are different than vertex positions in that they always have their origin at 0,0,0 (i.e. they don't have a position) and they shouldn't be scaled or skewed.

For this reason, when transforming normals:

1. You shouldn't apply any translation.
继续阅读

It's common to use reflect HLSL function if you want to write a realistic computer graphics of DirectX10 program.

You can read MSDN  to learn how to use it. There is a little confusion of this function. The format of this function is

ret reflect(i, n)

"i" is a floating-point, incident vector. "n" is a floating-point, normal vector.

By using this function, you'll get v = i - 2 * n * dot(i•n)  and its direction is showed at the following picture.

继续阅读

www.liaoqiqi.com网站PR查询 博客简洁版 博客Google_Site_Map 博客Baidu_Site_Map ?