Godot Tutorial - Gradient Mapping using Visual Shader


In this tutorial we will make gradient mapping shader
It's pretty useful
In Blender, this is called ColorRamp
Here is an example of what you can make with gradient mapping


Let's get started
As always, create new ShaderMaterial


Because it's 2D, change the mode to CanvasItem


Add Texture node


Let's create Noise texture


We will convert it to grayscale
Add Dot node


Enter the following values to convert it to grayscale (0.299, 0.587, 0.114)

The effect is not visible because our noise is indeed gray
Let's try with another texture

Look, now it's gray

Add gradient texture


And here you go:


For the alpha, just connect the alpha to alpha


Tip: instead of you having to put the texture back on your sprite, just change the Texture to Texture2d (but the output preview won't work properly)

This is a tutorial from GDQuest that I converted to Visual Shader. Here is their detailed tutorial: https://www.youtube.com/watch?v=i7VljTl4I3w

Comments

Popular posts from this blog

Godot Tutorial - How to make Sword Slash Effect using Visual Shader - 3 different versions

Godot Tutorial - Vertex Displacement using Visual Shader