Lightweight Render Pipeline Shaders
"Lightweight Render Pipeline Shaders" is a collection of shaders designed for Unity 2018 Lightweight Render Pipeline. It's especially useful for VFX and particles.
All shaders are fully customizable and GPU Instancing / GPU Instancing Particles friendly.
Available Shaders
- Lightweight
- Unlit
- Color
- Gradient
- Texture
- Texture and Color
- Particles
- Color
- Texture
- Textureless (Port from ShurikenPlus)
- Unlit
Features
Basic Parameters
This section contains shader specific parameters. Basically, color and texture.
Alpha Clip
If you check Alpha Clip
, alpha clipping is enabled. A pixel with alpha that is less than threshold will be discarded.
Surface
You can choose one of the following surface types:
Opaque
Transparent
Premultiply
Additive
Multiply
and Src Blend
, Dst Blend
, Z Write
and Premultiplied Alpha
values will automatically be configured to appropriate settings.
If you choose Custom
, you can change that values as you like.
Cull
You can choose a cull mode from:
Off
Front
Back
Default is Back
. Off
is for double sided material.
Z Test
You can choose which compare function will be used for Z Test.
GPU Instaincing
If you check Enable GPU Instancing
, a material is automatically configured for GPU Instancing. If you use same mesh and the material with MeshRenderer for rendering, draw call will be automatically instanced.
Also if you check Enable Per Instance Data
, you can store per-instance Basic Parameters
via MaterialPropertyBlock.
// Set random colors but keep GPU Instancing
foreach (var g in gameObjects)
{
var property = new MaterialPropertyBlock();
property.SetColor("_Color", Random.color);
g.GetComponent<MeshRenderer>().SetProperty(property);
}
GPU Instancing Particle
All Particles shaders works correctly with GPU Instaincing in Particle System.
To enable GPU Instaincing in Particle System, use Mesh
render mode and check Enable GPU Instancing
in Render
section of Particle System inspector.
Minimum
All features are implemented by shader variants. After compilation, code of non-used feature is efficiently striped!