set tessGeo when collecting custom vertex attributes

This commit is contained in:
codeanticode
2019-01-15 13:30:24 -05:00
parent 12664c1621
commit 5d05885774
+8 -1
View File
@@ -2828,15 +2828,21 @@ public class PShapeOpenGL extends PShape {
protected void tessellate() {
if (root == this && parent == null) { // Root shape
boolean initAttr = false;
if (polyAttribs == null) {
polyAttribs = PGraphicsOpenGL.newAttributeMap();
collectPolyAttribs();
initAttr = true;
}
if (tessGeo == null) {
tessGeo = PGraphicsOpenGL.newTessGeometry(pg, polyAttribs, PGraphicsOpenGL.RETAINED);
}
tessGeo.clear();
if (initAttr) {
collectPolyAttribs();
}
for (int i = 0; i < polyAttribs.size(); i++) {
VertexAttribute attrib = polyAttribs.get(i);
tessGeo.initAttrib(attrib);
@@ -2854,6 +2860,7 @@ public class PShapeOpenGL extends PShape {
protected void collectPolyAttribs() {
AttributeMap rootAttribs = root.polyAttribs;
tessGeo = root.tessGeo;
if (family == GROUP) {
for (int i = 0; i < childCount; i++) {