Skip to content

Lit Shader

From version 2.0 onwards, the asset also includes a Lit Shader compatible with all 3D lights of all render pipelines. This shader will be automatically configured based on the render pipeline package installed and the Unity version you are currently using.

If at some point you want to force this automatic setup process, in case you see some error, change pipeline or Unity version you can do so in the Other tab of the Asset Window:

The Other tab of the Asset Window with the shader Auto Setup, Disable Depth And Scene Color effects, the Scene View notifications toggle and Refresh Lit Shader

The Lit shader has no Screen Distortion and no Soft Particles, and it draws opaque, so it always writes depth. From version 2.41 its inspector no longer shows those two effects or the Enable Z Write option, which did nothing on it.

To use this shader you’ll need to manually assign the shader in the Material Inspector, like so:

The Material Inspector's Shader dropdown open on the AllIn1Vfx shaders, with a red arrow from AllIn1VfxBuiltIn down to AllIn1VfxLit
The demo's water sphere material on the regular shader and on the Lit shader while the light goes around: only the Lit one shades and casts a shadow

To see this shader in action you can checkout the DemoVfxToolkitLitShader scene included in the Demo folder of the asset.

The Lit shader demo scene: a green water blob, a character trailing sparkles and a purple hexagon sphere casting shadows under green and red light

This lit shader was created using Better Shaders, a Unity Asset by Jason Booth that simplifies cross-pipeline shader development. This Better Shaders file can be found over at:

AllIn1VfxToolkit\Shaders\LitShaders\AllIn1VfxLit_BetterShader.surfshader

This is the Better shaders asset in case you want to check it out:

https://assetstore.unity.com/packages/tools/visual-scripting/better-shaders-2022-standard-urp-hdrp-244057?aid=1101l52IjU

If you do own Better Shaders, you are free to open the source file and change whatever you want. Your edits produce a separate shader, because the AllIn1Vfx/AllIn1VfxLit shader is built from its own templates when it gets configured.