New Feature Examples Sample

The Shader Graph team is excited to announce the release of the Feature Examples sample, available now for 2022 LTS as well as 2023.3.

The Shader Graph Feature Examples sample content is a collection of Shader Graph assets that demonstrate how to achieve common techniques and effects in Shader Graph. The goal of this sample pack is to help users see what is required to achieve specific effects and provide examples to make it easier for users to learn.

Here’s a list of some of the samples in this package:

  • Blending Masks - these samples generate masks based on characteristics of the surface - such as height, facing angle, or distance from the camera.

  • Custom Interpolator - here we show how to use the Custom Interpolator feature in Shader Graph to move calculations from the fragment stage to the vertex stage to save performance.

  • Detail Mapping - techniques for adding additional detail to a surface that isn’t contained in the base set of texture maps.

  • Procedural Noise and Shapes - methods for creating shapes or patterns that use math instead of texture samples.

  • Shader Graph Feature Examples - examples of using specific Shader Graph features - such as the Custom Code node or the Custom Interpolator

  • UV Projection - methods of creating texture coordinates to achieve specific effects such as parallax occlusion mapping, or triplanar projection

  • Vertex Animation - techniques for adjusting the position of the vertices to create effects such as waves, animated flags, or camera-facing billboards.

  • Particles - shows how a full-featured particle system can be built using just Shader Graph

  • Conditions - demonstrates branching based on graphics quality setting and based on the active render pipeline.

    • Custom Lighting - shows how Shader Graph can be used to build custom lighting models - including PBR, simple, and cel shading.

Take a look at the video we created that shows how to install and use the samples.

We would love to get your feedback! Take a look at the new samples and let us know what you think in this thread.

9 Likes

Great work, Could you please also consider a similar sample for Canvas Ui shaders?

Thanks for the positive feedback @jGate99 , and to answer your question, we do have plans for UI Shader Samples.
Feel free to upvote/comment here.

1 Like

Good job, and as I said in the other thread, thank you for taking 2022.3 into account.

I have one feedback related to custom light. It’s great to see PBR and stuff recreated in SG, but I think there is something else that could be useful.
Block shaders are in development, but as far as I know they are not close to finished state, so for instance if I wanted to create PBR shader with some additional customizations (example) or toon shader based on PBR, then the only way is to duplicate existing (in my case) URP Lit shader in form of text file, then copy and modify functions used to calculate light and stuff and modify what I need. This is not a trivial task, plus it does not allow use of shader graph, because PBR Lit function takes complex structs and a lot of parameters.
In the end nobody wants to recreate whole shader if it already exists just to change one line.

What would be amazing to see is the example taking modified builtin function CalculatePBRblahblah(...) used in shader graph as custom function.

1 Like

This will save me so much time. Thanks a lot!

I think I found an issue in Custom Lighting/PBR/CustomLightingAdditionalLights.

I think this View Vector should be a View Direction:

Is there a specific version of 2022.3 lts I should be using to get to this? It’s not appearing in 2022.3.15f1, URP 14.0.9

EDIT: according to Youtube comments, 2022.3.21 should have it, and 2022.3.22 DOES have it.

1 Like