Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | avencherus | |
Old Version | Published before Godot 3 was released. |
Starting my exploration of Shaders a bit. I’m trying to work out a water reflection, but I got stuck. After reading the documentation several times and looking over various examples for a few hours, I’m still missing something.
I’m applying a CanvasItemShader to a Sprite, that has a 1x1 white Texture. What I would like to do is take a cut out some rectangle part of the screen texture behind that node. Then take those pixels, invert the Y, and map them to Sprite’s UV.
I’m having difficulty with the shading language, it escapes me how to extract and mix together these bits of UV and Texture.
There is texscreen(SCREEN_UV)
that returns a Color with the screen information, but I can’t seem to do much with it from there. Then I’ve tried out tex(TEXTURE, UV)
, but I get an initializer error.
Appreciate any pointers.