diff options
author | Sven Gothel <[email protected]> | 2011-06-11 05:50:18 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-06-11 05:50:18 +0200 |
commit | 17e90844af05344e43588e97e947d1f540f9566f (patch) | |
tree | f36ff98f2db0ec901c7cc853fb5678dca8c63a49 /src/jogl/classes/jogamp/graph | |
parent | 090ea75c8e3e14fe7c68b5ed9a183c917e881258 (diff) | |
parent | d23d1dd01cc7e3bb228d65feb8f781c4ff0e5e11 (diff) |
Merge remote-tracking branch 'remotes/rsantina/master'
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
5 files changed, 38 insertions, 36 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java index e33a78ed8..e73b0cb85 100755 --- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java @@ -54,10 +54,20 @@ public class RegionFactory { }
}
+ /** Create a Single Pass Region using the passed render mode
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
+ * {@link Region#VBAA_RENDERING_BIT}
+ * @return
+ */
public static GLRegion createSinglePass(int renderModes) {
return new VBORegionSPES2(renderModes);
}
+ /** Create a Two Pass (VBAA) Region using the passed render mode
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
+ * {@link Region#VBAA_RENDERING_BIT}
+ * @return
+ */
public static GLRegion createTwoPass(int renderModes, int textureUnit) {
return new VBORegion2PES2(renderModes, textureUnit);
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java index dcfe3cae0..58086e06c 100755 --- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java @@ -48,7 +48,7 @@ public class RegionRendererImpl01 extends RegionRenderer { @Override
protected String getFragmentShaderName(GL2ES2 gl) {
- if(Region.usesVariableCurveWeight(renderModes)){
+ if(Region.isNonUniformWeight(renderModes)){
return "curverenderer02" + getShaderGLVersionSuffix(gl);
}
return "curverenderer01" + getShaderGLVersionSuffix(gl);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java index 285caacf9..6427bcd48 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java @@ -153,11 +153,10 @@ public class VBORegion2PES2 extends GLRegion { texCoordTxtAttr.rewind(); for(int i=0; i<vertices.size(); i++) { final Vertex v = vertices.get(i); - final float ysign = isFlipped() ? -1.0f : 1.0f ; - verticeTxtAttr.putf( v.getX()); - verticeTxtAttr.putf(ysign * v.getY()); - verticeTxtAttr.putf( v.getZ()); - box.resize(v.getX(), ysign*v.getY(), v.getZ()); + verticeTxtAttr.putf(v.getX()); + verticeTxtAttr.putf(v.getY()); + verticeTxtAttr.putf(v.getZ()); + box.resize(v.getX(), v.getY(), v.getZ()); final float[] tex = v.getTexCoord(); texCoordTxtAttr.putf(tex[0]); diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java index 17fb29b1b..dc4e3a6e0 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java @@ -34,7 +34,6 @@ import jogamp.graph.curve.opengl.shader.AttributeNames; import com.jogamp.graph.curve.opengl.GLRegion; import com.jogamp.graph.curve.opengl.RenderState; -import com.jogamp.graph.geom.AABBox; import com.jogamp.graph.geom.Vertex; import com.jogamp.graph.geom.Triangle; import com.jogamp.opengl.util.GLArrayDataServer; @@ -44,47 +43,47 @@ public class VBORegionSPES2 extends GLRegion { private GLArrayDataServer verticeAttr = null; private GLArrayDataServer texCoordAttr = null; private GLArrayDataServer indices = null; - + protected VBORegionSPES2(int renderModes) { super(renderModes); } - + protected void update(GL2ES2 gl, RenderState rs) { if(!isDirty()) { return; } - + if(null == indices) { final int initialSize = 256; final ShaderState st = rs.getShaderState(); - + indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialSize, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); - + verticeAttr = GLArrayDataServer.createGLSL(st, AttributeNames.VERTEX_ATTR_NAME, 3, - GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW); + GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW); st.ownAttribute(verticeAttr, true); - + texCoordAttr = GLArrayDataServer.createGLSL(st, AttributeNames.TEXCOORD_ATTR_NAME, 2, - GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW); + GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW); st.ownAttribute(texCoordAttr, true); - + if(DEBUG_INSTANCE) { System.err.println("VBORegionSPES2 Create: " + this); } } - + // process triangles indices.seal(gl, false); indices.rewind(); for(int i=0; i<triangles.size(); i++) { final Triangle t = triangles.get(i); final Vertex[] t_vertices = t.getVertices(); - + if(t_vertices[0].getId() == Integer.MAX_VALUE){ t_vertices[0].setId(numVertices++); t_vertices[1].setId(numVertices++); t_vertices[2].setId(numVertices++); - + vertices.add(t_vertices[0]); vertices.add(t_vertices[1]); vertices.add(t_vertices[2]); @@ -100,7 +99,7 @@ public class VBORegionSPES2 extends GLRegion { } indices.seal(gl, true); indices.enableBuffer(gl, false); - + // process vertices and update bbox box.reset(); verticeAttr.seal(gl, false); @@ -109,12 +108,11 @@ public class VBORegionSPES2 extends GLRegion { texCoordAttr.rewind(); for(int i=0; i<vertices.size(); i++) { final Vertex v = vertices.get(i); - final float ysign = isFlipped() ? -1.0f : 1.0f ; - verticeAttr.putf( v.getX()); - verticeAttr.putf(ysign * v.getY()); - verticeAttr.putf( v.getZ()); - box.resize(v.getX(), ysign*v.getY(), v.getZ()); - + verticeAttr.putf(v.getX()); + verticeAttr.putf(v.getY()); + verticeAttr.putf(v.getZ()); + box.resize(v.getX(), v.getY(), v.getZ()); + final float[] tex = v.getTexCoord(); texCoordAttr.putf(tex[0]); texCoordAttr.putf(tex[1]); @@ -123,26 +121,22 @@ public class VBORegionSPES2 extends GLRegion { verticeAttr.enableBuffer(gl, false); texCoordAttr.seal(gl, true); texCoordAttr.enableBuffer(gl, false); - - // update all bbox related data: nope - + setDirty(false); - - // the buffers were disabled, since due to real/fbo switching and other vbo usage } - + protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int width) { verticeAttr.enableBuffer(gl, true); texCoordAttr.enableBuffer(gl, true); indices.enableBuffer(gl, true); - + gl.glDrawElements(GL2ES2.GL_TRIANGLES, indices.getElementNumber() * indices.getComponentNumber(), GL2ES2.GL_UNSIGNED_SHORT, 0); - + verticeAttr.enableBuffer(gl, false); texCoordAttr.enableBuffer(gl, false); indices.enableBuffer(gl, false); } - + public final void destroy(GL2ES2 gl, RenderState rs) { if(DEBUG_INSTANCE) { System.err.println("VBORegionSPES2 Destroy: " + this); diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java index 50b510d23..86d4d2a3d 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java @@ -29,7 +29,6 @@ package jogamp.graph.font.typecast; import java.util.ArrayList; -import jogamp.graph.curve.text.GlyphShape; import jogamp.graph.font.typecast.ot.OTGlyph; import jogamp.graph.font.typecast.ot.Point; import jogamp.graph.geom.plane.AffineTransform; |