diff options
author | Sven Gothel <[email protected]> | 2023-04-14 06:22:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-04-14 06:22:52 +0200 |
commit | 401440e5466a0d180d5d0e563ed474f4c23d839c (patch) | |
tree | 2e5b98e38e423d524ebcf9316047681362143aa7 /src/jogl | |
parent | 0017e5f6e7e8410d566dcefd9f42ffd0d4fc61e7 (diff) |
Graph Region: Add NORM_RENDERING_BIT (0) for better documented usage; Add getRenderModeString(renderModes, graphSampleCount, fsaaSampleCount) for unified tech representation
Diffstat (limited to 'src/jogl')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/Region.java | 31 |
1 files changed, 31 insertions, 0 deletions
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; @@ -64,6 +66,14 @@ public abstract class Region { /** * Rendering-Mode bit for {@link #getRenderModes() Region} * <p> + * One pass `norm` rendering either using no AA or underlying full-screen AA (fsaa). + * </p> + */ + public static final int NORM_RENDERING_BIT = 0; + + /** + * Rendering-Mode bit for {@link #getRenderModes() Region} + * <p> * MSAA based Anti-Aliasing, a two pass region rendering, slower and more * resource hungry (FBO), but providing fast MSAA in case * the whole scene is not rendered with MSAA. @@ -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: + * <pre> + * (vbaa|msaa|norm)[-curve][-cols][-ctex] + * </pre> + * @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: + * <pre> + * {@link #getRenderModeString(int)}-s{sampleCount}-fsaa{CapsNumSamples} + * </pre> + * + * @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; |