|
|
发表于 2005-3-21 11:22:00
|
显示全部楼层
Re: 求在opengl里实现镜面效果的方法
tjxduck: 求在opengl里实现镜面效果的方法
也许镜面效果很难实现,似乎很少3D游戏有这种效果(仅记得NFS7有)....
我想过用视点变换,但是考虑到如果镜面之后还有东西的话,将不能实现...
望各位指点!!
basiclly i do like this 
1 Bind a render texture as current render target
2 Load Camera projection matrix
3 Set the reflective view matrix = Camera matrix * Reflection matrix(*Local object matrix)
4 Push the model view matrix, load Mreflview as the current modelview matrix
5 Enable a user clip plane at the mirror surface
6 Invert the primitive culling / winding order
7 Render the entire scene (except the reflect object ?) to the currently bound render texture
8 Restore the culling / winding order
9 Disable user clip plane
10 Pop the previous model view matrix
11 Bind the framebuffer as render target
镜面之后还有东西的话
dont worry :) as i told you what to do |
|