diff options
author | Sven Göthel <[email protected]> | 2024-01-09 03:37:00 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-09 03:37:00 +0100 |
commit | 335dd0a493fff1435cad1cd22e4ac5a20d7df03a (patch) | |
tree | a848055c1f3bc6f8d9ab630816a3e3e0c0f6149a /src/jogl/classes/com/jogamp/graph/curve | |
parent | bb11c498b7d4fe269e7273a1b164e46f3c7a3b50 (diff) |
Graph Clipping: Add missing Modelview-Matrix (Mv) Multiplication / Consideration
- GLSL vertex shader sets smooth varying 'gcv_ClipBBoxCoord' w/ Mv multiplied vertex-coord
- RegionRenderer.setClipBBox(AABBox) expects a pre-multiplied Mv AABBox covering an independent area, not per Shape/Region.
- This works as expected with moving/scaling of each Shape/Region etc
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index 06c10586c..c43dc7913 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -303,7 +303,9 @@ public final class RegionRenderer { public final void setColorStatic(final float r, final float g, final float b, final float a){ rs.setColorStatic(r, g, b, a); } + /** Set the optional clipping {@link AABBox}, which shall be pre-multiplied with the Mv-matrix or null to disable. */ public final void setClipBBox(final AABBox clipBBox) { rs.setClipBBox(clipBBox); } + /** Returns the optional Mv-premultiplied clipping {@link AABBox} or null if unused. */ public final AABBox getClipBBox() { return rs.getClipBBox(); } public final boolean isHintMaskSet(final int mask) { return rs.isHintMaskSet(mask); } diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java index 32483c1fc..ed4bc2585 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java @@ -98,6 +98,7 @@ public class RenderState { private final FloatBuffer weightBuffer; private final float[] colorStatic; private final FloatBuffer colorStaticBuffer; + /** Optional clipping {@link AABBox}, which shall be pre-multiplied with the Mv-matrix. Null if unused. */ private AABBox clipBBox; private int hintBitfield; private ShaderProgram sp; @@ -262,7 +263,9 @@ public class RenderState { colorStatic[3] = a; } + /** Set the optional clipping {@link AABBox}, which shall be pre-multiplied with the Mv-matrix or null to disable. */ public final void setClipBBox(final AABBox clipBBox) { this.clipBBox = clipBBox; } + /** Returns the optional Mv-premultiplied clipping {@link AABBox} or null if unused. */ public final AABBox getClipBBox() { return this.clipBBox; } /** |