41
Graphics / Re: Text and shaders
« Last post by Hapax on April 30, 2025, 07:04:09 pm »I realised that gradients in texts are so common that I really should have a shader prepared for that sort of thing already but alas, I did not.
That was then (up to yesterday) and this is now!
I present to you my new shader: multiGradient!
I've added it to be a part of my Lens collection. All shaders are in the "Lens" folder of that directory.
For information on how to use it, you can read the short wiki entry:
https://github.com/Hapaxia/Lens/wiki#multigradient
It allows to provide multiple heights (y positions) and multiple colours to the shader. The shader then interpolates those colours based on the current y position, creating a gradient.
This can be used on textured or non-textured objects and there can be up to 16 different heights and colours!
Here are a couple of quick test examples...
3 steps (3 different colours - yellow, magenta, cyan):

10 steps (10 different colours, yellow, magenta, cyan, white, blue, yellow, magenta, cyan, red, black):

That was then (up to yesterday) and this is now!
I present to you my new shader: multiGradient!
I've added it to be a part of my Lens collection. All shaders are in the "Lens" folder of that directory.
For information on how to use it, you can read the short wiki entry:
https://github.com/Hapaxia/Lens/wiki#multigradient
It allows to provide multiple heights (y positions) and multiple colours to the shader. The shader then interpolates those colours based on the current y position, creating a gradient.
This can be used on textured or non-textured objects and there can be up to 16 different heights and colours!
Here are a couple of quick test examples...
3 steps (3 different colours - yellow, magenta, cyan):

10 steps (10 different colours, yellow, magenta, cyan, white, blue, yellow, magenta, cyan, red, black):
