Transparency in custom shader?

Probably my approach is really naive

But the idea was that the red sphere should be seen through the holes.

I managed to make it work by using
shaderMaterial.alpha = 0.9999;

But I’m not sure why I need to setup it.

(btw my final intention is to see the “real world” using immersive-ar)

Thank you!

You need to indicate to the ShaderMaterial constructor that alpha blending should be enabled by setting needAlphaBlending: true when you create the material:

1 Like

Just for future readers here is the modified version that uses the camera as background: