Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
4.1 KiB

  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "ASESampleShaders/Simple/SimpleRefraction"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] __dirty( "", Int ) = 1
  8. _BrushedMetalNormal("BrushedMetalNormal", 2D) = "bump" {}
  9. _Distortion("Distortion", Range( 0 , 1)) = 0.292
  10. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  11. }
  12. SubShader
  13. {
  14. Tags{ "RenderType" = "Opaque" "Queue" = "Transparent+0" "IsEmissive" = "true" }
  15. Cull Back
  16. GrabPass{ }
  17. CGPROGRAM
  18. #pragma target 3.0
  19. #pragma surface surf Standard keepalpha addshadow fullforwardshadows
  20. struct Input
  21. {
  22. float4 screenPos;
  23. float2 uv_texcoord;
  24. };
  25. uniform sampler2D _GrabTexture;
  26. uniform sampler2D _BrushedMetalNormal;
  27. uniform float4 _BrushedMetalNormal_ST;
  28. uniform float _Distortion;
  29. void surf( Input i , inout SurfaceOutputStandard o )
  30. {
  31. float4 ase_screenPos = float4( i.screenPos.xyz , i.screenPos.w + 0.00000000001 );
  32. float4 ase_screenPos40 = ase_screenPos;
  33. #if UNITY_UV_STARTS_AT_TOP
  34. float scale40 = -1.0;
  35. #else
  36. float scale40 = 1.0;
  37. #endif
  38. float halfPosW40 = ase_screenPos40.w * 0.5;
  39. ase_screenPos40.y = ( ase_screenPos40.y - halfPosW40 ) * _ProjectionParams.x* scale40 + halfPosW40;
  40. ase_screenPos40.xyzw /= ase_screenPos40.w;
  41. float2 uv_BrushedMetalNormal = i.uv_texcoord * _BrushedMetalNormal_ST.xy + _BrushedMetalNormal_ST.zw;
  42. float4 screenColor8 = tex2D( _GrabTexture, ( (ase_screenPos40).xy + (( UnpackNormal( tex2D( _BrushedMetalNormal, uv_BrushedMetalNormal ) ) * _Distortion )).xy ) );
  43. o.Emission = screenColor8.rgb;
  44. o.Alpha = 1;
  45. }
  46. ENDCG
  47. }
  48. Fallback "Diffuse"
  49. CustomEditor "ASEMaterialInspector"
  50. }
  51. /*ASEBEGIN
  52. Version=13202
  53. 487;574;979;444;889.9358;180.2048;1.699979;False;False
  54. Node;AmplifyShaderEditor.RangedFloatNode;31;-830.9375,433.5321;Float;False;Property;_Distortion;Distortion;1;0;0.292;0;1;0;1;FLOAT
  55. Node;AmplifyShaderEditor.SamplerNode;29;-855.48,221.599;Float;True;Property;_BrushedMetalNormal;BrushedMetalNormal;0;0;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;1.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT3;FLOAT;FLOAT;FLOAT;FLOAT
  56. Node;AmplifyShaderEditor.GrabScreenPosition;40;-447.4607,49.29217;Float;False;0;0;5;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
  57. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;32;-441.6739,287.2988;Float;False;2;2;0;FLOAT3;0.0,0,0;False;1;FLOAT;0.0,0,0;False;1;FLOAT3
  58. Node;AmplifyShaderEditor.ComponentMaskNode;39;-191.7806,65.19897;Float;False;True;True;False;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT2
  59. Node;AmplifyShaderEditor.ComponentMaskNode;36;-248.5805,285.0987;Float;False;True;True;False;True;1;0;FLOAT3;0,0,0;False;1;FLOAT2
  60. Node;AmplifyShaderEditor.SimpleAddOpNode;30;36.62508,137.2995;Float;False;2;2;0;FLOAT2;0.0,0;False;1;FLOAT2;0.0,0,0,0;False;1;FLOAT2
  61. Node;AmplifyShaderEditor.ScreenColorNode;8;224.0004,85.8997;Float;False;Global;_ScreenGrab0;Screen Grab 0;-1;0;Object;-1;False;1;0;FLOAT2;0,0;False;5;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
  62. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;536.7999,-33.8;Float;False;True;2;Float;ASEMaterialInspector;0;0;Standard;ASESampleShaders/Simple/SimpleRefraction;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;3;False;0;0;Translucent;0.5;True;True;0;False;Opaque;Transparent;All;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;False;0;255;255;0;0;0;0;False;0;4;10;25;False;0.5;True;0;Zero;Zero;0;Zero;Zero;Add;Add;0;False;0;0,0,0,0;VertexOffset;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;0;0;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0.0;False;4;FLOAT;0.0;False;5;FLOAT;0.0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0.0;False;9;FLOAT;0.0;False;10;OBJECT;0.0;False;11;FLOAT3;0.0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
  63. WireConnection;32;0;29;0
  64. WireConnection;32;1;31;0
  65. WireConnection;39;0;40;0
  66. WireConnection;36;0;32;0
  67. WireConnection;30;0;39;0
  68. WireConnection;30;1;36;0
  69. WireConnection;8;0;30;0
  70. WireConnection;0;2;8;0
  71. ASEEND*/
  72. //CHKSM=0B5226CEA863513E547197127E5C490AB617C827