<div dir="ltr">Hi Sebastian,<div><br></div><div>thanks for coming back to me. </div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">Changing texture coordinates or switching binding is fast
enough.</div></blockquote><div><br></div><div>Will give that a try for sure! I guess the reason I'm trying to still push further is to understand how to translate raw OpenGL to osg.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">Rasterizing has to be done in any case you want to put it to
screen.</div></blockquote><div><br></div><div>I'm not so sure here. Assuming a static scene with only three viewpoints ,couldn't I render each viewpoint to an 'image' ? Then depending on the user's choice all I would have to do is copy the pixels of the image to the screen. That would not require rasterization, would it?</div><div><br></div><div>The way I'd like to implement this is to render each CPU image using a textured quad to a custom FBO with a renderbuffer attached. Then, upon user request copy the pixels of the FBO to the default DRAW buffer.<br></div><div><br></div><div>Here's a sketch in raw OpenGL</div><div><div><br></div><div><div>// Initialization: Called n-times for each image to be pre-rendered.</div><div>GLuint uploadImageGPU(const char *imgdata)</div><div>{</div><div> GLuint fb;</div><div><br></div><div> glGenFramebuffers(1, &fb);</div><div> glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb);</div><div><br></div><div> GLuint rb;</div><div> glGenRenderbuffers(1,&rb);</div><div> glBindRenderbuffer(GL_RENDERBUFFER, rb);</div><div> glRenderbufferStorage(GL_RENDERBUFFER,GL_RGBA8, resX, resY);</div><div> </div><div> glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rb);</div><div> // Check state...</div><div> </div><div> // Generate textured quad</div><div> glTexImage2D(GL_TEXTURE_2D, ..., imgdata);</div><div> glBegin(GL_QUADS);</div><div> // ... Skipped for readability</div><div> glEnd();</div><div> </div><div> return fb;</div><div>}</div><div><br></div><div>// Run-time: Quickly switch between pre-rendered images (textured quads)</div><div>void showImageGPU(GLuint fbo)</div><div>{</div><div> glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);</div><div> glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);</div><div> glBlitFramebuffer(0, 0, resX, resY, 0, 0, resX, resY, GL_COLOR_BUFFER_BIT, GL_NEAREST);</div><div> // Swap buffers, glFinish();</div><div>}</div></div></div><div><br></div><div>As I would like to use the convenience of osg as far as setting up windows and other things, I would love to translate this to osg if possible.</div><div><br></div><div>Best,</div><div>Christoph</div></div></div>