Jump to content
  • Advertisement
Sign in to follow this  
soumya_iiitc

stencil Problem [ Help Please ]

This topic is 4095 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 am drawing a circle with border shadow and with texture as steps below: step 1 -------------------------------------------------------------------------------- glStencilFunc(GL_ALWAYS, 1, 0xFFFFFFFF); glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE) Render CircleBody(); Render Circle Border(); Render Circle Shadow(); step 2 -------------------------------------------------------------------------------- glStencilFunc(GL_EQUAL, 1, 0xFFFFFFFF) glStencilOp(GL_KEEP, GL_KEEP, GL_INCR) Render CircleBody(); glStencilFunc(GL_EQUAL, 2, 0xFFFFFFFF) glStencilOp(GL_KEEP, GL_KEEP, GL_INCR) Render CircleBody(); glStencilFunc(GL_EQUAL, 3, 0xFFFFFFFF) glStencilOp(GL_KEEP, GL_KEEP, GL_INCR) Render CircleBody(); step 3 -------------------------------------------------------------------------------- glStencilFunc(GL_EQUAL, 1, 0xFFFFFFFF) glStencilOp(GL_KEEP, GL_KEEP, GL_INCR) Render Circle Border(); glStencilFunc(GL_EQUAL, 1, 0xFFFFFFFF) glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO) Render Circle Shadow(); step 4 -------------------------------------------------------------------------------- glStencilFunc(GL_EQUAL, 4, 0xFFFFFFFF); glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); Render CircleBody Texture(); step 5 -------------------------------------------------------------------------------- glStencilFunc(GL_EQUAL, 2, 0xFFFFFFFF); glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); Render CircleBorder Texture(); In step 2 i wanted to increment stencil value from 1 to 4 and for that i have called Render CircleBody(); 3 times ,i think this is not correct. Can any one please tell me how can increment the value from 1 to 4 using 1 Render CircleBody(); call. Thanks Soumya

Share this post


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

  • 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!