Jump to content
Posted 18 December 2012 - 11:19 PM
Posted 26 December 2012 - 12:24 AM
It seems in DirectX 9 you can't customize the way it does texturing. There is interpolation modifier to turn off perspective texturing but only for shader model 4 .
Posted 26 December 2012 - 08:51 AM
You can do perspective correction yourself by interpolating iz=1/z and iuv=uv/z as varyings and reconstructing uv in the fragment shader as iuv/iz.
Posted 26 December 2012 - 08:15 PM
What is the value of iz if z = 0 ?
Posted 27 December 2012 - 02:36 AM
If z = 0, then you have a problem with your perspective. A vertex is located on the eye-plane.
This division by zero problem can't happen in regular graphics pipelines because the depth-division happens after near-clipping.
I guess my first attempt for avoiding this problem would simply be adding a very small bias value to z if it's 0.
Posted 27 December 2012 - 03:39 AM
Wait, is z means the content of z buffer ? I thought by z you mean the z coordinate of the vertex. I got confused, because vertex with z coordinate 0 is a valid vertex.
Posted 27 December 2012 - 04:03 AM
Z is the z coordinate of the vertex.