Improving Game Visuals with Unity’s HDRP

Improve your game visuals and take them up by several notches using the High Definition Render Pipeline from Unity. By Wilmer Lin.

5 (4) · 3 Reviews

Download materials
Save for later
Share

Lighting can make all the difference in a game’s mood. From a sunny summer beach scene to a creepy haunted castle, a scene’s lighting sets the tone and gives users subtle visual cues about the setting. In this tutorial, you’ll begin exploring Unity’s High-Definition Render Pipeline (HDRP). Aimed at graphic realism, HDRP lets you configure rendering and post-processing with C# scripts. It’s part of the Scriptable Render Pipeline, first introduced in Unity 2018.

Getting started with HDRP, however, doesn’t actually require any scripting per se. Its pre-built components can deliver high-quality visuals without writing a line of code.

In this excercise, you’ll learn how to use HDRP and its Volume framework to:

  • Work with the Volume framework.
  • Use physically based skies.
  • Add post processing effects.
  • Work with lighting and global illumination.

In a few steps, you can transform some simple geometry into a rendered level and add some flair to your game visuals.

Get ready to paint with light!

RW logo lit from behind on a concrete wall

Since HDRP targets graphical realism, it’s important to ensure you use a compatible machine to build this project. We’ve observed that the scenes appear darker than normal (especially the Daylight scene in this tutorial) on certain machines that aren’t compatible.

Note: Use Unity 2020.3 or newer to follow this tutorial. You should have basic familiarity with the Editor before exploring HDRP’s lighting features. Some familiarity with Unity’s lighting could also be of help.

Since HDRP targets graphical realism, it’s important to ensure you use a compatible machine to build this project. We’ve observed that the scenes appear darker than normal (especially the Daylight scene in this tutorial) on certain machines that aren’t compatible.

Getting Started

Download the project materials by clicking Download Materials at the top or bottom of the tutorial.

Now, extract the zip file to a convenient location. After extracting, you’ll notice Starter and Final project folders. Feel free to explore these projects to familiarize yourself with them. Once ready, open the HDRPBlocks-Starter project in Unity.

Project Structure showing the assets

Note that this project includes the Default HDRP Template. Every time you use the Unity Hub to create a new HDRP project, Unity begins with a few default folders under Assets to help get started:

  • HDRPDefaultResources: This includes some default and fallback assets to set up the pipeline.
  • Scenes: This contains the template’s SampleScene.
  • SampleSceneAssets: This includes assets used in that scene.

Your project will use a few of the materials and meshes from these folders, so leave them intact.

All the custom assets you’ll need for this tutorial are inside the RW folder:

  • Materials: This contains some modified versions of the template materials.
  • Meshes: This folder contains simple geometry for the level.
  • Prefabs: Use these pre-built GameObjects to save setup time.
  • Scenes: Save your scene files here.
  • Settings: These assets contain lighting and rendering settings.

Load the Start scene from the RW/Scenes folder. You’ll use this scene as a template to create other scenes for you to work with.

the starting scene view

Once open, use File ▸ Save As to save this scene as a new scene called Daylight. Remember to save it within the RW/Scenes folder to keep your project organized.

Daylight scene position in project structure

Exploring the Level

Now that you have the Daylight scene, it’s time to explore its contents.

First, the Hierarchy includes PlayerControllerFPS, which allows you to move around the level.

Lighting contains — you guessed it — the lights and lighting props used in the scene! It has one Directional Light and a bunch of CeilingSpotlights.

Expose the child objects under Level.

  • The main environment and its meshes are the children of Building.
  • Props contains several pieces of decorative set dressing from the SampleSceneAssets template.
  • LevelCollider confines the player controller to this one room to keep things simple.

components of the Daylight scene

Now, enter Play mode to explore the level yourself. Use the standard mouse movement and WASD keys to aim and translate the player. The environment consists of several gray cubes assembled to form a single room.

concrete room with stairs and two columns

What is this house?

[spoiler title=”Reveal”]
The inspiration for this level is Hanasaki House, a custom-built home in Japan. Its minimalist architecture makes the most of light and simple forms, perfect for your first foray into HDRP.
[/spoiler]

What is this house?

[spoiler title=”Reveal”]
The inspiration for this level is Hanasaki House, a custom-built home in Japan. Its minimalist architecture makes the most of light and simple forms, perfect for your first foray into HDRP.
[/spoiler]

While the building blocks are present in the scene, the level looks drab. Too much uniform light makes the geometry appear “flat.” The meshes lack the shadows and highlights to create the illusion of 3D form. They need something to accentuate depth and dimension. They just look like dull grey cubes.

To lighten up the mood and breathe some life into the level, you’ll add some HDRP into the mix.

Understanding HDRP

The High-Definition Render Pipeline targets high-end platforms like consoles and PCs. As the name implies, it’s a rendering pipeline. It consists of three parts:

  • Culling: Determining what GameObjects to render on-screen.
  • Rendering: How to draw those same objects.
  • Post-processing: What effects to apply to the camera after rendering.

HDRP stores its settings in a Pipeline Asset saved within the project. Create one in the project using right-click ▸ Create ▸ Rendering ▸ High Definition Render Pipeline Asset. Don’t worry about changing it’s name.

However, the standard template already includes several working Pipeline Assets. Locate them under Edit ▸ Project Settings ▸ Graphics.

HDRP graphics settings under project settings menu

In the Graphics tab, the Scriptable Render Pipeline Settings contains the default pipeline asset. Locate DefaultHDRPAsset in the project window and check it in the Inspector. These settings modify how Unity renders and post-processes the scene.

Inspector view for Default HDRP Asset

Whew, that’s a lot of settings!

The Scriptable Render Pipeline offers far greater flexibility than the built-in render pipeline. However, this means that it contains many different settings to fine-tune your visuals. Since this tutorial is to help you get started with HDRP, you can leave most of these settings as-is.

Inspect the other pre-built pipeline assets in SampleSceneAssets/Settings. You can see assets for multiple graphics qualities, allowing you to cater to a wide range of devices.

HDRP assets

To begin, in the Graphics tab, switch Scriptable Render Pipeline Settings to HDRPHighQuality.

Various default HDRP quality settings in the Project

You can also see them in Project Settings under the Quality tab. Choosing a Quality Level switches the active pipeline asset. Keep High Quality selected.

Quality tab under Project Settings Menu with High Quality selected

At this point, there’s no need to modify the other individual dropdowns and fields. You’ll simply work at a macro level and swap between high, medium or low quality settings.