Advertisement Jump to content
Sign in to follow this  

Clipping regions

This topic is 4823 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'm not exactly sure if this is entirely possible, but is there a way to mask a certain area of the back buffer so that anything out of that region is clipped? Say for example I want to make a simple GUI and it happens to have scroll bars, how would I clip the content inside a frame without it spilling over the edge of the box?

Share this post

Link to post
Share on other sites
You could set a user defined clipping plane but I think what you want might be closer to stencil buffers than actual clipping planes.

What you would want to do is look at how stencil buffers operate.
The purpose of the stencil buffer
The stencil buffer enables or disables drawing to the rendering target surface on a pixel-by-pixel basis. At its most fundamental level, it enables applications to mask sections of the rendered image so that they are not displayed. Applications often use stencil buffers for special effects such as dissolves, decaling, and outlining.

This is normally used in reflections and shadows. As it provides the user with ways to "stencil" out parts.

I hope this helps.
Take care.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!