Why does a shader i added, which adds chromatic aberration to my game, affect text labels, and how do I stop it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HadrianDev

I’m relatively new to Godot and to shaders.

I added a shader to my game that has chromatic aberration, it looks pretty cool. But it messes with other text labels that are not its parent or child node, and I don’t really understand why that happens.

Here are the screenshots.

Thank you!

:bust_in_silhouette: Reply From: horsecar123

You are giving your screen texture and screen cordinates to shader as an input so shader affects you whole screen without looking your node tree. There 2 ways to deal with it.
1-) Replace all “SCREEN_TEXTURE” with “TEXTURE” and “SCREEN_UV” with “UV” in your shader and add your shader material one by one to all nodes except for your labels.(easy way)
2-)You can use your screen as a texture with using viewport node and later add your labels above it. Documents explain this well(Custom post-processing — Godot Engine (stable) documentation in English)(if there is something you don’t understand please ask)