Godot Newbie here , I want to apply a Fake 2D perspective like this :
https://godotshaders.com/shader/2d-perspective/

This shader works for a single node but since the children might have their positions offset from the parent node , the transform shifts them differently (not sticking to the parent) . This is while I am using "use parent material" property for the children.

I have applied the shader to the SpriteRect and expect the child ColorRect to move as if it were on its surface.
Is there a way to transform the parent node as if it was one "texture" ?

  • xyz replied to this.

    druboi You can't do it like that. A shader is just an effect applied to sprite's pixels. There's no real spatial transformation that can be inherited by a child from the parent happening here.
    What's your final goal with this? There may be other ways to achieve it.

    Hi , Thanks for the reply.
    I am able to get my intended output using a Subviewport and applying the shader to that. see the first example in this video :

    Basically a subviewport converts every thing into a texture and applies the shader to that.
    However I don't understand how to size the subviewport and the child nodes , would you know any help resources to help with that ?

    • xyz replied to this.