summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-09 08:26:57 +0200
committerSven Gothel <[email protected]>2023-04-09 08:26:57 +0200
commitdf60909c70b5dba10c9734e0c26d31e0649f4309 (patch)
treee600920890e52670c2749ce70f70b1913d77dd3c /src/jogl/classes/jogamp/graph/curve/opengl
parent003eb8ca1f296f287dc3d224fa19781705e10dd9 (diff)
Matrix4f.mapWin*(): Drop unused temp matrices, map*() returns false on invPMv null; PMVMatrix: Make Mvi, Mvit optional at ctor, add user PMv and PMvi - used at gluUnProject() ..
Matrix4f.mapWin*() variants w/ invPMv don't need temp matrices, they also shall handle null invPMv -> return false to streamline usage w/ PMVMatrix if inversion failed. PMVMatrix adds user space common premultiplies Pmv and Pmvi on demand like Frustum. These are commonly required for e.g. gluUnProject(..)/mapWinToObj(..) and might benefit from caching if stack is maintained and no modification occured. PMVMatrix now has the shader related Mvi and Mvit optional at construction(!), so its backing buffers. This reduces footprint for other use cases. The 2nd temp matrix is also on-demand, to reduce footprint for certain use cases. Removed public access to temporary storage. +++ While these additional matrices are on demand and/or at request @ ctor, general memory footprint is reduced per default and hence deemed acceptable while still having PMVMatrix acting as a core flexible matrix provider.
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java4
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java4
2 files changed, 2 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
index bc5fe7d11..d970b7029 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -383,7 +383,6 @@ public final class VBORegion2PMSAAES2 extends GLRegion {
private final AABBox drawWinBox = new AABBox();
private final Recti drawView = new Recti();
- private final Matrix4f drawMat4PMv = new Matrix4f();
private static final int border = 2; // surrounding border, i.e. width += 2*border, height +=2*border
@@ -426,8 +425,7 @@ public final class VBORegion2PMSAAES2 extends GLRegion {
drawView.setWidth(vpWidth);
drawView.setHeight(vpHeight);
- renderer.getMatrix().mulPMvMat(drawMat4PMv);
- box.mapToWindow(drawWinBox, drawMat4PMv, drawView, true /* useCenterZ */);
+ box.mapToWindow(drawWinBox, renderer.getMatrix().getPMvMat(), drawView, true /* useCenterZ */);
winWidth = drawWinBox.getWidth();
winHeight = drawWinBox.getHeight();
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index a7fce3a92..889f4448d 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -444,7 +444,6 @@ public final class VBORegion2PVBAAES2 extends GLRegion {
private final AABBox drawWinBox = new AABBox();
private final Recti drawView = new Recti();
- private final Matrix4f drawMat4PMv = new Matrix4f();
private static final int border = 2; // surrounding border, i.e. width += 2*border, height +=2*border
@@ -487,8 +486,7 @@ public final class VBORegion2PVBAAES2 extends GLRegion {
drawView.setWidth(vpWidth);
drawView.setHeight(vpHeight);
- renderer.getMatrix().mulPMvMat(drawMat4PMv);
- box.mapToWindow(drawWinBox, drawMat4PMv, drawView, true /* useCenterZ */);
+ box.mapToWindow(drawWinBox, renderer.getMatrix().getPMvMat(), drawView, true /* useCenterZ */);
winWidth = drawWinBox.getWidth();
winHeight = drawWinBox.getHeight();