Post news RSS More Immortal Redneck sand rendering tricks – Devlog #7

Since you liked our sand rendering, we are showing you another trick with the sand of Immortal Redneck.

Posted by on

Hello, everyone. It's monday, it's raining in Madrid and we are sad Halloween is over, so this is going to be a short devlog. Let's go.

As you should know already, we have a very cool shader made in Shader Forge so the piles and floors of Immortal Redneck are filled with sand and it all looks very natural. But what if we used such a good idea with more stuff, like chests or enemies? That's what we did.

After working for a time with our sand shader, we started trying some silly stuff and ended up doing a new shader.

The new shader

The shader has two values: one that allow us to make transitions from any texture to sand and another one that makes the object dissappear from top to bottom while using the world position as a reference. We frist tried using the local position of the object, but the effect looked bad when it wasn't on a horizontal surface.

So, with this shader in our hands, we made an animation using the two values one after another.

We also added a little sand particle, a splash while the object dissolves so it looks more dramatic. Well, maybe dramatic is not the word, but hey, it's oddly satisfying.

By the way, the shader uses a noise texture, something you really, really need if you want to make a non linear transition that looks both perfect and natural. Also, it's really easy to use.

Using again our other sand shader

Finally, we wrote a script to use our other sand rendering shader once more time. If you don't know about it, just know that is a shader that paints sand according to the vertex colors in a plane. Using this script, once the animation is in motion and the sand particle splashes, the script starts painting the vertices below the given object.

This can also be used to achieve other cool sand effects, like an enemy leaving a sand trail while moving. We'll probably use it in a future creature because ir really looks nice:

To summarize

So, to summarize, this effect is achieved with a few tricks:

  • the new shader that uses a noise texture to make a non linear transition,
  • a sand particule system from Unity,
  • our other sand vertex shader,
  • a script that paints those vertices
  • and the animation putting it all together.

This is how it all looks together:

Since we are a small studio, it's crucial to get the best out of the technology we use. If we can also make a more visually interesting game, the better.

As always, here you have the shader in shader forge, so you can see exactly what the shader it's doing. Click on the image to zoom in.

That's it, that's all I have your you today. Think it's not enough? Well, you can read our longer devlogs, like this one about the first three guns of Immortal Redneck or this one about the sand rendering shader. If not, well, just follow us on Facebook and Twitter, we have lots of stuff around.

Praetor_Niedz - - 110 comments

Wow, the effect looks cool. I love it. :D Good job.

Reply Good karma Bad karma+3 votes
Saghen - - 154 comments

Effect is looking great! I would suggest baking a position map (aka gradient map) and then basing the sand effect on that. It would give a better result.

They look like this:

White at the top, black at the bottom. Dissolve from white to black.

Reply Good karma Bad karma+2 votes
Crema Author
Crema - - 11 comments

Thanks for your comment! The effect already goes from top to bottom! We use the world position of each object to achieve that very easily. The tricky thing is that we used the noise texture to make it look less linear and a little random.

Reply Good karma+1 vote
Saghen - - 154 comments

Hm but you seem to still have some issues with parts lasting longer than others.
In theory, if you were to look at any of the sides on a direct angle, it would be a completely flat line that moves downward as it dissolves. However, your objects are not doing this and instead are jagged.

Reply Good karma Bad karma+1 vote
x-Fourty7 - - 63 comments

Looks awesome! The sprite on the "Sand Dissolve" video is a tiny tiny tiny bit off color / lighting though fyi

Reply Good karma Bad karma+1 vote
Guest - - 687,512 comments

To be honest i think you'd find a great deal of use for it for one major reason.

leaving a blood trail behind that actually seeps into cracks..can't say i've seen it that before in a game.

Reply Good karma Bad karma0 votes
Crema Author
Crema - - 11 comments

A guest suggested we could use this shader for blood, but we think that would be a lot more tricky to nail. We'll try it anyway! Thanks a lot!

Reply Good karma+1 vote
Saghen - - 154 comments

Make sure you don't over do it though. Just subtle effects would be awesome.

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.