Skip to content

Commit b3a3eb9

Browse files
committed
fix(PolyDataMapper): Fix VBO rebuild condition
Add MTime of PolyDataMapper CustomShaderAttributes arrays for VBO rebuild condition
1 parent d461390 commit b3a3eb9

File tree

1 file changed

+13
-3
lines changed
  • Sources/Rendering/OpenGL/PolyDataMapper

1 file changed

+13
-3
lines changed

Sources/Rendering/OpenGL/PolyDataMapper/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,11 +1856,21 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
18561856
tex.deactivate();
18571857
}
18581858

1859+
const customAttributes = model.renderable.getCustomShaderAttributes();
1860+
const customAttributesArrays = customAttributes.map((arrayName) =>
1861+
poly.getPointData().getArrayByName(arrayName)
1862+
);
18591863
const toString =
1860-
`${poly.getMTime()}A${representation}B${poly.getMTime()}` +
1861-
`C${n ? n.getMTime() : 1}D${c ? c.getMTime() : 1}` +
1864+
poly.getMTime() +
1865+
`A${representation}` +
1866+
`B${poly.getMTime()}` +
1867+
`C${n ? n.getMTime() : 1}` +
1868+
`D${c ? c.getMTime() : 1}` +
18621869
`E${actor.getProperty().getEdgeVisibility()}` +
1863-
`F${tcoords ? tcoords.getMTime() : 1}`;
1870+
`F${tcoords ? tcoords.getMTime() : 1}` +
1871+
`G${customAttributesArrays
1872+
.map((attributeArray) => attributeArray.getMTime())
1873+
.join(',')}`;
18641874
if (model.VBOBuildString !== toString) {
18651875
// Build the VBOs
18661876
const points = poly.getPoints();

0 commit comments

Comments
 (0)