what's new in shader graph 10
the introduction of the universal render
pipeline and high definition render
pipeline
introduce changes on how shaders are
written to help the process of creating
custom shaders
we've introduced shader graph an
artist-friendly node editor which allows
you
the artists and developers to create
custom shaders to help shape your game's
look
we've recently made shader graph 10
available and in this video
we'll be going over some of its new
features in the description below
you'll find links to the shader graph 10
documentation and a link to the boat
attack demo we're using in this video
the master stack in previous versions of
shader graph
when we create a custom shader all nodes
we add to the graph will connect to a
final output node
otherwise known as the master node in
shader graph 10
we've replaced the master node with the
new master stack
like the master node the master stack
defines the final appearance of your
shader
however unlike the master node the
master stack defines two different
contexts
instead of a single context as such we
now have the vertex context
and the fragment context this is similar
to how shader code is written
where you define behavior in the vertex
pass and the fragment pass
the vertex context will describe the
final vertex information such as
position
normal and tangent coordinates while the
fragment context
will define the final appearance
properties of your shader including
color
metallic properties smoothness and
emissive properties
for those familiar with writing shader
code this is similar to the vertex and
fragment passes
we define in our shader code block nodes
in each context
can be removed and added depending on
its use
if you need to add a new block you can
press the spacebar to add a new block
node
if you'd like to remove a block node you
can select your desired block
and press the delete key on your
keyboard you can add a block
back to the stack by pressing the
spacebar or right clicking the stack
and selecting your desired node by
default
block nodes will be added and removed
when the graph settings change to
reflect the necessary outputs for each
setting
you can turn this feature off in edit
user preferences
shader graph automatically add and
remove block nodes
debugging shaders in previous iterations
of shader graph
we can view the generated shader code by
right-clicking the master node and
selecting
view generated shader this will open up
your text editor or ide
and show you the generated shader code
to make this more obvious
we've moved this option to the shader
graph asset itself
now instead of right-clicking the master
node we can view the shader graph asset
in our project
and select view generated shader in the
inspector
like before this will open up your text
editor or ide
with the generated shader code this can
be useful for debugging your shader
the graph inspector in order to provide
a unified window where we can view all
settings for the graph and its
respective nodes
we introduced the graph inspector we can
view the graph inspector by ensuring
that the graph inspector button
in the top right corner of the shader
graph window is enabled
in order to view the master stack
settings in your graph inspector
simply click the graph settings tab here
you set specific properties for your
shader
including your material type workflow
and surface type
the graph inspector also allows you to
change individual node settings
via the node settings tab here you can
select on an existing node
and change its precision type per node
for example
if you need a more accurate computation
you can change a node's precision type
to single instead of half
or vice versa if you need less precision
while the graph
retains a high precision the graph
inspector is also where you can edit
properties that exist in blackboard
this is useful if you want to use a
slider type for vector one
instead of a numerical field or create
enum states for your shader
that can easily be selected from the
inspector you can also define specific
reference names and display names
to make your properties more readable
upgrading to shader graph 10
when upgrading from a previous version
of shader graph to shader graph 10
the master node will be automatically
replaced with the master stack
during the upgrade process nodes
connecting to the master node will
connect to the corresponding context
and block nodes so for example if you
have a node which manipulates the albedo
of the master node
the connection will now be connected to
the base color block node of the master
stack
it's important to note that during the
upgrade process
if your shader graph has multiple master
nodes the current
active master node in your graph will be
converted to the master stack
while other master nodes will be removed
from the graph
the data in other master nodes will not
be preserved during the upgrade process
we recommend you take notes of other
connections and ports of the masternodes
before the upgrade shader graph 10
brings quality of life improvements
to help you create your own look for
your project to learn more about the
upgrade process
we strongly recommend viewing the
package documentation
so that you can easily upgrade your
shader graph assets
thanks for watching