#Switching from shader graph to shader code

1 messages · Page 1 of 1 (latest)

west marten
#

Is it easier if I know the concepts of shading through graph. Also where to start?

mortal nexus
#

1rst question I'd ask is : why ?
If you want to go slowly, you can use ShaderGraph's custom function node to write code that will be executed in SG.
It uses the HLSL language and shadergraph nodes are named like the code function that they use (you can also look at the generated code examples from SG doc).

If you want to go to "raw" shader code, take a look at ShaderToy. It uses GLSL, which is very close to HLSL so you won't be lost.

Then ultimately, if you want to do Unity shaders, you'll need to dig into the official ShaderLab syntax documentation, for declaring properties and passes.

The Book of Shaders is a good general ressource about shaders that is worth reading through, and The Unity Shader Bible for Unity oriented shader code.

west marten
#

It's the reason ig I want to switch.

#

Or maybe 1 of the reasons.

remote flame
solar pike
#

URP 14.0 aka Unity 2022.3. didn't have Fullscreen graph type yet, so missing that official blitting method
Nevermind, it did

west marten
#

Currently reading your blog Cyan...

#

About render pass

#

Looks like you are typing.
Feel free to ping me when you post the message 😊.

mortal nexus
west marten
#

My pleasure

#

You are still typing.
React to this message to ensure that it's not a random kid or pet playing with your keyboard LOL.

remote flame
# west marten Looks like you are typing. Feel free to ping me when you post the message 😊.

Also no reason why you can't use both graphs and shader code in a project btw. No need to "switch" completely.

Writing a code shader for a Blitter function is likely just one pass so not too bad, but shaders used on scene objects can have many (like for drawing shadows, into depth/normal textures etc). Still possible to write but can be quite lengthy. Can look at the shaders under the URP package for examples, and/or I've also got a URP shader code article on my blog.

Graphs handle a lot of the setup & those additional passes for you to let you focus on the important parts (vertex/fragment function logic)

#

(Sorry, writing and doing other things at the same time so took longer)

west marten
#

There no need to.
Actually Thanks instead for your time 😊