[sldev] Viewport inside viewport

Cypren Christenson cypren at gmail.com
Thu Jul 23 11:06:34 PDT 2009


On Jul 23, 2009, at 10:34 AM, chandra kiran kuchi wrote:

> I am trying to render another graphics window inside second life  
> browser, this window should be able to render objects (generated  
> using opengl commands). Yeah I am looking for independent floater  
> window, which can do this.


If I understand you correctly, you want an independently-manipulable  
3D space with its own rendering window that seamlessly integrates into  
the SL UI, right? For showing things like texturing previews?

Since the SLUI is drawn entirely inside of a single OpenGL  
framebuffer, you'll need to get your scene into a texture that can be  
drawn into that buffer. My OpenGL is very rusty, but as far as I know  
the best way of doing it is to create an offscreen framebuffer, bind  
the buffer to a texture, and then render your sub-scene into it. You  
then have a texture you can draw into the main viewport that contains  
an image of your sub-scene.

I haven't looked into the rendering system in the SLViewer at all, but  
a brief search using what I know of GL framebuffer rendering indicates  
that the LLRenderTarget class seems to be designed for exactly this  
purpose, and appears to be used to generate the main world-view in  
LLViewerWindow. Presumably one could harness this same functionality  
to create an LLUICtrl-derived object that could go into in-engine  
dialog boxes. Of course, you'd need to replicate your own scene graph  
for it as well.

It's a complicated request, but a lot of the tools you want are  
already available in the codebase for extending.


More information about the SLDev mailing list