Entry 10 - Creation of Lava

In one of the locations there is lava.

 

First I bought the ready material of lava in the Unity Asset Store. However, the situation was similar to the situation with the purchased water material. The purchased shader was not optimized and it was very difficult to improve it, because its code is completely unreadable and full of such lines as

      float4 break770 = ( i.vertexColor / float4( 1,1,1,1 ) );

      float4 lerpResult904 = lerp( lerpResult903 , appendResult898 , temp_output_1000_0);

      float4 break967 = appendResult876;

      float4 appendResult965 = (half4(break967.x , break967.y , 0.0 , break967.w));

As if someone specifically wanted to confuse me.

 

So I decided to write a similar shader from scratch. Armed with textures from the purchased asset, I quickly managed to make a pretty good lava:

 

However, when I gave the lava a flow animation, I ran into a problem - the lava flowed through the stones, creating a feeling that the stones hang over the lava:

 

To solve this problem I generated a texture of the distance to the nearest land. Using this texture, I can make the lava near the stones colder and reduce the speed of its flow. I also decided to change the textures from the purchased asset to my own.

  

Here is the result:

Write a comment

Comments: 4
  • #1

    Biddiss (Friday, 20 December 2019 12:18)

    Look great dude!

  • #2

    Ruth (Friday, 20 December 2019 22:40)

    Force of nature is truthly an amazing game. I never played a game so many hours as much as I did with this game. I really look foward for the second part, thanks so much for put work an effort on it.

  • #3

    Melanie (Thursday, 16 April 2020 19:59)

    Wow! You're really smart. I'm amazed at how you're doing most of this from scratch

  • #4

    Yana (Thursday, 15 August 2024 19:27)

    That shader is a HLSL one. If you are interested in them look for Ben Cloward chanel on You tube - he is great with shaders and tricks both for Unity and Unreal. That Aside - Great work on both games and I looking up to what you are cooking up now XD Bee safe and keep on keeping on! =^&^=