Hi,
I’m quite new to the WebGPU node materials and trying to figure out how to hide part of a material (change opacity) based on the vertex position.
Bellow a screenshot of a shader graph (external tool) of what I’m trying to achieve:
Result:
I have been going through the node examples, but I can quite seem to figure it out, any help would be much appreciated.
Here is what I’ve got so far, but I think I’m quite a bit off
const material = new MeshStandardNodeMaterial();
const opacityControl = tslFn(() => {
if (positionLocal.x > 0) {
return float(1)
}
return float(0)
})
material.opacityNode = opacityControl()
material. Transparent = true;