Add contact patch collection for water brushes in viewport-host.js
This commit is contained in:
@@ -2247,7 +2247,10 @@ export class ViewportHost {
|
||||
const brushHovered = this.hoveredSelection.kind === "brushes" && this.hoveredSelection.ids.includes(brush.id);
|
||||
renderObjects.edges.material.color.setHex(brushSelected ? BRUSH_SELECTED_EDGE_COLOR : brushHovered && this.whiteboxSelectionMode === "object" ? BRUSH_HOVERED_EDGE_COLOR : BRUSH_EDGE_COLOR);
|
||||
const previousMaterials = renderObjects.mesh.material;
|
||||
renderObjects.mesh.material = BOX_FACE_IDS.map((faceId) => this.createFaceMaterial(brush, faceId, this.currentDocument?.materials[brush.faces[faceId].materialId ?? ""], this.getFaceHighlightState(brush.id, faceId), volumeRenderPaths));
|
||||
const contactPatches = brush.volume.mode === "water"
|
||||
? this.collectViewportWaterContactPatches(this.currentDocument, brush.id, brush.center, brush.rotationDegrees, brush.size)
|
||||
: [];
|
||||
renderObjects.mesh.material = BOX_FACE_IDS.map((faceId) => this.createFaceMaterial(brush, faceId, this.currentDocument?.materials[brush.faces[faceId].materialId ?? ""], this.getFaceHighlightState(brush.id, faceId), volumeRenderPaths, contactPatches));
|
||||
for (const material of previousMaterials) {
|
||||
material.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user