Floating Islands: Setting Up Stylized Shaders with HDRP in Unity

Maciej Hernik discussed the details of his stylized scene Floating Islands: shaders for grass, trees, and water, Volume Overrides, asset texturing, and more. 

Introduction

Hi! My name is Maciej Hernik and I am a self-taught Level Artist from Poland. Since I remember I always enjoyed games. My first contact with video games was when I saw some games on PS1. When I was a kid I had a dream to someday make my own games even though I didn’t know how to make them yet. When I got older I discovered what 3D art is and found that it was very interesting and fun to me. My passion for game art gave me the opportunity to get my first job and at that moment I knew I wanted to make a living making game art and games.

Floating Islands: Idea

At first, this artwork was supposed to be an endless project like a playground for experiments with Unity HDRP that would help me get more familiar with its tools. However, when I made the first iterations of vegetation shaders and showed them to my friends they encouraged me to make a fancy scene with them. That was the moment when I decided to make this fairy tale/The Legend of Zelda inspired artwork. In this article, I wanted to break down some components of it.

Start of the Project

Initially, I used placeholders for terrain and some assets like rocks, trees, and grass to get information about the scale of the whole island and the shape of the Monolith and trees. I realised that shadows and sun shafts that were cast by triangle shaped trees were most satisfying to me.

Then I decided to place the first iterations of grass and trees with proper shaders and materials and started to polish the water effects. At that moment, I knew that the look of the scene would probably change later in the process, however, thanks to this iteration I saw that the artwork was going in the right way in terms of stylisation.

The Monolith and water were intended to be the focal point in the scene. It was pretty easy because the water was very dynamic thanks to an animated shader or particle effects and the Monolith and chains had a little top-down movement that added to the story a bit.

At some point, I felt that a single island was not as interesting as it could be. After giving it some thought I decided to add little islands around the main island to close the composition. At first, I thought that adding those little islands would take too much attention from the main island, however, after making them a little larger and placing some trees and rocks on them I felt they helped the composition. Finally, I added some clouds. I actually hand-painted them on planes with transparency and made them move across the sky using Unity animator.

Grass Creation

The grass shader was one of the first things created for this project. However, it went through many iterations to achieve the most satisfying effect. I have chosen a more procedural approach because I thought it would be a more challenging and fun way to make grass. For shader creation, I used a shader graph in Unity 2020.1.0f1 version.

Now let’s look into the grass shader part that is responsible for coloring. It is divided into 4 layers of colors which are blended between each other using the Lerp function. Those layers are:

  • Primary color + Shadow color
  • Additional color
  • Ground color
  • Highlights

Primary and Shadow colors are divided into two parts. One part is just a single color, and the second part is responsible for tiling another color over grass. This is achieved by projecting a texture onto the grass from the top view from the world position. Additional color is used to provide more variation in the grass because I felt that two colors weren’t enough, especially from the top view. Ground color was used to provide a gentle, almost invisible fake ambient at the bottom of the grass to bump the shapes a little. In the end, I reduced it because it created too much separation in the grass strands and it was bad for stylisation, in my opinion – that's why this ground ambient occlusion effect is very weak. The last layer creates highlights at the top parts of the grass depending on the mask texture scrolling speed.

With all these layers of color combined, I could set up my final grass by changing parameters in materials, and personally, I really enjoyed this approach.

Trees

I created a separate shader for trees and other vegetation that is slightly different than the grass shader. This time it has been used as a lit master shader. Thanks to this I could very easily get information from light direction and also in HDRP lit master adds the possibility to manipulate translucency of the object.

The tree model is made of simple cards but with normals modified to achieve a smoother look and get better control over light spreading on the tree. I achieved this in Blender thanks to the data transfer modifier which allowed me to transfer normals from another mesh to the tree cards.

Trees have no diffuse texture. Instead, in the shader, I used information about the light direction. Thanks to this I could control the translucency of the tree to decide how much light will spread through it. I also used information about light direction to change the color in the lit area and in the shadow area of the tree. Those functions were key for me to achieve a stylised look of vegetation.

I also implemented an option to control color based on height in the object Y local value. It allowed me to create a nice top-down gradient that helped blend the tree with the ground better. Finally, I decided to add gentle ambient occlusion between leaves to give them some separation.

Water Effects

As I mentioned, water is an important part of my scene because it stands out against the green grass and trees and contains many dynamic parts that help focus the viewer's attention on the center of the scene. 

The waterfall is actually a mix of two things:

  • Water with water shader
  • Foam and bubbles particles

I knew that I wanted to achieve a stylised look of the water, that’s why I created a simple shader that performs operations on a Voronoi texture like rotating, scaling and scrolling over time. In addition, I used a WaterfallMask texture in the red channel to mask the place where I wanted to hide the Voronoi pattern, like at the start of the waterfall. 

I added some particles to simulate foam and bubbles using the Unity particle systems with a custom spherical mesh. To achieve the final look I played around with settings like emission, particle system shape, or size over lifetime. 

For the bigger waterfall, I used a similar approach and only adjusted settings in particle systems to increase the size.

Non-Vegetation Assets

Assets like rocks, the bridge, and the Monolith have been created in a standard way – I modeled them in Blender, sculpted high poly versions in ZBrush, and baked them on low poly meshes in Substance Painter.

In Substance Painter, I simply used baked maps to give some colors and detail to the meshes, however, I wanted to share with you one trick that was used in the texturing process. 

This trick is to use a Blur Slope filter on a Baked Lighting layer that's on top of all other layers. It allowed me to achieve this satisfying stylised patchy effect.

An important thing to know is that the Baked Lighting layer was adding shadows into the texture based on environment lighting from Substance Painter. Because of that, I had to choose an environment that is not so directional in terms of lighting. 

The best way to reduce directionality in baked textures is to create a couple of Baked Lighting layers with different rotation settings and simply mask them to receive the best result.

Setting Up the Volume

The last part of the project that I wanted to talk about is the Volume component in Unity HDRP, it allowed me to adjust lighting and post-process. In the Volume, I added some Overrides that helped me achieve different effects.

Visual environment, HDRI sky, and Indirect Lighting Controller were Overrides that provided me with some ambient light from the sky. By using Indirect Lighting Controller I had the possibility to adjust the intensity of the ambient light and that was pretty handy for me.

Another useful option that I really enjoy using inside Unity HDRP is Fog and especially Volumetric Fog. I have found that the best way to use it is to set up a couple of Density Volume components in the scene. Density Volume is a component that allows you to manually adjust the area where the fog will be displayed, and how strong it will be.

I also added some post-processing effects in Volume because I felt the scene was too dark and needed more bloom to achieve the fairy tale look that I was aiming for. In the end, the scene got more blue colors, especially in the shadows, and I was pleased with the final result.

Conclusion

I am very happy that I started this project, even if it took me a while to create. I have gained some experience in creating stylised scenes and I especially feel that I know more about shaders and HDRP now. I've also got to say that without feedback from my friends, this scene probably wouldn't have turned out as good. That's why I am grateful to them.

If you have any questions about this scene or art in general, feel free to send me a message on ArtStation.

Thank you for reading! Cheers!

Maciej Hernik, Level Artist

Join discussion

Comments 1

  • Anonymous user

    Hi, amazing work! Can you give more details about how you did the AO for the trees? Is it a prebaked map for the entire tree, a post process? Thank you

    3

    Anonymous user

    ·3 years ago·

You might also like

We need your consent

We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more