From 38e51e4a5f6f35c658df10f6d48a33e3ffaea2f3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 7 Jul 2014 23:46:19 +0200 Subject: Bug 1021: Add GenericStereoDevice* Supporting custom configurations; Hook-in oculusvr-sdk java distortion-mesh calculation if available StereoDeviceFactory support new GenericStereoDeviceFactory, with it's GenericStereoDevice and GenericStereoDeviceRenderer. GenericStereoDevice maintains different configurations, triggered either by passing a GenericStereoDevice.Config instance directly or by the device-index parameter: - 0: monoscopi device: No post-processing - 1: stereoscopic device SBS: No post-processing - 2: stereoscopic device SBS + Lenses: Distortion post-processing (only available w/ oculusvr-sdk sub-module) Producing a 'GenericStereoDevice.Config' instance is self containing and may extend if supporting more device types like top-bottom, interlaced etc. StereoDemo01 handles all use-cases and may be used as a test-bed to add and experiment with stereoscopy, devices and settings. --- .../classes/com/jogamp/opengl/math/FloatUtil.java | 4 +- .../com/jogamp/opengl/math/FovHVHalves.java | 71 +++++++++++++++-- .../classes/com/jogamp/opengl/math/VectorUtil.java | 64 +++++++++++++++- .../classes/com/jogamp/opengl/util/PMVMatrix.java | 2 +- .../opengl/util/stereo/StereoClientRenderer.java | 40 +++++----- .../jogamp/opengl/util/stereo/StereoDevice.java | 88 +++++++++++++++++++--- .../opengl/util/stereo/StereoDeviceFactory.java | 33 ++++++-- .../opengl/util/stereo/StereoDeviceRenderer.java | 37 ++++----- .../com/jogamp/opengl/util/stereo/StereoUtil.java | 2 +- 9 files changed, 269 insertions(+), 72 deletions(-) (limited to 'src/jogl/classes/com/jogamp') diff --git a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java index d2e535eaf..3a3568697 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java @@ -559,7 +559,7 @@ public final class FloatUtil { * @param initM if true, given matrix will be initialized w/ identity matrix, * otherwise only the frustum fields are set. * @param fovy_rad angle in radians - * @param aspect + * @param aspect aspect ratio width / height * @param zNear * @param zFar * @return given matrix for chaining @@ -591,7 +591,7 @@ public final class FloatUtil { */ public static float[] makePerspective(final float[] m, final int m_offset, final boolean initM, final FovHVHalves fovhv, final float zNear, final float zFar) { - final FovHVHalves fovhvTan = fovhv.getInTangents(); // use tangent of half-fov ! + final FovHVHalves fovhvTan = fovhv.toTangents(); // use tangent of half-fov ! final float top = fovhvTan.top * zNear; final float bottom = -1.0f * fovhvTan.bottom * zNear; final float left = -1.0f * fovhvTan.left * zNear; diff --git a/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java b/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java index 786d146e6..26ed57009 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java +++ b/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java @@ -69,26 +69,87 @@ public final class FovHVHalves { /** * Returns a symmetrical centered {@link FovHVHalves} instance in tangents, using: *
-        final float halfHorizFovTan = (float)Math.tan(horizontalFov/2f);
-        final float halfVertFovTan = (float)Math.tan(verticalFov/2f);
+        halfHorizFovTan = tan( horizontalFov / 2f );
+        halfVertFovTan  = tan( verticalFov / 2f );
      * 
