Get started with the Custom Lighting sample
Use the templates and sub graphs included in the Custom Lighting sample to get started with lighting model customization in Shader Graph.
Note
To use the Custom Lighting templates and sub graphs, you first need to import the sample in your project.
Start from a shader graph template
To use one of the available Custom Lighting templates as a starting point to customize lighting in a prebuilt shader graph asset, follow these steps:
In the template browser, select one of the templates from the URP Custom Lighting section.
Select Create.
Open the created shader graph asset in the Shader Graph window if the window doesn't open automatically.
Start from an empty shader graph
To use one of the available Lighting Model sub graphs as a starting point to customize lighting in an empty shader graph asset, follow these steps:
Create a shader graph asset with a preset target and select URP > Unlit Shader Graph.
Open the created shader graph asset in the Shader Graph window if the window doesn't open automatically.
Go to the Create Node menu and add one of the sub graphs from the Custom Lighting > Lighting Models section.
Connect the Lit output port of the added sub graph to the Base Color input port of the Master Stack.
To allow the Unlit target to correctly support custom lighting models, set the Graph Settings as follows:
- Enable Keep Lighting Variants.
- Disable Default Decal Blending and Default SSAO.