Search Unity

Coming soon: Recipes for popular visual effects using the Universal Render Pipeline

April 26, 2023 in Engine & platform | 7 min. read
This image and the cover image for the e-book are from PRINCIPLES, an adventure game from COLOPL Creators, the technology brand of COLOPL Inc, who developed the series of Shironeko Project and Quiz RPG: The World of Mystic Wiz.
This image and the cover image for the e-book are from PRINCIPLES, an adventure game from COLOPL Creators, the technology brand of COLOPL Inc, who developed the series of Shironeko Project and Quiz RPG: The World of Mystic Wiz.
Share

Is this article helpful for you?

Thank you for your feedback!

A dash of post-processing, a cup of decals, a pinch of color grading, and some sparkling water: Our new Universal Render Pipeline (URP) cookbook is coming soon. Here’s a sneak peek at what’s on the menu.

URP is the successor to the Built-In Render Pipeline. It provides Unity creators with flexibility and customization, enhanced performance across a range of platforms, and the ability to iterate more quickly.

Our upcoming guide, The Universal Render Pipeline cookbook: Recipes for shaders and visual effects, helps you harness the many capabilities of URP. You can now preregister to be notified when the guide is available.

This handy cookbook provides 12 recipes for popular visual effects that can be applied to a wide range of games, art styles, and platforms. You can use it alongside the Introduction to the Universal Render Pipeline for advanced Unity creators guide.

In the meantime, here’s a taste of what you’ll find in the cookbook: A recipe for using one of the post-processing filters available in URP for color grading.

LUT for color grading

Still from mystery adventure FPS game Return of the Obra Dinn
The mystery adventure FPS game Return of the Obra Dinn, made with Unity by Lucas Pope, achieves a unique look and feel thanks to its lo-fi art style and color palette that could be achieved following this recipe.
Using Color Lookup to create grading effects
Using Color Lookup to create grading effects

If you’ve yet to use the post-processing filters available with URP, you’re in for a treat. This recipe involves using one filter, but the steps employed apply to all of them. Using LUT Textures is an efficient way to create dramatic color grading, and this approach can be useful in many games.

By default, a new URP scene has post-processing disabled, so make sure to enable it via the Camera > Rendering panel.

View of how to select Post Processing in Camera > Rendering
Select Post Processing in Camera > Rendering

Additionally, you’ll need to enable post-processing in the Universal Renderer Data asset.

Capture of what you see in Editor when selecting post-processing in the Universal Renderer Data asset
Selecting post-processing in the Universal Renderer Data asset

To apply the filter where the camera is located, add a Global Volume. Right-click the Hierarchy window and select Volume > Global Volume.

Capture of how to find Global Volume in the Editor
Creating a Global Volume

Select the new GameObject, and create a new Profile by clicking New.

“New” selected in red box within capture of Volume view in Editor
Creating a new Profile

Now you can add an override. Press the Add Override button, select post-processing, then choose Color Lookup.

“Color Lookup” selected within “Add Override” menu in Editor
Adding a Color Lookup post-processing filter

Click the All button. Now you need a LUT (Lookup Table) image texture. This is a strip image that will be used by the filter to change the default rendered colors. You’ll find the image file in Scenes > LUT > NeutralLUT.png, or you can download it using this link.

NeutralLUT.png
NeutralLUT.png

A LUT image must have sRGB (Color Texture) disabled, which you do by selecting the image and viewing the Inspector.

Editor capture showing “sRGB (Color Texture)” not selected with the Neutral LUT (Texture 2D) Import Settings, disabling it for all LUT textures
Disable sRGB (Color Texture) for all LUT textures

Count the blocks in the NeutralLUT image above, and you’ll find there are 32 of them. Alternatively, you can use 16 blocks. Whether you choose 32 or 16 blocks, ensure the settings for your URP Asset match your choice. If you choose 32, make sure the post-processing panel has LUT size set to 32. Feel free to experiment with the Grading Mode option.

Look at where to set LUT size within the Post-processing panel in the Editor
Setting the LUT size

If you assign NeutralLUT.png as the Lookup Texture using the Color Lookup settings panel, you’ll see no change to the rendered image. The filter uses the texture to set a new color. The code takes the current pixel color and uses this to find a texel on the LUT image. With a neutral LUT image, the texel color will be the same as the current pixel color. The real magic occurs when you process the image you use as the Lookup Texture using a paint program like Photoshop or Krita. Explore these resources to learn more:

Editor capture showing “NeutralLUT” selected within the Color Lookup panel
Assigning the Lookup Texture

Take a screen grab of your scene and open it in Photoshop. At the bottom of the Layers panel, find the half black/half white circular button. Select it, and in the panel find Gradient Map. A new color adjustment layer is added.

View of Gradient Map drop-down in Editor
Creating a color adjustment layer

To create a color adjustment layer that results in a high-contrast black-and-white image, click the Gradient Map drop-down and select Basics, black and white.

View of Gradient Map tools in Editor with Basics expanded
Selecting a black and white gradient

To boost the contrast click the gradient to open a new window. Use the stops to adjust the contrast.

Capture of the customization window for gradients within Gradient Map; stops are displayed to show how developers can make adjustments
Changing the stops to boost the contrast

The screengrab should now look black and white.

Still of the effect of the Gradient Map in black and white
The effect of the Gradient Map

Once you have the grading of your choice, you need to apply this layer to the NeutralLUT.png file. Open the file in Photoshop. Back in the screengrab, right-click the adjustment layer, and select Duplicate Layer. In the new panel, select NeutralLUT.png as the Destination > Document.

Duplicate Layer window in Editor showing “As:” row with “Gradient Map 1” text highlighted
Duplicating the adjustment layer

Now the texture looks like this:

B&WLUT.png
B&WLUT.png

Save it, and drag it to your project’s Assets folder. Make sure to disable sRGB (Color Texture) using the Inspector panel. The last step is to assign the new LUT texture as the Lookup Texture for the Color Lookup filter.

Four-quadrant photo showing various versions of the same URP scene with different LUT textures applied
Using various LUT textures

Stay tuned for more helpful recipes from our upcoming URP cookbook. Sign up to be notified as soon as it’s available.

This cover image shown here is from PRINCIPLES, an adventure game from COLOPL Creators, the technology brand of COLOPL, Inc., who developed the series of Shironeko Project and Quiz RPG: The World of Mystic Wiz.
The cover image shown here is from PRINCIPLES, an adventure game from COLOPL Creators, the technology brand of COLOPL, Inc., who developed the series of Shironeko Project and Quiz RPG: The World of Mystic Wiz.

For even more tech and creative tips, explore all of the advanced e-books for programmers, artists, and designers on the Unity best practices hub. Want more great gamedev blog content? Be sure to read our Games Focus series.

April 26, 2023 in Engine & platform | 7 min. read

Is this article helpful for you?

Thank you for your feedback!

Related Posts