MTECommon.hlsl 820 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef MTE_COMMON_CGINC_INCLUDED
  2. #define MTE_COMMON_CGINC_INCLUDED
  3. #ifdef MTE_STANDARD_SHADER
  4. #define Output SurfaceOutputStandard
  5. #else
  6. #define Output SurfaceOutput
  7. #endif
  8. void MTE_SplatmapFinalColor(Input IN, Output o, inout fixed4 color)
  9. {
  10. color *= o.Alpha;
  11. UNITY_APPLY_FOG(IN.fogCoord, color);
  12. }
  13. void MTE_SplatmapFinalPrepass(Input IN, Output o, inout fixed4 normalSpec)
  14. {
  15. normalSpec *= o.Alpha;
  16. }
  17. void MTE_SplatmapFinalGBuffer(Input IN, Output o, inout half4 diffuse, inout half4 specSmoothness, inout half4 normal, inout half4 emission)
  18. {
  19. diffuse.rgb *= o.Alpha;
  20. specSmoothness *= o.Alpha;
  21. normal.rgb *= o.Alpha;
  22. emission *= o.Alpha;
  23. }
  24. fixed3 MTE_NormalIntensity_fixed(fixed3 normal, fixed Strength)
  25. {
  26. return lerp(normal, fixed3(0,0,1), - Strength + 1.0);
  27. }
  28. #endif // MTE_COMMON_CGINC_INCLUDED