Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if name contains "Sprite", fallback is "Sprites/Default".
- else if name contains "Particle", fallback is "Particles/~Additive-Multiply".
- else if name contains "MatCap", fallback is "MatCap/Vertex/Textured Lit" with "_Color" set to white and the "_MatCap" uniform copied from the original.
- else if (
- (name contains "Toon" or the property "_Ramp" exists) and
- name does not contain "Transparent" and
- name does not contain "Fade" and
- the "_ALPHABLEND_ON" keyword is not set in the material) {
- if name contains "VertexLit", fallback is "Legacy Shaders/VertexLit"; if the "_Color" property exists, then "_SpecColor" is set to black, "_Emission" is set to 0.2 * the value original "_Color" property, and "_Shininess" is set to 0.
- else if (name contains "Cutout" or the "_ALPHATEST_ON" keyword is set in the material) {
- the float "_Cutoff" property gets copied.
- if (the "_outline_width" property exists and is set to 0 and the "TINTED_OUTLINE" keyword is set in the material), fallback is "Toon/Lit Cutout (Double)", which is just "Toon/Lit" with alpha testing and culling turned off.
- else the fallback is "Toon/Lit Cutout".
- if name contains "Unlit", a default white texture gets copied into the "_Ramp" parameter.
- else the Texture2D "_Ramp" parameter is copied. if material.GetTexture("_Ramp") returns null, then a default toon ramp is copied into the slot.
- }
- else if name contains "Outline" {
- if (the "_outline_width" property exists and is set to 0 and the "TINTED_OUTLINE" keyword is set in the material), fallback is "Toon/Lit (Double)", which is just "Toon/Lit" with culling turned off.
- else the fallback is "Toon/Lit".
- if name contains "Unlit", a default white texture gets copied into the "_Ramp" parameter.
- else the Texture2D "_Ramp" parameter is copied. if material.GetTexture("_Ramp") returns null, then a default toon ramp is copied into the slot.
- the Color "_OutlineColor" parameter gets copied.
- the float "_Outline" parameter gets copied.
- if the "TINTED_OUTLINE" or "COLORED_OUTLINE" keywords are set in the material, the Color "outline_tint" property is transferred to "_OutlineColor" and "_Outline" is set to the original value of "_outline_width" / 100.
- }
- else {
- the fallback is "Toon/Lit".
- if name contains "Unlit", a default white texture gets copied into the "_Ramp" parameter.
- else the Texture2D "_Ramp" parameter is copied. if material.GetTexture("_Ramp") returns null, then a default toon ramp is copied into the slot.
- }
- }
- else if (
- (name contains "Toon" or the property "_Ramp" exists) or
- name contains "Unlit") {
- if the "_MainTex" property does not exist, fallback is "Unlit/Color".
- else if name contains "Cutout" or the "_ALPHATEST_ON" keyword is set in the material, fallback is "Unlit/Transparent Cutout".
- else if name contains "Transparent" or name contains "Fade" or the "_ALPHABLEND_ON" keyword is set in the material, fallback is "Unlit/Transparent".
- else fallback is "Unlit/Texture".
- }
- else if name contains "VertexLit", fallback is "Legacy Shaders/VertexLit".
- else {
- the fallback is "Standard".
- if the "_Mode" property exists, the blend mode property in standard (Opaque, Cutout, Fade, or Transparent) is set to the integer value of that.
- the float "_Cutoff" property is copied.
- the float "_Glossiness" property is copied.
- the float "_Metallic" property is copied.
- the Texture2D "_BumpMap" property is copied.
- the Color "_EmissionColor" property is copied.
- the Texture2D "_EmissionMap" property is copied.
- }
- at the end of all of this shit:
- it attempts to copy values from "_MainTex", "_Diffuse", or "_Texture" to "_MainTex" in that order. if all of these fail and there is no "_Color" parameter, fallback is "MatCap/Vertex/Textured Lit" with "_Color" set to their Trust level color * .8 + (.2,.2,.2) and "_MatCap" set to a default MatCap texture.
- the Color "_Color" property is copied.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement