High Definition Render Pipeline: Lit shader in action Part 1

What is HDRP?

High Definition Render Pipeline is a new way of rendering that gives us resources to achieve realistic results in Unity. SRPs (Scriptable Render Pipelines) was released in Unity 2018.1 as Preview package, so these features are still not finished.

HDRP brings to Unity a new Lightning system called Physical Light Units (PLU), new Volume settings that contain information about fog, visual environment, shadows, reflections, etc. We can also find some new shaders for HD rendering, especially new Lit shader which is the equivalent of Standard Shader.

Entire HDRP is too much for just one post, so I will focus on Lit shader and all the properties that it contains.

 

Installation of HDRP into Unity project

The easiest way to add HDRP to your project is just to create a new project with High-Definition RP template.

High Definition Render Pipeline Template
HDRP Template

However, if you want to install HDRP to existing project just follow instructions from Unity:

 

https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/Getting-started-with-HDRP#upgrading-an-existing-project

 

Lit shader features

Lit Shader Features
HDRP Lit Shader Features

Surface Type
First of all, we need to choose the type of our material. Opaque, with which we will get solid material with no light penetration or Transparent, that allows us to make transparent object like glass but with higher performance costs.

Double sided

Check this if you want your shader to display on both sides. When disabled your shader will not render backfaces.

Material type

Standard is a basic option with no render changes.

Subsurface scattering is an advanced feature that simulates light penetration. Useful with rendering plants or skin.

Quick setup:

Lit Shader Subsurface scattering
HDRP Lit Shader Subsurface scattering

Anisotropy affects reflection on material, useful with metallic materials. I’m using anisotropy on my sample scene I created for this post to achieve some brushed metal feeling.

Iridescence is an effect useful in creating glass or elements like oil stains.

Specular color controls color and strength of specular reflections. Specular replacing Metallic inputs and converts it from slider to a color space because with specular we can change color of our reflections.

Translucent allows us to simulate light transmission through an object. This material type offers less costly solution than Subsurface Scattering but it’s kind a “fake” effect.

Inputs

Base color + opacity simple RGBA color space with texture input.

Metallic and Smoothness in basic version are sliders that control how material is reflecting environment. It is a rough surface that absorbs light or it’s smooth and reflects light.

Mask Map is a pack of 4 grayscale textures in one RGBA texture, where each channel contains information:
Red Channel – Metallic

Green Channel – Ambient Occlusion

Blue Channel – Detail Map Mask

Alpha Channel – Smoothness

Mask Map affects Metallic and Smothess sliders from above.

Normal Map with strength factor from 0 to 2

Detail Inputs

Detail Map is a second map that gives us more space to work with details like skin pores etc. Texture input is similar to Mask Map.
Red Channel – Grayscale using Overlay Blending

Green Channel – Normal Map Y channel

Blue Channel – Smoothness

Alpha Channel – Normal Map X channel

Coat Mask a clear coat effect that affects smoothness on surface. Powerful with creating car paint or making surface wet.

 

Transparency inputs

In this section, we can control refraction of transparent objects using parameter called Index of Refraction and Refraction Thickness. We can also apply distortion to set some blur to refraction.

These are the most important features that the new HDRP Lit shader introduces to us in Unity 2018.1. I’m using Unity 2018.2.14 and things got better since I tried them at the release. I haven’t noticed any issues or experienced crashes during project work.

In the next part, I will explain how to achieve high quality of rendering. I will focus on tools that I have used to create my sample HDRP scene, so you will see how to put these into practice.

 

related
Tutorial
Coroutines in Unity – Encapsulating with Promises [Part 2]
In the last article we focused on the internals behind Unity’s Coroutines and went in depth...
2
GuideIntermediateTipsTutorial
Project Tiny: Play Your Games Instantly
Unity Technologies is one of these companies that constantly bring something new to the table....
0
Tutorial
Finite State Machines [Part 2]
Deeper inside FSM Finite State Machines are a sequential logic that are very low level....
2
Call The Knights!
We are here for you.
Please contact us with regards to a Unity project below.



The Knights appreciate your decision!
Expect the first news soon!
hire us!