Change to color TSL function

This commit is contained in:
Fuhrmann 2025-04-11 11:31:01 +02:00
parent 6bf44194b3
commit 74fe150ef4
2 changed files with 6 additions and 6 deletions

View file

@ -25,7 +25,7 @@ import {
MeshStandardNodeMaterial,
WebGPURenderer,
} from "three/webgpu";
import { vec4 } from "three/tsl";
import { color, vec4 } from "three/tsl";
export enum Orientation {
X = "X",
@ -653,7 +653,7 @@ function generateCapMeshes(
// Intersection surface can be a multipolygon consisting of disconnected polygons
const polygons: Vector3[][] = buildPolygons(edges);
const color =
const colorThree =
mesh.material instanceof MeshStandardNodeMaterial
? mesh.material.color
: new Color(0.1, 0.1, 0.1);
@ -665,7 +665,7 @@ function generateCapMeshes(
alphaToCoverage: true,
});
material.colorNode = vec4(color.r, color.g, color.b, 1.0);
material.colorNode = color(colorThree.r, colorThree.g, colorThree.b);
polygons.forEach((polygon) => {
const geometry = triangulatePolygon(polygon, plane);