From 401440e5466a0d180d5d0e563ed474f4c23d839c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 Apr 2023 06:22:52 +0200 Subject: Graph Region: Add NORM_RENDERING_BIT (0) for better documented usage; Add getRenderModeString(renderModes, graphSampleCount, fsaaSampleCount) for unified tech representation --- .../classes/com/jogamp/graph/curve/Region.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java index 6b590a4d8..b3cee629c 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/Region.java +++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java @@ -33,6 +33,7 @@ import java.nio.IntBuffer; import java.nio.ShortBuffer; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.concurrent.TimeUnit; import jogamp.opengl.Debug; @@ -44,6 +45,7 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.common.os.Clock; import com.jogamp.common.util.PerfCounterCtrl; import com.jogamp.graph.curve.opengl.GLRegion; +import com.jogamp.opengl.GLCapabilitiesImmutable; import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.math.geom.AABBox; import com.jogamp.opengl.math.geom.Frustum; @@ -61,6 +63,14 @@ public abstract class Region { public static final boolean DEBUG = Debug.debug("graph.curve"); public static final boolean DEBUG_INSTANCE = Debug.debug("graph.curve.Instance"); + /** + * Rendering-Mode bit for {@link #getRenderModes() Region} + *

+ * One pass `norm` rendering either using no AA or underlying full-screen AA (fsaa). + *

+ */ + public static final int NORM_RENDERING_BIT = 0; + /** * Rendering-Mode bit for {@link #getRenderModes() Region} *

@@ -169,6 +179,13 @@ public abstract class Region { return 0 != (renderModes & Region.COLORTEXTURE_RENDERING_BIT); } + /** + * Returns a unique technical description string for renderModes as follows: + *

+     *    (vbaa|msaa|norm)[-curve][-cols][-ctex]
+     * 
+ * @param renderModes Graph renderModes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)} + */ public static String getRenderModeString(final int renderModes) { final String curveS = hasVariableWeight(renderModes) ? "-curve" : ""; final String cChanS = hasColorChannel(renderModes) ? "-cols" : ""; @@ -182,6 +199,20 @@ public abstract class Region { } } + /** + * Return a unique technical description string for renderModes and sample counts as follows: + *
+     *    {@link #getRenderModeString(int)}-s{sampleCount}-fsaa{CapsNumSamples}
+     * 
+ * + * @param renderModes the used Graph renderModes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)} + * @param graphSampleCount Graph sample count for {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT} + * @param fsaaSampleCount full-screen AA (fsaa) sample count, retrieved e.g. via {@link GLCapabilitiesImmutable#getNumSamples()} + */ + public static String getRenderModeString(final int renderModes, final int graphSampleCount, final int fsaaSampleCount) { + return String.format((Locale)null, "%s-s%02d-fsaa%d", Region.getRenderModeString(renderModes), graphSampleCount, fsaaSampleCount); + } + protected Region(final int regionRenderModes, final boolean use_int32_idx) { this.renderModes = regionRenderModes; this.use_int32_idx = use_int32_idx; -- cgit v1.2.3