Game Development Community

Fix for zfighting on non-mapped interior materials

by Tom Spilman · in Torque Game Engine Advanced · 01/23/2005 (3:46 pm) · 4 replies

I went about fixing this the wrong way to begin with (creating new default materials to ones that were unmapped), but then came to my senses.

This simple patch fixes the Interior::renderToZBuffer function to use fixed function rendering for interior surfaces that do not use materials (meaning shaders).

Note that i didn't change it, but i think with this change the "demoMaterial" function in Material.cs doesn't seem to be necessary anymore.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
01/23/2005 (4:22 pm)
I'm now noticing that the fixed function rendering path is broken. I don't see any vertex lighting and the shadows do not obey the scene ambient color levels.

Brian does fixed function have any future in TSE at all? Probably not i guess.

Should i insted have gone with my original solution to the zfighting issue... automaticly adding default material mappings for ones that were unmapped?
#2
01/23/2005 (5:02 pm)
Well, the current generation cards actually don't have a fixed function pipe anymore - they emulate it with default fragment and vertex programs.

So I'd say that switching everything to materials wouldn't be a bad idea at all.
#3
01/25/2005 (2:16 pm)
Supporting fixed function is still a possibility. At least it would be nice if it were arranged such that it wouldn't be super hard for some developers to support it if necessary. At the same time, I don't want to see the engine hacked up or jumping through big hoops to support it either.

Matt Fairfax and the Bravetree crew mentioned creating a special fixed function Material. That is an interesting idea and will be looked at.
#4
01/25/2005 (2:23 pm)
I think it could be good, it would allow a lot more people to play the games developed even with out the glitter of shaders.