Advertisement
Guest User

Untitled

a guest
Oct 9th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. in diffuse_sun.hlsl
  2.  
  3. #ifndef GLASS_MATERIAL
  4. res.a = diffuseColor.a * MeltFactor.x;
  5. #else
  6. float specularMax = saturate(max(max(specular.r, specular.g), specular.b));
  7. if(transparencyFlag == TRANSPARENCY_ADD){
  8. res.a = saturate(diffuseColor.a + specularMax) * MeltFactor.x * max(SUM_BLEND_SHADOW_COEF_ALPHA, shadow);
  9. res.a *= 0.20+pow(clamp(1-sunDir.y, 0.1, 1),3)*0.15;
  10. res.rgb *= max(SUM_BLEND_SHADOW_COEF, shadow);
  11. }else{
  12. //float shadowedAlpha = specularMax * lerp(max(BLEND_SHADOW_COEF, shadow), 1.0, BLEND_SHADOW_SPLIT_COEF);
  13. //res.a = saturate(diffuseColor.a + shadowedAlpha) * MeltFactor.x;
  14. //res.a = lerp(res.a, res.a * 0.25, smoothstep(0.0, 0.3, -sunDir.y));
  15. res.a = diffuseColor.a * MeltFactor.x;
  16. res.rgb *= lerp(max(BLEND_SHADOW_COEF, shadow), 1.0, 1.0 - BLEND_SHADOW_SPLIT_COEF);
  17. }
  18. #endif
  19.  
  20. and
  21.  
  22. //res += calcScratches(input, shadow);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement