Royal Dunes

I wanted to learn more about making sand shaders and testing out the new volume options for Unity.

The Idea

I saw a tutorial from Alan Zucconi on "A Journey Into Sand." Where he recreated the sand shader from the indy game Journey. This is what set me on the path to making a desert environment. I started by roughley drawing out the shape I wanted using the Terrain tool. After that I started to look into how I could make something similar.

Sand Shader: Making The Shape

For the flat texture to look like sand it needs to have ripples, twists turns and grain. I started by getting a PerlinNoise and distorting it with some sine waves and rotate nodes. After doing that, the material looked a little better but it was all one flat color.


Sand Shader: Adding Color

I added color to the shader by blending the color for the high and the low parts of the sand with the black and white mask of the sand. To add a little more detail to the material, I used a voronoi noise and added that on top of the colors.


Sand Shader: The Normals

At last the normals. They were created by using the NormalFromHeight node. Plugging that into a NormalStrength node and multiplying that by a NormalStrength float. After doing all of that the sand shader was pretty much finished. I added some props from de ExampleAssets and started working on the fun stuff.


Environment: Density Volumes

To create the fog I mainly wanted to limit myself to using density volumes. I found that they can be extremely useful for good looks but are horribly inefficient when using them in game. I set up the procedural skybox. Added a day-night cycle, and called it there.


Conclusion

The main roadblock I had with this project was not knowing when to stop adjusting sliders and just being happy with the setting where they were at. Ultimately it turned out fine but I wasted a lot of time adjusting subtle elements of the thader that ultimately I would either cut completely because they were too complicated for the time I had, or they made the shader way to crowded. So for the next time I should probably first complete the entire shader and then start touching the slider to fine tune it. This little project was a lot of fun and very nice to be able to keep practicing what I like.


Check out my other projects

Vaporwave Car Ride

A bit of a deeper dive into the rendering side of game engines.

Learn more

Skybox(es)

A skybox I made during my time at SyncVR.

Learn more