Bug 202

Summary: Render to texture no longer working correctly
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED INVALID    
Severity: normal    
Priority: P5    
Version: 1   
Hardware: All   
OS: windows   
URL: http://www.cs.rutgers.edu/~tedmunds/share/jogl/RenderToTextureBasic.java
Type: DEFECT SCM Refs:
Workaround: ---
Attachments: Example application (in demos.renderToTexture package).
Framebuffer object implementation of the desired functionality

Description Sven Gothel 2010-03-24 07:48:27 CET


---- Reported by tedmunds 2006-02-07 12:07:21 ----

The (relatively) recent changes to how Pbuffer contexts are managed has resulted
in undesirable behaviour on a simple render-to-texture test case.  In the test
case, the Pbuffer is bound to a texture, a scene is rendered to the Pbuffer, the
Pbuffer is unbound, and then the texture is used in rendering to the main frame
buffer.  Before the implementation changes for JSR-231, this test application
functioned correctly (i.e. when the texture was mapped onto a rectangle, the
image was as expected); now, the rendering to texture does not seem to have been
completed before the texture is accessed for rendering in the frame buffer.  By
alternating the colour of the scene each time when rendering to the Pbuffer, it
becomes clear that the texture access is getting a mix of the old contents and
the new contents of the Pbuffer.

This behaviour is present in both the latest release and the latest nightly build.

The associated URL points to the code for the example application.



---- Additional Comments From tedmunds 2006-02-07 12:08:27 ----

Created an attachment
Example application (in demos.renderToTexture package).




---- Additional Comments From tedmunds 2006-02-07 14:25:34 ----

I have downgraded the priority of this defect after discovering that the
framebuffer object extension is now sufficiently accessible to provide the
desired functionality.  An example implementation using framebuffer objects that
corresponds to the submitted defect example is available at
http://www.cs.rutgers.edu/~tedmunds/share/jogl/RenderToTextureFBO.java (and will
be attached to this issue).



---- Additional Comments From tedmunds 2006-02-07 14:28:43 ----

Created an attachment
Framebuffer object implementation of the desired functionality




---- Additional Comments From kbr 2006-02-15 19:44:09 ----

The basic problem doesn't seem to be reproducible, at least not on all hardware.
The RenderToTextureBasic test case seems to render properly, with four orange
teapots showing up on the square background behind the gray teapot. It's
possible that an appropriately-placed glFinish() call in the application will
cause it to behave better.

In general the render-to-texture support in the GLCapabilities is non-portable
and not to be relied on. The submitter is correct that FBOs are the best way to
do render-to-texture portably.

This bug will probably be closed as "works for me", but would like to
incorporate these test cases, slightly modified, into the jogl-demos package.
Will contact the submitter for permission.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:48 EDT  ---

This bug was previously known as _bug_ 202 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=202
Imported an attachment (id=72)
Imported an attachment (id=73)

The original submitter of attachment 72 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.
The original submitter of attachment 73 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.

Comment 1 Sven Gothel 2010-11-19 12:31:29 CET
not reproducable