Holo_face.shader 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. Shader "NRSDK/Holo_face" {
  2. Properties {
  3. _node_5051 ("node_5051", Color) = (0.3014706,1,0.9691825,1)
  4. _node_2675 ("node_2675", Range(0, 10)) = 4.213583
  5. _node_3534 ("node_3534", Range(0, 1)) = 0.9881258
  6. }
  7. SubShader {
  8. Tags {
  9. "RenderType"="Opaque"
  10. }
  11. Pass {
  12. Name "FORWARD"
  13. Tags {
  14. "LightMode"="ForwardBase"
  15. }
  16. CGPROGRAM
  17. #pragma vertex vert
  18. #pragma fragment frag
  19. #include "UnityCG.cginc"
  20. #pragma multi_compile_fwdbase_fullshadows
  21. #pragma multi_compile_fog
  22. //#pragma only_renderers d3d9 d3d11 glcore gles
  23. #pragma target 3.0
  24. uniform float4 _node_5051;
  25. uniform float _node_2675;
  26. uniform float _node_3534;
  27. struct VertexInput {
  28. float4 vertex : POSITION;
  29. float3 normal : NORMAL;
  30. };
  31. struct VertexOutput {
  32. float4 pos : SV_POSITION;
  33. float4 posWorld : TEXCOORD0;
  34. float3 normalDir : TEXCOORD1;
  35. UNITY_FOG_COORDS(2)
  36. };
  37. VertexOutput vert (VertexInput v) {
  38. VertexOutput o = (VertexOutput)0;
  39. o.normalDir = UnityObjectToWorldNormal(v.normal);
  40. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  41. o.pos = UnityObjectToClipPos( v.vertex );
  42. UNITY_TRANSFER_FOG(o,o.pos);
  43. return o;
  44. }
  45. float4 frag(VertexOutput i) : COLOR {
  46. i.normalDir = normalize(i.normalDir);
  47. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  48. float3 normalDirection = i.normalDir;
  49. ////// Lighting:
  50. float3 node_5334 = (pow(1.0-max(0,dot(i.normalDir, viewDirection)),_node_2675)*_node_5051.rgb*_node_3534);
  51. float3 finalColor = node_5334;
  52. fixed4 finalRGBA = fixed4(finalColor,1);
  53. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  54. return finalRGBA;
  55. }
  56. ENDCG
  57. }
  58. }
  59. FallBack "Diffuse"
  60. CustomEditor "ShaderForgeMaterialInspector"
  61. }