#shader to mask one Node in Another - Cant use Clip Chil on CanvasGroup, so I search for workaround

4 messages · Page 1 of 1 (latest)

prime rivet
#

I try for 2 Days now to find a way to Only show The Firefly Reflection on the water. The Fireflys are Emitted by a script. Every Firefly creates a copy of itselft into an Node2D
Also i have to create multiple Sprite2D as ponds because the Shader isnt working good on a Tilemap i created... As long as there is only one Pond it works fine... i thought of multiple things like Canvas Grouping so it is one Calldraw texture? but how can i access the rendered Texture f the CanvasGroup and use it on the water node? In the screnshot i reversed a try wit canvasgroup the ponds but same problem, i cant ClipChildmask the Fireflys as long as it isnt a Child of the pond. And since there are multiple ponds i got totaly lost of all the trys i did. Also tried something with BackBufferCopy but i dont understand its usecase and also tried viewport but the FPS of the viewport Texture where low FPS oO The Fireflys were moving 60FPS but the reflections on the VieportTexture did not.

Anyway any ideas so i can get all Fireflys into my water shader as one texture? Because i want to handle the reflection directly in the shader or if there is a better way please tell me 🙂

Simple Z-indexing dosnt work because the water is moving and is one layer above the groundlayer and there is no groundlayer above the waterlevel.
I Will show you a Video and it looks promissing... but problem is as i said the FireflyReflections are a Child of One Pond and a second Pond could not Clip the reflections because its not a child of pond2, pond3 etc...

I would love to get some help on this.

#

In this Video thats where fireflys where created as child

  • Water (just a container)
    -- Waterlight (lightreflection on the ground)
    -- WaterSrpite (The Pond Sprite with water Shader (Movement, foam and characterreflection=
    -- - FireflyReflection ( Node2D Container that gets all the -y Spritecopys of the fireflys

Here WaterSprite use Clip Child "Clip Only" So the Reflection Childs are shown only in water.
I do not want to have a full copy of all fireflys for every pond , that would be overkill but would work sadly...

I would love to get the hole CanvasGroup COLOR in shader and get the texture from one shader to the water shader.

Another Idea would be when the map is done i just create a big sprite with every pond on it, and clip the fireflysreflections there and but it below the waterline. Maybe this will work, but i think there must be a better way

prime rivet
#

Okay thats what i thought.
So i will just create one Mask Texture of the hole map like a stencil and put the reflection node inside there and clip child. So it ist not 100% accurat cause of the wobbling edges of the pond but it seems there is no other simple solution out there.

To bad Tilemap has no Child Clipping... that would make life so much easier.