Hi Oliver,

On Fri, 2005-08-05 at 11:59 +0200, Oliver Kutter wrote:
> Hi,
> 
> I want to do some data (non effects) computation on the gpu by glsl
> with multipass rendering. I put the data on the gpu by textures. For
> the way back from the gpu to my application, I want to use an object
> (like a plane or a quad) on the framebuffer and I want to read the
> pixel values of this object. 
> My first question: Is there a way to create an object on the
> framebuffer (in 2D or with parallel projection) like the
> ImageForeground object and set some shader on it? Or do I have to
> manage this manually?

I think you have to do it manually, but I'm not sure I fully understand
what you're trying to do. 

> My second Question: I want to compute my results by the fragment
> shader in the first pass. Then I want to get the computed pixels (my
> results) back to my application with glReadPixels() and store them for
> further computation. Then, in the second pass, I want to clear the
> object, because the rest of the scene should be visible without it.
> And then, I want to render the whole opengl scene. Is there a way to
> do it? I read something about a MultiPassMaterialRender, but I don't
> think, that I can use this, because I can't pause between the first
> and the second pass, or am I wrong?

My recommendation would be to use two Viewports. You can use a Viewport
that is totally covered by a later Viewport to draw stuff that doesn't
show up in the final image, and you can use a GrabForeground or a
TextureGrabForeground to get its contents into an Image in main memory
or directly into a texture. In 2.0 alpha we'll have an FBOViewport that
does this using FBOs, which is more flexible, more robust and hopefully
faster, too. ;)

> I think, it would even work, if the objects first pass is rendered to
> the back buffer, and then the object will be cleared in the second
> pass while rendering the whole scene, but I don't know how to do it.

You can do this with two Viewports, as outlines above.

Hope it helps

        Dirk




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to