aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-20 05:01:38 +0100
committerSven Göthel <[email protected]>2024-01-20 05:01:38 +0100
commitc1531c3d99b19032040018b9414263b0d3000147 (patch)
tree93ad05df0398d430884350166a88371f82143947 /src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
parent5cca51e32999a882e2a5f00cb45ecafc824ffd86 (diff)
Graph Clipping: Use Frustum Clipping using AABBox -> Mv transformed Cube -> Frustum mapping + GraphUI Support
AABBox clipping naturally couldn't be transformed into 3D Model-View (Mv) Space, as it is axis aligned and only provided 2 points (min/max). Therefor we map the Group's AABBox to a 8-point Cube, perform the Mv-transformation and then produce the 6-plane Frustum. As before, we cull fully outside shapes within the Group's draw method and perform fragment clipping with same Frustum planes in the shader. With clipping enabled, the 3D z-axis getBounds() depth will be slightly increased for functional Frustum operation. This is also done for setFixedSize(Vec2f). The Frustum planes are copied to the Graph shader via float[4*6] -> uniform vec4 gcu_ClipFrustum[6]; // L, R, B, T, N, F each {n.x, n.y, n.z, d} +++ Concludes related work of below commits - 1040bed4ecc6f4598ea459f1073a9240583fc3c3 - 5cca51e32999a882e2a5f00cb45ecafc824ffd86
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
index dce78b9c8..5ee5fcb46 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
@@ -14,8 +14,8 @@ void main(void)
// gl_Position = gcu_PMVMatrix01[0] * gcu_PMVMatrix01[1] * vec4(gca_FboVertices, 1);
gl_Position = gcu_PMVMatrix01[0] * gcu_PMVMatrix01[1] * gca_FboVertices;
-#ifdef USE_AABBOX_CLIPPING
- gcv_ClipBBoxCoord = (gcu_PMVMatrix01[1] * gca_FboVertices).xyz; // Mv
+#ifdef USE_FRUSTUM_CLIPPING
+ gcv_ClipCoord = (gcu_PMVMatrix01[1] * gca_FboVertices).xyz; // Mv
#endif
gcv_FboTexCoord = gca_FboTexCoords;