Transparency with custom shader
Hi,
I'm trying to control transparency (of parts of a mesh) with a fragment shader.
As a first test, I tried to adapt the deformable sphere example by changing the alpha value in deform_fs.glsl
:
i.e. change
fragColor = vec4(finalColor, 1);
into
fragColor = vec4(finalColor, 0.5);
But it remains opaque.
Defining another visual in the sdf without shaders but with element <transparency>0.5</transparency>
does yield a transparent object. Adding the <transparency>
element to the visual with the shaders has no effect.
Is there a way to do this in the fragment shader?