• Advertisement
Sign in to follow this  

debugging stencil

This topic is 4144 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

im working on some stencil code for my games UI. I've got this problem where most thigns work but the occasional button or what ever doesnt render. Are there any methods to view the stencil buffer so i can see whats going on? or other methods to debug such problems?

Share this post


Link to post
Share on other sites
Advertisement
can i call this at any point during the rendering of my frame or must it be at the end?

Share this post


Link to post
Share on other sites
after your stencil-renderpart. (to only condition is that this is done outside of glBegin)

use glReadPixels(0,0,viewport_x,viewport_y,GL_STENCIL_INDEX,GL_UNSIGNED_BYTE,data);
to visualize the result you can use:
glDrawPixels(viewport_x,viewport_y,GL_STENCIL_INDEX,GL_UNSIGNED_BYTE,data);

it will be very slow but you will be able to see whats going on. if you dont see anything try putting a glFlush before glReadPixels.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement