|
|
当我使用多通道渲染,同样的顶点输入数据和变换操作却产生"z-fighting_z值冲突",为什么会这样?
当我使用多通道渲染,同样的顶点输入数据和变换操作却产生"z-fighting_z值冲突",为什么会这样?
确信你不是在一个渲染通道中使用VS做变换操作,在另一个渲染通道中使用固定渲染线完成同样的功能。这两条渲染线,虽然输入的顶点数据相同,会产生不同的z值,这回在相等的深度测试中产生"z-fighting_z值冲突"。为了避免这种情况,必须在所有的渲染通道中使用相同的渲染方式。
/************************************/
I'm using multiple passes, but with the exact same vertex data and transformations in each pass. Why am I getting z-fighting in my scene?
Make sure you're not using vertex shaders to do transforms in one pass and fixed function transforms in another. These two paths, even given the exact same data, will not generally produce the exact same values, and this can cause z-fighting when rendering multiple passes with an EQUAL depth test. The solution is to stick to one method for all passes over an object, or use an OpenGL extension such as ARB_vertex_program with the ARB_position_invariant option.
|
|