.[ ČeskéHry.cz ].

Laboratoř ČeskýchHer.cz - PasteBin

Vložit nový kód

ČeskéHry.cz - KOMUNITA HERNÍCH VÝVOJÁŘŮ

  1. List
    6 hod
  2. Çpmegafolder8.3gb
    11 hod
  3. sdggdsh
    11 hod
  4. sdfsdf
    11 hod
  5. Mega pack teen leaks video links
    12 hod
  6. Mega pack teen leaks video links
    12 hod
  7. Mega pack teen leaks video links
    12 hod
  8. Mega pack teen leaks video links
    12 hod
  9. Mega pack teen leaks video links
    12 hod
  10. Mega pack teen leaks video links
    12 hod
Link: http://nopaste.ceske-hry.cz/subdom/nopaste224704
Zaslal: Fresnel shader.
Popis: Jednoduchý Fresnel shader pro auta do Unity. Zkoušeno ve verzi 3.5.
Jazyk: C
Vloženo: 7.12.2015, 11:22
Stáhnout jako soubor
  1. Shader "Custom/Fresnel" {
  2. Properties {
  3. _MainTex ("Base (RGB)", 2D) = "white" {}
  4. _Reflection ("Reflection (RGB)", Cube) = "white" {}
  5. _Color ("Color", Color) = (1.0, 1.0, 1.0, 0)
  6. _FresnelPower ("Fresnel Power", Float) = 2
  7. _FresnelBias ("Fresnel Bias", Float) = 0.1
  8. }
  9. SubShader {
  10. Tags { "RenderType"="Opaque" }
  11. LOD 200
  12. CGPROGRAM
  13. #pragma surface surf BlinnPhong
  14.  
  15. sampler2D _MainTex;
  16. samplerCUBE _Reflection;
  17. float4 _Color;
  18. float _FresnelPower;
  19. float _FresnelBias;
  20.  
  21. struct Input {
  22. float2 uv_MainTex;
  23. float3 worldRefl;
  24. float3 worldNormal;
  25. float3 viewDir;
  26. };
  27. float fresnel(float3 I, float3 N, float power, float bias)
  28. {
  29. return saturate(pow(1.0-abs(dot(I, N)), power) + bias);
  30. }
  31.  
  32. void surf (Input IN, inout SurfaceOutput o)
  33. {
  34. float fres = fresnel(normalize(IN.viewDir), IN.worldNormal, _FresnelPower, _FresnelBias);
  35. half4 r = texCUBE(_Reflection, IN.worldRefl);
  36. half4 c = tex2D (_MainTex, IN.uv_MainTex);
  37. o.Albedo = lerp(c.rgb * _Color.rgb, r.rgb, fres * c.a);
  38. o.Alpha = 0.0;
  39. }
  40. ENDCG
  41. }
  42. FallBack "Diffuse"
  43. }
  44.