Skip to main content
gamedev.net
🔒 Locked

UI rendering - clipping

Started by supagu 1 reply 750+ views
Original Post
supagu
supagu
im writting some UI Code, but i keep running in to the problem of how to clip stuff so they arent rendered outside of some bounds (such as a box of sphere or some arbitary shape). I've been thinking of using render to texture, render the child windows to a texture, then use the render to render inside the parent window. This seems a bit over the top and was wondering if there was a simpler solution?
rapso
rapso
u could render the shape u want to clip to, into the stencilbuffer.
then draw whatever UI u want, just where stencilbits are set.

it should be pretty easy to realize this.
Rasmadrak
Rasmadrak
You could also use glScissors if the area is square/ish...
"Game Maker For Life, probably never professional thou." =)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.