diff options
author | Sven Göthel <sgothel@jausoft.com> | 2024-01-09 03:13:20 +0100 |
---|---|---|
committer | Sven Göthel <sgothel@jausoft.com> | 2024-01-09 03:13:20 +0100 |
commit | bb11c498b7d4fe269e7273a1b164e46f3c7a3b50 (patch) | |
tree | b613bdfa633df28841a68b45fe0e0f36e5385763 /src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java | |
parent | f836fbd9201034010ecbf591348433f23920f527 (diff) |
Graph Clipping: Initial Region impl of AABBox clipping using GLSL shader (Convenient using Graph/GraphUI produced AABBox)
Simple demo, setting clip-bbox manually:
- src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeClippingDemo00.java
TODO:
- GLSL: Add missing Mv-multiplication of vertex-position -> gcv_ClipBBoxCoord
-- AABBox min/max should be set pre-multiplied w/ Mv covering an independent area, not per Shape/Region.
-- This to properly work with moving/scaling of each Shape/Region etc
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index 2cd40c6e4..af8a54177 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -366,6 +366,7 @@ public abstract class GLRegion extends Region { // gca_VerticesAttr.putf(coords, 0, 3);
// gca_CurveParamsAttr.putf(texParams, 0, 3);
// gca_VerticesAttr.put3f(coords.x(), coords.y(), coords.z());
+ // System.err.println("GLRegion V: "+coords);
put3f((FloatBuffer)vpc_ileave.getBuffer(), coords);
put3f((FloatBuffer)vpc_ileave.getBuffer(), texParams);
if( hasColorChannel() ) {
@@ -384,6 +385,7 @@ public abstract class GLRegion extends Region { if( cc && null == rgba ) {
throw new IllegalArgumentException("Null color given for COLOR_CHANNEL rendering mode");
}
+ // System.err.println("GLRegion V: "+coords1+", "+coords2+", "+coords3);
put3f((FloatBuffer)vpc_ileave.getBuffer(), coords1);
put3f((FloatBuffer)vpc_ileave.getBuffer(), texParams1);
if( cc ) {
@@ -531,7 +533,7 @@ public abstract class GLRegion extends Region { markStateDirty();
}
if( isShapeDirty() ) {
- updateImpl(gl, curRenderModes);
+ updateImpl(gl, renderer, curRenderModes);
}
drawImpl(gl, renderer, curRenderModes, sampleCount);
clearDirtyBits(DIRTY_SHAPE|DIRTY_STATE);
@@ -544,9 +546,8 @@ public abstract class GLRegion extends Region { * objects for use in rendering if {@link #isShapeDirty()}.
* <p>Allocates the ogl related data and initializes it the 1st time.<p>
* <p>Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.</p>
- * @param curRenderModes TODO
*/
- protected abstract void updateImpl(final GL2ES2 gl, int curRenderModes);
+ protected abstract void updateImpl(final GL2ES2 gl, final RegionRenderer renderer, final int curRenderModes);
- protected abstract void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, int curRenderModes, final int[/*1*/] sampleCount);
+ protected abstract void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int curRenderModes, final int[/*1*/] sampleCount);
}
|