General_101

shaders_shader_passes_hud_widget_simple_flash_0 pixel

May 15th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. ; compiled from tags\rasterizer\pixel_shaders_dx9\shaders_shader_passes_hud_widget_simple_flash_0.txt
  2. ;
  3. #const C1.rgb= $normal_color
  4. #const C1.a= $flash_amount
  5. #const C2.rgb= $flash_color
  6. #const C2.a= $global_alpha
  7. sampler2D s0 : register(S0);
  8. float4 bumpenv : register(C0); // .r=m00 .g=m01 .b=m10 .a=m11
  9. float4 c1 : register(C1);
  10. float4 c2 : register(C2);
  11. float4 zwriteout : register(c16);
  12. struct MRT_return
  13. {
  14. float4 color :COLOR0;
  15. float4 depth :COLOR1;
  16. };
  17. #ifndef MRT
  18. float4 main(
  19. #else
  20. MRT_return main(
  21. #endif
  22. #ifdef CENTROID0
  23. float4 tc0 : TEXCOORD0_centroid,
  24. #else
  25. float4 tc0 : TEXCOORD0,
  26. #endif
  27. float4 tc7:TEXCOORD7,
  28. float4 color0 : COLOR0,
  29. float4 color1 : COLOR1
  30. )
  31. #ifndef MRT
  32. : COLOR
  33. #endif
  34. {
  35. float4 r0, r1;
  36. float3 e, f;
  37. r0.r= r0.g= r0.b= 0;
  38. r0.a= 1;
  39. float4 tex1;
  40. float4 tex2;
  41. float4 tex3;
  42. float4 tex4;
  43. float4 tex5;
  44. float4 tex6;
  45. float4 tex7;
  46. // texture stage 0 mode 0 dot 0 input-stage 0
  47. float4 tex0= tex2Dproj(s0, tc0);
  48. // exp.components=3 term=3 term=3
  49. // line 18: R0= C0*INVERT(C0a)+C1*C0a
  50. float3 temp0;
  51. float3 temp1;
  52. float3 temp2;
  53. float3 temp3;
  54. temp3= c1.rgb;
  55. float3 temp4;
  56. float temp5;
  57. temp5= 1-c1.a;
  58. float3 temp6;
  59. float3 temp7;
  60. temp7= temp3 * temp5;
  61. temp1= temp7;
  62. float3 temp8;
  63. temp8= c2.rgb;
  64. float3 temp9;
  65. float temp10;
  66. temp10= c1.a;
  67. float3 temp11;
  68. float3 temp12;
  69. temp12= temp8 * temp10;
  70. temp2= temp12;
  71. temp0= temp1 + temp2;
  72. // exp.components=1 term=1
  73. // line 19: T0a= T0a*C1a
  74. float temp13;
  75. float temp14;
  76. temp14= saturate(tex0.a);
  77. float3 temp15;
  78. float temp16;
  79. temp16= c2.a;
  80. float3 temp17;
  81. float temp18;
  82. temp18= temp14 * temp16;
  83. temp13= temp18;
  84. r0.rgb= temp0;
  85. tex0.a= temp13;
  86. // exp.components=3 term=3
  87. // line 22: SRCCOLOR= R0
  88. float3 temp19;
  89. float3 temp20;
  90. temp20= saturate(r0.rgb);
  91. float3 temp21;
  92. temp19= temp20;
  93. // exp.components=1 term=1
  94. // line 23: SRCALPHA= T0a
  95. float temp22;
  96. float temp23;
  97. temp23= saturate(tex0.a);
  98. float3 temp24;
  99. temp22= temp23;
  100. r0.rgb= temp19;
  101. r0.a= temp22;
  102.  
  103. //fog zvalue
  104. float linear_depth = tc7.w / zwriteout.z;
  105. float3 depth_stripe;
  106.  
  107. depth_stripe.r = floor(linear_depth*256)/256;
  108. depth_stripe.g = frac(floor(linear_depth*65536)/256);
  109. depth_stripe.b = frac(floor(linear_depth*65536*256)/256);
  110.  
  111. #ifdef ZPRIME
  112. //r0.a has alpha kill value
  113. r0.rgb = depth_stripe.rgb;
  114. #endif
  115.  
  116. #ifndef MRT
  117. return r0;
  118. #else
  119. MRT_return retval;
  120. retval.color = r0;
  121. retval.depth.rgb = depth_stripe.rgb;
  122. retval.depth.a = r0.a;
  123. return retval;
  124. #endif
  125. }
Add Comment
Please, Sign In to add comment