chenbin b6410008e9 feat:spine3.8 | 5 months ago | |
---|---|---|
.. | ||
CGIncludes | 5 months ago | |
CGIncludes.meta | 5 months ago | |
CameraDepthNormalsTexture.shader | 5 months ago | |
CameraDepthNormalsTexture.shader.meta | 5 months ago | |
CameraDepthTexture.shader | 5 months ago | |
CameraDepthTexture.shader.meta | 5 months ago | |
CameraNormalsTexture.shader | 5 months ago | |
CameraNormalsTexture.shader.meta | 5 months ago | |
README.md | 5 months ago | |
README.md.meta | 5 months ago | |
SpriteDepthNormalsTexture.shader | 5 months ago | |
SpriteDepthNormalsTexture.shader.meta | 5 months ago | |
SpritesPixelLit.shader | 5 months ago | |
SpritesPixelLit.shader.meta | 5 months ago | |
SpritesUnlit.shader | 5 months ago | |
SpritesUnlit.shader.meta | 5 months ago | |
SpritesVertexLit.shader | 5 months ago | |
SpritesVertexLit.shader.meta | 5 months ago |
Contributed by ToddRivers
An Uber Shader specialised for rendering Sprites in Unity. Even though it's designed for Sprites it can be used for a whole range of uses. It supports a wide range of optional shader features that won't effect performance unless they are used. It also supports per-pixel effects such as normal maps and diffuse ramping whilst using Vertex Lit rendering.
The shaders support lighting using both Forward Rendering and Vertex Lit Rendering. Forward rendering is more accurate but is slower and crucially means the sprite has to write to depth using alpha clipping to avoid overdraw. Vertex lit means all lighting can be done in one pass meaning full alpha can be used.
Normals maps are supported in both lighting modes (in Vertex Lit rendering data for normal mapping is packed into texture channels and then processed per pixel).
Easily switch between blend modes including pre-multiplied alpha, additive, multiply etc.
Camera-space rim lighting is supported in both lighting modes.
A ramp texture is optionally supported for toon shading effects.
Shadows are supported using alpha clipping.
Both lighting modes support using a gradient for ambient light. In Vertex Lit mode the Spherical Harmonics is approximated from the ground, equator and sky colors.
An optional emission map is supported.
As sprites are 2d their normals will always be constant. The shaders allow you to define a fixed normal in camera space rather than pass through mesh normals. This not only saves vertex throughput but means lighting looks less 'flat' for rendering sprites with a perspective camera.
The shaders allow optional adjustment of hue / saturation and brightness as well as applying a solid color overlay effect for flashing a sprite to a solid color (eg. for damage effects).
Fog is optionally supported
On your object's material click the drop down for shader and select Spine\Sprite\Pixel Lit, Vertex Lit or Unlit.