Commits

Michael Ludwig committed d99807a

Fix bugs in transparent inflated mesh rendering.

Comments (0)

Files changed (1)

ferox-scene/src/main/java/com/ferox/scene/controller/ffp/IndexBufferState.java

                                             .getFixedFunctionRenderer();
 
             int inflatedIndexCount = polyType.getPolygonCount(indexCount) * polyType.getPolygonSize();
+            PolygonType inflatedType = polyType;
             synchronized (sortedIndicesShared) {
                 if (sortedIndicesShared.getData().getLength() < inflatedIndexCount) {
                     sortedIndicesShared.setData(new BufferData(new int[inflatedIndexCount]));
                     case TRIANGLE_STRIP:
                         TopologyUtil.inflateTriangleStripArray(indexOffset, indexCount,
                                                                sharedData, 0);
+                        inflatedType = PolygonType.TRIANGLES;
                         break;
                     default:
                         TopologyUtil.inflateSimpleArray(indexOffset, indexCount,
                     case TRIANGLE_STRIP:
                         TopologyUtil.inflateTriangleStrip(indices.getData(), indexOffset,
                                                           indexCount, sharedData, 0);
+                        inflatedType = PolygonType.TRIANGLES;
                         break;
                     default:
                         UnsignedDataView source = indices.getData().getUnsignedView();
                 }
             }
 
-            FaceView view = new FaceView(polyType,
+            FaceView view = new FaceView(inflatedType,
                                          sortedIndicesShared,
-                                         indexCount,
+                                         inflatedIndexCount,
                                          vertices,
                                          modelMatrix);
             for (int i = 0; i < count; i += 16) {
                 access.update(sortedIndicesShared);
                 r.setIndices(sortedIndicesShared);
 
-                r.render(polyType, 0, inflatedIndexCount);
+                r.render(inflatedType, 0, inflatedIndexCount);
             }
 
             // restore modelview matrix for lighting, etc.