chenbin b6410008e9 feat:spine3.8 | 6 місяців тому | |
---|---|---|
.. | ||
CGIncludes | 6 місяців тому | |
CGIncludes.meta | 6 місяців тому | |
CameraDepthNormalsTexture.shader | 6 місяців тому | |
CameraDepthNormalsTexture.shader.meta | 6 місяців тому | |
CameraDepthTexture.shader | 6 місяців тому | |
CameraDepthTexture.shader.meta | 6 місяців тому | |
CameraNormalsTexture.shader | 6 місяців тому | |
CameraNormalsTexture.shader.meta | 6 місяців тому | |
README.md | 6 місяців тому | |
README.md.meta | 6 місяців тому | |
SpriteDepthNormalsTexture.shader | 6 місяців тому | |
SpriteDepthNormalsTexture.shader.meta | 6 місяців тому | |
SpritesPixelLit.shader | 6 місяців тому | |
SpritesPixelLit.shader.meta | 6 місяців тому | |
SpritesUnlit.shader | 6 місяців тому | |
SpritesUnlit.shader.meta | 6 місяців тому | |
SpritesVertexLit.shader | 6 місяців тому | |
SpritesVertexLit.shader.meta | 6 місяців тому |
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.