Gazebo | Ignition | Community
Ask Your Question
0

Transparency with custom shader

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

jrtg gravatar image

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

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

jrtg gravatar image

The answer is here

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 138 times

Last updated: Jun 02 '23