Bug: Weapon Drawn on HUD going through world...
Hello, I''m having a problem with the weapon on my Heads Up Display poking through the world, if I scoot it closer to the camera it happens less, but I like the way it looks where it is. I tried calling glClear( GL_DEPTH_BUFFER_BIT ); right before I draw the HUD (which is the last thing drawn in the game loop), but that didn''t fix it.
I''m sure many people have ran into this problem before, how did you guys fix it?
Prolly be better to just clear the Z buffer. You still want depth testing so the model comes out right.
-=[ Megahertz ]=-
-=[ Megahertz ]=-
DrEvil, If I disable depth testing on the level, the polygons of the level will overlap all funny, if I disable depth testing with the gun model on the HUD, the weapon models polygons will become all glitchy looking. I''m pretty sure I need to just clear the Z buffer (the depth buffer), and Right before I draw the weapon model I do call glClear( CL_DEPTH_BUFFER_BIT ); but that doesnt work
Any Ideas?
Thanks,
- John
Any Ideas?
Thanks,
- John
Post your code, it should work.
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
clear the buffers (z buffer, color, stencil, whatever you have), enable z-test, render the scene, clear the z buffer (or try disable depth test), render the gun, disable z-test, render the HUD, swap buffers.
Try this:
* Set the stencil op to output a 1 when drawing w/ no stencil test
* Draw your weapon model
* Swap the stencil test to skip pixels with a stencil 1
* Disable the stencil op
* Draw the world geometry
Good luck on yer project.
-"Sta7ic" Matt
* Set the stencil op to output a 1 when drawing w/ no stencil test
* Draw your weapon model
* Swap the stencil test to skip pixels with a stencil 1
* Disable the stencil op
* Draw the world geometry
Good luck on yer project.
-"Sta7ic" Matt
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement