I’m sorry.
What would I need to do to render the alpha mask for this?
I’m sorry.
What would I need to do to render the alpha mask for this?
The first solution I posted renders the casters into a viewport. If the transparency is enabled for that viewport, its alpha channel is the alpha mask. Viewport’s texture can then be plugged into any shader and its alpha used as a mixing factor between textures.
Of course.
I’ll go with that solution; sorry for wasting your time.
All of the necessary casters were added to this scene; only one shadow has been implemented for demonstrative purposes.
The only thing that really needs to be done here is apply the shaded textures to the barrel, and I unfortunately don’t know how to do that part.
I had discovered it’s possible to clip children and draw parent while I was being unreasonable earlier in this thread, which solves one potential (albeit minor) issue I had.

If you’re wondering why the shadow looks the way it does, it’s due to a quantized bayer dither shader I grabbed from Godot Shaders; I had to modify it so it could be used on a ColorRect.
The texture swapping part of it is giving me a hard time.
I don’t know why I thought this was a good idea to begin with.
Thank you all for your help.
You’ll need a shader to mix the textures.
I’m aware of that, but…how would that even work? That’s the part I’m stumped on.
Plug 2 textures and an alpha mask texture into the shader via shader uniforms. Sample all 3 of them in a fragment function, then use mix() to interpolate between the two main texture using the mask sample as the mixing factor.
One other thing: where does this shader go in the scene tree?
It goes on the object that wants to display those textures. Or if it’s a whole screen post-processing shader then it typicall goes onto a full screen rectangle covering everything else.
It has finally been done.
