Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actual3TATUK2

Posted 22 October 2013 - 02:52 PM

so i "sort of" figured out my issue with the stencil... http://i.imgur.com/v4abqYA.png
 
the yellow is the stencil rendering of a sphere, so only the pixels it hit are processed by fragment shader
 
The problem is where rendering multiple spheres close to eachother... the stencil setup is slightly incorrect and part of it gets 
 
Any idea what i might need?
 
This is the current setup:
 
        glDepthFunc( GL_LESS );
        glStencilMask( 0xFF );

        glCullFace( GL_FRONT );
        glStencilFunc( GL_ALWAYS, 1, 0xFF );
        glStencilOp( GL_KEEP, GL_REPLACE, GL_KEEP );
        
        renderSpheres();

        glCullFace( GL_BACK );
        glStencilFunc( GL_EQUAL, 1, 0xFF );
        glStencilOp( GL_KEEP, GL_ZERO, GL_REPLACE );

        renderSpheres();

#23TATUK2

Posted 22 October 2013 - 01:35 PM

[deleted]


#13TATUK2

Posted 22 October 2013 - 01:22 PM

so i "sort of" figured out my issue with the stencil... http://i.imgur.com/v4abqYA.png
 
the yellow is the stencil rendering of a sphere, so only the pixels it hit are processed by fragment shader
 
The problem is where rendering multiple spheres close to eachother... the stencil setup is slightly incorrect and part of it gets 
 
Any idea what i might need?
 
This is the current setup:
 
		glDepthFunc( GL_LESS );
		glStencilMask( 0xFF );

		glCullFace( GL_FRONT );
		glStencilFunc( GL_ALWAYS, 1, 0xFF );
		glStencilOp( GL_KEEP, GL_REPLACE, GL_KEEP );
		
		renderSpheres();

		glCullFace( GL_BACK );
		glStencilFunc( GL_EQUAL, 1, 0xFF );
		glStencilOp( GL_KEEP, GL_ZERO, GL_REPLACE );

		renderSpheres();

 


PARTNERS