Shader Graph is great for multi-platform games, but for advanced control and efficiency, learning HLSL and ShaderLab is key. Explore these techniques in depth with the Unity Shaders Bible!
Have you tried compiling a Shader Graph shader? Many 3D artists transitioning into Technical Art are using Shader Graph to create shaders for their games. With the announcement of Shader Graph 2, the tool will offer even more robust features, enabling artists to craft complex visual effects with greater ease and flexibility. However, relying solely on nodes to build shaders may not always be the best option if you are looking for something really advanced and require greater control. For instance, the graphical layout of nodes can quickly become cluttered and hard to manage. Additionally, Shader Graph may generate unnecessary code for your project, potentially affecting shader efficiency.
These are the key reasons we encourage 3D artists to learn HLSL and the basics of ShaderLab (the code that defines shader properties in the Inspector). When you compile a Shader Graph shader, you might notice that the generated code (even with no nodes) can be over ~1700 lines, far more than a typical .shader file. A standard .shader file with one pass and a vertex/fragment stage typically contains around 59 lines of code.
So, when should you use Shader Graph versus writing your own HLSL shader? While Shader Graph is versatile and can be used in most cases, we recommend writing your own shaders when building your exclusively for a single platform. Shader Graphics shines particularly when your game needs to run across multiple platforms.
Curious to learn more about HLSL and Unity Shaders? We invite you to explore the “Unity Shaders Bible,” a comprehensive book that takes you on a linear journey, starting with fundamental concepts to advanced techniques.
Jettelly wishes you success in your professional carrer!
Did you find an error? No worries!
Write to us at [email protected], and we'll fix it!