aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-16 05:02:24 +0100
committerSven Göthel <[email protected]>2024-01-16 05:02:24 +0100
commit6b1979992a7da2573c420ce3eb22f35abcbd35b7 (patch)
tree5786a3286a773ccc3082977e1888c13b3f481dc9 /src/jogl/classes/com/jogamp
parent33ec9480da3d414a4c973607970afa06b5ed79ca (diff)
Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to RegionRenderer's RenderState usually rarely set from top of user API, reducing complexity.
Discussion: Alternative was to pass AA-Quality same as SampleCount from the top (e.g. GraphUI Scene), however, this convolutes the API even more. Both parameter modify the resulting shader code in pass2 rendering (only). The used 'renderMode' is still maintained within the Region, since it contains more dynamic states individual to each Region instance (color-texture, ..). This despite 'renderMode' also changes the RenderState's shader program. In the end, it really doesn't matter and is a choice of frequency - the pipeline is usually rendering from on OpenGL rendering thread sequentially. AA-Quality and SampleCount simply usually don't change that often and are set only once.
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/Region.java4
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java45
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java25
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java20
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java47
5 files changed, 89 insertions, 52 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java
index 389af2a8b..2cbbd5f48 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/Region.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java
@@ -186,6 +186,8 @@ public abstract class Region {
public static final int MIN_AA_SAMPLE_COUNT = 1;
/** Maximum pass2 AA sample count {@value} for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
public static final int MAX_AA_SAMPLE_COUNT = 8;
+ /** Default pass2 AA sample count {@value} for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link #VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
+ public static final int DEFAULT_AA_SAMPLE_COUNT = 4;
/** Returns clipped AA sample-count to [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] */
public static final int clipAASampleCount(final int v) { return Math.min(Region.MAX_AA_SAMPLE_COUNT, Math.max(v, Region.MIN_AA_SAMPLE_COUNT)); }
@@ -801,7 +803,7 @@ public abstract class Region {
* Mark this region's shape dirty,
* i.e. its vertices, triangles, lines and/or color-texture coordinates changed.
* <p>
- * The data will be re-uploaded to the GPU at next {@link GLRegion#draw(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer, int, int[]) draw(..)}.
+ * The data will be re-uploaded to the GPU at next {@link GLRegion#draw(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) draw(..)}.
* </p>
* <p>
* In 2-pass mode, this implies updating the FBO itself as well.
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 dfc7d3921..8b45910c8 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
@@ -488,8 +488,7 @@ public abstract class GLRegion extends Region {
/**
* Renders the associated OGL objects specifying
- * current width/hight of window for multi pass rendering
- * of the region.
+ * current width/hight of window for optional multi pass rendering of the region.
* <p>
* User shall consider {@link RegionRenderer#enable(GL2ES2, boolean) enabling}
* the renderer beforehand and {@link RegionRenderer#enable(GL2ES2, boolean) disabling}
@@ -511,18 +510,19 @@ public abstract class GLRegion extends Region {
* </p>
* @param gl current {@link GL2ES2}.
* @param renderer the {@link RegionRenderer} to be used
- * @param pass2Quality pass2 AA-quality selector in the range [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}] for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}
- * @param sampleCount desired pass2 AA-multisampling sample count in the typical range [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}, {@link Region#MSAA_RENDERING_BIT}
- * Use -1 for glSelect mode, pass1 w/o any color texture nor channel, use static select color only.
- * The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @see RegionRenderer#enable(GL2ES2, boolean)
+ * @see RegionRenderer#setAAQuality(int)
+ * @see RegionRenderer#setSampleCount(int)
+ * @see RegionRenderer#setClipBBox(com.jogamp.math.geom.AABBox)
*/
- public final void draw(final GL2ES2 gl, final RegionRenderer renderer, final int pass2Quality, final int[/*1*/] sampleCount) {
+ public final void draw(final GL2ES2 gl, final RegionRenderer renderer) {
+ final int pass2Quality = renderer.getAAQuality();
+ final int pass2SampleCount = renderer.getSampleCount();
final int curRenderModes;
- if( 0 == sampleCount[0] ) {
+ if( 0 == pass2SampleCount ) {
// no sampling, reduce to pass1
curRenderModes = getRenderModes() & ~( VBAA_RENDERING_BIT | MSAA_RENDERING_BIT );
- } else if( 0 > sampleCount[0] ) {
+ } else if( 0 > pass2SampleCount ) {
// negative sampling, hint we perform glSelect: pass1 w/o any color texture nor channel, use static select color only
curRenderModes = getRenderModes() & ~( VBAA_RENDERING_BIT | MSAA_RENDERING_BIT | COLORCHANNEL_RENDERING_BIT | COLORTEXTURE_RENDERING_BIT );
} else {
@@ -535,15 +535,38 @@ public abstract class GLRegion extends Region {
if( lastRenderModes != curRenderModes ) {
markShapeDirty();
markStateDirty();
+ } else if( Region.isGraphAA(curRenderModes) &&
+ ( lastPass2Quality != pass2Quality || lastPass2SampleCount != pass2SampleCount ) ) {
+ markStateDirty();
}
if( isShapeDirty() ) {
updateImpl(gl, renderer, curRenderModes);
}
- drawImpl(gl, renderer, curRenderModes, Region.clipAAQuality(pass2Quality), sampleCount);
+ drawImpl(gl, renderer, curRenderModes);
clearDirtyBits(DIRTY_SHAPE|DIRTY_STATE);
lastRenderModes = curRenderModes;
+ lastPass2Quality = pass2Quality;
+ lastPass2SampleCount = pass2SampleCount;
}
+
+ /** Perform glSelect false color rendering: pass1 w/o any color texture nor channel, use static select color only */
+ public final void drawToSelect(final GL2ES2 gl, final RegionRenderer renderer) {
+ final int curRenderModes = getRenderModes() & ~( VBAA_RENDERING_BIT | MSAA_RENDERING_BIT | COLORCHANNEL_RENDERING_BIT | COLORTEXTURE_RENDERING_BIT );
+ if( lastRenderModes != curRenderModes ) {
+ markShapeDirty();
+ markStateDirty();
+ }
+ if( isShapeDirty() ) {
+ updateImpl(gl, renderer, curRenderModes);
+ }
+ drawImpl(gl, renderer, curRenderModes);
+ clearDirtyBits(DIRTY_SHAPE|DIRTY_STATE);
+ lastRenderModes = curRenderModes;
+ }
+
private int lastRenderModes = 0;
+ private int lastPass2Quality = -1;
+ private int lastPass2SampleCount = -1;
/**
* Updates a graph region by updating the ogl related
@@ -553,5 +576,5 @@ public abstract class GLRegion extends Region {
*/
protected abstract void updateImpl(final GL2ES2 gl, final RegionRenderer renderer, final int curRenderModes);
- protected abstract void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int curRenderModes, int pass2Quality, final int[/*1*/] sampleCount);
+ protected abstract void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int curRenderModes);
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index ba9606064..50fae4907 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -92,7 +92,7 @@ public final class RegionRenderer {
* and turning-on the {@link GL#GL_BLEND} state.
* <p>
* Implementation also sets {@link RegionRenderer#getRenderState() RenderState}'s {@link RenderState#BITHINT_BLENDING_ENABLED blending bit-hint},
- * which will cause {@link GLRegion#draw(GL2ES2, RegionRenderer, int, int[]) GLRegion's draw-method}
+ * which will cause {@link GLRegion#draw(GL2ES2, RegionRenderer) GLRegion's draw-method}
* to set the proper {@link GL#glBlendFuncSeparate(int, int, int, int) blend-function}
* and the clear-color to <i>transparent-black</i> in case of {@link Region#isTwoPass(int) multipass} FBO rendering.
* </p>
@@ -236,7 +236,7 @@ public final class RegionRenderer {
* Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
* if not initialized yet.
* <p>Disables the renderer via {@link #enable(GL2ES2, boolean)} to remove any side-effects, ie ShaderState incl. shader program.</p>
- * <p>Shall be called once before at initialization before a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, int, int)}</p>
+ * <p>Shall be called once before at initialization before a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region)}</p>
*
* @param gl referencing the current GLContext to which the ShaderState is bound to
* @throws GLException if initialization failed
@@ -304,6 +304,16 @@ public final class RegionRenderer {
public final void setColorStatic(final float r, final float g, final float b, final float a){ rs.setColorStatic(r, g, b, a); }
+ /** Sets pass2 AA-quality rendering value clipped to the range [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}] for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}. */
+ public final int setAAQuality(final int v) { return rs.setAAQuality(v); }
+ /** Returns pass2 AA-quality rendering value for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}. */
+ public final int getAAQuality() { return rs.getAAQuality(); }
+
+ /** Sets pass2 AA sample count clipped to the range [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link #VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
+ public final int setSampleCount(final int v) { return rs.setSampleCount(v); }
+ /** Returns pass2 AA sample count for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link #VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
+ public final int getSampleCount() { return rs.getSampleCount(); }
+
/** Set the optional clipping {@link AABBox}, which shall be pre-multiplied with the Mv-matrix or null to disable. */
public final void setClipBBox(final AABBox clipBBox) { rs.setClipBBox(clipBBox); }
/** Returns the optional Mv-premultiplied clipping {@link AABBox} or null if unused. */
@@ -319,7 +329,7 @@ public final class RegionRenderer {
* Enabling or disabling the {@link #getRenderState() RenderState}'s
* current {@link RenderState#getShaderProgram() shader program}.
* <p>
- * {@link #useShaderProgram(GL2ES2, int, boolean, int, int, TextureSequence)}
+ * {@link #useShaderProgram(GL2ES2, int, boolean, TextureSequence)}
* generates, selects and caches the desired Curve-Graph {@link ShaderProgram}
* and {@link RenderState#setShaderProgram(GL2ES2, ShaderProgram) sets it current} in the {@link RenderState} composition.
* </p>
@@ -330,7 +340,7 @@ public final class RegionRenderer {
* @param gl current GL object
* @param enable if true enable the current {@link ShaderProgram}, otherwise disable.
* @see #create(Vertex.Factory<? extends Vertex>, RenderState, GLCallback, GLCallback)
- * @see #useShaderProgram(GL2ES2, int, boolean, int, int, TextureSequence)
+ * @see #useShaderProgram(GL2ES2, int, boolean, TextureSequence)
* @see RenderState#setShaderProgram(GL2ES2, ShaderProgram)
* @see RenderState#getShaderProgram()
*/
@@ -591,8 +601,6 @@ public final class RegionRenderer {
* @param gl
* @param renderModes
* @param pass1
- * @param pass2Quality
- * @param sampleCount
* @param colorTexSeq
* @return true if a new shader program is being used and hence external uniform-data and -location,
* as well as the attribute-location must be updated, otherwise false.
@@ -600,9 +608,8 @@ public final class RegionRenderer {
* @see RenderState#setShaderProgram(GL2ES2, ShaderProgram)
* @see RenderState#getShaderProgram()
*/
- public final boolean useShaderProgram(final GL2ES2 gl, final int renderModes,
- final boolean pass1, final int pass2Quality, final int sampleCount, final TextureSequence colorTexSeq) {
- final ShaderKey shaderKey = new ShaderKey(renderModes, pass1, pass2Quality, sampleCount, colorTexSeq, null != getClipBBox());
+ public final boolean useShaderProgram(final GL2ES2 gl, final int renderModes, final boolean pass1, final TextureSequence colorTexSeq) {
+ final ShaderKey shaderKey = new ShaderKey(renderModes, pass1, getAAQuality(), getSampleCount(), colorTexSeq, null != getClipBBox());
/**
if(DEBUG) {
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index 88392ea04..ed5bcb110 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -60,7 +60,7 @@ public class RenderState {
* Shall be set via {@link #setHintMask(int)} and cleared via {@link #clearHintMask(int)}.
* </p>
* <p>
- * If set, {@link GLRegion#draw(GL2ES2, RegionRenderer, int, int[]) GLRegion's draw-method}
+ * If set, {@link GLRegion#draw(GL2ES2, RegionRenderer) GLRegion's draw-method}
* will set the proper {@link GL#glBlendFuncSeparate(int, int, int, int) blend-function}
* and the clear-color to <i>transparent-black</i> in case of {@link Region#isTwoPass(int) multipass} FBO rendering.
* </p>
@@ -79,7 +79,7 @@ public class RenderState {
* Shall be set via {@link #setHintMask(int)} and cleared via {@link #clearHintMask(int)}.
* </p>
* <p>
- * {@link GLRegion#draw(GL2ES2, RegionRenderer, int, int[]) GLRegion's draw-method}
+ * {@link GLRegion#draw(GL2ES2, RegionRenderer) GLRegion's draw-method}
* may toggle depth test, and reset it's state according to this hint.
* </p>
* <p>
@@ -98,6 +98,10 @@ public class RenderState {
private final FloatBuffer weightBuffer;
private final float[] colorStatic;
private final FloatBuffer colorStaticBuffer;
+ /** Pass2 AA-quality rendering {@value} for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}. */
+ private int aaQuality;
+ /** Default pass2 AA sample count {@value} for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
+ private int sampleCount;
/** Optional clipping {@link AABBox}, which shall be pre-multiplied with the Mv-matrix. Null if unused. */
private AABBox clipBBox;
private int hintBitfield;
@@ -199,6 +203,8 @@ public class RenderState {
this.weightBuffer = FloatBuffer.wrap(weight);
this.colorStatic = new float[] { 1, 1, 1, 1 };
this.colorStaticBuffer = FloatBuffer.wrap(colorStatic);
+ this.aaQuality = Region.DEFAULT_AA_QUALITY;
+ this.sampleCount = Region.DEFAULT_AA_SAMPLE_COUNT;
this.clipBBox = null;
this.hintBitfield = 0;
this.sp = null;
@@ -265,6 +271,16 @@ public class RenderState {
colorStatic[3] = a;
}
+ /** Sets pass2 AA-quality rendering value clipped to the range [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}] for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}. */
+ public final int setAAQuality(final int v) { final int q=Region.clipAAQuality(v); this.aaQuality=q; return q;}
+ /** Returns pass2 AA-quality rendering value for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT}. */
+ public final int getAAQuality() { return this.aaQuality; }
+
+ /** Sets pass2 AA sample count clipped to the range [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link #VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
+ public final int setSampleCount(final int v) { final int s=Region.clipAASampleCount(v); this.sampleCount=s; return s;}
+ /** Returns pass2 AA sample count for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link #VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}. */
+ public final int getSampleCount() { return this.sampleCount; }
+
/** Set the optional clipping {@link AABBox}, which shall be pre-multiplied with the Mv-matrix or null to disable. */
public final void setClipBBox(final AABBox clipBBox) { this.clipBBox = clipBBox; }
/** Returns the optional Mv-premultiplied clipping {@link AABBox} or null if unused. */
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
index 633bc38af..5d60e2686 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
@@ -168,7 +168,7 @@ public class TextRegionUtil {
* @return the given int[2] storage for chaining
* @see Region#setBufferCapacity(int, int)
* @see Region#growBuffer(int, int)
- * @see #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, int, int[], AffineTransform, AffineTransform)
+ * @see #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform)
*/
public static int[] countStringRegion(final Font font, final CharSequence str, final int[/*2*/] vertIndexCount) {
final Font.GlyphVisitor2 visitor = new Font.GlyphVisitor2() {
@@ -203,15 +203,11 @@ public class TextRegionUtil {
* @param rgbaColor used to fill the {@link Region#hasColorChannel() region's color-channel} if used
* and set {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} to white.
* Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only, if not {@code null}.
- * @param aaQuality pass2 AA-quality, clipped to [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}]
- * @param sampleCount desired multisampling sample count for msaa-rendering.
- * The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @return the bounding box of the given string from the produced and rendered GLRegion
* @throws Exception if TextRenderer not initialized
*/
- public AABBox drawString3D(final GL2ES2 gl,
- final RegionRenderer renderer, final Font font, final CharSequence str,
- final Vec4f rgbaColor, final int aaQuality, final int[/*1*/] sampleCount) {
+ public AABBox drawString3D(final GL2ES2 gl, final RegionRenderer renderer,
+ final Font font, final CharSequence str, final Vec4f rgbaColor) {
if( !renderer.isInitialized() ) {
throw new GLException("TextRendererImpl01: not initialized!");
}
@@ -232,20 +228,19 @@ public class TextRegionUtil {
} else {
renderer.setColorStatic(1, 1, 1, 1);
}
- region.draw(gl, renderer, aaQuality, sampleCount);
+ region.draw(gl, renderer);
return res;
}
/**
- * Try using {@link #drawString3D(GL2ES2, int, RegionRenderer, Font, CharSequence, Vec4f, int, int[], AffineTransform, AffineTransform)} to reuse {@link AffineTransform} instances.
+ * Try using {@link #drawString3D(GL2ES2, int, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform)} to reuse {@link AffineTransform} instances.
* <p>
* The region's buffer size is pre-calculated via {@link GLRegion#create(com.jogamp.opengl.GLProfile, int, com.jogamp.opengl.util.texture.TextureSequence, Font, CharSequence)}
* </p>
*/
- public static AABBox drawString3D(final GL2ES2 gl, final int renderModes,
- final RegionRenderer renderer, final Font font, final CharSequence str,
- final Vec4f rgbaColor, final int aaQuality, final int[/*1*/] sampleCount) {
- return drawString3D(gl, renderModes, renderer, font, str, rgbaColor, aaQuality, sampleCount, new AffineTransform(), new AffineTransform());
+ public static AABBox drawString3D(final GL2ES2 gl, final int renderModes, final RegionRenderer renderer,
+ final Font font, final CharSequence str, final Vec4f rgbaColor) {
+ return drawString3D(gl, renderModes, renderer, font, str, rgbaColor, new AffineTransform(), new AffineTransform());
}
/**
@@ -262,7 +257,7 @@ public class TextRegionUtil {
* <p>
* In case of a multisampling region renderer, i.e. {@link Region#VBAA_RENDERING_BIT}, recreating the {@link GLRegion}
* is a huge performance impact.
- * In such case better use {@link #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, int, int[], AffineTransform, AffineTransform)}
+ * In such case better use {@link #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform)}
* instead.
* </p>
* @param gl the current GL state
@@ -272,17 +267,14 @@ public class TextRegionUtil {
* @param rgbaColor used to fill the {@link Region#hasColorChannel() region's color-channel} if used
* and set {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} to white.
* Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only, if not {@code null}.
- * @param aaQuality pass2 AA-quality, clipped to [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}]
- * @param sampleCount desired multisampling sample count for msaa-rendering.
- * The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @param tmp1 temp {@link AffineTransform} to be reused
* @param tmp2 temp {@link AffineTransform} to be reused
* @throws Exception if TextRenderer not initialized
* @return the bounding box of the given string from the produced and rendered GLRegion
*/
- public static AABBox drawString3D(final GL2ES2 gl, final int renderModes,
- final RegionRenderer renderer, final Font font, final CharSequence str,
- final Vec4f rgbaColor, final int aaQuality, final int[/*1*/] sampleCount, final AffineTransform tmp1, final AffineTransform tmp2) {
+ public static AABBox drawString3D(final GL2ES2 gl, final int renderModes, final RegionRenderer renderer,
+ final Font font, final CharSequence str, final Vec4f rgbaColor,
+ final AffineTransform tmp1, final AffineTransform tmp2) {
if(!renderer.isInitialized()){
throw new GLException("TextRendererImpl01: not initialized!");
}
@@ -295,20 +287,20 @@ public class TextRegionUtil {
} else {
renderer.setColorStatic(1, 1, 1, 1);
}
- region.draw(gl, renderer, aaQuality, sampleCount);
+ region.draw(gl, renderer);
region.destroy(gl);
return res;
}
/**
- * Try using {@link #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, int, int[], AffineTransform, AffineTransform)} to reuse {@link AffineTransform} instances.
+ * Try using {@link #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform)} to reuse {@link AffineTransform} instances.
* <p>
* The region buffer's size is grown by pre-calculating required size via {@link #countStringRegion(Font, CharSequence, int[])}.
* </p>
*/
public static AABBox drawString3D(final GL2ES2 gl, final GLRegion region, final RegionRenderer renderer,
- final Font font, final CharSequence str, final Vec4f rgbaColor, final int aaQuality, final int[/*1*/] sampleCount) {
- return drawString3D(gl, region, renderer, font, str, rgbaColor, aaQuality, sampleCount, new AffineTransform(), new AffineTransform());
+ final Font font, final CharSequence str, final Vec4f rgbaColor) {
+ return drawString3D(gl, region, renderer, font, str, rgbaColor, new AffineTransform(), new AffineTransform());
}
/**
@@ -333,9 +325,6 @@ public class TextRegionUtil {
* @param rgbaColor used to fill the {@link Region#hasColorChannel() region's color-channel} if used
* and set {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} to white.
* Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only, if not {@code null}.
- * @param aaQuality pass2 AA-quality, clipped to [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}]
- * @param sampleCount desired multisampling sample count for msaa-rendering.
- * The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @param tmp1 temp {@link AffineTransform} to be reused
* @param tmp2 temp {@link AffineTransform} to be reused
* @return the bounding box of the given string from the produced and rendered GLRegion
@@ -343,7 +332,7 @@ public class TextRegionUtil {
*/
public static AABBox drawString3D(final GL2ES2 gl, final GLRegion region, final RegionRenderer renderer,
final Font font, final CharSequence str, final Vec4f rgbaColor,
- final int aaQuality, final int[/*1*/] sampleCount, final AffineTransform tmp1, final AffineTransform tmp2) {
+ final AffineTransform tmp1, final AffineTransform tmp2) {
if(!renderer.isInitialized()){
throw new GLException("TextRendererImpl01: not initialized!");
}
@@ -355,7 +344,7 @@ public class TextRegionUtil {
} else {
renderer.setColorStatic(1, 1, 1, 1);
}
- region.draw(gl, renderer, aaQuality, sampleCount);
+ region.draw(gl, renderer);
return res;
}