Create a New Scene with Area3D as root
Add a MeshInstance3D as child
Select the MeshInstance3D
Set the size to 10.m x 10.m
Find the Material Override property
Right-Click on the Material
Open the visual shader editor
We need to adjust the colour (Albedo)
We need to make it glow (Emission)
We need to make it move (UV)
So the two outputs we will send input to are Albedo and Emission
Right-Click in Empty Space
Choose New GradientTexture1D
To create the lava colour gradient
Click on the new GradientTexture1D
In the Inspector Gradient property
Double-click the Far left rectangle
I used a bright yellow colour
Click in the middle of the colour gradient
To add another colour point
Double-click this rectangle
Double-click the far right rectangle
To create the texture of swirling blobs of lava we will make use of noise
Noise is a mixed up pattern which adds randomness, surface irregularities, and realism to textures. noise is an aesthetic choice and often affects how things look. One of the most famous types of noise is Perlin Noise
Perlin noise is a type of gradient noise developed by Ken Perlin in 1982. It has many uses, including but not limited to: procedurally generating terrain, applying pseudo-random changes to a variable, and assisting in the creation of image textures.
Click on the NoiseTexture2D
In Inspector set Seamless to On
In the Noise property add a New FastNoiseLite
Click on FastNoiseLite to expand it
Set the Noise Type property to Cellular
Connect the Noise Texture2D UV
to the Gradient Texture 2D UV
To make the noise texture move
We must control the position (UV)
Set the Function to Panning
Connect its UV out to the NoiseTexture2D UV
UV only controls position
To move these coordinates
We must change the offset over time
Connect it to the UV offset
Now the lava is flowing too fast!
Set the scale of the UVFunc
Let's get some lava flowing in the
opposite direction at a different speed
Set scale to -0.02 on both
Add another Texture2D node
Click on the NoiseTexture2D
In the Inspector turn Seamless On
In Noise property add a New FastNoiseLite
Expand it and set Noise Type to Simplex Smooth
To combine the two textures
We multiply their UVs to get
Search for multiply and add it
Then hook up the connections
Finally, to improve the look and make
Gradient changes smoother,
You should now have a working Lava Shader!