Advertisement

weird Z-fighting problem...

Started by June 25, 2004 02:47 PM
2 comments, last by vincoof 20 years, 5 months ago
Hmmm I'm trying to upgrade my "stupid demo" to make a "stupid demo with shadows". I have a weird problem : whenever I use a VP (for PPL); if I don't use VP's for all rendering passes (ambient, shadow volumes...), it seems there's a problem with the Z buffer. I guess that the calculated Z component (with/without VP) is not the same... Is there a way of avoiding this problem (except using VPs when necessary) ??? zfighting is visible on Astroboy models...
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
You have to use position invariant VPs if you use multipass techniques. Add

OPTION ARB_position_invariant;

on top of your VP (right after !!ARBvp1.0). Then in VP don't transform vertex to clipspace (it will be done automaticly).
You should never let your fears become the boundaries of your dreams.
Advertisement
@darkwing: Thanx a lot !!!
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
As a side note if you want your shadows to cast correctly on the bumped walls, you will have to write the fragment depth in your fragment program using a slight offset (corresponding to the height value of the parallax mapping).

This topic is closed to new replies.

Advertisement