CustomRTInit.shader 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Shader /*ase_name*/"Hidden/Templates/CustomRTInit"/*end*/
  2. {
  3. Properties
  4. {
  5. /*ase_props*/
  6. }
  7. SubShader
  8. {
  9. Tags { }
  10. /*ase_all_modules*/
  11. /*ase_pass*/
  12. Pass
  13. {
  14. Name "Custom RT Init"
  15. CGPROGRAM
  16. #include "UnityCustomRenderTexture.cginc"
  17. #pragma vertex ASEInitCustomRenderTextureVertexShader
  18. #pragma fragment frag
  19. #pragma target 3.5
  20. /*ase_pragma*/
  21. struct ase_appdata_init_customrendertexture
  22. {
  23. float4 vertex : POSITION;
  24. float4 texcoord : TEXCOORD0;
  25. /*ase_vdata:p=p;uv0=tc0*/
  26. };
  27. // User facing vertex to fragment structure for initialization materials
  28. struct ase_v2f_init_customrendertexture
  29. {
  30. float4 vertex : SV_POSITION;
  31. float2 texcoord : TEXCOORD0;
  32. float3 direction : TEXCOORD1;
  33. /*ase_interp(2,):sp=sp.xyzw;uv0=tc0;uv1=tc1*/
  34. };
  35. /*ase_globals*/
  36. ase_v2f_init_customrendertexture ASEInitCustomRenderTextureVertexShader (ase_appdata_init_customrendertexture v /*ase_vert_input*/)
  37. {
  38. ase_v2f_init_customrendertexture o;
  39. /*ase_vert_code:v=ase_appdata_init_customrendertexture;o=ase_v2f_init_customrendertexture*/
  40. o.vertex = UnityObjectToClipPos(v.vertex);
  41. o.texcoord = float3(v.texcoord.xy, CustomRenderTexture3DTexcoordW);
  42. o.direction = CustomRenderTextureComputeCubeDirection(v.texcoord.xy);
  43. return o;
  44. }
  45. float4 frag(ase_v2f_init_customrendertexture IN /*ase_frag_input*/) : COLOR
  46. {
  47. float4 finalColor;
  48. /*ase_frag_code:IN=ase_v2f_init_customrendertexture*/
  49. finalColor = /*ase_frag_out:Frag Color;Float4*/float4(1,1,1,1)/*end*/;
  50. return finalColor;
  51. }
  52. ENDCG
  53. }
  54. }
  55. }