3D Lights

The Lit shader variant supports all default 3D light components (Directional, Point, Spot, etc.) and allows you to create games in the style of Octopath Traveler:

All pipelines are supported except the 2D Renderer. For 2D lighting in URP, use the dedicated 2D Renderer Lit variant instead (see the 2D Renderer URP Lights section).

As usual, you can add this shader variant by selecting the Lit option in the asset component:

Alternatively, you can manually select it in the Material Inspector:

A Transparent Lit shader also exists. To select it, you'll need to use the manual setup method described above.

The feature has its own Demo scene that you can find at: AllIn13DShader\Demo\DemoLitShader

circle-exclamation

If the shader is added through the asset component, shadow configuration will be automatically done for you. Otherwise, you can manually configure it in the Material Advanced Configuration:

And enable cast shadows in the sprite (it needs debug mode to be active):

If you want to add a Normal Map the shader variant has an effect for that:

The asset component has a button that will activate the normal map effect, create a normal map texture, and add it to the material:

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:

AllIn1SpriteShader\Shaders\LitShaders\BetterShaders_AllIn1Sprite.surfshader

You can get Better Shaders here:

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

If you do own Better Shaders, you are free to open the source file and change whatever you want.

If after an update or after changing render pipelies you get an error in any of the lit shaders please go into the asset Window (Tools/AllIn1/SpriteShaderWindow) and press the button at the very bottom:

Last updated