Gazebo | Ignition | Community
Ask Your Question

Transparency with custom shader

asked 2023-05-03 10:33:39 -0500

jrtg gravatar image

updated 2023-05-03 14:03:22 -0500


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);


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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-06-02 06:38:19 -0500

jrtg gravatar image

The answer is here

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2023-05-03 10:33:39 -0500

Seen: 99 times

Last updated: Jun 02 '23