Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MaxxJag

Multipasses

This topic is 5789 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know what it is, I just don''t know how to do it. redraw the entire scene...that would likely cause Z-Fighting (no, not DBZ type...) so how is it done? I have a few theories but all fail.

Share this post


Link to post
Share on other sites
Advertisement
You have to render your model twice, and (as RipTorn wrote) depth testing should be set to GL_EQUAL.

Note that your models must be EXACTLY the same. The common pitfall of multipass Z-figthing is to render a big wall in a first pass and then render a small part of the wall in a second pass. For instance if you want to render a poster on a door, you would render the whole door with a wood texture in a first pass, and then render the poster with a poster texture in a second pass. This will inflige Z-fighting because the coordinates of the door and the poster will not really overlap (I mean, the depth fragments will not equal) exactly because of floating point approximations.

The problem has been discussed thousands of times before. I''m sure you could pick up any of the older topics hanging out there. There will be much more information than we can ever repeat

Share this post


Link to post
Share on other sites
Don''t forget to take advantage of the compiled vertex arrays extensions while you are at it (They love multiple passes)

Share this post


Link to post
Share on other sites
i understand that the depth testing formula shud be changed... but is there any reason/alternative to that by using depth masking instead?

Share this post


Link to post
Share on other sites
Ya, I''m also trying to get the hang of Vertex Arrays. Though I''m trying to find out what feature should be used on what.

Share this post


Link to post
Share on other sites
CraZeE: what do you mean by "depth masking" ?

MaxxJag: vertex arrays are good, but if you''re not used with them yet, maybe you should start with what you master now. And later you''ll have all the time you want to find optimizations.

Share this post


Link to post
Share on other sites
I''m working on a FPS game right now, my main problem is that I lag resources and some basic knowledge, I do believe I understand vertex arrays now, haven''t used them yet.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!