Stencil Lights and Shadows
Stencil Lights and Shadows

Stencil Lights and Shadows

Description

Stencil Lights and Shadows brings a flexible shader that uses the stencil buffer to create sharp stylized lights or shadows in realtime. It can be used as a lightweight substitute for realtime point lights or as a complementary effect to achieve stylized visual effects.

Inspired by the techniques used in old-generation consoles, which had strict hardware limitations and required innovative solutions.

Made by Ian Mandarini

Features

βœ“ Simple to use, realtime, sharp and stylized. It is all just meshes with a material. Everything is made to be used in realtime. Everything can be dynamic and animated. No baking or mapping. Result is always sharp. Use low poly meshes for performance or high poly for smooth curved silhouettes. Works on top of any shader - feel free to use in your project that uses custom shaders. All we do is rendering meshes using a fancy transparent material.

βœ“ Super performative. More efficient than realtime point lights. Produce realtime effects that otherwise would not be viable in platforms where performance is critical. Performance test included in the package. Use low poly meshes for better performance or high poly for smooth silhouettes. Use LOD to have the best of both worlds of high performance and silhouette vertex resolution. Using multiple colors? Use the vertex colors option to reduce the number of materials per scene and have effect color embedded in each mesh.

βœ“ Show Volume Option: For those beautiful god rays and spotlights. You can also individually control the volume color, separate from the main effect color.

βœ“ Unlimited lights per object. Everything is just a mesh. This means that even in forward rendering any number of stencil lights and shadows can affect any given single mesh. Traditionally, forward rendering only supports a limited number of realtime lights per object.

βœ“ Support non-convex meshes and the camera can enter the mesh: Which are traditionally not supported by naive implementations. Meshes only need to be closed and orientable to work and you can safely move the camera the mesh volume.

βœ“ Built-in, URP and HDRP Support: Works out of the box for the built-in render pipeline and requires very minimal setup for URP and HDRP. Just add our renderer feature. Upon importing Stencil Lights and Shadows will recompile its shaders and setup all examples to the pipeline being used. You can also manually set the package to any chosen render pipeline in the settings window.

βœ“ Blend Modes: Stack stencil lights and shadows on top of each other. Combine with traditional realtime lights for hybrid effects. If the simplicity of just β€œlights” and β€œshadows” aren't enough for you, Stencil Lights and Shadows includes 16 advanced blending modes.

βœ“ Everything shown in the demo video and screenshots is included. All examples are included for each and every pipeline.

βœ“ Documentation and Source Code Included.