Magic Stone

Project information

  • Category: Shader
  • Project date: 2022

Magic Stone

This scene was put together inside Unity, using URP.

The scene is mainly composed of 2 shaders.

The first is the foliage shader that is used for the trees, the bushes, the flowers and even for the clouds. It changes the model's faces to always be facing the camera. The color has a lot o variations. It uses a base color, a top color (for normals that face upwards), bottom color and Fresnel color, so it appears more fluffy. It also varies in hue, saturation and brightness based on the object's position, so you can create a pretty varied forest with just one material. The wind movement is a gradient vertex displacement that is world-relative, so it stays coherent between different trees. The material is opaque and uses Alpha-Clip.

The other main shader is the ground grass. It uses Parallax Occlusion Mapping with a noise texture to fake depth for the grass. The movement is done by a simple displacement using gradient. The grass is cutout when the mesh is intersected by an opaque object, so it creates the effect as if the object is obstructed by some grass blades.

The Lighting is baked and uses shadowmask so that it works well with moving shadow casters.

I also modeled every mesh used on the scene on Blender and created every texture and material.

For the Post-Processing, the scene uses mainly bloom, and some color corrections.