Some of you may remember a few months back I started working on a
project I'm calling "osgHUD" which aims to solve the issue of doing
simple-to-moderately-complex 2D UI's in OSG without subbing work out to
external libraries. I haven't had much opportunity to work on this
lately, but I'm back at it now and have come across another thing I'd
like an opinion from the target audience of the software. :)

As you know, GUI's require having some notion of a "scrollable"
region--that is, being able to display only a subset of the window or
rectangular region in question. I've been thinking about this all
weekend and the only things I can come up with to achieve the effect
are:

        1. Render the "scrolled window" into an off-screen texture and use only
the portion I need. However, this approach would almost certainly
require a re-working of the rest of the architecture, but I'm willing to
do it if necessary.

        2. Use a shader to define an "active region" of each window; if the
pixel in question falls within this arbitrarily defined region, render
it--otherwise skip. I'd hate to impose a GLSL restriction without a
fallback, but maybe it's the best way.

        3. Somehow introduce the use of GL_SCISSOR into my NodeKit, though I'm
not entirely sure what it is or what it does. Cursory research tends to
indicate it would allow me to render only a portion of a 2D quad, but
also alludes to performance issues and flickering.

I hope I'm making sense here, and I'd love if anyone who has done
something similar before could give me a few keywords to research or
advice on how to proceed. I'm trying to figure out how CEGUI does it,
but the code is pretty hard to look at sometimes, and their
API-agnosticism gives them a lot of liberty in their internal
implementations...

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to