Skip to main content
GameDev.net gamedev.net
🔒 Locked

Z-Fighting

Started by Hassanbasil Jun 12, 2010 at 8:04 AM 1 replies 750+ views
Original Post
Hassanbasil
Hassanbasil
Hello everyone,

I'm trying to pick a triangle of a mesh using the mouse, so, after i pick the triangle, i create a new triangle and place it over the original one to make it looks like i have "chosen" it, but here comes the problem, if i position it far to avoid z-fighting, it wouldn't look like it's one triangle (way too far from the original one), and if i place it close enough, i get annoying z-fighting when i move the camera away

So i was wondering if there is a way to draw my selection object's triangles always over the main object's triangles

Thanks for reading
-Hassan
shultays
shultays
you can render second triangle using only stencil test. render object, set stencil bits to 1 while rendering. after render picked triangle, disable depth test and enable stencil test and render if stencil buffer is 1

not sure if this is a good idea though
taytay

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.