How to create a linear gradient?

Hi, I need to have a linear gradient with 2 colors or more on my background, and i would like to know if there is any way i can do that in Defold, or there is a ready to use shader.

Shader is the best way if you want it to be dynamically generated. You can stretch a quad to fit your window size, and give it a gradient shader.

I don’t know that there is a Defold ready gradient shader prepared already somewhere by someone. You can find examples on shadertoy for how you could make one


Thank you so much, you saved me <3

1 Like

Please share the shader if you get it working!


I show a small example of this here.