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:
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.