What are you looking for?
Engine & platform

New Shader Graph Production Ready Shaders in Unity 6

BEN CLOWARD Senior Technical Artist
Jul 9, 2024|7:09 Min
Shader Graph Production Ready Shaders sample

The Shader Graph team is excited to announce the release of our newest set of samples, available to import now in 2022 LTS and the upcoming Unity 6 release. This set of samples contains more than 25 Shader Graph assets and dozens of subgraphs that are ready to be used directly in your projects. The sample shaders work in both HDRP and URP.

We have two main objectives with this sample set:

  1. Give our users a jump start in shader creation by providing a set of shaders that are ready to use.
  2. Provide examples that users can build on or modify to suit their needs.

This sample set will help you achieve the shader results you want more quickly without starting from scratch.We also include a step-by-step tutorial that shows how to combine the assets to create realistic environments. With the tutorial you can see how the shaders work together in context.

Sample content

Here’s a breakdown of the content available in the Production Ready Shaders pack:

HDRP and URP Lit Shaders
HDRP and URP Lit Shaders
HDRP and URP Lit Shaders

Both URP and HDRP come with code-based shaders. The most commonly used shader for each of the SRPs is called Lit. For projects that use it, it’s often applied to just about every mesh in the game. Both the HDRP and URP versions of the Lit shader are full-featured. However, sometimes users want to add additional features to achieve a specific look, or remove unused features to optimize performance. For users who aren’t familiar with shader code, this can be very difficult.

For that reason, we’ve included Shader Graph versions of the Lit shader for both URP and HDRP in this sample pack. Users can make a copy of the appropriate Shader Graph Lit shader, then change any material that’s currently referencing the code version of the Lit shader to the Shader Graph version. All material settings will correctly be applied and continue to work. They’ll then be able to make changes to the Shader Graph version as needed.

Decals
Decal Shaders
Decal Shaders

Decals allow you to apply local material modifications to specific locations in your scene. Think of things like applying graffiti tags to a wall or scattering fallen leaves below a tree. But decals can be used for a lot more. In these examples we see decals making things look wet, making surfaces appear to have flowing water across them, projecting water caustics, and blending specific materials onto other objects.

Terrain details
 Terrain details
Terrain Shaders

This set of shaders is made for meshes applied to terrain – such as grass, weeds, undergrowth, pebbles, etc. To learn more, read the terrain documentation on details. Detail meshes have some specific requirements for shaders. First, because of the high number of these meshes used on the terrain, their shaders must be as fast and efficient as possible. That mainly means keeping the number of texture samples low and doing more work in the vertex shader instead of the pixel shader. Second, because these meshes stop rendering and pop out at a specific distance, we use a method to dissolve them to prevent a harsh pop, making it less obvious that they’re being removed. In each shader, you’ll see a Distance Mask used to dissolve the mesh at a distance before the mesh stops rendering.

Rock shader
Rock Shaders
Rock Shaders

This is a full-featured, modular rock shader that can be used for everything from small pebbles, to boulders, to large cliff faces. It has features that can be turned on and off depending on the application. Each is encapsulated in a subgraph so it’s easy to remove unneeded features. You can also add new features in the chain of modules.

Water shaders
Water Shaders
Water Shaders

The sample set comes with four different water shaders – lake water, animated pond water, stream water, and stream waterfall. Each one uses reflection, refraction, surface ripples using scrolling normal maps, and depth fog. They also provide additional features unique to each water type.

Weather effects
Weather Effects
Weather Effects

This sample comes with a full set of weather-related subgraphs (rain and snow) that can be mixed and matched depending on the requirements of the object type. Rain effects include rain drops on top of objects, rain drips trickling down the sides, and puddles that can dynamically accumulate on flat surfaces, including rain and wind ripples.

Forest stream tutorial
Forest Steam tutorial
Forest Steam tutorial

The sample set also includes a step-by-step tutorial showing how to combine the water shaders, decals, rocks, and terrain detail meshes, along with several other Unity features to create a forest stream environment. The tutorial shows how everything is put together, and how the sample pack assets can be used together to create an environment.

Install the new sample assets using the Package Manager.

  1. In the Editor, open Package Manager.
Window Menu with Package Manager selected
Window Menu with Package Manager selected

2. In the Package Manager window, select the Shader Graph package.

Shader Graph selected in the Package Manage
Shader Graph selected in the Package Manage

3. Select the Samples tab.

Press the Import button in the Samples section of the Shader Graph package
Press the Import button in the Samples section of the Shader Graph package

4. Finally, select the Production Ready Import button to bring the new Production Ready sample set into your project.

With these steps completed, the node reference assets will show up in your project under Assets/Samples/Shader Graph/<your version>/Production Ready Shaders.

Project window showing where to find the Production Ready Shaders sample
Project window showing where to find the Production Ready Shaders sample

After importing the samples, get started by opening the scene that corresponds to the render pipeline you’re using (High Definition Render Pipeline,(HDRP), or Universal Render Pipeline (URP):

  • Assets/Samples/Shader Graph/<your version>/Production Ready Shaders/Scenes/URPProductionReadyShaders
  • Assets/Samples/Shader Graph/<your version>/Production Ready Shaders/Scenes/HDRPProductionReadyShaders
Open the the URP or HDRP sample scene from the Scenes folder
Open the the URP or HDRP sample scene from the Scenes folder

Once the scene is open, select the Shader Graph Feature Samples Showcase asset at the top of the Hierarchy panel, then follow the guided tour in the Inspector.

Select the Shader Graph Production Ready Shaders Showcase asset in the Hierarchy panel
Select the Shader Graph Production Ready Shaders Showcase asset in the Hierarchy panel

You can use the Samples dropdown box to select a sample and jump to that location in the scene.

Samples Showcase asset
Samples Showcase asset

Unity continues to add more samples to Shader Graph, with several more sample packs coming in the months ahead. These will help you learn Shader Graph more quickly, understand how to set up specific functionality, and create new shaders faster with premade subgraphs and templates. We hope you’ll enjoy using them.

This is a deep and rich sample set. We hope you have fun exploring it and use it to speed up your own shader creation process.

We’d love to hear your thoughts and impressions on these samples – tell us what you think in the Shader Graph forum.