Avoid z-fighting in multiple passes?

Blitz3D Forums/Blitz3D Programming/Avoid z-fighting in multiple passes?

JoshK(Posted 2004) [#1]
Any way to avoid z-fighting between identical objects when rendered in multiple passes? I know you can add the second mesh as anothe surface, but would like to avoid doing that. EntityFX 32 appeared to have no effect.

Lifting the shadow off the surface just a hair is probably the best method, unless anyone knows a better way to do this.

This is for projection shadows:



koekjesbaby(Posted 2004) [#2]
it's very possible, but it takes another render pass which can be slow and (if you want to create a system for other people to use) it may not be something people want to put into their code. this is how i actually solved the annoying vertex-aplha-z-order problem: first render the object solid (by setting its fx to non-transparent) and then render the object with the correct fx (with the cameraclear set to 0,0 of course).


JoshK(Posted 2004) [#3]
I get z-fighting when I render two meshes on top of each other in separate passes.


koekjesbaby(Posted 2004) [#4]
well, i said i used the same mesh but just changed it appearance between the two render passes. using two meshes doens't change a thing if you don't clear the z-buffer, but you can't clear it because otherwise the objects in the second pass are drawn on top of everything.


JoshK(Posted 2004) [#5]
Yeah.

I think this is fine. I just moved the verts out from the surface by like 1 unit.