Rendering a layer out with partial transparency

I am working with render layers to merge two outputs together using the RenderTargetTexture. However, what I need is for one of the layers (the top one) to only have an opacity of about 0.5. The idea is that I would like to partially see the bottom later through the top one. Any ideas?

Hey maybe let’s start with a repro in the playground so we can hack together ;D

Sure, but before we dive in to deep let me first illustrate what I am trying to do. In this playground link you will see a scene with a background image and knot. The knot has transparency to it and you can see the background image through it, however, you also see the other parts of the knot which I don’t want to see. (See image example) So my thinking was that I would need to set up a solution where I rendered out the mesh with full opacity as a separate layer and then lay that on top of the background layer and add opacity to the layer at that point. However, I wonder if I am over complicating things? Anyway, after I get your initial thoughts about what we are trying to achieve and setting up the layers is the way to go I will get that set up in the playground as well.

Playground Link:
https://www.babylonjs-playground.com/#TAZ2CB#84

Example:

Like that you mean? ;D
https://www.babylonjs-playground.com/#TAZ2CB#85

1 Like

Ok, now I feel like I have egg on my face lol. You rock man, that is exactly what I am after. As always, much thanks. :slight_smile:

1 Like