请教OpenGL的4种阴影算法
谁能给我大致介绍下4种阴影算法哈
[解决办法]
阴影映射—OpenGL实现
典型的阴影比较过程
glBindTexture(GL_TEXTURE_2D, depthMap); //绑定深度图纹理
glEnable(GL_TEXTURE_2D);
//启用深度比较
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_COMPARE_MODE_ARB,
GL_COMPARE_R_TO_TEXTURE);
//深度比较函数 (if r <=texture then not in shadow)
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);
//深度比较应产生的结果的形式
glTexParameteri(GL_TEXTURE_2D,
GL_DEPTH_TEXTURE_MODE_ARB,
GL_ALPHA);
可参考的文献
[1] Projective Texture Mapping. Cass Everitt. NVIDIA. http://developer.nvidia.com/object/Projective_Texture_ Mapping.html
[2] Fast Shadows and Lighting Effects Using Texture Mapping. Mark Segal. SIGGRAPH 1992.(投影映射的原创论文)
[3] Casting Curved Shadows On Curved Surfaces. Lance Williams. SIGGRAPH 1978.(阴影映射的原创论文).
[4] Rendering antialiased shadows with depth maps. William Reeves . SIGGRAPH 87.(阴影反走样的经典论文)
[5] Shadow Mapping Tutorial. http://www.paulsprojects.net/tutorials/
[6] MSDN. Key word: glTexGen