原文見:http://www.cnblogs.com/Pointer/archive/2004/12/20/79323.html 最近通過學習固定渲染管線的光柵化過程,終於明白了扭曲的原因。 我們先設V=投影變換前的頂點,V'=投影變換後的齊次頂點。 在螢幕空間中,V的各項屬性並不是線性分布的,但1/Vz是線性分布的,對於其它的頂點屬性Vb/Vz也是線性分布的(《Mathematics for 3D Game Programming & Computer
多謝CSDN上happy__888([顧問團]尋開心)的熱心指點,明白了法向量的矩陣變換方式和頂點的矩陣變換方式是不同的。以前確實是沒有注意過這個問題。心藍兄有一篇文章介紹了這一點:http://xreal.51.net/Game/NormalMatrix.htm 推導過程見上文,最後的結論是:假設矩陣M為頂點Vo的模型視圖變換矩陣,No為頂點Vo的法線。Ve為進行過模型視圖變換後的眼座標系下的頂點座標,Ne為Ve的法線。那麼有: Ve = M * Vo;Ne = No * M-1;
仔細查閱了一下RedBook上關於自動紋理座標產生的說明:The GL_OBJECT_LINEAR function calculates the texture coordinates in the model's coordinate system. In Example 9-3 , where the contour lines are perpendicular to the base of the teapot, they would remain so, no matter how
I recieved this in email from John on May 23rd, 2000.- Mark KilgardI solved this in a way that is so elegant you just won't believe it. Hereis a description that I posted to a private mailing list:----------------------------------------------------
第二個重要的步驟:勾邊。《Introduction to 3D Game Programming with DirectX 9.0》中介紹了一種方法,其原理如下:1 對於一條邊構造一個退化四邊形2 對於該邊相鄰的兩個三角面,如果從視點方向看到這兩個三角面一個是正面一個是背面;或者該邊只與一個三角面相鄰,則該邊為輪廓線,否則不是。3
今天在CSDN上看到RaymondKing翻譯的《Introduction to 3D Game Programming with DirectX 9.0》,正巧可以作為學習GLSL的補充。嘗試分析了一下2.4節中用HLSL實現的散射光照代碼,發現其原理和GLSL基本是一樣的。加刪除線的部分是《OpenGL Shading