Shader Graph in Unity for Beginners | raywenderlich.com

A shader is a small program containing instructions for the GPU. They describe how to calculate the onscreen color of a particular material. Though Unity provides a Standard Shader, sometimes you may need to make an effect beyond what the out-of-the-box shader can do. Historically, this has required a special shading language, such as Cg […]


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3744978-shader-graph-in-unity-for-beginners

Excellent tutorial–Wilmer consistently puts out highest quality material (I found Wilmer on Udemy and he is one of the best instructors I’ve encountered period–super organized, well planned, he does everything possible to prevent the user from hitting roadblocks on the learner’s journey). I’m not affiliated with him in any way, I just appreciate him so much! Great Shader Graph intro–I finally get a nice grasp of this cool Unity feature.

Thanks for the vote of confidence! Glad you enjoyed the tutorial!

Why the project crashed when I open it with Unity 2019.2.14f1 on Windows:disappointed_relieved:

Hi bling, sorry the project crashed for you.

However, I downloaded the ZIP from the RayWenderlich site and was able to open both the IntroToShaderGraph_Starter and IntroToShaderGraph_Final projects in both Unity 2019.2.10f and 2019.2.15f using Windows 10.

A number of factors can cause a crash, so I suggest first you try to reboot, download the ZIP again and try to re-open one of the projects. Make sure you download to a disk with sufficient disk space as Unity needs to generate a number of cache files when the projects open. -Wilmer

Hi can you make a tutorial like this for 2D shader graph?

The general workflow is the same as the 3d. However, the graphs themselves use slightly different nodes.

When you create the initial Shader Graph, instead of choosing PBR Graph, choose 2D Renderer > Sprite Lit Graph.

You’ll find many of the nodes like Sample Texture 2D behave the same.

Great intro - thanks! One minor thing - I couldn’t get the Bloom/post processing step to work with 2019.3.0f3. Did I miss something?

Hi @timchroma , Unity 2019.3 introduced a revised PostProcessing stack (internally I think it is version 3).

The LightweightRenderPipeline was changed to the UniversalRenderPipeline among other things. The PostProcessing stack was reorganized using different components.

To get the PostProcessing stack in 2019.3 and above:

  • Note what settings are currently being used for Postprocessing (take a screenshot or write them down) in Unity 2019.2.

  • In the Window â–ş PackageManager, remove LightweightRenderPipeline and PostProcessing packages.

  • Add the Universal RP package instead.

  • In the scene, remove any broken components previously from the PostProcessingVolume and PostProcessLayer (just remove the latter from the camera and delete the PostProcessing object from the Hieararchy)

  • For the MainCamera, switch the Layer back to Default. Check PostProcessing under the Rendering section in the Inspector. Choose an anti-aliasing option.

  • Add a “Volume” component (NOT PostProcessVolume). Use Global mode.

  • Create and assign a Volume Profile. This component is different from Unity 2019.2 and prior.

  • In the Volume Profile, add Bloom, Tonemapping, Color Adjustments, and Vignetting. Adjust the settings to match what you had in Unity 2019.2. What used to be ColorGrading is now separated into several different Overrides.

I will need to update this tutorial at some point. But this should work in the meantime.

Wilmer

1 Like

Thanks for taking the time for this response :slight_smile:

my tangrams doesn’t glow like they do when i convert color to a property. it reverts color rgb values to 4 - 191 - 4 and intensity to 3.9169… even though i try to force it into rgb 5-255-5 and 3.5 for instensity.
property is exposed, default is 5-255-5, 3.5 mode HDR precision inherit.
unity version 2019.2.18f1
edit. this is really weird, if i convert property back to inline-node it works as expected, when converted into property again doesn’t work

@waltran Do you have a color overriding the default? Check the Glow_Mat material. Whatever is the Inspector will override the default value you have in the Blackboard. Otherwise, I am not sure why Converting to a Property should have that effect. It should be just an interface to set numbers via the Inspector.

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!