chenbin b6410008e9 feat:spine3.8 | hai 6 meses | |
---|---|---|
.. | ||
CGIncludes | hai 6 meses | |
CGIncludes.meta | hai 6 meses | |
CameraDepthNormalsTexture.shader | hai 6 meses | |
CameraDepthNormalsTexture.shader.meta | hai 6 meses | |
CameraDepthTexture.shader | hai 6 meses | |
CameraDepthTexture.shader.meta | hai 6 meses | |
CameraNormalsTexture.shader | hai 6 meses | |
CameraNormalsTexture.shader.meta | hai 6 meses | |
README.md | hai 6 meses | |
README.md.meta | hai 6 meses | |
SpriteDepthNormalsTexture.shader | hai 6 meses | |
SpriteDepthNormalsTexture.shader.meta | hai 6 meses | |
SpritesPixelLit.shader | hai 6 meses | |
SpritesPixelLit.shader.meta | hai 6 meses | |
SpritesUnlit.shader | hai 6 meses | |
SpritesUnlit.shader.meta | hai 6 meses | |
SpritesVertexLit.shader | hai 6 meses | |
SpritesVertexLit.shader.meta | hai 6 meses |
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.