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.
Thanks

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

https://www.shadertoy.com/results?query=linear+gradient

http://glslsandbox.com/e#39992.0

3 Likes

Thank you so much, you saved me <3

1 Like

Please share the shader if you get it working!

3 Likes

I show a small example of this here.

1 Like