A-ha, gotcha!.
Well, seriouly, I got some z-fitghtin and I don't know hot to solved.
I have my terrain and over it a put a squad with a texture to make the tank track print.
But it seems sometimes that the z-distance is not well calculate and the terrain sometimes occlude the print.
What are the technics to solve this kind of fighting?
Thanks ins advance.
Why they fight?
-
- Posts: 15
- Joined: Wed Jun 02, 2004 1:53 am
If you make sure your tank treads are draw after your terrain, you could disable the z compare on the material. However this could easily cause issues with tank treads on the back of a hill side.
Your best bet is to likely add some epsilon to the positions of the geometry for the treads so that the floating point inaccuracy isn't significant enough to give you z compare "fights".
Your best bet is to likely add some epsilon to the positions of the geometry for the treads so that the floating point inaccuracy isn't significant enough to give you z compare "fights".
LittleGiant
What values do you sugests?arras wrote:Playing with camera near and far plane can help.
I actualy using 0.01f for near value, and 10000 for far. My scale is 5 unitis 1 meter.
I don't understand quite well what do you recommed to do.Your best bet is to likely add some epsilon to the positions of the geometry for the treads so that the floating point inaccuracy isn't significant enough to give you z compare "fights".
Do you mean like separating more the squad from the terrain?
if so, already is quite separted them (but not su much to view floating over the terrain).
Thanks.
http://www.sjbaker.org/steve/omniv/love ... uffer.html
use that code to find the optimal values
Code: Select all
z_buffer_value = (1<<N) * ( a + b / z )
Where:
N = number of bits of Z precision
a = zFar / ( zFar - zNear )
b = zFar * zNear / ( zNear - zFar )
z = distance from the eye to the object
...and z_buffer_value is an integer.