* @param horizontalFov whole horizontal FOV in radians * @param verticalFov whole vertical FOV in radians */ - public static FovHVHalves createByRadians(final float horizontalFov, final float verticalFov) { + public static FovHVHalves byRadians(final float horizontalFov, final float verticalFov) { final float halfHorizFovTan = FloatUtil.tan(horizontalFov/2f); final float halfVertFovTan = FloatUtil.tan(verticalFov/2f); return new FovHVHalves(halfHorizFovTan, halfHorizFovTan, halfVertFovTan, halfVertFovTan, true); } /** - * Returns this instance values in tangent values. + * Returns a symmetrical centered {@link FovHVHalves} instance in tangents, using: + *
+        top  = bottom = tan( verticalFov / 2f );
+        left =  right = aspect * top;
+     * 
+ * + * @param verticalFov vertical FOV in radians + * @param aspect aspect ration width / height + */ + public static FovHVHalves byFovyRadianAndAspect(final float verticalFov, final float aspect) { + final float halfVertFovTan = FloatUtil.tan(verticalFov/2f); + final float halfHorizFovTan = aspect * halfVertFovTan; + return new FovHVHalves(halfHorizFovTan, halfHorizFovTan, + halfVertFovTan, halfVertFovTan, true); + } + + /** + * Returns a custom symmetry {@link FovHVHalves} instance in tangents, using: + *
+        left   = tan( horizontalFov * horizCenterFromLeft )
+        right  = tan( horizontalFov * ( 1f - horizCenterFromLeft ) )
+        top    = tan( verticalFov   * vertCenterFromTop )
+        bottom = tan( verticalFov   * (1f - vertCenterFromTop ) )
+     * 
+ * @param horizontalFov whole horizontal FOV in radians + * @param horizCenterFromLeft horizontal center from left in [0..1] + * @param verticalFov whole vertical FOV in radians + * @param vertCenterFromTop vertical center from top in [0..1] + */ + public static FovHVHalves byRadians(final float horizontalFov, final float horizCenterFromLeft, + final float verticalFov, final float vertCenterFromTop) { + return new FovHVHalves(FloatUtil.tan(horizontalFov * horizCenterFromLeft), + FloatUtil.tan(horizontalFov * ( 1f - horizCenterFromLeft )), + FloatUtil.tan(verticalFov * vertCenterFromTop), + FloatUtil.tan(verticalFov * (1f - vertCenterFromTop )), + true); + } + + /** + * Returns a custom symmetry {@link FovHVHalves} instance in tangents, + * via computing the horizontalFov using: + *
+        halfVertFovTan  = tan( verticalFov / 2f );
+        halfHorizFovTan = aspect * halfVertFovTan;
+        horizontalFov   = atan( halfHorizFovTan ) * 2f;
+        return {@link #byRadians(float, float, float, float) byRadians}(horizontalFov, horizCenterFromLeft, verticalFov, vertCenterFromTop)
+     * 
+ * @param verticalFov whole vertical FOV in radians + * @param vertCenterFromTop vertical center from top in [0..1] + * @param aspect aspect ration width / height + * @param horizCenterFromLeft horizontal center from left in [0..1] + */ + public static FovHVHalves byFovyRadianAndAspect(final float verticalFov, final float vertCenterFromTop, + final float aspect, final float horizCenterFromLeft) { + final float halfVertFovTan = FloatUtil.tan(verticalFov/2f); + final float halfHorizFovTan = aspect * halfVertFovTan; + final float horizontalFov = FloatUtil.atan(halfHorizFovTan) * 2f; + return byRadians(horizontalFov, horizCenterFromLeft, verticalFov, vertCenterFromTop); + } + + /** + * Returns this instance in tangent values. *

* If this instance is {@link #inTangents} already, method returns this instance, * otherwise a newly created instance w/ converted values to tangent. *

*/ - public final FovHVHalves getInTangents() { + public final FovHVHalves toTangents() { if( inTangents ) { return this; } else { diff --git a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java index c11c2bd2b..36222cf4a 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java @@ -393,7 +393,7 @@ public final class VectorUtil { } /** - * Scales a vector by param using given result float[] + * Scales a vector by param using given result float[], result = vector * scale * @param result vector for the result, may be vector (in-place) * @param vector input vector * @param scale single scale constant for all vector components @@ -406,7 +406,7 @@ public final class VectorUtil { } /** - * Scales a vector by param using given result float[] + * Scales a vector by param using given result float[], result = vector * scale * @param result vector for the result, may be vector (in-place) * @param vector input vector * @param scale single scale constant for all vector components @@ -420,7 +420,7 @@ public final class VectorUtil { } /** - * Scales a vector by param using given result float[] + * Scales a vector by param using given result float[], result = vector * scale * @param result vector for the result, may be vector (in-place) * @param vector input vector * @param scale 3 component scale constant for each vector component @@ -435,7 +435,7 @@ public final class VectorUtil { } /** - * Scales a vector by param using given result float[] + * Scales a vector by param using given result float[], result = vector * scale * @param result vector for the result, may be vector (in-place) * @param vector input vector * @param scale 2 component scale constant for each vector component @@ -448,6 +448,62 @@ public final class VectorUtil { return result; } + /** + * Divides a vector by param using given result float[], result = vector / scale + * @param result vector for the result, may be vector (in-place) + * @param vector input vector + * @param scale single scale constant for all vector components + * @return result vector for chaining + */ + public static float[] divVec2(final float[] result, final float[] vector, final float scale) { + result[0] = vector[0] / scale; + result[1] = vector[1] / scale; + return result; + } + + /** + * Divides a vector by param using given result float[], result = vector / scale + * @param result vector for the result, may be vector (in-place) + * @param vector input vector + * @param scale single scale constant for all vector components + * @return result vector for chaining + */ + public static float[] divVec3(final float[] result, final float[] vector, final float scale) { + result[0] = vector[0] / scale; + result[1] = vector[1] / scale; + result[2] = vector[2] / scale; + return result; + } + + /** + * Divides a vector by param using given result float[], result = vector / scale + * @param result vector for the result, may be vector (in-place) + * @param vector input vector + * @param scale 3 component scale constant for each vector component + * @return result vector for chaining + */ + public static float[] divVec3(final float[] result, final float[] vector, final float[] scale) + { + result[0] = vector[0] / scale[0]; + result[1] = vector[1] / scale[1]; + result[2] = vector[2] / scale[2]; + return result; + } + + /** + * Divides a vector by param using given result float[], result = vector / scale + * @param result vector for the result, may be vector (in-place) + * @param vector input vector + * @param scale 2 component scale constant for each vector component + * @return result vector for chaining + */ + public static float[] divVec2(final float[] result, final float[] vector, final float[] scale) + { + result[0] = vector[0] / scale[0]; + result[1] = vector[1] / scale[1]; + return result; + } + /** * Adds two vectors, result = v1 + v2 * @param result float[2] result vector, may be either v1 or v2 (in-place) diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java index 289183b8e..11acb0c58 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java +++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java @@ -673,7 +673,7 @@ public final class PMVMatrix implements GLMatrixFunc { * {@link #glMultMatrixf(FloatBuffer) Multiply} the {@link #glGetMatrixMode() current matrix} with the perspective/frustum matrix. * * @param fovy_deg fov angle in degrees - * @param aspect aspect ratio + * @param aspect aspect ratio width / height * @param zNear * @param zFar */ diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java index 9f9ebdf2a..dfb676456 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java @@ -58,7 +58,6 @@ public class StereoClientRenderer implements GLEventListener { private final FBObject[] fbos; private final int magFilter; private final int minFilter; - private final boolean usePostprocessing; private int numSamples; private final TextureAttachment[] fboTexs; @@ -71,7 +70,6 @@ public class StereoClientRenderer implements GLEventListener { } this.helper = new GLDrawableHelper(); this.deviceRenderer = deviceRenderer; - this.usePostprocessing = deviceRenderer.ppRequired() || deviceRenderer.usesSideBySideStereo() && fboCount > 1; this.ownsDevice = ownsDevice; this.magFilter = magFilter; this.minFilter = minFilter; @@ -179,26 +177,31 @@ public class StereoClientRenderer implements GLEventListener { final int fboCount = fbos.length; final int displayRepeatFlags; - if( 1 == fboCount ) { + if( 1 >= fboCount ) { displayRepeatFlags = CustomGLEventListener.DISPLAY_DONTCLEAR; } else { displayRepeatFlags = 0; } + final int[] eyeOrder = deviceRenderer.getDevice().getEyeRenderOrder(); + final int eyeCount = eyeOrder.length; + // Update eye pos upfront to have same (almost) results - deviceRenderer.updateEyePose(0); - deviceRenderer.updateEyePose(1); + for(int eyeNum=0; eyeNum - * Default offset is 1.6f up and 5.0f away. - *

- */ - public static final float[] DEFAULT_EYE_POSITION_OFFSET = { 0.0f, 1.6f, -5.0f }; + /** Merely a class providing a type-tag for extensions */ + public static class Config { + // NOP + } /** Disposes this {@link StereoDevice}. */ public void dispose(); @@ -66,7 +64,25 @@ public interface StereoDevice { public DimensionImmutable getSurfaceSize(); /** - * Returns the device default {@link FovHVHalves} per eye. + * Return the device default eye position offset for {@link #createRenderer(int, int, float[], FovHVHalves[], float)}. + *

+ * Result is an array of float values for + *

+ *

+ * @return + */ + public float[] getDefaultEyePositionOffset(); + + /** + * Returns the device default {@link FovHVHalves} for all supported eyes + * in natural order, i.e. left and right if supported. + *

+ * Monoscopic devices return an array length of one, without the value for the right-eye! + *

*/ public FovHVHalves[] getDefaultFOV(); @@ -76,13 +92,61 @@ public interface StereoDevice { /** Return true if sensors have been started, false otherwise */ public boolean getSensorsStarted(); + /** + * Returns an array of the preferred eye rendering order. + * The array length reflects the supported eye count. + *

+ * Monoscopic devices only support one eye, where stereoscopic device two eyes. + *

+ */ + public int[] getEyeRenderOrder(); + + /** + * Returns the supported distortion compensation by the {@link StereoDeviceRenderer}, + * e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, {@link StereoDeviceRenderer#DISTORTION_CHROMATIC}, etc. + * @see StereoDeviceRenderer#getDistortionBits() + * @see #createRenderer(int, int, float[], FovHVHalves[], float, int) + * @see #getRecommendedDistortionBits() + * @see #getMinimumDistortionBits() + */ + public int getSupportedDistortionBits(); + + /** + * Returns the recommended distortion compensation bits for the {@link StereoDeviceRenderer}, + * e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, {@link StereoDeviceRenderer#DISTORTION_CHROMATIC} + * {@link StereoDeviceRenderer#DISTORTION_VIGNETTE}. + *

+ * User shall use the recommended distortion compensation to achieve a distortion free view. + *

+ * @see StereoDeviceRenderer#getDistortionBits() + * @see #createRenderer(int, int, float[], FovHVHalves[], float, int) + * @see #getSupportedDistortionBits() + * @see #getMinimumDistortionBits() + */ + public int getRecommendedDistortionBits(); + + /** + * Returns the minimum distortion compensation bits as required by the {@link StereoDeviceRenderer}, + * e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL} in case the stereoscopic display uses [a]spherical lenses. + *

+ * Minimum distortion compensation bits are being enforced by the {@link StereoDeviceRenderer}. + *

+ * @see #getSupportedDistortionBits() + * @see #getRecommendedDistortionBits() + * @see StereoDeviceRenderer#getDistortionBits() + * @see #createRenderer(int, int, float[], FovHVHalves[], float, int) + */ + public int getMinimumDistortionBits(); + /** * Create a new {@link StereoDeviceRenderer} instance. * - * @param distortionBits {@link StereoDeviceRenderer} distortion bits, e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, etc. - * @param textureCount desired texture count for post-processing, see {@link StereoDeviceRenderer#getTextureCount()} and {@link StereoDeviceRenderer#ppRequired()} - * @param eyePositionOffset eye position offset, e.g. {@link #DEFAULT_EYE_POSITION_OFFSET}. - * @param eyeFov FovHVHalves[2] field-of-view per eye + * @param distortionBits {@link StereoDeviceRenderer} distortion bits, e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, etc, + * see {@link #getRecommendedDistortionBits()}. + * @param textureCount desired texture count for post-processing, see {@link StereoDeviceRenderer#getTextureCount()} and {@link StereoDeviceRenderer#ppAvailable()} + * @param eyePositionOffset eye position offset, e.g. {@link #getDefaultEyePositionOffset()}. + * @param eyeFov FovHVHalves[] field-of-view per eye, e.g. {@link #getDefaultFOV()}. May contain only one value for monoscopic devices, + * see {@link #getEyeRenderOrder()}. * @param pixelsPerDisplayPixel * @param textureUnit * @return diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java index d9054ce28..46ce82f03 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java @@ -31,26 +31,43 @@ import com.jogamp.common.util.ReflectionUtil; /** * Platform agnostic {@link StereoDevice} factory. + *

+ * To implement a new {@link StereoDevice}, the following interfaces/classes must be implemented: + *

+ *

*/ public abstract class StereoDeviceFactory { private static final String OVRStereoDeviceClazzName = "jogamp.opengl.oculusvr.OVRStereoDeviceFactory"; - private static final Object[] ctorArgs; + private static final String GenericStereoDeviceClazzName = "jogamp.opengl.util.stereo.GenericStereoDeviceFactory"; private static final String isAvailableMethodName = "isAvailable"; - static { - ctorArgs = new Object[6]; - ctorArgs[0] = null; + public static enum DeviceType { Default, Generic, OculusVR }; - } public static StereoDeviceFactory createDefaultFactory() { final ClassLoader cl = StereoDeviceFactory.class.getClassLoader(); - final StereoDeviceFactory sink = createFactory(cl, OVRStereoDeviceClazzName); + StereoDeviceFactory sink = createFactory(cl, OVRStereoDeviceClazzName); if( null == sink ) { - // sink = create(cl, ANYOTHERCLAZZNAME); + sink = createFactory(cl, GenericStereoDeviceClazzName); } return sink; } + public static StereoDeviceFactory createFactory(final DeviceType type) { + final String className; + switch( type ) { + case Default: return createDefaultFactory(); + case Generic: className = GenericStereoDeviceClazzName; break; + case OculusVR: className = OVRStereoDeviceClazzName; break; + default: throw new InternalError("XXX"); + } + final ClassLoader cl = StereoDeviceFactory.class.getClassLoader(); + return createFactory(cl, className); + } + public static StereoDeviceFactory createFactory(final ClassLoader cl, final String implName) { try { if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) { @@ -60,5 +77,5 @@ public abstract class StereoDeviceFactory { return null; } - public abstract StereoDevice createDevice(final int deviceIndex, final boolean verbose); + public abstract StereoDevice createDevice(final int deviceIndex, final StereoDevice.Config config, final boolean verbose); } diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java index fd94f6bc3..1805b71bc 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java @@ -41,13 +41,13 @@ import javax.media.opengl.GL; *
  • device.{@link #beginFrame(GL)}
  • *
  • For both eyes:
      *
    • device.{@link #updateEyePose(int)}
    • - *
    • if device.{@link #ppRequired()}: Set the render target, e.g. FBO
    • + *
    • if device.{@link #ppAvailable()}: Set the render target, e.g. FBO
    • *
    • Set the viewport using {@link Eye#getViewport()}
    • *
    • {@link StereoGLEventListener#reshapeForEye(javax.media.opengl.GLAutoDrawable, int, int, int, int, EyeParameter, EyePose) upstream.reshapeEye(..)}
    • *
    • {@link StereoGLEventListener#display(javax.media.opengl.GLAutoDrawable, int) upstream.display(..)}.
    • *
  • *
  • Reset the viewport
  • - *
  • If device.{@link #ppRequired()}:
      + *
    • If device.{@link #ppAvailable()}:
        *
      • device.{@link #ppBegin(GL)}
      • *
      • Use render target, e.g. FBO's texture
      • *
      • device.{@link #ppBothEyes(GL)} or device.{@link #ppOneEye(GL, int)} for both eyes
      • @@ -116,10 +116,10 @@ public interface StereoDeviceRenderer { public EyePose updateEyePose(final int eyeNum); /** - * Returns distortion compensation bits, e.g. {@link #DISTORTION_BARREL}, + * Returns used distortion compensation bits, e.g. {@link #DISTORTION_BARREL}, * in case the stereoscopic display requires such, i.e. in case lenses are utilized. *

        - * Distortion requires {@link #ppRequired() post-processing}. + * Distortion requires {@link #ppAvailable() post-processing}. *

        */ public int getDistortionBits(); @@ -133,7 +133,7 @@ public interface StereoDeviceRenderer { *

        *

        * Either the renderer presents the images side-by-side according to the {@link Eye#getViewport() eye's viewport}, - * or {@link #ppRequired() post-processing} is utilized to merge {@link #getTextureCount() textures} + * or {@link #ppAvailable() post-processing} is utilized to merge {@link #getTextureCount() textures} * to a side-by-side configuration. *

        */ @@ -156,7 +156,7 @@ public interface StereoDeviceRenderer { public DimensionImmutable getTotalSurfaceSize(); /** - * Returns the used texture-image count for post-processing, see {@link #ppRequired()}. + * Returns the used texture-image count for post-processing, see {@link #ppAvailable()}. *

        * In case the renderer does not support multiple textures for post-processing, * or no post-processing at all, method returns zero despite the request @@ -165,7 +165,7 @@ public interface StereoDeviceRenderer { */ public int getTextureCount(); - /** Returns the desired texture-image unit for post-processing, see {@link #ppRequired()}. */ + /** Returns the desired texture-image unit for post-processing, see {@link #ppAvailable()}. */ public int getTextureUnit(); /** Initialize OpenGL related resources */ @@ -181,13 +181,12 @@ public interface StereoDeviceRenderer { public void endFrame(final GL gl); /** - * Returns true if stereoscopic post-processing is required, + * Returns true if stereoscopic post-processing is required and available, * otherwise false. *

        - * Stereoscopic post-processing is usually required if: + * Stereoscopic post-processing is available if: *

          - *
        • one of the distortion modes are set, i.e. {@link #usesBarrelDistortion()}
        • - *
        • texture-images are being used, see {@link #getTextureCount()}
        • + *
        • one of the distortion bits are set, see {@link #getDistortionBits()}
        • *
        *

        *

        @@ -195,15 +194,15 @@ public interface StereoDeviceRenderer { * the following post-processing methods must be called to before {@link #endFrame()}: *

          *
        • {@link #ppBegin(GL)}
        • - *
        • {@link #ppBothEyes(GL)} or {@link #ppOneEye(GL, int)} for both eyes
        • + *
        • {@link #ppOneEye(GL, int)} for both eyes
        • *
        • {@link #ppEnd(GL)}
        • *
        *

        */ - public boolean ppRequired(); + public boolean ppAvailable(); /** - * Begin stereoscopic post-processing, see {@link #ppRequired()}. + * Begin stereoscopic post-processing, see {@link #ppAvailable()}. *

        * {@link #updateEyePose(int)} for both eyes must be called upfront * when rendering upstream {@link StereoGLEventListener}. @@ -214,20 +213,14 @@ public interface StereoDeviceRenderer { public void ppBegin(final GL gl); /** - * Performs stereoscopic post-processing for both eyes, see {@link #ppRequired()}. - * @param gl - */ - public void ppBothEyes(final GL gl); - - /** - * Performs stereoscopic post-processing for one eye, see {@link #ppRequired()}. + * Performs stereoscopic post-processing for one eye, see {@link #ppAvailable()}. * @param gl * @param eyeNum */ public void ppOneEye(final GL gl, final int eyeNum); /** - * End stereoscopic post-processing, see {@link #ppRequired()}. + * End stereoscopic post-processing, see {@link #ppAvailable()}. * @param gl */ public void ppEnd(final GL gl); diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java index 280d99233..3031013b8 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java @@ -50,7 +50,7 @@ public class StereoUtil { final StringBuilder sb = new StringBuilder(); if( usesBarrelDistortion(distortionBits) ) { if( appendComma ) { sb.append(", "); }; - sb.append("barrell"); appendComma=true; + sb.append("barrel"); appendComma=true; } if( usesVignetteDistortion(distortionBits) ) { if( appendComma ) { sb.append(", "); }; -- cgit v1.2.3