diff options
author | Sven Gothel <sgothel@jausoft.com> | 2014-03-22 06:23:50 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2014-03-22 06:23:50 +0100 |
commit | b4817d053d7af20dae33774e430bf79a3d3c6fcd (patch) | |
tree | 1e7cd3d713e3c1f8442f00be8d161a63de34f601 /src/jogl/classes/com/jogamp/graph/geom/Triangle.java | |
parent | 523d1dae2431fdd56d39d3ea06220cfed412a0b5 (diff) |
Bug 801: Revise Graph VBAA (Add border dropping MSAA; Test diff. AA modes incl. FXAA2) ; Test exp. LineAA ; Misc Changes
- Revise VBAA
- Add border to FBO dropping MSAA
- This automatically gives AA for edges on FBO boundary
- Correcting ceil-diff, use object-diff instead of win-diff (diff := ceil(a)-a, w/ float a)
- Reorg shader - using includes to test diff. AA modes:
- [poles, wholeedge] * [equalweight, propweight]
- fxaa2
- Exp. LineAA (disabled)
- Test ROESSLER-2012-OGLES for detected rectangles only
- Test boundary line detection
See screenshots: <http://jogamp.org/files/screenshots/graphui/20140322/>
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/geom/Triangle.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/geom/Triangle.java | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java index de629dfc4..33e53f3ed 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java +++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java @@ -27,6 +27,8 @@ */ package com.jogamp.graph.geom; +import com.jogamp.opengl.math.VectorUtil; + import jogamp.graph.geom.plane.AffineTransform; public class Triangle { @@ -35,31 +37,29 @@ public class Triangle { private boolean[] boundaryVertices = null; private int id; - public Triangle(Vertex v1, Vertex v2, Vertex v3) { + public Triangle(final Vertex v1, final Vertex v2, final Vertex v3, final boolean[] boundaryVertices) { id = Integer.MAX_VALUE; vertices[0] = v1; vertices[1] = v2; vertices[2] = v3; + this.boundaryVertices = boundaryVertices; } - public Triangle(Triangle src) { + public Triangle(final Triangle src) { id = src.id; vertices[0] = src.vertices[0].clone(); vertices[1] = src.vertices[1].clone(); vertices[2] = src.vertices[2].clone(); System.arraycopy(src.boundaryEdges, 0, boundaryEdges, 0, 3); - boundaryVertices = src.boundaryVertices; + boundaryVertices = new boolean[3]; + System.arraycopy(src.boundaryVertices, 0, boundaryVertices, 0, 3); } private Triangle(final int id, final boolean[] boundaryEdges, final boolean[] boundaryVertices){ this.id = id; System.arraycopy(boundaryEdges, 0, this.boundaryEdges, 0, 3); - this.boundaryVertices = boundaryVertices; - /** - if( null != boundaryVertices ) { - this.boundaryVertices = new boolean[3]; - System.arraycopy(boundaryVertices, 0, this.boundaryVertices, 0, 3); - } */ + this.boundaryVertices = new boolean[3]; + System.arraycopy(boundaryVertices, 0, this.boundaryVertices, 0, 3); } /** @@ -73,6 +73,22 @@ public class Triangle { return tri; } + /** + * Returns true if all vertices are on-curve, otherwise false. + */ + public final boolean isOnCurve() { + return vertices[0].isOnCurve() && vertices[1].isOnCurve() && vertices[2].isOnCurve(); + } + + /** + * Returns true if all vertices are lines, i.e. zero tex-coord, otherwise false. + */ + public final boolean isLine() { + return VectorUtil.isVec2Zero(vertices[0].getTexCoord(), 0) && + VectorUtil.isVec2Zero(vertices[1].getTexCoord(), 0) && + VectorUtil.isVec2Zero(vertices[2].getTexCoord(), 0) ; + } + public int getId() { return id; } @@ -108,6 +124,9 @@ public class Triangle { @Override public String toString() { - return "Tri ID: " + id + "\n\t" + vertices[0] + "\n\t" + vertices[1] + "\n\t" + vertices[2]; + return "Tri ID: " + id + ", onCurve "+isOnCurve()+"\n\t" + + vertices[0] + ", bound "+boundaryVertices[0]+"\n\t" + + vertices[1] + ", bound "+boundaryVertices[1]+"\n\t" + + vertices[2] + ", bound "+boundaryVertices[2]; } } |