This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I have several shaders that I want to apply to one sprite.

What is the easiest way for me to do this?

Godot version 3.4.3
in Engine by (20 points)

1 Answer

+1 vote

You can't; one shader visible at a time.
But depending on the use case, you can find a way around it if you need to.

If you need to switch between different shaders for different effects, you can attach shaders to different textures and switch out the visibility for each texture/shader as needed to achieve desired effects.

If you want all the effects at once, that's not really possible unless you consolidate all the shader code into one shader in a nice way. Or find another compromise.

by (170 points)

Okay, I don't understand much about shaders, but I have 4 shaders and it turns out that I need to combine them into one? Where should I start? Thanks for the reply.

Shaders are really just code in their own language that directly modifies the pixels of a texture, changing over time if you want to. A shader is just a file of code that does that.

What effects are you trying to achieve? Are you sure using all 4 at the same time makes sense? There may be other ways to get what you want that might be easier or more desirable

I need to make these shaders affect only the game interface, not the entire game. I tried applying them to the whole screen through CanvasLayer, but they affect the game, which I don't need

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.