Skip to content

Shader Documentation (Legacy)

shadowmage45 edited this page Oct 19, 2018 · 1 revision

Legacy Shader Documentation

The following legacy shaders are included with TU for backwards compatibility with existing mods and texture sets.

  • SSTU/PBR/Metallic - U5 Standard Metallic analogue
  • SSTU/PBR/StockMetallicBumped - Metallic shader that uses diffuse-A channel for gloss/smoothness
  • SSTU/PBR/MetallicTransparent - U5 Standard Metallic shader w/transparency support
  • SSTU/Masked - Legacy 'Recoloring' shader
  • SSTU/PBR/Masked - PBR 'Recoloring' shader
  • SSTU/PBR/MaskedTransparent - PBR 'Recoloring' shader w/transparency support
  • SSTU/SolarShader - Legacy back-lit 'Solar Panel' shader
  • SSTU/PBR/Solar - PBR back-lit 'Solar Panel' shader

SSTU/PBR/Metallic

Unity 5 Standard Metallic Shader analogue, with a subset of supported features. All main texture inputs exist and are used equivalently to U5S. The only adjustable 'property' is the main Color property. Full documentation of texture use can be found: https://docs.unity3d.com/Manual/shader-StandardShader.html

Texture Slots

  • _MainTex - RGB - Diffuse/Albedo/Base color texture
    • RGB = Diffuse/Albedo/Base color
  • _MetallicGlossMap - RGBA - Metallic Gloss Map
    • RGB = Grayscale Metallic mask. Reads from the R channel
    • A = Grayscale smoothness/gloss map.
  • _BumpMap - NRM - Normal Map
  • _AoMap - RGB - Grayscale AO map, reads actual color from R channel
  • _Emissive - RGB - Emission Color

Properties (float/color)

  • _Color - Tint applied to the color sampled from _MainTex texture
  • _EmissiveColor - Tint applied to the color sampled from _Emissive texture
  • _Opacity - Used in stock part-highlighting and stock thermal emissive (do not adjust manually) -- adjusts the opacity of both the main mesh and emissive highlighting
  • _RimFalloff - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _RimColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _TemperatureColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _BurnColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)

SSTU/PBR/MetallicTransparent

Unity 5 Standard Metallic Shader analogue, with a subset of supported features. All main texture inputs exist and are used equivalently to U5S. The only adjustable 'property' is the main Color property. Full documentation of texture use can be found: https://docs.unity3d.com/Manual/shader-StandardShader.html This shader variant includes transparency support, with the main source of transparency data being the alpha channel of the diffuse shader.

Texture Slots

  • _MainTex - RGB - Diffuse/Albedo/Base color texture
    • RGB = Diffuse/Albedo/Base color
    • A = Transparency value.
  • _MetallicGlossMap - RGBA - Metallic Gloss Map
    • RGB = Grayscale Metallic mask. Reads from the R channel
    • A = Grayscale smoothness/gloss map.
  • _BumpMap - NRM - Normal Map
  • _AoMap - RGB - Grayscale AO map, reads actual color from R channel
  • _Emissive - RGB - Emission Color

Properties (float/color)

  • _Color - Tint applied to the color sampled from _MainTex texture
  • _EmissiveColor - Tint applied to the color sampled from _Emissive texture
  • _Opacity - Used in stock part-highlighting and stock thermal emissive (do not adjust manually) -- adjusts the opacity of both the main mesh and emissive highlighting
  • _RimFalloff - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _RimColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _TemperatureColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _BurnColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)

SSTU/PBR/StockMetallicBumped

Unity 5 Standard Metallic Shader analogue, with a subset of supported features. Intended to allow for easier use of existing stock Diff(RGB)Spec(A) textures. Reads the gloss/smoothness value from the existing diffuse texture alpha channel. Full documentation of texture use can be found: https://docs.unity3d.com/Manual/shader-StandardShader.html

Texture Slots

  • _MainTex - RGB - Diffuse/Albedo/Base color texture
    • RGB = Diffuse/Albedo/Base color
    • A = Grayscale smoothness/gloss map.
  • _MetallicGlossMap - RGB - Metallic Map
    • RGB = Grayscale Metallic mask. Reads from the R channel
  • _BumpMap - NRM - Normal Map
  • _AoMap - RGB - Grayscale AO map, reads actual color from R channel
  • _Emissive - RGB - Emission Color

Properties (float/color)

  • _Color - Tint applied to the color sampled from _MainTex texture
  • _EmissiveColor - Tint applied to the color sampled from _Emissive texture
  • _Opacity - Used in stock part-highlighting and stock thermal emissive (do not adjust manually) -- adjusts the opacity of both the main mesh and emissive highlighting
  • _RimFalloff - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _RimColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _TemperatureColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _BurnColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)

Keywords

  • ALBEDOALPHA_INVERT - disabled by default. When enabled, it inverts the value taken from the albedo alpha channel before using it as a smoothness value.

