<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">Am 15.11.2015 18:58, schrieb Christoph
      Heindl:<br>
    </div>
    <blockquote
cite="mid:CAFBX4giBTOaFWKdO6Tc37XWRNM9mcsoFaUn3Vy5THNkL=N2-Zg@mail.gmail.com"
      type="cite">
      <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>
      </div>
    </blockquote>
    <br>
    Putting anything to the screen is "rasterizing". <br>
    Scanning through your example I got what you are trying to achieve.
    But seriously I'd call this premature optimization. <br>
    For presenting anything to an output device you will have a lot of
    time (~16ms at 60Hz), so simply rendering a fullscreen quad with an
    image will definitely fit in a frame, so your optimization is not
    really useful except for some  caching that might occur by uploading
    the texture beforehand. <br>
    Usually you solve a problem, benchmark it, see if it fits your needs
    and optimize it if it doesn't...<br>
    <br>
    Cheers<br>
    Sebastian <br>
    <br>
    <br>
    <blockquote
cite="mid:CAFBX4giBTOaFWKdO6Tc37XWRNM9mcsoFaUn3Vy5THNkL=N2-Zg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>