Hello,
I've got this really weird behavior with shaders. There is the following setup
- ParallaxBackground
- - ParallaxLayer_1
- - - TextureRect_1 (solid image)
- - ParallaxLayer_2
- - - TextureRect_2 (image with transparency)
Now at some point the two parallax layers are going to become visible and start scrolling. This is to create the illusion of fast motion.
To add to the illusion, I wanted to blur TextureRext_2. So I applied a shader to it inside a material, as is stated in the documentation.
The code of the shader can be found here:
https://pastebin.com/YjQ5Qxv8
Now here's what happens.
1) TextureRect_2 completely disappears. It is no longer visible as soon as the shader is applied to it.
2) TextureRect_1 becomes blurry.
3) If I apply the shader to TextureRect_1 it also disappears.
So how does this work? Do I need to create a separate texture rect for just the shader and it will affect everything before it?
I created a TextureRect_3, added the shader to it and placed it below TextureRect_2, in the same ParallaxLayer and a separate one, but that didn't do anything.
I thought a shader applies to its parent object. Did I misunderstand? If so, why did placing the TextureRect_3 not work?
Is something wrong with the shader code?
What is going on?