SSTU/PBR/Solar

This shader is intended to produce back-lit visuals for solar panels -- simulating a not-quite-opaque solar panel by allowing light to bleed through when the light-source is behind the viewed object. Includes properties to adjust the amount of light, and how much it is distorted and/or attenuated as it travels through the object.

Texture Slots

  • _MainTex - RGB - Diffuse/Albedo/Base color texture
    • RGB = Diffuse/Albedo/Base color
  • _Thickness - RGB - Subsurface glow amount and color
  • _MetallicGlossMap - RGBA - Metallic Gloss Map
    • RGB = Grayscale Metallic mask. Reads from the R channel
    • A = Grayscale smoothness/gloss map.
  • _BumpMap - NRM - Normal Map
  • _AoMap - RGB - Grayscale AO map, reads actual color from R channel
  • _Emissive - RGB - Emission Color

Properties (float/color)

_Color("Color", Color) = (1,1,1,1) _SubSurfAmbient("SubSurf Ambient", Range(0, 1)) = 0 _SubSurfScale("SubSurf Scale", Range(0, 10)) = 1 _SubSurfPower("SubSurf Falloff Power", Range(0, 10)) = 1 _SubSurfDistort("SubSurf Distortion", Range(0, 1)) = 0 _SubSurfAtten("SubSurf Attenuation", Range(0, 1)) = 1 _EmissiveColor("EmissionColor", Color) = (0,0,0) _Opacity("Emission Opacity", Range(0,1) ) = 1 _RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1 _RimColor("_RimColor", Color) = (0,0,0,0) _TemperatureColor("_TemperatureColor", Color) = (0,0,0,0) _BurnColor ("Burn Color", Color) = (1,1,1,1)


SSTU/Masked

This shader is intended to support user-controlled coloring of parts. It uses specially authored diffuse and specular textures that function as grayscale detail masks in user-controlled areas, and as standard diff/spec textures in non-user controlled areas. The _MaskTex determines which portions of the texture can be adjusted by the user, with each RGB channel from the _MaskTex denoting a specific 'recoloring channel'; for example if the 'R' channel in the _MaskTex = 1, then all color input for that fragment will come from _UserColor1.

Texture Slots

  • _MainTex - RGB - Diffuse Detail Mask
    • RGB = Base of 128,128,128 with MINOR highlights and shadows added to it
  • _MaskTex - RGB - Mask texture
    • RGB = R = user color1, G = user color2, B = user color3; only one channel should be active at any one time
  • _SpecMap - RGB - Specular Reflection Color
    • RGB = Base of 128,128,128 with MINOR highlights and shadows added to it
  • _BumpMap - NRM - Normal Map
  • _AoMap - RGB - Grayscale AO map, reads actual color from R channel

Properties (float/color)

  • _MaskColor1 - User specified color that will be used for areas masked by the R channel in _MaskTex
  • _MaskColor2 - User specified color that will be used for areas masked by the G channel in _MaskTex
  • _MaskColor3 - User specified color that will be used for areas masked by the B channel in _MaskTex
  • _Shininess - Specular adjustment
  • _Opacity - Used in stock part-highlighting and stock thermal emissive (do not adjust manually) -- adjusts the opacity of both the main mesh and emissive highlighting
  • _RimFalloff - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _RimColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _TemperatureColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _BurnColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)

SSTU/PBR/Masked

PBR version of the SSTU/Masked shader. Includes additional shader property for the user to input metallic values for the masked portions of a texture.

Texture Slots

  • _MainTex - RGB - Diffuse Detail Mask
    • RGB = Base of 128,128,128 with MINOR highlights and shadows added to it
  • _MaskTex - RGB - Mask texture
    • RGB = R = user color1, G = user color2, B = user color3; only one channel should be active at any one time
  • _SpecMap - RGBA - Specular Metallic Map
    • RGB = Grayscale, Specular detail - Base of 128,128,128 with MINOR highlights and shadows added to it
    • A = Grayscale, Metallic detail - Base of 128,128,128 with MINOR highlights and shadows added to it
  • _BumpMap - NRM - Normal Map
  • _AoMap - RGB - Grayscale AO map, reads actual color from R channel

Properties (float/color)

  • _MaskColor1 - User specified color that will be used for areas masked by the R channel in _MaskTex
  • _MaskColor2 - User specified color that will be used for areas masked by the G channel in _MaskTex
  • _MaskColor3 - User specified color that will be used for areas masked by the B channel in _MaskTex
  • _MetalColor - User specified metallic values for the R,G,B masks (_MetalColor R = metal value for areas masked by R in _MaskTex)
  • _Shininess - Specular adjustment
  • _Opacity - Used in stock part-highlighting and stock thermal emissive (do not adjust manually) -- adjusts the opacity of both the main mesh and emissive highlighting
  • _RimFalloff - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _RimColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _TemperatureColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)
  • _BurnColor - Used in stock part-highlighting and stock thermal emissive (do not adjust manually)