The Curse Of Grimsey Island -

Lighting and Effects

Hi there!

I received a few requests to share how the lighting and effects work in Grimsey Island, so I thought I’d write that up here. I’ll try to keep everything as succinct as possible. Thankfully, most of the effects are handled by Unity itself (specifically HDRP 2021.3) so it’s mostly just setting things up and going from there.

Sky

The skybox in Grimsey Island is handled by Unity’s HDRI Sky component. This is part of the Post Processing package that comes with Unity. Here’s how it looks:

Thank you Unity for having this!

What’s really amazing to me is the Distortion Mode. It “animates” the skybox in a direction and provides a sense of movement. I learned a short while back that it’s good to always have something moving on the screen (either in the UI or world itself) and this is an easy way to achieve that. It’s not as nice as a procedural skybox, but for 5 minutes of setup time it’s very effective with the right skybox texture.

As a side note, I use skyboxes from Allsky (slightly edited in some cases). They’re very well done and come in different formats.

In addition to the Skybox, I also use Volumetric clouds. Thankfully Unity 2021 has this built in!

Thanks again Unity!

This adds just enough movement and life to the sky. I try to be subtle with it though.

The Light itself is just a single Directional Light with Volumetrics enabled. Nothing fancy at all.

Day vs Night

I haven’t really shared this aspect of the game yet, but in Grimsey Island the player will be able to inspect a crime scene at two different time periods - one during the day and another at night.

There are multiple ways of achieving the effect of switching between Day and Night. The obvious, and likely smarter way, would be to use multiple Unity Volumes. For Grimsey Island, I ended up taking a different approach as I use one global Volume for the entire scene and different volumes based on camera (i.e. flying a Drone, cinematic shot, etc). The reason I use a single global Volume is mostly because I change various settings at runtime and it’s easier to manage in one volume, at least for me.

I currently have a custom asset that stores settings for the Skybox and Lighting and switch back and forth that way. It’s easy to set up and manage as well. Here’s how it looks:

I’m addicted to custom Asset Files.

Underwater

Similar to Day and Night, when the player goes underwater some of the components of the Volume change to suit the environment (blueish, darker, etc). As a side note, all of the audio has to pass through a LowPass Filter as well to complete the effect.

Various channels for different situations.

There is an additional effect that happens when going underwater called caustics. There are several ways to achieve this, either in a custom shader or by using a light itself. I decided to go with using an actual light for the simple fact that it can support volumetrics. The idea of having “columns of light” underwater just sounds cool to me.

In Grimsey Island there are 4 Box lights, all of which use a custom Cookie with a water caustics texture. Here’s how the lights are all set up:

The size of the Cookie is 2048 x 2048!

Note that I do not enable shadows to help with performance. I do enable Volumetrics though :)

To provide a sense of motion, each of the 4 lights rotate and move in a subtle way to provide a sense of naturalness. It’s not as sharp as generating caustics with a texture, but it’s pretty neat looking and very easy to set up and get going. If the area of water were smaller, the caustics would likely look much better.

Dissolve Effect

In Grimsey Island, it’s possible to scan surfaces to make them disappear so the player can glance behind them, possibly finding a clue. Since this mechanic needs to work on pretty much everything, it means that a custom shader needs to be used for just about every object as well as the water.

Also, after finishing the tutorial section of the game there is a sort of cinematic moment where everything dissolves into view from the bottom up. The shader has to support that as well.

My favorite resource for learning about the Dissolve effect is from Brackey’s. I basically used that as the starting point.

Unfortunately, the Shader Graph for the custom shader in Grimsey Island looks like a web.

Yikes!

But I’ll try to explain how it works a little. A raycast is used to find a surface point (usually straight from the camera). That surface Vector3 point is passed to every Material instance that uses the custom shader. From there, I use Vector3.Distance to effectively create a sphere from that point.

From there, I set the alpha to zero for everything inside sphere (adding some weathered edges so it’s not so clear cut). I also add some emissive effects on the edges to show the spherical effect.

The same process is used for the Water surface shader as well. Here’s how the Dissolve effect looks in Shader Graph for water:

Remap is the coolest!

Determining the radius of the sphere happens in C# code. The code basically just feeds the shader this value over time. Passing a value directly to a custom shader is pretty easy - the parameter for that value just has to not be exposed.

Exposed in unchecked.

I think that pretty much covers it! If you have any questions, please don’t hesitate to reach out.

Thanks for reading!

Larry