Intro to ShaderGraph - aefreedman/SP2018_IntermediateGameDev GitHub Wiki

Create your project

  1. Open Unity Hub
  2. Create a new project
    • Select Unity 2018 beta
    • Select Lightweight RP (Preview) template
    • Disable Unity Analytics
  3. Go to Window > Lighting > Settings and disable Auto Generate for the lightmap
  4. Go to Window > Package Manager
    • Click on Render-pipelines.light and update if an update is available
    • Click the All button and install the Shadergraph package
  5. If the sample scene is still magenta, you need to update your Render-pipelines.light package (above)
  6. Go to your Project window and create a new PBR Graph
    • Right Click > Create > Shader > PBR Graph
    • If you don't see this option, install the Shadergraph package
  7. Double-click on your new Graph
    • If the sphere in your Graph window is magenta, you're using the wrong render pipeline or your render pipeline package is out of date (see above)
    • You should see a single node called PBR Master and a grey sphere preview

Shadergraph basics

Unity's official documentation for Shadergraph is currently located on GitHub.

If you are looking at this outside of class, this Unity Forum post has multiple gifs covering basic graph creation.

The documentation covers everything in detail, but we will cover the following in class:

  • Basic interface
    • Nodes
      • Node datatypes
    • Dropdowns
    • Preview
    • Blackboard
    • Zoom, Drag
  • Connecting nodes
  • Adding data to the Blackboard
  • Creating common shader properties
    • Color
    • Textures & Normals
  • Using multiple nodes to modify output

Using your Shadergraph shader

Using your Shadergraph shader is easy! Just create a new material and pick your shader from the graphs category.

Examples

Unity has a bunch of example projects for both 2D and 3D with examples of how to use Shadergraph to create interesting results.