Some custom lighting functions/sub-graphs for Shader Graph, Universal Render Pipeline
Some custom lighting functions/sub-graphs for Shader Graph, Universal Render Pipeline. If anything breaks, let me know by opening an issue!
+ This version is for URP v17.1+ / Unity 6000.1+
- For older (including 6000.0) versions, see branches!
https://github.com/Cyanilux/URP_ShaderGraphCustomLighting.git
Main Light
Main Light Shadows
Main Light Cookie
- For supporting cookies. Will also enable cookies for additional lights (as they use the same keyword)Main Light Layer Test
- For supporting Light Layers. Pass your shading calculation from main light through here.Main Light Diffuse
(handles Lambert / NdotL calculation)Main Light Specular Highlights
- handles specular highlights based on Phong or BlinnPhong modelsAdditional Lights
- Loops through each additional light, point, spotlights, etc. Handles diffuse, specular and shadows. Supports Forward+ path (in 2022.2+)Main Light Cookie
node is used (or _LIGHT_COOKIES
Boolean Keyword is defined in Blackboard)Main Light Layer Test
node is used (or _LIGHT_LAYERS
Boolean Keyword is defined in Blackboard)Sample Shadowmask
- attach this to the Shadowmask port on the Main Light Shadows and Additional Lights sub graphs, in order to support Shadowmask baked lighting modeSubtractive GI
- for supporting Subtractive baked lighting mode. Should connect Main Light Shadows node to first port. Uses MixRealtimeAndBakedGI function from URP ShaderLibraryMix Fog
- applies fog to the colour, should be used just before outputting to BaseColor on Master StackPhong Specular
and Blinn-Phong Specular
subgraphs are now considered deprecated - use Main Light Specular Highlights
instead.Ambient SampleSH
- uses per-pixel SampleSH. Somewhat redundant, should prefer using the built-in Baked GI
node