Hello @prisoner849 Thank you for your answer like this?

```
function paintInsideVolumeShader(planeXPos,
planeXNeg,
planeYPos,
planeYNeg,
planeZPos,
planeZNeg) {
const material = new THREE.ShaderMaterial({
transparent: true,
depthWrite: false,
side: THREE.DoubleSide,
uniforms: {
XPos: {
type: "3f",
value: planeXPos.toArray(),
},
XNeg: {
type: "3f",
value: planeXNeg.toArray(),
},
YPos: {
type: "3f",
value: planeYPos.toArray(),
},
YNeg: {
type: "3f",
value:planeYNeg.toArray(),
},
ZPos: {
type: "3f",
value: planeZPos.toArray(),
},
ZNeg: {
type: "3f",
value: planeZNeg.toArray(),
},
color: {
type: "c",
value: new THREE.Color(0xffff00),
}
},
vertexShader: `
void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,
fragmentShader: `
uniform vec3 color;
uniform vec3 XPos;
uniform vec3 XNeg;
uniform vec3 YPos;
uniform vec3 YNeg;
uniform vec3 ZPos;
uniform vec3 ZNeg;
void main() {
vec3 final_color;
float distance = 0.0;
float opacity = 1.0;
// TODO: check inside volume, calc distance to plane?
if (distance <= 0.0 ) final_color = vec3(1.0, 0.0, 0.0); // inside volume color
else final_color = color; // initial color
gl_FragColor = vec4(final_color, opacity);
}
`,
});
mesh.material = material;
}
```

In this case I would need to pass the center of each plane and the normal, but I don’t understand how to calculate the distance from which point to the plane to change colors