From c223c64a195fb543167d66b7e9ce3661eb48d772 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 28 Jul 2014 18:37:01 +0200 Subject: GLJPanel: Enhance the class API-doc --- .../classes/javax/media/opengl/awt/GLJPanel.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index 40fc1001f..a5142aa98 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -130,19 +130,19 @@ import com.jogamp.opengl.util.texture.TextureState; using {@link GLDrawableFactory#createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int) GLDrawableFactory.createOffscreenDrawable(..)}.

- - In case the drawable {@link #isGLOriented()} and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}, - this component performs the required vertical flip to bring the content from OpenGL's orientation into AWT's orientation. + A vertical-flip is required, if the drawable {@link #isGLOriented()} and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}.
+ In this case this component performs the required vertical flip to bring the content from OpenGL's orientation into AWT's orientation.
+ In case GLSL based vertical-flip is not available, + the CPU intensive {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line. See details about FBO and GLSL vertical flipping.

- The OpenGL path is concluded by copying the rendered pixels an {@link BufferedImage} via {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) glReadPixels(..)} - for later Java2D composition. + For performance reasons, as well as for GL state sideeffects, + {@link #setSkipGLOrientationVerticalFlip(boolean) skipping vertical flip} is highly recommended!

- In case {@link #setSkipGLOrientationVerticalFlip(boolean) vertical-flip is not skipped} and GLSL based vertical-flip is not performed, - {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line. - This step causes more CPU load per frame and is not hardware-accelerated. + The OpenGL path is concluded by copying the rendered pixels an {@link BufferedImage} via {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) glReadPixels(..)} + for later Java2D composition.

Finally the Java2D compositioning takes place via via {@link Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver) Graphics.drawImage(...)} @@ -153,7 +153,8 @@ import com.jogamp.opengl.util.texture.TextureState; *

*
FBO / GLSL Vertical Flip
- In case FBO is used and GLSL is available and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}, a fragment shader is utilized + If vertical flip is required, + FBO is used, GLSL is available and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}, a fragment shader is utilized to flip the FBO texture vertically. This hardware-accelerated step can be disabled via system property jogl.gljpanel.noglsl.

The FBO / GLSL code path uses one texture-unit and binds the FBO texture to it's active texture-target, @@ -167,7 +168,7 @@ import com.jogamp.opengl.util.texture.TextureState; The current gl-viewport is preserved.

- Warning (Bug 842): Certain GL states other than viewport and texture (see above) + Warning (Bug 842): Certain GL states other than viewport and texture (see above) influencing rendering, will also influence the GLSL vertical flip, e.g. {@link GL#glFrontFace(int) glFrontFace}({@link GL#GL_CCW}). It is recommended to reset those states to default when leaving the {@link GLEventListener#display(GLAutoDrawable)} method! We may change this behavior in the future, i.e. preserve all influencing states. -- cgit v1.2.3