Sign in to follow this  
The_Nerd

OpenGL Two un-important questions (mostly)

Recommended Posts

One: Is OpenGL 2.0 out yet and is it supported on Linux? Two: I remember someone saying that you can use clipplans instead of using the stencil test, cissor box, or glviewport. What way is the best to clip allot of stuff inside allot of rectangles (to be exact, clipping GUI object's children for a GUI system)? Also, is it possible to clip to a rectangular area any where on the screen using clipplans?

Share this post


Link to post
Share on other sites
1/ i believe only with 3dlabs cards, though ati/nvidia are nearly there.
2/ scissor is the best but the problem is u only have one of them, viewport is something else (so it doesnt count).
though for a GUI ild use nothing, ie whats the purpose of clipplanes in this case

Share this post


Link to post
Share on other sites
Viewport sets the transform but does no clipping. If you want to make sure your gui element does not go outside a rectangle then use a scissor test. You do only get one at a time, but you can change it for each gui item. If you want to clip gui items to each other you could control the draw order to draw the top ones first or you could use the depth buffer and draw them at different z values. If you really need complex screen space clipping you could also use the stencil buffer.

From your description it sounds like you want to make sure a gui child is clipped to it's parent's rectangle. In that case before you draw each child just set the scissor rect to the parent rect.

You could also use clip planes, but they don't really make sense for 2d usually. You should be able to get the same effect here with scissor rect.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this