Advertisement
AkaiMage

VRChat Shader Fallback System (2019.2.1p1)

Apr 17th, 2019
916
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. if name contains "Sprite", fallback is "Sprites/Default".
  2. else if name contains "Particle", fallback is "Particles/~Additive-Multiply".
  3. else if name contains "MatCap", fallback is "MatCap/Vertex/Textured Lit" with "_Color" set to white and the "_MatCap" uniform copied from the original.
  4. else if (
  5. (name contains "Toon" or the property "_Ramp" exists) and
  6. name does not contain "Transparent" and
  7. name does not contain "Fade" and
  8. the "_ALPHABLEND_ON" keyword is not set in the material) {
  9.  
  10. 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.
  11. else if (name contains "Cutout" or the "_ALPHATEST_ON" keyword is set in the material) {
  12. the float "_Cutoff" property gets copied.
  13.  
  14. 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.
  15. else the fallback is "Toon/Lit Cutout".
  16.  
  17. if name contains "Unlit", a default white texture gets copied into the "_Ramp" parameter.
  18. else the Texture2D "_Ramp" parameter is copied. if material.GetTexture("_Ramp") returns null, then a default toon ramp is copied into the slot.
  19. }
  20. else if name contains "Outline" {
  21. 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.
  22. else the fallback is "Toon/Lit".
  23.  
  24. if name contains "Unlit", a default white texture gets copied into the "_Ramp" parameter.
  25. else the Texture2D "_Ramp" parameter is copied. if material.GetTexture("_Ramp") returns null, then a default toon ramp is copied into the slot.
  26.  
  27. the Color "_OutlineColor" parameter gets copied.
  28. the float "_Outline" parameter gets copied.
  29.  
  30. 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.
  31. }
  32. else {
  33. the fallback is "Toon/Lit".
  34. if name contains "Unlit", a default white texture gets copied into the "_Ramp" parameter.
  35. else the Texture2D "_Ramp" parameter is copied. if material.GetTexture("_Ramp") returns null, then a default toon ramp is copied into the slot.
  36. }
  37. }
  38. else if (
  39. (name contains "Toon" or the property "_Ramp" exists) or
  40. name contains "Unlit") {
  41.  
  42. if the "_MainTex" property does not exist, fallback is "Unlit/Color".
  43. else if name contains "Cutout" or the "_ALPHATEST_ON" keyword is set in the material, fallback is "Unlit/Transparent Cutout".
  44. else if name contains "Transparent" or name contains "Fade" or the "_ALPHABLEND_ON" keyword is set in the material, fallback is "Unlit/Transparent".
  45. else fallback is "Unlit/Texture".
  46. }
  47. else if name contains "VertexLit", fallback is "Legacy Shaders/VertexLit".
  48. else {
  49. the fallback is "Standard".
  50. if the "_Mode" property exists, the blend mode property in standard (Opaque, Cutout, Fade, or Transparent) is set to the integer value of that.
  51.  
  52. the float "_Cutoff" property is copied.
  53. the float "_Glossiness" property is copied.
  54. the float "_Metallic" property is copied.
  55. the Texture2D "_BumpMap" property is copied.
  56. the Color "_EmissionColor" property is copied.
  57. the Texture2D "_EmissionMap" property is copied.
  58. }
  59.  
  60.  
  61. at the end of all of this shit:
  62.  
  63. 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.
  64.  
  65. the Color "_Color" property is copied.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement