Advertisement
Guest User

Test

a guest
Aug 8th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 351.60 KB | None | 0 0
  1. 08/08/2015 09:24:04:822 [07460] | INFO | Loading effect from "C:\Program Files (x86)\Steam\steamapps\common\The Talos Principle\Bin\ReShade.fx" ...
  2. 08/08/2015 09:24:04:822 [07460] | TRACE | > Running preprocessor ...
  3. 08/08/2015 09:24:07:239 [07460] | TRACE | > Running parser ...
  4. 08/08/2015 09:24:07:245 [07460] | TRACE | > Running compiler ...
  5. 08/08/2015 09:24:07:247 [07460] | TRACE | > Compiling shader 'RFX_VS_PostProcess':
  6.  
  7. struct __sampler2D { Texture2D t; SamplerState s; };
  8. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  9. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  10. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  11. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  12. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  13. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  14. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  15. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  16. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  17. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  18. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  19. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  20. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  21. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  22. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  23. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  24. cbuffer __GLOBAL__ : register(b0)
  25. {
  26. extern uniform float _NSRFX_timer;
  27. extern uniform float _NSRFX_timeleft;
  28. extern uniform float _NSRFX_frametime;
  29. };
  30. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  31. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  32. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  33. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  34. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  35. SamplerState __SamplerState0 : register(s0);
  36. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  37. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  38. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  39. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  40. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  41. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  42. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  43. SamplerState __SamplerState1 : register(s1);
  44. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  45. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  46. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  47. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  48. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  49. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  50. SamplerState __SamplerState2 : register(s2);
  51. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  52. SamplerState __SamplerState3 : register(s3);
  53. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  54. SamplerState __SamplerState4 : register(s4);
  55. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  56. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  57. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  58. SamplerState __SamplerState5 : register(s5);
  59. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  60. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  61. {
  62. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  63. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  64. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  65. }
  66. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  67. {
  68. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  69. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  70. (color.xyz = float3(depth.xxx));
  71. }
  72. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  73. {
  74. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  75. float2 tex = texcoord;
  76. float3 color = colorInput.xyz;
  77. float dither_bit = 8.000000f;
  78. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  79. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  80. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  81. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  82. (color.xyz += dither_shift_RGB);
  83. (colorInput.xyz = color.xyz);
  84. (depthTexR = colorInput);
  85. }
  86. float _NSMFX_NSGetLinearDepth(in float depth)
  87. {
  88. return (1 / ((depth * -998.999939f) + 999.999939f));
  89. }
  90. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  91. {
  92. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  93. }
  94. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  95. {
  96. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  97. return color;
  98. }
  99. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  100. {
  101. float3 color = colorInput.xyz;
  102. float dither_bit = 8.000000f;
  103. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  104. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  105. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  106. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  107. (color.xyz += dither_shift_RGB);
  108. (colorInput.xyz = color.xyz);
  109. return colorInput;
  110. }
  111. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  112. {
  113. float P = __tex2D(tex, texcoord).x;
  114. float Pleft = __tex2D(tex, offset[0].xy).x;
  115. float Ptop = __tex2D(tex, offset[0].zw).x;
  116. return float3(P, Pleft, Ptop);
  117. }
  118. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  119. {
  120. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  121. float2 delta = abs((neighbours.xx - neighbours.yz));
  122. float2 edges = step(0.001000f, delta);
  123. return (0.200000f * (1.000000f - (0.400000f * edges)));
  124. }
  125. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  126. {
  127. [flatten]if (cond.x)
  128. (variable.x = value.x);
  129. [flatten]if (cond.y)
  130. (variable.y = value.y);
  131. }
  132. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  133. {
  134. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  135. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  136. }
  137. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  138. {
  139. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  140. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  141. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  142. }
  143. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  144. {
  145. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  146. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  147. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  148. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  149. }
  150. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  151. {
  152. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  153. }
  154. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  155. {
  156. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  157. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  158. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  159. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  160. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  161. float4 delta;
  162. (delta.xy = abs((L - float2(Lleft, Ltop))));
  163. float2 edges = step(threshold, delta.xy);
  164. if ((abs(edges.x) == -abs(edges.y)))
  165. {
  166. discard;
  167. }
  168. else
  169. {
  170. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  171. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  172. (delta.zw = abs((L - float2(Lright, Lbottom))));
  173. float2 maxDelta = max(delta.xy, delta.zw);
  174. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  175. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  176. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  177. (maxDelta = max(maxDelta.xy, delta.zw));
  178. float finalDelta = max(maxDelta.x, maxDelta.y);
  179. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  180. }
  181. return edges;
  182. }
  183. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  184. {
  185. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  186. float4 delta;
  187. float3 C = __tex2D(colorTex, texcoord).xyz;
  188. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  189. float3 t = abs((C - Cleft));
  190. (delta.x = max(max(t.x, t.y), t.z));
  191. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  192. (t = abs((C - Ctop)));
  193. (delta.y = max(max(t.x, t.y), t.z));
  194. float2 edges = step(threshold, delta.xy);
  195. if ((abs(edges.x) == -abs(edges.y)))
  196. {
  197. discard;
  198. }
  199. else
  200. {
  201. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  202. (t = abs((C - Cright)));
  203. (delta.z = max(max(t.x, t.y), t.z));
  204. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  205. (t = abs((C - Cbottom)));
  206. (delta.w = max(max(t.x, t.y), t.z));
  207. float2 maxDelta = max(delta.xy, delta.zw);
  208. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  209. (t = abs((C - Cleftleft)));
  210. (delta.z = max(max(t.x, t.y), t.z));
  211. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  212. (t = abs((C - Ctoptop)));
  213. (delta.w = max(max(t.x, t.y), t.z));
  214. (maxDelta = max(maxDelta.xy, delta.zw));
  215. float finalDelta = max(maxDelta.x, maxDelta.y);
  216. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  217. }
  218. return edges;
  219. }
  220. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  221. {
  222. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  223. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  224. float2 edges = step(0.010000f, delta);
  225. if ((abs(edges.x) == -abs(edges.y)))
  226. discard;
  227. return edges;
  228. }
  229. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  230. {
  231. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  232. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  233. (e.y = (e.y >= 0.500000f));
  234. (e.x = ((er1 * er2) - e.y));
  235. return e;
  236. }
  237. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  238. {
  239. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  240. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  241. (e.y = (e.y >= 0.500000f));
  242. (e.x = ((er1 * er2) - e.y));
  243. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  244. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  245. (e.w = (e.w >= 0.500000f));
  246. (e.z = ((eb1 * eb2) - e.w));
  247. return e;
  248. }
  249. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  250. {
  251. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  252. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  253. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  254. {
  255. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  256. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  257. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  258. }
  259. return coord.zw;
  260. }
  261. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  262. {
  263. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  264. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  265. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  266. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  267. {
  268. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  269. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  270. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  271. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  272. }
  273. return coord.zw;
  274. }
  275. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  276. {
  277. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  278. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  279. (texcoord.x += 0.500000f);
  280. (texcoord.y += (0.142857f * offset));
  281. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  282. }
  283. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  284. {
  285. float2 weights = float2(0.000000f, 0.000000f);
  286. float4 d;
  287. float2 end;
  288. if ((e.x > 0.000000f))
  289. {
  290. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  291. (d.x += float((end.y > 0.900000f)));
  292. }
  293. else
  294. (d.xz = float2(0.000000f, 0.000000f));
  295. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  296. [branch]if (((d.x - 2.000000f) > -d.y))
  297. {
  298. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  299. float4 c;
  300. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  301. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  302. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  303. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  304. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  305. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  306. }
  307. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  308. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  309. {
  310. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  311. (d.y += float((end.y > 0.900000f)));
  312. }
  313. else
  314. (d.yw = float2(0.000000f, 0.000000f));
  315. [branch]if (((d.x - 2.000000f) > -d.y))
  316. {
  317. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  318. float4 c;
  319. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  320. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  321. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  322. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  323. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  324. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  325. }
  326. return weights;
  327. }
  328. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  329. {
  330. float2 scale = float2(33.000000f, -33.000000f);
  331. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  332. (scale += float2(-1.000000f, 1.000000f));
  333. (bias += float2(0.500000f, -0.500000f));
  334. (scale *= float2(0.015625f, 0.062500f));
  335. (bias *= float2(0.015625f, 0.062500f));
  336. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  337. }
  338. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  339. {
  340. float2 e = float2(0.000000f, 1.000000f);
  341. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  342. {
  343. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  344. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  345. }
  346. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  347. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  348. }
  349. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  350. {
  351. float2 e = float2(0.000000f, 1.000000f);
  352. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  353. {
  354. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  355. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  356. }
  357. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  358. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  359. }
  360. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  361. {
  362. float2 e = float2(1.000000f, 0.000000f);
  363. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  364. {
  365. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  366. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  367. }
  368. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  369. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  370. }
  371. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  372. {
  373. float2 e = float2(1.000000f, 0.000000f);
  374. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  375. {
  376. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  377. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  378. }
  379. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  380. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  381. }
  382. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  383. {
  384. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  385. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  386. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  387. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  388. }
  389. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  390. {
  391. float2 leftRight = step(d.xy, d.yx);
  392. float2 rounding = (1.000000f * leftRight);
  393. (rounding /= (leftRight.x + leftRight.y));
  394. float2 factor = float2(1.000000f, 1.000000f);
  395. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  396. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  397. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  398. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  399. (weights *= saturate(factor));
  400. }
  401. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  402. {
  403. float2 leftRight = step(d.xy, d.yx);
  404. float2 rounding = (1.000000f * leftRight);
  405. (rounding /= (leftRight.x + leftRight.y));
  406. float2 factor = float2(1.000000f, 1.000000f);
  407. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  408. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  409. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  410. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  411. (weights *= saturate(factor));
  412. }
  413. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  414. {
  415. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  416. float2 e = __tex2D(edgesTex, texcoord).xy;
  417. [branch]if ((e.y > 0.000000f))
  418. {
  419. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  420. [branch]if ((weights.x == -weights.y))
  421. {
  422. float2 d;
  423. float3 coords;
  424. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  425. (coords.y = offset[1].y);
  426. (d.x = coords.x);
  427. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  428. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  429. (d.y = coords.z);
  430. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  431. float2 sqrt_d = sqrt(d);
  432. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  433. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  434. (coords.y = texcoord.y);
  435. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  436. }
  437. else
  438. (e.x = 0.000000f);
  439. }
  440. [branch]if ((e.x > 0.000000f))
  441. {
  442. float2 d;
  443. float3 coords;
  444. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  445. (coords.x = offset[0].x);
  446. (d.x = coords.y);
  447. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  448. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  449. (d.y = coords.z);
  450. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  451. float2 sqrt_d = sqrt(d);
  452. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  453. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  454. (coords.x = texcoord.x);
  455. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  456. }
  457. return weights;
  458. }
  459. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  460. {
  461. float4 a;
  462. (a.x = __tex2D(blendTex, offset.xy).w);
  463. (a.y = __tex2D(blendTex, offset.zw).y);
  464. (a.wz = __tex2D(blendTex, texcoord).xz);
  465. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  466. {
  467. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  468. return color;
  469. }
  470. else
  471. {
  472. bool h = (max(a.x, a.z) > max(a.y, a.w));
  473. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  474. float2 blendingWeight = a.yw;
  475. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  476. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  477. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  478. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  479. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  480. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  481. return color;
  482. }
  483. }
  484. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  485. {
  486. float4 current = __tex2D(currentColorTex, texcoord);
  487. float4 previous = __tex2D(previousColorTex, texcoord);
  488. return lerp(current, previous, 0.500000f);
  489. }
  490. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  491. {
  492. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  493. return FinalColor;
  494. }
  495. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  496. {
  497. _NSRFX_VS_PostProcess(id, position, texcoord);
  498. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  499. }
  500. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  501. {
  502. _NSRFX_VS_PostProcess(id, position, texcoord);
  503. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  504. }
  505. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  506. {
  507. _NSRFX_VS_PostProcess(id, position, texcoord);
  508. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  509. }
  510. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  511. {
  512. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  513. }
  514. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  515. {
  516. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  517. }
  518. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  519. {
  520. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  521. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  522. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  523. return color.xyz;
  524. }
  525. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  526. {
  527. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  528. }
  529.  
  530.  
  531. 08/08/2015 09:24:07:255 [07460] | TRACE | > Compiling shader 'RFX_CalcDepth':
  532.  
  533. struct __sampler2D { Texture2D t; SamplerState s; };
  534. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  535. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  536. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  537. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  538. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  539. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  540. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  541. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  542. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  543. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  544. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  545. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  546. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  547. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  548. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  549. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  550. cbuffer __GLOBAL__ : register(b0)
  551. {
  552. extern uniform float _NSRFX_timer;
  553. extern uniform float _NSRFX_timeleft;
  554. extern uniform float _NSRFX_frametime;
  555. };
  556. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  557. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  558. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  559. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  560. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  561. SamplerState __SamplerState0 : register(s0);
  562. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  563. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  564. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  565. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  566. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  567. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  568. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  569. SamplerState __SamplerState1 : register(s1);
  570. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  571. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  572. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  573. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  574. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  575. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  576. SamplerState __SamplerState2 : register(s2);
  577. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  578. SamplerState __SamplerState3 : register(s3);
  579. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  580. SamplerState __SamplerState4 : register(s4);
  581. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  582. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  583. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  584. SamplerState __SamplerState5 : register(s5);
  585. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  586. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  587. {
  588. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  589. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  590. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  591. }
  592. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  593. {
  594. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  595. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  596. (color.xyz = float3(depth.xxx));
  597. }
  598. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  599. {
  600. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  601. float2 tex = texcoord;
  602. float3 color = colorInput.xyz;
  603. float dither_bit = 8.000000f;
  604. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  605. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  606. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  607. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  608. (color.xyz += dither_shift_RGB);
  609. (colorInput.xyz = color.xyz);
  610. (depthTexR = colorInput);
  611. }
  612. float _NSMFX_NSGetLinearDepth(in float depth)
  613. {
  614. return (1 / ((depth * -998.999939f) + 999.999939f));
  615. }
  616. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  617. {
  618. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  619. }
  620. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  621. {
  622. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  623. return color;
  624. }
  625. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  626. {
  627. float3 color = colorInput.xyz;
  628. float dither_bit = 8.000000f;
  629. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  630. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  631. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  632. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  633. (color.xyz += dither_shift_RGB);
  634. (colorInput.xyz = color.xyz);
  635. return colorInput;
  636. }
  637. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  638. {
  639. float P = __tex2D(tex, texcoord).x;
  640. float Pleft = __tex2D(tex, offset[0].xy).x;
  641. float Ptop = __tex2D(tex, offset[0].zw).x;
  642. return float3(P, Pleft, Ptop);
  643. }
  644. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  645. {
  646. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  647. float2 delta = abs((neighbours.xx - neighbours.yz));
  648. float2 edges = step(0.001000f, delta);
  649. return (0.200000f * (1.000000f - (0.400000f * edges)));
  650. }
  651. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  652. {
  653. [flatten]if (cond.x)
  654. (variable.x = value.x);
  655. [flatten]if (cond.y)
  656. (variable.y = value.y);
  657. }
  658. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  659. {
  660. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  661. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  662. }
  663. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  664. {
  665. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  666. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  667. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  668. }
  669. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  670. {
  671. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  672. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  673. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  674. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  675. }
  676. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  677. {
  678. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  679. }
  680. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  681. {
  682. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  683. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  684. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  685. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  686. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  687. float4 delta;
  688. (delta.xy = abs((L - float2(Lleft, Ltop))));
  689. float2 edges = step(threshold, delta.xy);
  690. if ((abs(edges.x) == -abs(edges.y)))
  691. {
  692. discard;
  693. }
  694. else
  695. {
  696. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  697. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  698. (delta.zw = abs((L - float2(Lright, Lbottom))));
  699. float2 maxDelta = max(delta.xy, delta.zw);
  700. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  701. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  702. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  703. (maxDelta = max(maxDelta.xy, delta.zw));
  704. float finalDelta = max(maxDelta.x, maxDelta.y);
  705. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  706. }
  707. return edges;
  708. }
  709. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  710. {
  711. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  712. float4 delta;
  713. float3 C = __tex2D(colorTex, texcoord).xyz;
  714. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  715. float3 t = abs((C - Cleft));
  716. (delta.x = max(max(t.x, t.y), t.z));
  717. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  718. (t = abs((C - Ctop)));
  719. (delta.y = max(max(t.x, t.y), t.z));
  720. float2 edges = step(threshold, delta.xy);
  721. if ((abs(edges.x) == -abs(edges.y)))
  722. {
  723. discard;
  724. }
  725. else
  726. {
  727. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  728. (t = abs((C - Cright)));
  729. (delta.z = max(max(t.x, t.y), t.z));
  730. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  731. (t = abs((C - Cbottom)));
  732. (delta.w = max(max(t.x, t.y), t.z));
  733. float2 maxDelta = max(delta.xy, delta.zw);
  734. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  735. (t = abs((C - Cleftleft)));
  736. (delta.z = max(max(t.x, t.y), t.z));
  737. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  738. (t = abs((C - Ctoptop)));
  739. (delta.w = max(max(t.x, t.y), t.z));
  740. (maxDelta = max(maxDelta.xy, delta.zw));
  741. float finalDelta = max(maxDelta.x, maxDelta.y);
  742. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  743. }
  744. return edges;
  745. }
  746. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  747. {
  748. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  749. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  750. float2 edges = step(0.010000f, delta);
  751. if ((abs(edges.x) == -abs(edges.y)))
  752. discard;
  753. return edges;
  754. }
  755. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  756. {
  757. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  758. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  759. (e.y = (e.y >= 0.500000f));
  760. (e.x = ((er1 * er2) - e.y));
  761. return e;
  762. }
  763. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  764. {
  765. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  766. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  767. (e.y = (e.y >= 0.500000f));
  768. (e.x = ((er1 * er2) - e.y));
  769. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  770. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  771. (e.w = (e.w >= 0.500000f));
  772. (e.z = ((eb1 * eb2) - e.w));
  773. return e;
  774. }
  775. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  776. {
  777. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  778. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  779. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  780. {
  781. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  782. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  783. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  784. }
  785. return coord.zw;
  786. }
  787. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  788. {
  789. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  790. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  791. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  792. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  793. {
  794. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  795. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  796. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  797. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  798. }
  799. return coord.zw;
  800. }
  801. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  802. {
  803. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  804. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  805. (texcoord.x += 0.500000f);
  806. (texcoord.y += (0.142857f * offset));
  807. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  808. }
  809. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  810. {
  811. float2 weights = float2(0.000000f, 0.000000f);
  812. float4 d;
  813. float2 end;
  814. if ((e.x > 0.000000f))
  815. {
  816. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  817. (d.x += float((end.y > 0.900000f)));
  818. }
  819. else
  820. (d.xz = float2(0.000000f, 0.000000f));
  821. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  822. [branch]if (((d.x - 2.000000f) > -d.y))
  823. {
  824. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  825. float4 c;
  826. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  827. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  828. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  829. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  830. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  831. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  832. }
  833. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  834. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  835. {
  836. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  837. (d.y += float((end.y > 0.900000f)));
  838. }
  839. else
  840. (d.yw = float2(0.000000f, 0.000000f));
  841. [branch]if (((d.x - 2.000000f) > -d.y))
  842. {
  843. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  844. float4 c;
  845. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  846. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  847. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  848. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  849. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  850. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  851. }
  852. return weights;
  853. }
  854. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  855. {
  856. float2 scale = float2(33.000000f, -33.000000f);
  857. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  858. (scale += float2(-1.000000f, 1.000000f));
  859. (bias += float2(0.500000f, -0.500000f));
  860. (scale *= float2(0.015625f, 0.062500f));
  861. (bias *= float2(0.015625f, 0.062500f));
  862. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  863. }
  864. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  865. {
  866. float2 e = float2(0.000000f, 1.000000f);
  867. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  868. {
  869. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  870. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  871. }
  872. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  873. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  874. }
  875. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  876. {
  877. float2 e = float2(0.000000f, 1.000000f);
  878. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  879. {
  880. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  881. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  882. }
  883. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  884. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  885. }
  886. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  887. {
  888. float2 e = float2(1.000000f, 0.000000f);
  889. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  890. {
  891. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  892. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  893. }
  894. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  895. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  896. }
  897. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  898. {
  899. float2 e = float2(1.000000f, 0.000000f);
  900. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  901. {
  902. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  903. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  904. }
  905. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  906. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  907. }
  908. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  909. {
  910. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  911. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  912. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  913. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  914. }
  915. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  916. {
  917. float2 leftRight = step(d.xy, d.yx);
  918. float2 rounding = (1.000000f * leftRight);
  919. (rounding /= (leftRight.x + leftRight.y));
  920. float2 factor = float2(1.000000f, 1.000000f);
  921. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  922. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  923. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  924. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  925. (weights *= saturate(factor));
  926. }
  927. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  928. {
  929. float2 leftRight = step(d.xy, d.yx);
  930. float2 rounding = (1.000000f * leftRight);
  931. (rounding /= (leftRight.x + leftRight.y));
  932. float2 factor = float2(1.000000f, 1.000000f);
  933. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  934. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  935. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  936. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  937. (weights *= saturate(factor));
  938. }
  939. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  940. {
  941. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  942. float2 e = __tex2D(edgesTex, texcoord).xy;
  943. [branch]if ((e.y > 0.000000f))
  944. {
  945. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  946. [branch]if ((weights.x == -weights.y))
  947. {
  948. float2 d;
  949. float3 coords;
  950. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  951. (coords.y = offset[1].y);
  952. (d.x = coords.x);
  953. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  954. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  955. (d.y = coords.z);
  956. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  957. float2 sqrt_d = sqrt(d);
  958. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  959. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  960. (coords.y = texcoord.y);
  961. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  962. }
  963. else
  964. (e.x = 0.000000f);
  965. }
  966. [branch]if ((e.x > 0.000000f))
  967. {
  968. float2 d;
  969. float3 coords;
  970. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  971. (coords.x = offset[0].x);
  972. (d.x = coords.y);
  973. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  974. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  975. (d.y = coords.z);
  976. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  977. float2 sqrt_d = sqrt(d);
  978. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  979. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  980. (coords.x = texcoord.x);
  981. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  982. }
  983. return weights;
  984. }
  985. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  986. {
  987. float4 a;
  988. (a.x = __tex2D(blendTex, offset.xy).w);
  989. (a.y = __tex2D(blendTex, offset.zw).y);
  990. (a.wz = __tex2D(blendTex, texcoord).xz);
  991. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  992. {
  993. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  994. return color;
  995. }
  996. else
  997. {
  998. bool h = (max(a.x, a.z) > max(a.y, a.w));
  999. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  1000. float2 blendingWeight = a.yw;
  1001. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  1002. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  1003. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  1004. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  1005. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  1006. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  1007. return color;
  1008. }
  1009. }
  1010. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  1011. {
  1012. float4 current = __tex2D(currentColorTex, texcoord);
  1013. float4 previous = __tex2D(previousColorTex, texcoord);
  1014. return lerp(current, previous, 0.500000f);
  1015. }
  1016. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  1017. {
  1018. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  1019. return FinalColor;
  1020. }
  1021. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  1022. {
  1023. _NSRFX_VS_PostProcess(id, position, texcoord);
  1024. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  1025. }
  1026. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  1027. {
  1028. _NSRFX_VS_PostProcess(id, position, texcoord);
  1029. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  1030. }
  1031. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  1032. {
  1033. _NSRFX_VS_PostProcess(id, position, texcoord);
  1034. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  1035. }
  1036. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  1037. {
  1038. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  1039. }
  1040. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  1041. {
  1042. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  1043. }
  1044. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  1045. {
  1046. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  1047. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  1048. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  1049. return color.xyz;
  1050. }
  1051. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  1052. {
  1053. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  1054. }
  1055.  
  1056.  
  1057. 08/08/2015 09:24:07:295 [07460] | TRACE | > Compiling shader 'RFX_VS_PostProcess':
  1058.  
  1059. struct __sampler2D { Texture2D t; SamplerState s; };
  1060. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  1061. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  1062. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  1063. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  1064. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  1065. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  1066. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  1067. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  1068. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  1069. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  1070. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  1071. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  1072. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  1073. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  1074. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  1075. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  1076. cbuffer __GLOBAL__ : register(b0)
  1077. {
  1078. extern uniform float _NSRFX_timer;
  1079. extern uniform float _NSRFX_timeleft;
  1080. extern uniform float _NSRFX_frametime;
  1081. };
  1082. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  1083. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  1084. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  1085. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  1086. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  1087. SamplerState __SamplerState0 : register(s0);
  1088. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  1089. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  1090. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  1091. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  1092. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  1093. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  1094. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  1095. SamplerState __SamplerState1 : register(s1);
  1096. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  1097. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  1098. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  1099. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  1100. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  1101. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  1102. SamplerState __SamplerState2 : register(s2);
  1103. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  1104. SamplerState __SamplerState3 : register(s3);
  1105. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  1106. SamplerState __SamplerState4 : register(s4);
  1107. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  1108. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  1109. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  1110. SamplerState __SamplerState5 : register(s5);
  1111. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  1112. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  1113. {
  1114. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  1115. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  1116. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  1117. }
  1118. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  1119. {
  1120. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  1121. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  1122. (color.xyz = float3(depth.xxx));
  1123. }
  1124. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  1125. {
  1126. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  1127. float2 tex = texcoord;
  1128. float3 color = colorInput.xyz;
  1129. float dither_bit = 8.000000f;
  1130. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  1131. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  1132. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  1133. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  1134. (color.xyz += dither_shift_RGB);
  1135. (colorInput.xyz = color.xyz);
  1136. (depthTexR = colorInput);
  1137. }
  1138. float _NSMFX_NSGetLinearDepth(in float depth)
  1139. {
  1140. return (1 / ((depth * -998.999939f) + 999.999939f));
  1141. }
  1142. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  1143. {
  1144. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  1145. }
  1146. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  1147. {
  1148. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  1149. return color;
  1150. }
  1151. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  1152. {
  1153. float3 color = colorInput.xyz;
  1154. float dither_bit = 8.000000f;
  1155. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  1156. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  1157. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  1158. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  1159. (color.xyz += dither_shift_RGB);
  1160. (colorInput.xyz = color.xyz);
  1161. return colorInput;
  1162. }
  1163. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  1164. {
  1165. float P = __tex2D(tex, texcoord).x;
  1166. float Pleft = __tex2D(tex, offset[0].xy).x;
  1167. float Ptop = __tex2D(tex, offset[0].zw).x;
  1168. return float3(P, Pleft, Ptop);
  1169. }
  1170. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  1171. {
  1172. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  1173. float2 delta = abs((neighbours.xx - neighbours.yz));
  1174. float2 edges = step(0.001000f, delta);
  1175. return (0.200000f * (1.000000f - (0.400000f * edges)));
  1176. }
  1177. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  1178. {
  1179. [flatten]if (cond.x)
  1180. (variable.x = value.x);
  1181. [flatten]if (cond.y)
  1182. (variable.y = value.y);
  1183. }
  1184. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  1185. {
  1186. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  1187. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  1188. }
  1189. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  1190. {
  1191. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  1192. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1193. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  1194. }
  1195. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  1196. {
  1197. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  1198. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  1199. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  1200. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  1201. }
  1202. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  1203. {
  1204. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1205. }
  1206. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  1207. {
  1208. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  1209. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  1210. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  1211. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  1212. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  1213. float4 delta;
  1214. (delta.xy = abs((L - float2(Lleft, Ltop))));
  1215. float2 edges = step(threshold, delta.xy);
  1216. if ((abs(edges.x) == -abs(edges.y)))
  1217. {
  1218. discard;
  1219. }
  1220. else
  1221. {
  1222. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  1223. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  1224. (delta.zw = abs((L - float2(Lright, Lbottom))));
  1225. float2 maxDelta = max(delta.xy, delta.zw);
  1226. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  1227. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  1228. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  1229. (maxDelta = max(maxDelta.xy, delta.zw));
  1230. float finalDelta = max(maxDelta.x, maxDelta.y);
  1231. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  1232. }
  1233. return edges;
  1234. }
  1235. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  1236. {
  1237. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  1238. float4 delta;
  1239. float3 C = __tex2D(colorTex, texcoord).xyz;
  1240. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  1241. float3 t = abs((C - Cleft));
  1242. (delta.x = max(max(t.x, t.y), t.z));
  1243. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  1244. (t = abs((C - Ctop)));
  1245. (delta.y = max(max(t.x, t.y), t.z));
  1246. float2 edges = step(threshold, delta.xy);
  1247. if ((abs(edges.x) == -abs(edges.y)))
  1248. {
  1249. discard;
  1250. }
  1251. else
  1252. {
  1253. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  1254. (t = abs((C - Cright)));
  1255. (delta.z = max(max(t.x, t.y), t.z));
  1256. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  1257. (t = abs((C - Cbottom)));
  1258. (delta.w = max(max(t.x, t.y), t.z));
  1259. float2 maxDelta = max(delta.xy, delta.zw);
  1260. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  1261. (t = abs((C - Cleftleft)));
  1262. (delta.z = max(max(t.x, t.y), t.z));
  1263. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  1264. (t = abs((C - Ctoptop)));
  1265. (delta.w = max(max(t.x, t.y), t.z));
  1266. (maxDelta = max(maxDelta.xy, delta.zw));
  1267. float finalDelta = max(maxDelta.x, maxDelta.y);
  1268. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  1269. }
  1270. return edges;
  1271. }
  1272. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  1273. {
  1274. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  1275. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  1276. float2 edges = step(0.010000f, delta);
  1277. if ((abs(edges.x) == -abs(edges.y)))
  1278. discard;
  1279. return edges;
  1280. }
  1281. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  1282. {
  1283. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  1284. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  1285. (e.y = (e.y >= 0.500000f));
  1286. (e.x = ((er1 * er2) - e.y));
  1287. return e;
  1288. }
  1289. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  1290. {
  1291. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  1292. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  1293. (e.y = (e.y >= 0.500000f));
  1294. (e.x = ((er1 * er2) - e.y));
  1295. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  1296. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  1297. (e.w = (e.w >= 0.500000f));
  1298. (e.z = ((eb1 * eb2) - e.w));
  1299. return e;
  1300. }
  1301. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1302. {
  1303. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1304. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  1305. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  1306. {
  1307. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1308. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  1309. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1310. }
  1311. return coord.zw;
  1312. }
  1313. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1314. {
  1315. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1316. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  1317. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  1318. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  1319. {
  1320. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1321. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  1322. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  1323. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1324. }
  1325. return coord.zw;
  1326. }
  1327. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  1328. {
  1329. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  1330. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1331. (texcoord.x += 0.500000f);
  1332. (texcoord.y += (0.142857f * offset));
  1333. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  1334. }
  1335. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  1336. {
  1337. float2 weights = float2(0.000000f, 0.000000f);
  1338. float4 d;
  1339. float2 end;
  1340. if ((e.x > 0.000000f))
  1341. {
  1342. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  1343. (d.x += float((end.y > 0.900000f)));
  1344. }
  1345. else
  1346. (d.xz = float2(0.000000f, 0.000000f));
  1347. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  1348. [branch]if (((d.x - 2.000000f) > -d.y))
  1349. {
  1350. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  1351. float4 c;
  1352. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  1353. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  1354. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  1355. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1356. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1357. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  1358. }
  1359. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  1360. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  1361. {
  1362. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  1363. (d.y += float((end.y > 0.900000f)));
  1364. }
  1365. else
  1366. (d.yw = float2(0.000000f, 0.000000f));
  1367. [branch]if (((d.x - 2.000000f) > -d.y))
  1368. {
  1369. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  1370. float4 c;
  1371. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  1372. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  1373. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  1374. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1375. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1376. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  1377. }
  1378. return weights;
  1379. }
  1380. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  1381. {
  1382. float2 scale = float2(33.000000f, -33.000000f);
  1383. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  1384. (scale += float2(-1.000000f, 1.000000f));
  1385. (bias += float2(0.500000f, -0.500000f));
  1386. (scale *= float2(0.015625f, 0.062500f));
  1387. (bias *= float2(0.015625f, 0.062500f));
  1388. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  1389. }
  1390. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1391. {
  1392. float2 e = float2(0.000000f, 1.000000f);
  1393. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1394. {
  1395. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1396. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  1397. }
  1398. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  1399. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  1400. }
  1401. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1402. {
  1403. float2 e = float2(0.000000f, 1.000000f);
  1404. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1405. {
  1406. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1407. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  1408. }
  1409. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  1410. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  1411. }
  1412. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1413. {
  1414. float2 e = float2(1.000000f, 0.000000f);
  1415. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1416. {
  1417. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1418. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  1419. }
  1420. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  1421. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  1422. }
  1423. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1424. {
  1425. float2 e = float2(1.000000f, 0.000000f);
  1426. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1427. {
  1428. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1429. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  1430. }
  1431. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  1432. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  1433. }
  1434. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  1435. {
  1436. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  1437. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1438. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  1439. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  1440. }
  1441. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1442. {
  1443. float2 leftRight = step(d.xy, d.yx);
  1444. float2 rounding = (1.000000f * leftRight);
  1445. (rounding /= (leftRight.x + leftRight.y));
  1446. float2 factor = float2(1.000000f, 1.000000f);
  1447. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1448. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1449. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1450. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1451. (weights *= saturate(factor));
  1452. }
  1453. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1454. {
  1455. float2 leftRight = step(d.xy, d.yx);
  1456. float2 rounding = (1.000000f * leftRight);
  1457. (rounding /= (leftRight.x + leftRight.y));
  1458. float2 factor = float2(1.000000f, 1.000000f);
  1459. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1460. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1461. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1462. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1463. (weights *= saturate(factor));
  1464. }
  1465. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  1466. {
  1467. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  1468. float2 e = __tex2D(edgesTex, texcoord).xy;
  1469. [branch]if ((e.y > 0.000000f))
  1470. {
  1471. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  1472. [branch]if ((weights.x == -weights.y))
  1473. {
  1474. float2 d;
  1475. float3 coords;
  1476. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  1477. (coords.y = offset[1].y);
  1478. (d.x = coords.x);
  1479. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  1480. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  1481. (d.y = coords.z);
  1482. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  1483. float2 sqrt_d = sqrt(d);
  1484. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  1485. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  1486. (coords.y = texcoord.y);
  1487. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  1488. }
  1489. else
  1490. (e.x = 0.000000f);
  1491. }
  1492. [branch]if ((e.x > 0.000000f))
  1493. {
  1494. float2 d;
  1495. float3 coords;
  1496. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  1497. (coords.x = offset[0].x);
  1498. (d.x = coords.y);
  1499. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  1500. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  1501. (d.y = coords.z);
  1502. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  1503. float2 sqrt_d = sqrt(d);
  1504. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  1505. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  1506. (coords.x = texcoord.x);
  1507. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  1508. }
  1509. return weights;
  1510. }
  1511. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  1512. {
  1513. float4 a;
  1514. (a.x = __tex2D(blendTex, offset.xy).w);
  1515. (a.y = __tex2D(blendTex, offset.zw).y);
  1516. (a.wz = __tex2D(blendTex, texcoord).xz);
  1517. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  1518. {
  1519. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  1520. return color;
  1521. }
  1522. else
  1523. {
  1524. bool h = (max(a.x, a.z) > max(a.y, a.w));
  1525. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  1526. float2 blendingWeight = a.yw;
  1527. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  1528. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  1529. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  1530. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  1531. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  1532. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  1533. return color;
  1534. }
  1535. }
  1536. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  1537. {
  1538. float4 current = __tex2D(currentColorTex, texcoord);
  1539. float4 previous = __tex2D(previousColorTex, texcoord);
  1540. return lerp(current, previous, 0.500000f);
  1541. }
  1542. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  1543. {
  1544. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  1545. return FinalColor;
  1546. }
  1547. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  1548. {
  1549. _NSRFX_VS_PostProcess(id, position, texcoord);
  1550. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  1551. }
  1552. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  1553. {
  1554. _NSRFX_VS_PostProcess(id, position, texcoord);
  1555. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  1556. }
  1557. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  1558. {
  1559. _NSRFX_VS_PostProcess(id, position, texcoord);
  1560. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  1561. }
  1562. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  1563. {
  1564. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  1565. }
  1566. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  1567. {
  1568. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  1569. }
  1570. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  1571. {
  1572. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  1573. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  1574. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  1575. return color.xyz;
  1576. }
  1577. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  1578. {
  1579. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  1580. }
  1581.  
  1582.  
  1583. 08/08/2015 09:24:07:302 [07460] | TRACE | > Compiling shader 'RFX_StoreDepth':
  1584.  
  1585. struct __sampler2D { Texture2D t; SamplerState s; };
  1586. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  1587. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  1588. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  1589. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  1590. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  1591. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  1592. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  1593. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  1594. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  1595. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  1596. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  1597. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  1598. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  1599. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  1600. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  1601. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  1602. cbuffer __GLOBAL__ : register(b0)
  1603. {
  1604. extern uniform float _NSRFX_timer;
  1605. extern uniform float _NSRFX_timeleft;
  1606. extern uniform float _NSRFX_frametime;
  1607. };
  1608. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  1609. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  1610. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  1611. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  1612. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  1613. SamplerState __SamplerState0 : register(s0);
  1614. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  1615. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  1616. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  1617. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  1618. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  1619. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  1620. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  1621. SamplerState __SamplerState1 : register(s1);
  1622. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  1623. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  1624. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  1625. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  1626. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  1627. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  1628. SamplerState __SamplerState2 : register(s2);
  1629. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  1630. SamplerState __SamplerState3 : register(s3);
  1631. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  1632. SamplerState __SamplerState4 : register(s4);
  1633. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  1634. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  1635. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  1636. SamplerState __SamplerState5 : register(s5);
  1637. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  1638. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  1639. {
  1640. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  1641. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  1642. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  1643. }
  1644. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  1645. {
  1646. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  1647. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  1648. (color.xyz = float3(depth.xxx));
  1649. }
  1650. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  1651. {
  1652. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  1653. float2 tex = texcoord;
  1654. float3 color = colorInput.xyz;
  1655. float dither_bit = 8.000000f;
  1656. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  1657. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  1658. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  1659. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  1660. (color.xyz += dither_shift_RGB);
  1661. (colorInput.xyz = color.xyz);
  1662. (depthTexR = colorInput);
  1663. }
  1664. float _NSMFX_NSGetLinearDepth(in float depth)
  1665. {
  1666. return (1 / ((depth * -998.999939f) + 999.999939f));
  1667. }
  1668. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  1669. {
  1670. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  1671. }
  1672. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  1673. {
  1674. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  1675. return color;
  1676. }
  1677. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  1678. {
  1679. float3 color = colorInput.xyz;
  1680. float dither_bit = 8.000000f;
  1681. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  1682. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  1683. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  1684. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  1685. (color.xyz += dither_shift_RGB);
  1686. (colorInput.xyz = color.xyz);
  1687. return colorInput;
  1688. }
  1689. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  1690. {
  1691. float P = __tex2D(tex, texcoord).x;
  1692. float Pleft = __tex2D(tex, offset[0].xy).x;
  1693. float Ptop = __tex2D(tex, offset[0].zw).x;
  1694. return float3(P, Pleft, Ptop);
  1695. }
  1696. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  1697. {
  1698. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  1699. float2 delta = abs((neighbours.xx - neighbours.yz));
  1700. float2 edges = step(0.001000f, delta);
  1701. return (0.200000f * (1.000000f - (0.400000f * edges)));
  1702. }
  1703. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  1704. {
  1705. [flatten]if (cond.x)
  1706. (variable.x = value.x);
  1707. [flatten]if (cond.y)
  1708. (variable.y = value.y);
  1709. }
  1710. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  1711. {
  1712. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  1713. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  1714. }
  1715. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  1716. {
  1717. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  1718. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1719. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  1720. }
  1721. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  1722. {
  1723. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  1724. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  1725. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  1726. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  1727. }
  1728. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  1729. {
  1730. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1731. }
  1732. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  1733. {
  1734. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  1735. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  1736. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  1737. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  1738. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  1739. float4 delta;
  1740. (delta.xy = abs((L - float2(Lleft, Ltop))));
  1741. float2 edges = step(threshold, delta.xy);
  1742. if ((abs(edges.x) == -abs(edges.y)))
  1743. {
  1744. discard;
  1745. }
  1746. else
  1747. {
  1748. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  1749. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  1750. (delta.zw = abs((L - float2(Lright, Lbottom))));
  1751. float2 maxDelta = max(delta.xy, delta.zw);
  1752. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  1753. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  1754. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  1755. (maxDelta = max(maxDelta.xy, delta.zw));
  1756. float finalDelta = max(maxDelta.x, maxDelta.y);
  1757. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  1758. }
  1759. return edges;
  1760. }
  1761. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  1762. {
  1763. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  1764. float4 delta;
  1765. float3 C = __tex2D(colorTex, texcoord).xyz;
  1766. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  1767. float3 t = abs((C - Cleft));
  1768. (delta.x = max(max(t.x, t.y), t.z));
  1769. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  1770. (t = abs((C - Ctop)));
  1771. (delta.y = max(max(t.x, t.y), t.z));
  1772. float2 edges = step(threshold, delta.xy);
  1773. if ((abs(edges.x) == -abs(edges.y)))
  1774. {
  1775. discard;
  1776. }
  1777. else
  1778. {
  1779. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  1780. (t = abs((C - Cright)));
  1781. (delta.z = max(max(t.x, t.y), t.z));
  1782. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  1783. (t = abs((C - Cbottom)));
  1784. (delta.w = max(max(t.x, t.y), t.z));
  1785. float2 maxDelta = max(delta.xy, delta.zw);
  1786. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  1787. (t = abs((C - Cleftleft)));
  1788. (delta.z = max(max(t.x, t.y), t.z));
  1789. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  1790. (t = abs((C - Ctoptop)));
  1791. (delta.w = max(max(t.x, t.y), t.z));
  1792. (maxDelta = max(maxDelta.xy, delta.zw));
  1793. float finalDelta = max(maxDelta.x, maxDelta.y);
  1794. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  1795. }
  1796. return edges;
  1797. }
  1798. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  1799. {
  1800. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  1801. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  1802. float2 edges = step(0.010000f, delta);
  1803. if ((abs(edges.x) == -abs(edges.y)))
  1804. discard;
  1805. return edges;
  1806. }
  1807. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  1808. {
  1809. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  1810. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  1811. (e.y = (e.y >= 0.500000f));
  1812. (e.x = ((er1 * er2) - e.y));
  1813. return e;
  1814. }
  1815. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  1816. {
  1817. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  1818. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  1819. (e.y = (e.y >= 0.500000f));
  1820. (e.x = ((er1 * er2) - e.y));
  1821. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  1822. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  1823. (e.w = (e.w >= 0.500000f));
  1824. (e.z = ((eb1 * eb2) - e.w));
  1825. return e;
  1826. }
  1827. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1828. {
  1829. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1830. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  1831. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  1832. {
  1833. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1834. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  1835. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1836. }
  1837. return coord.zw;
  1838. }
  1839. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1840. {
  1841. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1842. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  1843. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  1844. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  1845. {
  1846. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1847. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  1848. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  1849. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1850. }
  1851. return coord.zw;
  1852. }
  1853. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  1854. {
  1855. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  1856. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1857. (texcoord.x += 0.500000f);
  1858. (texcoord.y += (0.142857f * offset));
  1859. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  1860. }
  1861. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  1862. {
  1863. float2 weights = float2(0.000000f, 0.000000f);
  1864. float4 d;
  1865. float2 end;
  1866. if ((e.x > 0.000000f))
  1867. {
  1868. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  1869. (d.x += float((end.y > 0.900000f)));
  1870. }
  1871. else
  1872. (d.xz = float2(0.000000f, 0.000000f));
  1873. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  1874. [branch]if (((d.x - 2.000000f) > -d.y))
  1875. {
  1876. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  1877. float4 c;
  1878. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  1879. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  1880. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  1881. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1882. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1883. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  1884. }
  1885. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  1886. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  1887. {
  1888. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  1889. (d.y += float((end.y > 0.900000f)));
  1890. }
  1891. else
  1892. (d.yw = float2(0.000000f, 0.000000f));
  1893. [branch]if (((d.x - 2.000000f) > -d.y))
  1894. {
  1895. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  1896. float4 c;
  1897. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  1898. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  1899. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  1900. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1901. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1902. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  1903. }
  1904. return weights;
  1905. }
  1906. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  1907. {
  1908. float2 scale = float2(33.000000f, -33.000000f);
  1909. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  1910. (scale += float2(-1.000000f, 1.000000f));
  1911. (bias += float2(0.500000f, -0.500000f));
  1912. (scale *= float2(0.015625f, 0.062500f));
  1913. (bias *= float2(0.015625f, 0.062500f));
  1914. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  1915. }
  1916. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1917. {
  1918. float2 e = float2(0.000000f, 1.000000f);
  1919. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1920. {
  1921. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1922. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  1923. }
  1924. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  1925. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  1926. }
  1927. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1928. {
  1929. float2 e = float2(0.000000f, 1.000000f);
  1930. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1931. {
  1932. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1933. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  1934. }
  1935. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  1936. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  1937. }
  1938. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1939. {
  1940. float2 e = float2(1.000000f, 0.000000f);
  1941. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1942. {
  1943. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1944. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  1945. }
  1946. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  1947. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  1948. }
  1949. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  1950. {
  1951. float2 e = float2(1.000000f, 0.000000f);
  1952. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1953. {
  1954. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  1955. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  1956. }
  1957. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  1958. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  1959. }
  1960. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  1961. {
  1962. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  1963. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1964. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  1965. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  1966. }
  1967. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1968. {
  1969. float2 leftRight = step(d.xy, d.yx);
  1970. float2 rounding = (1.000000f * leftRight);
  1971. (rounding /= (leftRight.x + leftRight.y));
  1972. float2 factor = float2(1.000000f, 1.000000f);
  1973. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1974. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1975. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1976. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  1977. (weights *= saturate(factor));
  1978. }
  1979. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1980. {
  1981. float2 leftRight = step(d.xy, d.yx);
  1982. float2 rounding = (1.000000f * leftRight);
  1983. (rounding /= (leftRight.x + leftRight.y));
  1984. float2 factor = float2(1.000000f, 1.000000f);
  1985. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1986. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1987. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1988. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  1989. (weights *= saturate(factor));
  1990. }
  1991. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  1992. {
  1993. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  1994. float2 e = __tex2D(edgesTex, texcoord).xy;
  1995. [branch]if ((e.y > 0.000000f))
  1996. {
  1997. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  1998. [branch]if ((weights.x == -weights.y))
  1999. {
  2000. float2 d;
  2001. float3 coords;
  2002. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  2003. (coords.y = offset[1].y);
  2004. (d.x = coords.x);
  2005. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  2006. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  2007. (d.y = coords.z);
  2008. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  2009. float2 sqrt_d = sqrt(d);
  2010. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  2011. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  2012. (coords.y = texcoord.y);
  2013. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  2014. }
  2015. else
  2016. (e.x = 0.000000f);
  2017. }
  2018. [branch]if ((e.x > 0.000000f))
  2019. {
  2020. float2 d;
  2021. float3 coords;
  2022. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  2023. (coords.x = offset[0].x);
  2024. (d.x = coords.y);
  2025. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  2026. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  2027. (d.y = coords.z);
  2028. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  2029. float2 sqrt_d = sqrt(d);
  2030. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  2031. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  2032. (coords.x = texcoord.x);
  2033. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  2034. }
  2035. return weights;
  2036. }
  2037. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  2038. {
  2039. float4 a;
  2040. (a.x = __tex2D(blendTex, offset.xy).w);
  2041. (a.y = __tex2D(blendTex, offset.zw).y);
  2042. (a.wz = __tex2D(blendTex, texcoord).xz);
  2043. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  2044. {
  2045. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  2046. return color;
  2047. }
  2048. else
  2049. {
  2050. bool h = (max(a.x, a.z) > max(a.y, a.w));
  2051. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  2052. float2 blendingWeight = a.yw;
  2053. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  2054. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  2055. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  2056. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  2057. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  2058. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  2059. return color;
  2060. }
  2061. }
  2062. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  2063. {
  2064. float4 current = __tex2D(currentColorTex, texcoord);
  2065. float4 previous = __tex2D(previousColorTex, texcoord);
  2066. return lerp(current, previous, 0.500000f);
  2067. }
  2068. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  2069. {
  2070. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  2071. return FinalColor;
  2072. }
  2073. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  2074. {
  2075. _NSRFX_VS_PostProcess(id, position, texcoord);
  2076. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  2077. }
  2078. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  2079. {
  2080. _NSRFX_VS_PostProcess(id, position, texcoord);
  2081. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  2082. }
  2083. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  2084. {
  2085. _NSRFX_VS_PostProcess(id, position, texcoord);
  2086. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  2087. }
  2088. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  2089. {
  2090. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  2091. }
  2092. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  2093. {
  2094. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  2095. }
  2096. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  2097. {
  2098. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  2099. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  2100. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  2101. return color.xyz;
  2102. }
  2103. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  2104. {
  2105. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  2106. }
  2107.  
  2108.  
  2109. 08/08/2015 09:24:07:311 [07460] | TRACE | > Compiling shader 'SMAAEdgeDetectionVSWrap':
  2110.  
  2111. struct __sampler2D { Texture2D t; SamplerState s; };
  2112. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  2113. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  2114. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  2115. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  2116. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  2117. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  2118. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  2119. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  2120. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  2121. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  2122. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  2123. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  2124. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  2125. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  2126. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  2127. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  2128. cbuffer __GLOBAL__ : register(b0)
  2129. {
  2130. extern uniform float _NSRFX_timer;
  2131. extern uniform float _NSRFX_timeleft;
  2132. extern uniform float _NSRFX_frametime;
  2133. };
  2134. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  2135. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  2136. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  2137. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  2138. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  2139. SamplerState __SamplerState0 : register(s0);
  2140. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  2141. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  2142. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  2143. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  2144. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  2145. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  2146. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  2147. SamplerState __SamplerState1 : register(s1);
  2148. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  2149. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  2150. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  2151. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  2152. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  2153. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  2154. SamplerState __SamplerState2 : register(s2);
  2155. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  2156. SamplerState __SamplerState3 : register(s3);
  2157. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  2158. SamplerState __SamplerState4 : register(s4);
  2159. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  2160. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  2161. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  2162. SamplerState __SamplerState5 : register(s5);
  2163. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  2164. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  2165. {
  2166. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  2167. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  2168. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  2169. }
  2170. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  2171. {
  2172. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  2173. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  2174. (color.xyz = float3(depth.xxx));
  2175. }
  2176. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  2177. {
  2178. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  2179. float2 tex = texcoord;
  2180. float3 color = colorInput.xyz;
  2181. float dither_bit = 8.000000f;
  2182. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  2183. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  2184. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  2185. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  2186. (color.xyz += dither_shift_RGB);
  2187. (colorInput.xyz = color.xyz);
  2188. (depthTexR = colorInput);
  2189. }
  2190. float _NSMFX_NSGetLinearDepth(in float depth)
  2191. {
  2192. return (1 / ((depth * -998.999939f) + 999.999939f));
  2193. }
  2194. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  2195. {
  2196. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  2197. }
  2198. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  2199. {
  2200. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  2201. return color;
  2202. }
  2203. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  2204. {
  2205. float3 color = colorInput.xyz;
  2206. float dither_bit = 8.000000f;
  2207. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  2208. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  2209. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  2210. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  2211. (color.xyz += dither_shift_RGB);
  2212. (colorInput.xyz = color.xyz);
  2213. return colorInput;
  2214. }
  2215. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  2216. {
  2217. float P = __tex2D(tex, texcoord).x;
  2218. float Pleft = __tex2D(tex, offset[0].xy).x;
  2219. float Ptop = __tex2D(tex, offset[0].zw).x;
  2220. return float3(P, Pleft, Ptop);
  2221. }
  2222. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  2223. {
  2224. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  2225. float2 delta = abs((neighbours.xx - neighbours.yz));
  2226. float2 edges = step(0.001000f, delta);
  2227. return (0.200000f * (1.000000f - (0.400000f * edges)));
  2228. }
  2229. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  2230. {
  2231. [flatten]if (cond.x)
  2232. (variable.x = value.x);
  2233. [flatten]if (cond.y)
  2234. (variable.y = value.y);
  2235. }
  2236. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  2237. {
  2238. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  2239. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  2240. }
  2241. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  2242. {
  2243. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  2244. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2245. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  2246. }
  2247. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  2248. {
  2249. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  2250. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  2251. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  2252. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  2253. }
  2254. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  2255. {
  2256. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2257. }
  2258. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  2259. {
  2260. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  2261. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  2262. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  2263. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  2264. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  2265. float4 delta;
  2266. (delta.xy = abs((L - float2(Lleft, Ltop))));
  2267. float2 edges = step(threshold, delta.xy);
  2268. if ((abs(edges.x) == -abs(edges.y)))
  2269. {
  2270. discard;
  2271. }
  2272. else
  2273. {
  2274. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  2275. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  2276. (delta.zw = abs((L - float2(Lright, Lbottom))));
  2277. float2 maxDelta = max(delta.xy, delta.zw);
  2278. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  2279. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  2280. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  2281. (maxDelta = max(maxDelta.xy, delta.zw));
  2282. float finalDelta = max(maxDelta.x, maxDelta.y);
  2283. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  2284. }
  2285. return edges;
  2286. }
  2287. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  2288. {
  2289. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  2290. float4 delta;
  2291. float3 C = __tex2D(colorTex, texcoord).xyz;
  2292. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  2293. float3 t = abs((C - Cleft));
  2294. (delta.x = max(max(t.x, t.y), t.z));
  2295. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  2296. (t = abs((C - Ctop)));
  2297. (delta.y = max(max(t.x, t.y), t.z));
  2298. float2 edges = step(threshold, delta.xy);
  2299. if ((abs(edges.x) == -abs(edges.y)))
  2300. {
  2301. discard;
  2302. }
  2303. else
  2304. {
  2305. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  2306. (t = abs((C - Cright)));
  2307. (delta.z = max(max(t.x, t.y), t.z));
  2308. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  2309. (t = abs((C - Cbottom)));
  2310. (delta.w = max(max(t.x, t.y), t.z));
  2311. float2 maxDelta = max(delta.xy, delta.zw);
  2312. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  2313. (t = abs((C - Cleftleft)));
  2314. (delta.z = max(max(t.x, t.y), t.z));
  2315. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  2316. (t = abs((C - Ctoptop)));
  2317. (delta.w = max(max(t.x, t.y), t.z));
  2318. (maxDelta = max(maxDelta.xy, delta.zw));
  2319. float finalDelta = max(maxDelta.x, maxDelta.y);
  2320. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  2321. }
  2322. return edges;
  2323. }
  2324. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  2325. {
  2326. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  2327. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  2328. float2 edges = step(0.010000f, delta);
  2329. if ((abs(edges.x) == -abs(edges.y)))
  2330. discard;
  2331. return edges;
  2332. }
  2333. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  2334. {
  2335. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  2336. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  2337. (e.y = (e.y >= 0.500000f));
  2338. (e.x = ((er1 * er2) - e.y));
  2339. return e;
  2340. }
  2341. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  2342. {
  2343. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  2344. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  2345. (e.y = (e.y >= 0.500000f));
  2346. (e.x = ((er1 * er2) - e.y));
  2347. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  2348. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  2349. (e.w = (e.w >= 0.500000f));
  2350. (e.z = ((eb1 * eb2) - e.w));
  2351. return e;
  2352. }
  2353. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2354. {
  2355. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2356. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  2357. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  2358. {
  2359. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2360. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  2361. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2362. }
  2363. return coord.zw;
  2364. }
  2365. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2366. {
  2367. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2368. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  2369. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  2370. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  2371. {
  2372. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2373. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  2374. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  2375. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2376. }
  2377. return coord.zw;
  2378. }
  2379. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  2380. {
  2381. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  2382. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2383. (texcoord.x += 0.500000f);
  2384. (texcoord.y += (0.142857f * offset));
  2385. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  2386. }
  2387. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  2388. {
  2389. float2 weights = float2(0.000000f, 0.000000f);
  2390. float4 d;
  2391. float2 end;
  2392. if ((e.x > 0.000000f))
  2393. {
  2394. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  2395. (d.x += float((end.y > 0.900000f)));
  2396. }
  2397. else
  2398. (d.xz = float2(0.000000f, 0.000000f));
  2399. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  2400. [branch]if (((d.x - 2.000000f) > -d.y))
  2401. {
  2402. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  2403. float4 c;
  2404. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  2405. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  2406. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  2407. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2408. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2409. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  2410. }
  2411. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  2412. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  2413. {
  2414. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  2415. (d.y += float((end.y > 0.900000f)));
  2416. }
  2417. else
  2418. (d.yw = float2(0.000000f, 0.000000f));
  2419. [branch]if (((d.x - 2.000000f) > -d.y))
  2420. {
  2421. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  2422. float4 c;
  2423. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  2424. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  2425. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  2426. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2427. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2428. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  2429. }
  2430. return weights;
  2431. }
  2432. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  2433. {
  2434. float2 scale = float2(33.000000f, -33.000000f);
  2435. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  2436. (scale += float2(-1.000000f, 1.000000f));
  2437. (bias += float2(0.500000f, -0.500000f));
  2438. (scale *= float2(0.015625f, 0.062500f));
  2439. (bias *= float2(0.015625f, 0.062500f));
  2440. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  2441. }
  2442. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2443. {
  2444. float2 e = float2(0.000000f, 1.000000f);
  2445. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2446. {
  2447. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2448. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  2449. }
  2450. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  2451. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  2452. }
  2453. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2454. {
  2455. float2 e = float2(0.000000f, 1.000000f);
  2456. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2457. {
  2458. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2459. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  2460. }
  2461. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  2462. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  2463. }
  2464. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2465. {
  2466. float2 e = float2(1.000000f, 0.000000f);
  2467. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2468. {
  2469. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2470. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  2471. }
  2472. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  2473. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  2474. }
  2475. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2476. {
  2477. float2 e = float2(1.000000f, 0.000000f);
  2478. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2479. {
  2480. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2481. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  2482. }
  2483. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  2484. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  2485. }
  2486. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  2487. {
  2488. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  2489. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2490. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  2491. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  2492. }
  2493. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  2494. {
  2495. float2 leftRight = step(d.xy, d.yx);
  2496. float2 rounding = (1.000000f * leftRight);
  2497. (rounding /= (leftRight.x + leftRight.y));
  2498. float2 factor = float2(1.000000f, 1.000000f);
  2499. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  2500. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  2501. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  2502. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  2503. (weights *= saturate(factor));
  2504. }
  2505. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  2506. {
  2507. float2 leftRight = step(d.xy, d.yx);
  2508. float2 rounding = (1.000000f * leftRight);
  2509. (rounding /= (leftRight.x + leftRight.y));
  2510. float2 factor = float2(1.000000f, 1.000000f);
  2511. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  2512. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  2513. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  2514. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  2515. (weights *= saturate(factor));
  2516. }
  2517. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  2518. {
  2519. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  2520. float2 e = __tex2D(edgesTex, texcoord).xy;
  2521. [branch]if ((e.y > 0.000000f))
  2522. {
  2523. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  2524. [branch]if ((weights.x == -weights.y))
  2525. {
  2526. float2 d;
  2527. float3 coords;
  2528. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  2529. (coords.y = offset[1].y);
  2530. (d.x = coords.x);
  2531. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  2532. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  2533. (d.y = coords.z);
  2534. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  2535. float2 sqrt_d = sqrt(d);
  2536. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  2537. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  2538. (coords.y = texcoord.y);
  2539. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  2540. }
  2541. else
  2542. (e.x = 0.000000f);
  2543. }
  2544. [branch]if ((e.x > 0.000000f))
  2545. {
  2546. float2 d;
  2547. float3 coords;
  2548. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  2549. (coords.x = offset[0].x);
  2550. (d.x = coords.y);
  2551. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  2552. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  2553. (d.y = coords.z);
  2554. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  2555. float2 sqrt_d = sqrt(d);
  2556. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  2557. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  2558. (coords.x = texcoord.x);
  2559. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  2560. }
  2561. return weights;
  2562. }
  2563. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  2564. {
  2565. float4 a;
  2566. (a.x = __tex2D(blendTex, offset.xy).w);
  2567. (a.y = __tex2D(blendTex, offset.zw).y);
  2568. (a.wz = __tex2D(blendTex, texcoord).xz);
  2569. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  2570. {
  2571. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  2572. return color;
  2573. }
  2574. else
  2575. {
  2576. bool h = (max(a.x, a.z) > max(a.y, a.w));
  2577. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  2578. float2 blendingWeight = a.yw;
  2579. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  2580. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  2581. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  2582. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  2583. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  2584. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  2585. return color;
  2586. }
  2587. }
  2588. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  2589. {
  2590. float4 current = __tex2D(currentColorTex, texcoord);
  2591. float4 previous = __tex2D(previousColorTex, texcoord);
  2592. return lerp(current, previous, 0.500000f);
  2593. }
  2594. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  2595. {
  2596. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  2597. return FinalColor;
  2598. }
  2599. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  2600. {
  2601. _NSRFX_VS_PostProcess(id, position, texcoord);
  2602. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  2603. }
  2604. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  2605. {
  2606. _NSRFX_VS_PostProcess(id, position, texcoord);
  2607. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  2608. }
  2609. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  2610. {
  2611. _NSRFX_VS_PostProcess(id, position, texcoord);
  2612. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  2613. }
  2614. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  2615. {
  2616. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  2617. }
  2618. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  2619. {
  2620. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  2621. }
  2622. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  2623. {
  2624. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  2625. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  2626. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  2627. return color.xyz;
  2628. }
  2629. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  2630. {
  2631. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  2632. }
  2633.  
  2634.  
  2635. 08/08/2015 09:24:07:323 [07460] | TRACE | > Compiling shader 'SMAAColorEdgeDetectionPSWrap':
  2636.  
  2637. struct __sampler2D { Texture2D t; SamplerState s; };
  2638. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  2639. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  2640. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  2641. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  2642. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  2643. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  2644. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  2645. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  2646. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  2647. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  2648. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  2649. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  2650. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  2651. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  2652. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  2653. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  2654. cbuffer __GLOBAL__ : register(b0)
  2655. {
  2656. extern uniform float _NSRFX_timer;
  2657. extern uniform float _NSRFX_timeleft;
  2658. extern uniform float _NSRFX_frametime;
  2659. };
  2660. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  2661. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  2662. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  2663. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  2664. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  2665. SamplerState __SamplerState0 : register(s0);
  2666. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  2667. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  2668. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  2669. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  2670. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  2671. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  2672. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  2673. SamplerState __SamplerState1 : register(s1);
  2674. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  2675. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  2676. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  2677. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  2678. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  2679. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  2680. SamplerState __SamplerState2 : register(s2);
  2681. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  2682. SamplerState __SamplerState3 : register(s3);
  2683. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  2684. SamplerState __SamplerState4 : register(s4);
  2685. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  2686. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  2687. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  2688. SamplerState __SamplerState5 : register(s5);
  2689. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  2690. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  2691. {
  2692. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  2693. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  2694. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  2695. }
  2696. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  2697. {
  2698. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  2699. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  2700. (color.xyz = float3(depth.xxx));
  2701. }
  2702. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  2703. {
  2704. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  2705. float2 tex = texcoord;
  2706. float3 color = colorInput.xyz;
  2707. float dither_bit = 8.000000f;
  2708. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  2709. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  2710. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  2711. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  2712. (color.xyz += dither_shift_RGB);
  2713. (colorInput.xyz = color.xyz);
  2714. (depthTexR = colorInput);
  2715. }
  2716. float _NSMFX_NSGetLinearDepth(in float depth)
  2717. {
  2718. return (1 / ((depth * -998.999939f) + 999.999939f));
  2719. }
  2720. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  2721. {
  2722. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  2723. }
  2724. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  2725. {
  2726. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  2727. return color;
  2728. }
  2729. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  2730. {
  2731. float3 color = colorInput.xyz;
  2732. float dither_bit = 8.000000f;
  2733. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  2734. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  2735. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  2736. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  2737. (color.xyz += dither_shift_RGB);
  2738. (colorInput.xyz = color.xyz);
  2739. return colorInput;
  2740. }
  2741. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  2742. {
  2743. float P = __tex2D(tex, texcoord).x;
  2744. float Pleft = __tex2D(tex, offset[0].xy).x;
  2745. float Ptop = __tex2D(tex, offset[0].zw).x;
  2746. return float3(P, Pleft, Ptop);
  2747. }
  2748. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  2749. {
  2750. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  2751. float2 delta = abs((neighbours.xx - neighbours.yz));
  2752. float2 edges = step(0.001000f, delta);
  2753. return (0.200000f * (1.000000f - (0.400000f * edges)));
  2754. }
  2755. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  2756. {
  2757. [flatten]if (cond.x)
  2758. (variable.x = value.x);
  2759. [flatten]if (cond.y)
  2760. (variable.y = value.y);
  2761. }
  2762. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  2763. {
  2764. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  2765. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  2766. }
  2767. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  2768. {
  2769. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  2770. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2771. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  2772. }
  2773. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  2774. {
  2775. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  2776. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  2777. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  2778. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  2779. }
  2780. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  2781. {
  2782. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2783. }
  2784. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  2785. {
  2786. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  2787. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  2788. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  2789. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  2790. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  2791. float4 delta;
  2792. (delta.xy = abs((L - float2(Lleft, Ltop))));
  2793. float2 edges = step(threshold, delta.xy);
  2794. if ((abs(edges.x) == -abs(edges.y)))
  2795. {
  2796. discard;
  2797. }
  2798. else
  2799. {
  2800. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  2801. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  2802. (delta.zw = abs((L - float2(Lright, Lbottom))));
  2803. float2 maxDelta = max(delta.xy, delta.zw);
  2804. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  2805. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  2806. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  2807. (maxDelta = max(maxDelta.xy, delta.zw));
  2808. float finalDelta = max(maxDelta.x, maxDelta.y);
  2809. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  2810. }
  2811. return edges;
  2812. }
  2813. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  2814. {
  2815. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  2816. float4 delta;
  2817. float3 C = __tex2D(colorTex, texcoord).xyz;
  2818. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  2819. float3 t = abs((C - Cleft));
  2820. (delta.x = max(max(t.x, t.y), t.z));
  2821. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  2822. (t = abs((C - Ctop)));
  2823. (delta.y = max(max(t.x, t.y), t.z));
  2824. float2 edges = step(threshold, delta.xy);
  2825. if ((abs(edges.x) == -abs(edges.y)))
  2826. {
  2827. discard;
  2828. }
  2829. else
  2830. {
  2831. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  2832. (t = abs((C - Cright)));
  2833. (delta.z = max(max(t.x, t.y), t.z));
  2834. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  2835. (t = abs((C - Cbottom)));
  2836. (delta.w = max(max(t.x, t.y), t.z));
  2837. float2 maxDelta = max(delta.xy, delta.zw);
  2838. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  2839. (t = abs((C - Cleftleft)));
  2840. (delta.z = max(max(t.x, t.y), t.z));
  2841. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  2842. (t = abs((C - Ctoptop)));
  2843. (delta.w = max(max(t.x, t.y), t.z));
  2844. (maxDelta = max(maxDelta.xy, delta.zw));
  2845. float finalDelta = max(maxDelta.x, maxDelta.y);
  2846. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  2847. }
  2848. return edges;
  2849. }
  2850. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  2851. {
  2852. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  2853. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  2854. float2 edges = step(0.010000f, delta);
  2855. if ((abs(edges.x) == -abs(edges.y)))
  2856. discard;
  2857. return edges;
  2858. }
  2859. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  2860. {
  2861. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  2862. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  2863. (e.y = (e.y >= 0.500000f));
  2864. (e.x = ((er1 * er2) - e.y));
  2865. return e;
  2866. }
  2867. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  2868. {
  2869. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  2870. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  2871. (e.y = (e.y >= 0.500000f));
  2872. (e.x = ((er1 * er2) - e.y));
  2873. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  2874. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  2875. (e.w = (e.w >= 0.500000f));
  2876. (e.z = ((eb1 * eb2) - e.w));
  2877. return e;
  2878. }
  2879. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2880. {
  2881. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2882. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  2883. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  2884. {
  2885. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2886. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  2887. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2888. }
  2889. return coord.zw;
  2890. }
  2891. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2892. {
  2893. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2894. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  2895. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  2896. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  2897. {
  2898. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2899. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  2900. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  2901. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2902. }
  2903. return coord.zw;
  2904. }
  2905. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  2906. {
  2907. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  2908. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2909. (texcoord.x += 0.500000f);
  2910. (texcoord.y += (0.142857f * offset));
  2911. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  2912. }
  2913. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  2914. {
  2915. float2 weights = float2(0.000000f, 0.000000f);
  2916. float4 d;
  2917. float2 end;
  2918. if ((e.x > 0.000000f))
  2919. {
  2920. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  2921. (d.x += float((end.y > 0.900000f)));
  2922. }
  2923. else
  2924. (d.xz = float2(0.000000f, 0.000000f));
  2925. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  2926. [branch]if (((d.x - 2.000000f) > -d.y))
  2927. {
  2928. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  2929. float4 c;
  2930. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  2931. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  2932. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  2933. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2934. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2935. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  2936. }
  2937. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  2938. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  2939. {
  2940. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  2941. (d.y += float((end.y > 0.900000f)));
  2942. }
  2943. else
  2944. (d.yw = float2(0.000000f, 0.000000f));
  2945. [branch]if (((d.x - 2.000000f) > -d.y))
  2946. {
  2947. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  2948. float4 c;
  2949. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  2950. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  2951. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  2952. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2953. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2954. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  2955. }
  2956. return weights;
  2957. }
  2958. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  2959. {
  2960. float2 scale = float2(33.000000f, -33.000000f);
  2961. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  2962. (scale += float2(-1.000000f, 1.000000f));
  2963. (bias += float2(0.500000f, -0.500000f));
  2964. (scale *= float2(0.015625f, 0.062500f));
  2965. (bias *= float2(0.015625f, 0.062500f));
  2966. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  2967. }
  2968. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2969. {
  2970. float2 e = float2(0.000000f, 1.000000f);
  2971. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2972. {
  2973. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2974. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  2975. }
  2976. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  2977. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  2978. }
  2979. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2980. {
  2981. float2 e = float2(0.000000f, 1.000000f);
  2982. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2983. {
  2984. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2985. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  2986. }
  2987. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  2988. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  2989. }
  2990. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  2991. {
  2992. float2 e = float2(1.000000f, 0.000000f);
  2993. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2994. {
  2995. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  2996. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  2997. }
  2998. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  2999. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  3000. }
  3001. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  3002. {
  3003. float2 e = float2(1.000000f, 0.000000f);
  3004. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3005. {
  3006. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  3007. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  3008. }
  3009. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  3010. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  3011. }
  3012. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  3013. {
  3014. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  3015. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3016. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  3017. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  3018. }
  3019. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3020. {
  3021. float2 leftRight = step(d.xy, d.yx);
  3022. float2 rounding = (1.000000f * leftRight);
  3023. (rounding /= (leftRight.x + leftRight.y));
  3024. float2 factor = float2(1.000000f, 1.000000f);
  3025. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3026. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3027. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3028. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3029. (weights *= saturate(factor));
  3030. }
  3031. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3032. {
  3033. float2 leftRight = step(d.xy, d.yx);
  3034. float2 rounding = (1.000000f * leftRight);
  3035. (rounding /= (leftRight.x + leftRight.y));
  3036. float2 factor = float2(1.000000f, 1.000000f);
  3037. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3038. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3039. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3040. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3041. (weights *= saturate(factor));
  3042. }
  3043. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  3044. {
  3045. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  3046. float2 e = __tex2D(edgesTex, texcoord).xy;
  3047. [branch]if ((e.y > 0.000000f))
  3048. {
  3049. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  3050. [branch]if ((weights.x == -weights.y))
  3051. {
  3052. float2 d;
  3053. float3 coords;
  3054. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  3055. (coords.y = offset[1].y);
  3056. (d.x = coords.x);
  3057. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  3058. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  3059. (d.y = coords.z);
  3060. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  3061. float2 sqrt_d = sqrt(d);
  3062. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  3063. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  3064. (coords.y = texcoord.y);
  3065. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  3066. }
  3067. else
  3068. (e.x = 0.000000f);
  3069. }
  3070. [branch]if ((e.x > 0.000000f))
  3071. {
  3072. float2 d;
  3073. float3 coords;
  3074. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  3075. (coords.x = offset[0].x);
  3076. (d.x = coords.y);
  3077. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  3078. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  3079. (d.y = coords.z);
  3080. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  3081. float2 sqrt_d = sqrt(d);
  3082. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  3083. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  3084. (coords.x = texcoord.x);
  3085. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  3086. }
  3087. return weights;
  3088. }
  3089. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  3090. {
  3091. float4 a;
  3092. (a.x = __tex2D(blendTex, offset.xy).w);
  3093. (a.y = __tex2D(blendTex, offset.zw).y);
  3094. (a.wz = __tex2D(blendTex, texcoord).xz);
  3095. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  3096. {
  3097. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  3098. return color;
  3099. }
  3100. else
  3101. {
  3102. bool h = (max(a.x, a.z) > max(a.y, a.w));
  3103. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  3104. float2 blendingWeight = a.yw;
  3105. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  3106. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  3107. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  3108. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  3109. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  3110. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  3111. return color;
  3112. }
  3113. }
  3114. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  3115. {
  3116. float4 current = __tex2D(currentColorTex, texcoord);
  3117. float4 previous = __tex2D(previousColorTex, texcoord);
  3118. return lerp(current, previous, 0.500000f);
  3119. }
  3120. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  3121. {
  3122. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  3123. return FinalColor;
  3124. }
  3125. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  3126. {
  3127. _NSRFX_VS_PostProcess(id, position, texcoord);
  3128. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  3129. }
  3130. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  3131. {
  3132. _NSRFX_VS_PostProcess(id, position, texcoord);
  3133. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  3134. }
  3135. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  3136. {
  3137. _NSRFX_VS_PostProcess(id, position, texcoord);
  3138. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  3139. }
  3140. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  3141. {
  3142. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  3143. }
  3144. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  3145. {
  3146. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  3147. }
  3148. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  3149. {
  3150. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  3151. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  3152. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  3153. return color.xyz;
  3154. }
  3155. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  3156. {
  3157. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  3158. }
  3159.  
  3160.  
  3161. 08/08/2015 09:24:07:353 [07460] | TRACE | > Compiling shader 'SMAABlendingWeightCalculationVSWrap':
  3162.  
  3163. struct __sampler2D { Texture2D t; SamplerState s; };
  3164. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  3165. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  3166. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  3167. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  3168. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  3169. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  3170. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  3171. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  3172. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  3173. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  3174. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  3175. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  3176. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  3177. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  3178. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  3179. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  3180. cbuffer __GLOBAL__ : register(b0)
  3181. {
  3182. extern uniform float _NSRFX_timer;
  3183. extern uniform float _NSRFX_timeleft;
  3184. extern uniform float _NSRFX_frametime;
  3185. };
  3186. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  3187. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  3188. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  3189. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  3190. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  3191. SamplerState __SamplerState0 : register(s0);
  3192. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  3193. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  3194. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  3195. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  3196. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  3197. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  3198. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  3199. SamplerState __SamplerState1 : register(s1);
  3200. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  3201. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  3202. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  3203. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  3204. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  3205. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  3206. SamplerState __SamplerState2 : register(s2);
  3207. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  3208. SamplerState __SamplerState3 : register(s3);
  3209. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  3210. SamplerState __SamplerState4 : register(s4);
  3211. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  3212. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  3213. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  3214. SamplerState __SamplerState5 : register(s5);
  3215. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  3216. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  3217. {
  3218. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  3219. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  3220. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  3221. }
  3222. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  3223. {
  3224. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  3225. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  3226. (color.xyz = float3(depth.xxx));
  3227. }
  3228. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  3229. {
  3230. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  3231. float2 tex = texcoord;
  3232. float3 color = colorInput.xyz;
  3233. float dither_bit = 8.000000f;
  3234. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  3235. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  3236. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  3237. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  3238. (color.xyz += dither_shift_RGB);
  3239. (colorInput.xyz = color.xyz);
  3240. (depthTexR = colorInput);
  3241. }
  3242. float _NSMFX_NSGetLinearDepth(in float depth)
  3243. {
  3244. return (1 / ((depth * -998.999939f) + 999.999939f));
  3245. }
  3246. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  3247. {
  3248. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  3249. }
  3250. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  3251. {
  3252. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  3253. return color;
  3254. }
  3255. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  3256. {
  3257. float3 color = colorInput.xyz;
  3258. float dither_bit = 8.000000f;
  3259. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  3260. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  3261. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  3262. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  3263. (color.xyz += dither_shift_RGB);
  3264. (colorInput.xyz = color.xyz);
  3265. return colorInput;
  3266. }
  3267. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  3268. {
  3269. float P = __tex2D(tex, texcoord).x;
  3270. float Pleft = __tex2D(tex, offset[0].xy).x;
  3271. float Ptop = __tex2D(tex, offset[0].zw).x;
  3272. return float3(P, Pleft, Ptop);
  3273. }
  3274. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  3275. {
  3276. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  3277. float2 delta = abs((neighbours.xx - neighbours.yz));
  3278. float2 edges = step(0.001000f, delta);
  3279. return (0.200000f * (1.000000f - (0.400000f * edges)));
  3280. }
  3281. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  3282. {
  3283. [flatten]if (cond.x)
  3284. (variable.x = value.x);
  3285. [flatten]if (cond.y)
  3286. (variable.y = value.y);
  3287. }
  3288. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  3289. {
  3290. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  3291. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  3292. }
  3293. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  3294. {
  3295. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  3296. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3297. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  3298. }
  3299. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  3300. {
  3301. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  3302. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  3303. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  3304. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  3305. }
  3306. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  3307. {
  3308. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3309. }
  3310. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  3311. {
  3312. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  3313. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  3314. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  3315. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  3316. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  3317. float4 delta;
  3318. (delta.xy = abs((L - float2(Lleft, Ltop))));
  3319. float2 edges = step(threshold, delta.xy);
  3320. if ((abs(edges.x) == -abs(edges.y)))
  3321. {
  3322. discard;
  3323. }
  3324. else
  3325. {
  3326. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  3327. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  3328. (delta.zw = abs((L - float2(Lright, Lbottom))));
  3329. float2 maxDelta = max(delta.xy, delta.zw);
  3330. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  3331. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  3332. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  3333. (maxDelta = max(maxDelta.xy, delta.zw));
  3334. float finalDelta = max(maxDelta.x, maxDelta.y);
  3335. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  3336. }
  3337. return edges;
  3338. }
  3339. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  3340. {
  3341. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  3342. float4 delta;
  3343. float3 C = __tex2D(colorTex, texcoord).xyz;
  3344. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  3345. float3 t = abs((C - Cleft));
  3346. (delta.x = max(max(t.x, t.y), t.z));
  3347. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  3348. (t = abs((C - Ctop)));
  3349. (delta.y = max(max(t.x, t.y), t.z));
  3350. float2 edges = step(threshold, delta.xy);
  3351. if ((abs(edges.x) == -abs(edges.y)))
  3352. {
  3353. discard;
  3354. }
  3355. else
  3356. {
  3357. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  3358. (t = abs((C - Cright)));
  3359. (delta.z = max(max(t.x, t.y), t.z));
  3360. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  3361. (t = abs((C - Cbottom)));
  3362. (delta.w = max(max(t.x, t.y), t.z));
  3363. float2 maxDelta = max(delta.xy, delta.zw);
  3364. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  3365. (t = abs((C - Cleftleft)));
  3366. (delta.z = max(max(t.x, t.y), t.z));
  3367. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  3368. (t = abs((C - Ctoptop)));
  3369. (delta.w = max(max(t.x, t.y), t.z));
  3370. (maxDelta = max(maxDelta.xy, delta.zw));
  3371. float finalDelta = max(maxDelta.x, maxDelta.y);
  3372. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  3373. }
  3374. return edges;
  3375. }
  3376. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  3377. {
  3378. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  3379. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  3380. float2 edges = step(0.010000f, delta);
  3381. if ((abs(edges.x) == -abs(edges.y)))
  3382. discard;
  3383. return edges;
  3384. }
  3385. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  3386. {
  3387. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  3388. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  3389. (e.y = (e.y >= 0.500000f));
  3390. (e.x = ((er1 * er2) - e.y));
  3391. return e;
  3392. }
  3393. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  3394. {
  3395. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  3396. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  3397. (e.y = (e.y >= 0.500000f));
  3398. (e.x = ((er1 * er2) - e.y));
  3399. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  3400. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  3401. (e.w = (e.w >= 0.500000f));
  3402. (e.z = ((eb1 * eb2) - e.w));
  3403. return e;
  3404. }
  3405. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3406. {
  3407. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3408. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  3409. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  3410. {
  3411. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3412. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  3413. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3414. }
  3415. return coord.zw;
  3416. }
  3417. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3418. {
  3419. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3420. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  3421. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  3422. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  3423. {
  3424. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3425. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  3426. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  3427. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3428. }
  3429. return coord.zw;
  3430. }
  3431. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  3432. {
  3433. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  3434. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3435. (texcoord.x += 0.500000f);
  3436. (texcoord.y += (0.142857f * offset));
  3437. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  3438. }
  3439. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  3440. {
  3441. float2 weights = float2(0.000000f, 0.000000f);
  3442. float4 d;
  3443. float2 end;
  3444. if ((e.x > 0.000000f))
  3445. {
  3446. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  3447. (d.x += float((end.y > 0.900000f)));
  3448. }
  3449. else
  3450. (d.xz = float2(0.000000f, 0.000000f));
  3451. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  3452. [branch]if (((d.x - 2.000000f) > -d.y))
  3453. {
  3454. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  3455. float4 c;
  3456. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  3457. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  3458. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  3459. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3460. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3461. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  3462. }
  3463. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  3464. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  3465. {
  3466. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  3467. (d.y += float((end.y > 0.900000f)));
  3468. }
  3469. else
  3470. (d.yw = float2(0.000000f, 0.000000f));
  3471. [branch]if (((d.x - 2.000000f) > -d.y))
  3472. {
  3473. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  3474. float4 c;
  3475. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  3476. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  3477. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  3478. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3479. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3480. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  3481. }
  3482. return weights;
  3483. }
  3484. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  3485. {
  3486. float2 scale = float2(33.000000f, -33.000000f);
  3487. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  3488. (scale += float2(-1.000000f, 1.000000f));
  3489. (bias += float2(0.500000f, -0.500000f));
  3490. (scale *= float2(0.015625f, 0.062500f));
  3491. (bias *= float2(0.015625f, 0.062500f));
  3492. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  3493. }
  3494. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  3495. {
  3496. float2 e = float2(0.000000f, 1.000000f);
  3497. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3498. {
  3499. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  3500. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  3501. }
  3502. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  3503. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  3504. }
  3505. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  3506. {
  3507. float2 e = float2(0.000000f, 1.000000f);
  3508. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3509. {
  3510. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  3511. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  3512. }
  3513. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  3514. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  3515. }
  3516. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  3517. {
  3518. float2 e = float2(1.000000f, 0.000000f);
  3519. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3520. {
  3521. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  3522. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  3523. }
  3524. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  3525. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  3526. }
  3527. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  3528. {
  3529. float2 e = float2(1.000000f, 0.000000f);
  3530. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3531. {
  3532. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  3533. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  3534. }
  3535. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  3536. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  3537. }
  3538. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  3539. {
  3540. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  3541. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3542. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  3543. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  3544. }
  3545. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3546. {
  3547. float2 leftRight = step(d.xy, d.yx);
  3548. float2 rounding = (1.000000f * leftRight);
  3549. (rounding /= (leftRight.x + leftRight.y));
  3550. float2 factor = float2(1.000000f, 1.000000f);
  3551. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3552. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3553. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3554. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  3555. (weights *= saturate(factor));
  3556. }
  3557. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3558. {
  3559. float2 leftRight = step(d.xy, d.yx);
  3560. float2 rounding = (1.000000f * leftRight);
  3561. (rounding /= (leftRight.x + leftRight.y));
  3562. float2 factor = float2(1.000000f, 1.000000f);
  3563. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3564. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3565. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3566. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  3567. (weights *= saturate(factor));
  3568. }
  3569. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  3570. {
  3571. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  3572. float2 e = __tex2D(edgesTex, texcoord).xy;
  3573. [branch]if ((e.y > 0.000000f))
  3574. {
  3575. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  3576. [branch]if ((weights.x == -weights.y))
  3577. {
  3578. float2 d;
  3579. float3 coords;
  3580. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  3581. (coords.y = offset[1].y);
  3582. (d.x = coords.x);
  3583. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  3584. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  3585. (d.y = coords.z);
  3586. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  3587. float2 sqrt_d = sqrt(d);
  3588. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  3589. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  3590. (coords.y = texcoord.y);
  3591. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  3592. }
  3593. else
  3594. (e.x = 0.000000f);
  3595. }
  3596. [branch]if ((e.x > 0.000000f))
  3597. {
  3598. float2 d;
  3599. float3 coords;
  3600. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  3601. (coords.x = offset[0].x);
  3602. (d.x = coords.y);
  3603. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  3604. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  3605. (d.y = coords.z);
  3606. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  3607. float2 sqrt_d = sqrt(d);
  3608. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  3609. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  3610. (coords.x = texcoord.x);
  3611. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  3612. }
  3613. return weights;
  3614. }
  3615. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  3616. {
  3617. float4 a;
  3618. (a.x = __tex2D(blendTex, offset.xy).w);
  3619. (a.y = __tex2D(blendTex, offset.zw).y);
  3620. (a.wz = __tex2D(blendTex, texcoord).xz);
  3621. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  3622. {
  3623. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  3624. return color;
  3625. }
  3626. else
  3627. {
  3628. bool h = (max(a.x, a.z) > max(a.y, a.w));
  3629. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  3630. float2 blendingWeight = a.yw;
  3631. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  3632. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  3633. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  3634. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  3635. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  3636. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  3637. return color;
  3638. }
  3639. }
  3640. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  3641. {
  3642. float4 current = __tex2D(currentColorTex, texcoord);
  3643. float4 previous = __tex2D(previousColorTex, texcoord);
  3644. return lerp(current, previous, 0.500000f);
  3645. }
  3646. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  3647. {
  3648. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  3649. return FinalColor;
  3650. }
  3651. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  3652. {
  3653. _NSRFX_VS_PostProcess(id, position, texcoord);
  3654. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  3655. }
  3656. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  3657. {
  3658. _NSRFX_VS_PostProcess(id, position, texcoord);
  3659. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  3660. }
  3661. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  3662. {
  3663. _NSRFX_VS_PostProcess(id, position, texcoord);
  3664. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  3665. }
  3666. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  3667. {
  3668. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  3669. }
  3670. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  3671. {
  3672. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  3673. }
  3674. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  3675. {
  3676. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  3677. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  3678. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  3679. return color.xyz;
  3680. }
  3681. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  3682. {
  3683. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  3684. }
  3685.  
  3686.  
  3687. 08/08/2015 09:24:07:368 [07460] | TRACE | > Compiling shader 'SMAABlendingWeightCalculationPSWrap':
  3688.  
  3689. struct __sampler2D { Texture2D t; SamplerState s; };
  3690. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  3691. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  3692. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  3693. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  3694. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  3695. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  3696. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  3697. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  3698. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  3699. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  3700. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  3701. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  3702. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  3703. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  3704. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  3705. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  3706. cbuffer __GLOBAL__ : register(b0)
  3707. {
  3708. extern uniform float _NSRFX_timer;
  3709. extern uniform float _NSRFX_timeleft;
  3710. extern uniform float _NSRFX_frametime;
  3711. };
  3712. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  3713. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  3714. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  3715. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  3716. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  3717. SamplerState __SamplerState0 : register(s0);
  3718. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  3719. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  3720. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  3721. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  3722. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  3723. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  3724. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  3725. SamplerState __SamplerState1 : register(s1);
  3726. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  3727. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  3728. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  3729. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  3730. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  3731. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  3732. SamplerState __SamplerState2 : register(s2);
  3733. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  3734. SamplerState __SamplerState3 : register(s3);
  3735. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  3736. SamplerState __SamplerState4 : register(s4);
  3737. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  3738. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  3739. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  3740. SamplerState __SamplerState5 : register(s5);
  3741. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  3742. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  3743. {
  3744. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  3745. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  3746. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  3747. }
  3748. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  3749. {
  3750. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  3751. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  3752. (color.xyz = float3(depth.xxx));
  3753. }
  3754. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  3755. {
  3756. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  3757. float2 tex = texcoord;
  3758. float3 color = colorInput.xyz;
  3759. float dither_bit = 8.000000f;
  3760. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  3761. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  3762. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  3763. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  3764. (color.xyz += dither_shift_RGB);
  3765. (colorInput.xyz = color.xyz);
  3766. (depthTexR = colorInput);
  3767. }
  3768. float _NSMFX_NSGetLinearDepth(in float depth)
  3769. {
  3770. return (1 / ((depth * -998.999939f) + 999.999939f));
  3771. }
  3772. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  3773. {
  3774. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  3775. }
  3776. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  3777. {
  3778. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  3779. return color;
  3780. }
  3781. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  3782. {
  3783. float3 color = colorInput.xyz;
  3784. float dither_bit = 8.000000f;
  3785. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  3786. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  3787. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  3788. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  3789. (color.xyz += dither_shift_RGB);
  3790. (colorInput.xyz = color.xyz);
  3791. return colorInput;
  3792. }
  3793. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  3794. {
  3795. float P = __tex2D(tex, texcoord).x;
  3796. float Pleft = __tex2D(tex, offset[0].xy).x;
  3797. float Ptop = __tex2D(tex, offset[0].zw).x;
  3798. return float3(P, Pleft, Ptop);
  3799. }
  3800. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  3801. {
  3802. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  3803. float2 delta = abs((neighbours.xx - neighbours.yz));
  3804. float2 edges = step(0.001000f, delta);
  3805. return (0.200000f * (1.000000f - (0.400000f * edges)));
  3806. }
  3807. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  3808. {
  3809. [flatten]if (cond.x)
  3810. (variable.x = value.x);
  3811. [flatten]if (cond.y)
  3812. (variable.y = value.y);
  3813. }
  3814. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  3815. {
  3816. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  3817. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  3818. }
  3819. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  3820. {
  3821. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  3822. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3823. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  3824. }
  3825. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  3826. {
  3827. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  3828. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  3829. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  3830. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  3831. }
  3832. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  3833. {
  3834. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3835. }
  3836. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  3837. {
  3838. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  3839. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  3840. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  3841. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  3842. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  3843. float4 delta;
  3844. (delta.xy = abs((L - float2(Lleft, Ltop))));
  3845. float2 edges = step(threshold, delta.xy);
  3846. if ((abs(edges.x) == -abs(edges.y)))
  3847. {
  3848. discard;
  3849. }
  3850. else
  3851. {
  3852. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  3853. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  3854. (delta.zw = abs((L - float2(Lright, Lbottom))));
  3855. float2 maxDelta = max(delta.xy, delta.zw);
  3856. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  3857. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  3858. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  3859. (maxDelta = max(maxDelta.xy, delta.zw));
  3860. float finalDelta = max(maxDelta.x, maxDelta.y);
  3861. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  3862. }
  3863. return edges;
  3864. }
  3865. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  3866. {
  3867. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  3868. float4 delta;
  3869. float3 C = __tex2D(colorTex, texcoord).xyz;
  3870. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  3871. float3 t = abs((C - Cleft));
  3872. (delta.x = max(max(t.x, t.y), t.z));
  3873. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  3874. (t = abs((C - Ctop)));
  3875. (delta.y = max(max(t.x, t.y), t.z));
  3876. float2 edges = step(threshold, delta.xy);
  3877. if ((abs(edges.x) == -abs(edges.y)))
  3878. {
  3879. discard;
  3880. }
  3881. else
  3882. {
  3883. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  3884. (t = abs((C - Cright)));
  3885. (delta.z = max(max(t.x, t.y), t.z));
  3886. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  3887. (t = abs((C - Cbottom)));
  3888. (delta.w = max(max(t.x, t.y), t.z));
  3889. float2 maxDelta = max(delta.xy, delta.zw);
  3890. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  3891. (t = abs((C - Cleftleft)));
  3892. (delta.z = max(max(t.x, t.y), t.z));
  3893. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  3894. (t = abs((C - Ctoptop)));
  3895. (delta.w = max(max(t.x, t.y), t.z));
  3896. (maxDelta = max(maxDelta.xy, delta.zw));
  3897. float finalDelta = max(maxDelta.x, maxDelta.y);
  3898. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  3899. }
  3900. return edges;
  3901. }
  3902. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  3903. {
  3904. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  3905. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  3906. float2 edges = step(0.010000f, delta);
  3907. if ((abs(edges.x) == -abs(edges.y)))
  3908. discard;
  3909. return edges;
  3910. }
  3911. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  3912. {
  3913. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  3914. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  3915. (e.y = (e.y >= 0.500000f));
  3916. (e.x = ((er1 * er2) - e.y));
  3917. return e;
  3918. }
  3919. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  3920. {
  3921. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  3922. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  3923. (e.y = (e.y >= 0.500000f));
  3924. (e.x = ((er1 * er2) - e.y));
  3925. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  3926. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  3927. (e.w = (e.w >= 0.500000f));
  3928. (e.z = ((eb1 * eb2) - e.w));
  3929. return e;
  3930. }
  3931. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3932. {
  3933. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3934. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  3935. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  3936. {
  3937. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3938. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  3939. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3940. }
  3941. return coord.zw;
  3942. }
  3943. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3944. {
  3945. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3946. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  3947. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  3948. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  3949. {
  3950. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3951. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  3952. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  3953. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3954. }
  3955. return coord.zw;
  3956. }
  3957. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  3958. {
  3959. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  3960. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3961. (texcoord.x += 0.500000f);
  3962. (texcoord.y += (0.142857f * offset));
  3963. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  3964. }
  3965. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  3966. {
  3967. float2 weights = float2(0.000000f, 0.000000f);
  3968. float4 d;
  3969. float2 end;
  3970. if ((e.x > 0.000000f))
  3971. {
  3972. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  3973. (d.x += float((end.y > 0.900000f)));
  3974. }
  3975. else
  3976. (d.xz = float2(0.000000f, 0.000000f));
  3977. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  3978. [branch]if (((d.x - 2.000000f) > -d.y))
  3979. {
  3980. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  3981. float4 c;
  3982. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  3983. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  3984. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  3985. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3986. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3987. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  3988. }
  3989. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  3990. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  3991. {
  3992. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  3993. (d.y += float((end.y > 0.900000f)));
  3994. }
  3995. else
  3996. (d.yw = float2(0.000000f, 0.000000f));
  3997. [branch]if (((d.x - 2.000000f) > -d.y))
  3998. {
  3999. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  4000. float4 c;
  4001. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  4002. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  4003. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  4004. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4005. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4006. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  4007. }
  4008. return weights;
  4009. }
  4010. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  4011. {
  4012. float2 scale = float2(33.000000f, -33.000000f);
  4013. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  4014. (scale += float2(-1.000000f, 1.000000f));
  4015. (bias += float2(0.500000f, -0.500000f));
  4016. (scale *= float2(0.015625f, 0.062500f));
  4017. (bias *= float2(0.015625f, 0.062500f));
  4018. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  4019. }
  4020. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4021. {
  4022. float2 e = float2(0.000000f, 1.000000f);
  4023. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4024. {
  4025. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4026. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  4027. }
  4028. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  4029. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  4030. }
  4031. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4032. {
  4033. float2 e = float2(0.000000f, 1.000000f);
  4034. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4035. {
  4036. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4037. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  4038. }
  4039. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  4040. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  4041. }
  4042. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4043. {
  4044. float2 e = float2(1.000000f, 0.000000f);
  4045. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4046. {
  4047. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4048. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  4049. }
  4050. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  4051. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  4052. }
  4053. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4054. {
  4055. float2 e = float2(1.000000f, 0.000000f);
  4056. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4057. {
  4058. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4059. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  4060. }
  4061. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  4062. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  4063. }
  4064. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  4065. {
  4066. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  4067. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4068. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  4069. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  4070. }
  4071. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4072. {
  4073. float2 leftRight = step(d.xy, d.yx);
  4074. float2 rounding = (1.000000f * leftRight);
  4075. (rounding /= (leftRight.x + leftRight.y));
  4076. float2 factor = float2(1.000000f, 1.000000f);
  4077. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4078. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4079. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4080. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4081. (weights *= saturate(factor));
  4082. }
  4083. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4084. {
  4085. float2 leftRight = step(d.xy, d.yx);
  4086. float2 rounding = (1.000000f * leftRight);
  4087. (rounding /= (leftRight.x + leftRight.y));
  4088. float2 factor = float2(1.000000f, 1.000000f);
  4089. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4090. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4091. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4092. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4093. (weights *= saturate(factor));
  4094. }
  4095. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  4096. {
  4097. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  4098. float2 e = __tex2D(edgesTex, texcoord).xy;
  4099. [branch]if ((e.y > 0.000000f))
  4100. {
  4101. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  4102. [branch]if ((weights.x == -weights.y))
  4103. {
  4104. float2 d;
  4105. float3 coords;
  4106. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  4107. (coords.y = offset[1].y);
  4108. (d.x = coords.x);
  4109. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  4110. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  4111. (d.y = coords.z);
  4112. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  4113. float2 sqrt_d = sqrt(d);
  4114. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  4115. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  4116. (coords.y = texcoord.y);
  4117. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  4118. }
  4119. else
  4120. (e.x = 0.000000f);
  4121. }
  4122. [branch]if ((e.x > 0.000000f))
  4123. {
  4124. float2 d;
  4125. float3 coords;
  4126. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  4127. (coords.x = offset[0].x);
  4128. (d.x = coords.y);
  4129. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  4130. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  4131. (d.y = coords.z);
  4132. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  4133. float2 sqrt_d = sqrt(d);
  4134. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  4135. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  4136. (coords.x = texcoord.x);
  4137. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  4138. }
  4139. return weights;
  4140. }
  4141. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  4142. {
  4143. float4 a;
  4144. (a.x = __tex2D(blendTex, offset.xy).w);
  4145. (a.y = __tex2D(blendTex, offset.zw).y);
  4146. (a.wz = __tex2D(blendTex, texcoord).xz);
  4147. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  4148. {
  4149. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  4150. return color;
  4151. }
  4152. else
  4153. {
  4154. bool h = (max(a.x, a.z) > max(a.y, a.w));
  4155. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  4156. float2 blendingWeight = a.yw;
  4157. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  4158. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  4159. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  4160. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  4161. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  4162. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  4163. return color;
  4164. }
  4165. }
  4166. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  4167. {
  4168. float4 current = __tex2D(currentColorTex, texcoord);
  4169. float4 previous = __tex2D(previousColorTex, texcoord);
  4170. return lerp(current, previous, 0.500000f);
  4171. }
  4172. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  4173. {
  4174. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  4175. return FinalColor;
  4176. }
  4177. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  4178. {
  4179. _NSRFX_VS_PostProcess(id, position, texcoord);
  4180. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  4181. }
  4182. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  4183. {
  4184. _NSRFX_VS_PostProcess(id, position, texcoord);
  4185. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  4186. }
  4187. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  4188. {
  4189. _NSRFX_VS_PostProcess(id, position, texcoord);
  4190. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  4191. }
  4192. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  4193. {
  4194. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  4195. }
  4196. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  4197. {
  4198. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  4199. }
  4200. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  4201. {
  4202. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  4203. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  4204. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  4205. return color.xyz;
  4206. }
  4207. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  4208. {
  4209. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  4210. }
  4211.  
  4212.  
  4213. 08/08/2015 09:24:07:669 [07460] | TRACE | > Compiling shader 'SMAANeighborhoodBlendingVSWrap':
  4214.  
  4215. struct __sampler2D { Texture2D t; SamplerState s; };
  4216. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  4217. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  4218. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  4219. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  4220. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  4221. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  4222. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  4223. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  4224. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  4225. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  4226. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  4227. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  4228. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  4229. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  4230. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  4231. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  4232. cbuffer __GLOBAL__ : register(b0)
  4233. {
  4234. extern uniform float _NSRFX_timer;
  4235. extern uniform float _NSRFX_timeleft;
  4236. extern uniform float _NSRFX_frametime;
  4237. };
  4238. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  4239. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  4240. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  4241. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  4242. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  4243. SamplerState __SamplerState0 : register(s0);
  4244. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  4245. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  4246. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  4247. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  4248. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  4249. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  4250. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  4251. SamplerState __SamplerState1 : register(s1);
  4252. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  4253. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  4254. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  4255. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  4256. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  4257. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  4258. SamplerState __SamplerState2 : register(s2);
  4259. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  4260. SamplerState __SamplerState3 : register(s3);
  4261. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  4262. SamplerState __SamplerState4 : register(s4);
  4263. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  4264. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  4265. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  4266. SamplerState __SamplerState5 : register(s5);
  4267. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  4268. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  4269. {
  4270. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  4271. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  4272. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  4273. }
  4274. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  4275. {
  4276. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  4277. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  4278. (color.xyz = float3(depth.xxx));
  4279. }
  4280. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  4281. {
  4282. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  4283. float2 tex = texcoord;
  4284. float3 color = colorInput.xyz;
  4285. float dither_bit = 8.000000f;
  4286. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  4287. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  4288. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  4289. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  4290. (color.xyz += dither_shift_RGB);
  4291. (colorInput.xyz = color.xyz);
  4292. (depthTexR = colorInput);
  4293. }
  4294. float _NSMFX_NSGetLinearDepth(in float depth)
  4295. {
  4296. return (1 / ((depth * -998.999939f) + 999.999939f));
  4297. }
  4298. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  4299. {
  4300. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  4301. }
  4302. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  4303. {
  4304. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  4305. return color;
  4306. }
  4307. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  4308. {
  4309. float3 color = colorInput.xyz;
  4310. float dither_bit = 8.000000f;
  4311. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  4312. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  4313. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  4314. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  4315. (color.xyz += dither_shift_RGB);
  4316. (colorInput.xyz = color.xyz);
  4317. return colorInput;
  4318. }
  4319. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  4320. {
  4321. float P = __tex2D(tex, texcoord).x;
  4322. float Pleft = __tex2D(tex, offset[0].xy).x;
  4323. float Ptop = __tex2D(tex, offset[0].zw).x;
  4324. return float3(P, Pleft, Ptop);
  4325. }
  4326. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  4327. {
  4328. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  4329. float2 delta = abs((neighbours.xx - neighbours.yz));
  4330. float2 edges = step(0.001000f, delta);
  4331. return (0.200000f * (1.000000f - (0.400000f * edges)));
  4332. }
  4333. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  4334. {
  4335. [flatten]if (cond.x)
  4336. (variable.x = value.x);
  4337. [flatten]if (cond.y)
  4338. (variable.y = value.y);
  4339. }
  4340. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  4341. {
  4342. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  4343. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  4344. }
  4345. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  4346. {
  4347. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  4348. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4349. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  4350. }
  4351. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  4352. {
  4353. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  4354. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  4355. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  4356. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  4357. }
  4358. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  4359. {
  4360. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4361. }
  4362. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  4363. {
  4364. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  4365. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  4366. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  4367. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  4368. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  4369. float4 delta;
  4370. (delta.xy = abs((L - float2(Lleft, Ltop))));
  4371. float2 edges = step(threshold, delta.xy);
  4372. if ((abs(edges.x) == -abs(edges.y)))
  4373. {
  4374. discard;
  4375. }
  4376. else
  4377. {
  4378. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  4379. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  4380. (delta.zw = abs((L - float2(Lright, Lbottom))));
  4381. float2 maxDelta = max(delta.xy, delta.zw);
  4382. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  4383. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  4384. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  4385. (maxDelta = max(maxDelta.xy, delta.zw));
  4386. float finalDelta = max(maxDelta.x, maxDelta.y);
  4387. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  4388. }
  4389. return edges;
  4390. }
  4391. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  4392. {
  4393. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  4394. float4 delta;
  4395. float3 C = __tex2D(colorTex, texcoord).xyz;
  4396. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  4397. float3 t = abs((C - Cleft));
  4398. (delta.x = max(max(t.x, t.y), t.z));
  4399. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  4400. (t = abs((C - Ctop)));
  4401. (delta.y = max(max(t.x, t.y), t.z));
  4402. float2 edges = step(threshold, delta.xy);
  4403. if ((abs(edges.x) == -abs(edges.y)))
  4404. {
  4405. discard;
  4406. }
  4407. else
  4408. {
  4409. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  4410. (t = abs((C - Cright)));
  4411. (delta.z = max(max(t.x, t.y), t.z));
  4412. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  4413. (t = abs((C - Cbottom)));
  4414. (delta.w = max(max(t.x, t.y), t.z));
  4415. float2 maxDelta = max(delta.xy, delta.zw);
  4416. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  4417. (t = abs((C - Cleftleft)));
  4418. (delta.z = max(max(t.x, t.y), t.z));
  4419. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  4420. (t = abs((C - Ctoptop)));
  4421. (delta.w = max(max(t.x, t.y), t.z));
  4422. (maxDelta = max(maxDelta.xy, delta.zw));
  4423. float finalDelta = max(maxDelta.x, maxDelta.y);
  4424. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  4425. }
  4426. return edges;
  4427. }
  4428. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  4429. {
  4430. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  4431. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  4432. float2 edges = step(0.010000f, delta);
  4433. if ((abs(edges.x) == -abs(edges.y)))
  4434. discard;
  4435. return edges;
  4436. }
  4437. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  4438. {
  4439. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  4440. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  4441. (e.y = (e.y >= 0.500000f));
  4442. (e.x = ((er1 * er2) - e.y));
  4443. return e;
  4444. }
  4445. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  4446. {
  4447. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  4448. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  4449. (e.y = (e.y >= 0.500000f));
  4450. (e.x = ((er1 * er2) - e.y));
  4451. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  4452. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  4453. (e.w = (e.w >= 0.500000f));
  4454. (e.z = ((eb1 * eb2) - e.w));
  4455. return e;
  4456. }
  4457. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4458. {
  4459. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4460. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  4461. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  4462. {
  4463. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4464. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  4465. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4466. }
  4467. return coord.zw;
  4468. }
  4469. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4470. {
  4471. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4472. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  4473. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  4474. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  4475. {
  4476. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4477. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  4478. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  4479. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4480. }
  4481. return coord.zw;
  4482. }
  4483. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  4484. {
  4485. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  4486. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4487. (texcoord.x += 0.500000f);
  4488. (texcoord.y += (0.142857f * offset));
  4489. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  4490. }
  4491. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  4492. {
  4493. float2 weights = float2(0.000000f, 0.000000f);
  4494. float4 d;
  4495. float2 end;
  4496. if ((e.x > 0.000000f))
  4497. {
  4498. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  4499. (d.x += float((end.y > 0.900000f)));
  4500. }
  4501. else
  4502. (d.xz = float2(0.000000f, 0.000000f));
  4503. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  4504. [branch]if (((d.x - 2.000000f) > -d.y))
  4505. {
  4506. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  4507. float4 c;
  4508. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  4509. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  4510. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  4511. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4512. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4513. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  4514. }
  4515. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  4516. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  4517. {
  4518. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  4519. (d.y += float((end.y > 0.900000f)));
  4520. }
  4521. else
  4522. (d.yw = float2(0.000000f, 0.000000f));
  4523. [branch]if (((d.x - 2.000000f) > -d.y))
  4524. {
  4525. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  4526. float4 c;
  4527. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  4528. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  4529. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  4530. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4531. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4532. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  4533. }
  4534. return weights;
  4535. }
  4536. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  4537. {
  4538. float2 scale = float2(33.000000f, -33.000000f);
  4539. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  4540. (scale += float2(-1.000000f, 1.000000f));
  4541. (bias += float2(0.500000f, -0.500000f));
  4542. (scale *= float2(0.015625f, 0.062500f));
  4543. (bias *= float2(0.015625f, 0.062500f));
  4544. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  4545. }
  4546. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4547. {
  4548. float2 e = float2(0.000000f, 1.000000f);
  4549. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4550. {
  4551. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4552. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  4553. }
  4554. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  4555. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  4556. }
  4557. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4558. {
  4559. float2 e = float2(0.000000f, 1.000000f);
  4560. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4561. {
  4562. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4563. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  4564. }
  4565. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  4566. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  4567. }
  4568. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4569. {
  4570. float2 e = float2(1.000000f, 0.000000f);
  4571. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4572. {
  4573. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4574. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  4575. }
  4576. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  4577. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  4578. }
  4579. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  4580. {
  4581. float2 e = float2(1.000000f, 0.000000f);
  4582. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4583. {
  4584. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  4585. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  4586. }
  4587. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  4588. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  4589. }
  4590. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  4591. {
  4592. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  4593. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4594. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  4595. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  4596. }
  4597. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4598. {
  4599. float2 leftRight = step(d.xy, d.yx);
  4600. float2 rounding = (1.000000f * leftRight);
  4601. (rounding /= (leftRight.x + leftRight.y));
  4602. float2 factor = float2(1.000000f, 1.000000f);
  4603. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4604. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4605. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4606. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  4607. (weights *= saturate(factor));
  4608. }
  4609. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4610. {
  4611. float2 leftRight = step(d.xy, d.yx);
  4612. float2 rounding = (1.000000f * leftRight);
  4613. (rounding /= (leftRight.x + leftRight.y));
  4614. float2 factor = float2(1.000000f, 1.000000f);
  4615. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4616. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4617. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4618. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  4619. (weights *= saturate(factor));
  4620. }
  4621. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  4622. {
  4623. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  4624. float2 e = __tex2D(edgesTex, texcoord).xy;
  4625. [branch]if ((e.y > 0.000000f))
  4626. {
  4627. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  4628. [branch]if ((weights.x == -weights.y))
  4629. {
  4630. float2 d;
  4631. float3 coords;
  4632. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  4633. (coords.y = offset[1].y);
  4634. (d.x = coords.x);
  4635. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  4636. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  4637. (d.y = coords.z);
  4638. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  4639. float2 sqrt_d = sqrt(d);
  4640. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  4641. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  4642. (coords.y = texcoord.y);
  4643. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  4644. }
  4645. else
  4646. (e.x = 0.000000f);
  4647. }
  4648. [branch]if ((e.x > 0.000000f))
  4649. {
  4650. float2 d;
  4651. float3 coords;
  4652. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  4653. (coords.x = offset[0].x);
  4654. (d.x = coords.y);
  4655. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  4656. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  4657. (d.y = coords.z);
  4658. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  4659. float2 sqrt_d = sqrt(d);
  4660. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  4661. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  4662. (coords.x = texcoord.x);
  4663. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  4664. }
  4665. return weights;
  4666. }
  4667. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  4668. {
  4669. float4 a;
  4670. (a.x = __tex2D(blendTex, offset.xy).w);
  4671. (a.y = __tex2D(blendTex, offset.zw).y);
  4672. (a.wz = __tex2D(blendTex, texcoord).xz);
  4673. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  4674. {
  4675. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  4676. return color;
  4677. }
  4678. else
  4679. {
  4680. bool h = (max(a.x, a.z) > max(a.y, a.w));
  4681. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  4682. float2 blendingWeight = a.yw;
  4683. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  4684. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  4685. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  4686. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  4687. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  4688. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  4689. return color;
  4690. }
  4691. }
  4692. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  4693. {
  4694. float4 current = __tex2D(currentColorTex, texcoord);
  4695. float4 previous = __tex2D(previousColorTex, texcoord);
  4696. return lerp(current, previous, 0.500000f);
  4697. }
  4698. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  4699. {
  4700. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  4701. return FinalColor;
  4702. }
  4703. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  4704. {
  4705. _NSRFX_VS_PostProcess(id, position, texcoord);
  4706. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  4707. }
  4708. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  4709. {
  4710. _NSRFX_VS_PostProcess(id, position, texcoord);
  4711. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  4712. }
  4713. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  4714. {
  4715. _NSRFX_VS_PostProcess(id, position, texcoord);
  4716. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  4717. }
  4718. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  4719. {
  4720. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  4721. }
  4722. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  4723. {
  4724. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  4725. }
  4726. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  4727. {
  4728. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  4729. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  4730. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  4731. return color.xyz;
  4732. }
  4733. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  4734. {
  4735. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  4736. }
  4737.  
  4738.  
  4739. 08/08/2015 09:24:07:678 [07460] | TRACE | > Compiling shader 'SMAANeighborhoodBlendingPSWrap':
  4740.  
  4741. struct __sampler2D { Texture2D t; SamplerState s; };
  4742. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  4743. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  4744. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  4745. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  4746. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  4747. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  4748. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  4749. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  4750. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  4751. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  4752. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  4753. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  4754. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  4755. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  4756. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  4757. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  4758. cbuffer __GLOBAL__ : register(b0)
  4759. {
  4760. extern uniform float _NSRFX_timer;
  4761. extern uniform float _NSRFX_timeleft;
  4762. extern uniform float _NSRFX_frametime;
  4763. };
  4764. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  4765. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  4766. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  4767. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  4768. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  4769. SamplerState __SamplerState0 : register(s0);
  4770. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  4771. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  4772. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  4773. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  4774. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  4775. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  4776. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  4777. SamplerState __SamplerState1 : register(s1);
  4778. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  4779. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  4780. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  4781. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  4782. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  4783. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  4784. SamplerState __SamplerState2 : register(s2);
  4785. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  4786. SamplerState __SamplerState3 : register(s3);
  4787. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  4788. SamplerState __SamplerState4 : register(s4);
  4789. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  4790. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  4791. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  4792. SamplerState __SamplerState5 : register(s5);
  4793. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  4794. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  4795. {
  4796. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  4797. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  4798. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  4799. }
  4800. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  4801. {
  4802. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  4803. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  4804. (color.xyz = float3(depth.xxx));
  4805. }
  4806. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  4807. {
  4808. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  4809. float2 tex = texcoord;
  4810. float3 color = colorInput.xyz;
  4811. float dither_bit = 8.000000f;
  4812. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  4813. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  4814. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  4815. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  4816. (color.xyz += dither_shift_RGB);
  4817. (colorInput.xyz = color.xyz);
  4818. (depthTexR = colorInput);
  4819. }
  4820. float _NSMFX_NSGetLinearDepth(in float depth)
  4821. {
  4822. return (1 / ((depth * -998.999939f) + 999.999939f));
  4823. }
  4824. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  4825. {
  4826. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  4827. }
  4828. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  4829. {
  4830. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  4831. return color;
  4832. }
  4833. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  4834. {
  4835. float3 color = colorInput.xyz;
  4836. float dither_bit = 8.000000f;
  4837. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  4838. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  4839. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  4840. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  4841. (color.xyz += dither_shift_RGB);
  4842. (colorInput.xyz = color.xyz);
  4843. return colorInput;
  4844. }
  4845. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  4846. {
  4847. float P = __tex2D(tex, texcoord).x;
  4848. float Pleft = __tex2D(tex, offset[0].xy).x;
  4849. float Ptop = __tex2D(tex, offset[0].zw).x;
  4850. return float3(P, Pleft, Ptop);
  4851. }
  4852. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  4853. {
  4854. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  4855. float2 delta = abs((neighbours.xx - neighbours.yz));
  4856. float2 edges = step(0.001000f, delta);
  4857. return (0.200000f * (1.000000f - (0.400000f * edges)));
  4858. }
  4859. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  4860. {
  4861. [flatten]if (cond.x)
  4862. (variable.x = value.x);
  4863. [flatten]if (cond.y)
  4864. (variable.y = value.y);
  4865. }
  4866. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  4867. {
  4868. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  4869. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  4870. }
  4871. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  4872. {
  4873. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  4874. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4875. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  4876. }
  4877. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  4878. {
  4879. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  4880. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  4881. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  4882. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  4883. }
  4884. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  4885. {
  4886. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4887. }
  4888. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  4889. {
  4890. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  4891. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  4892. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  4893. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  4894. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  4895. float4 delta;
  4896. (delta.xy = abs((L - float2(Lleft, Ltop))));
  4897. float2 edges = step(threshold, delta.xy);
  4898. if ((abs(edges.x) == -abs(edges.y)))
  4899. {
  4900. discard;
  4901. }
  4902. else
  4903. {
  4904. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  4905. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  4906. (delta.zw = abs((L - float2(Lright, Lbottom))));
  4907. float2 maxDelta = max(delta.xy, delta.zw);
  4908. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  4909. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  4910. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  4911. (maxDelta = max(maxDelta.xy, delta.zw));
  4912. float finalDelta = max(maxDelta.x, maxDelta.y);
  4913. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  4914. }
  4915. return edges;
  4916. }
  4917. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  4918. {
  4919. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  4920. float4 delta;
  4921. float3 C = __tex2D(colorTex, texcoord).xyz;
  4922. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  4923. float3 t = abs((C - Cleft));
  4924. (delta.x = max(max(t.x, t.y), t.z));
  4925. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  4926. (t = abs((C - Ctop)));
  4927. (delta.y = max(max(t.x, t.y), t.z));
  4928. float2 edges = step(threshold, delta.xy);
  4929. if ((abs(edges.x) == -abs(edges.y)))
  4930. {
  4931. discard;
  4932. }
  4933. else
  4934. {
  4935. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  4936. (t = abs((C - Cright)));
  4937. (delta.z = max(max(t.x, t.y), t.z));
  4938. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  4939. (t = abs((C - Cbottom)));
  4940. (delta.w = max(max(t.x, t.y), t.z));
  4941. float2 maxDelta = max(delta.xy, delta.zw);
  4942. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  4943. (t = abs((C - Cleftleft)));
  4944. (delta.z = max(max(t.x, t.y), t.z));
  4945. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  4946. (t = abs((C - Ctoptop)));
  4947. (delta.w = max(max(t.x, t.y), t.z));
  4948. (maxDelta = max(maxDelta.xy, delta.zw));
  4949. float finalDelta = max(maxDelta.x, maxDelta.y);
  4950. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  4951. }
  4952. return edges;
  4953. }
  4954. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  4955. {
  4956. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  4957. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  4958. float2 edges = step(0.010000f, delta);
  4959. if ((abs(edges.x) == -abs(edges.y)))
  4960. discard;
  4961. return edges;
  4962. }
  4963. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  4964. {
  4965. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  4966. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  4967. (e.y = (e.y >= 0.500000f));
  4968. (e.x = ((er1 * er2) - e.y));
  4969. return e;
  4970. }
  4971. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  4972. {
  4973. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  4974. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  4975. (e.y = (e.y >= 0.500000f));
  4976. (e.x = ((er1 * er2) - e.y));
  4977. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  4978. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  4979. (e.w = (e.w >= 0.500000f));
  4980. (e.z = ((eb1 * eb2) - e.w));
  4981. return e;
  4982. }
  4983. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4984. {
  4985. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4986. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  4987. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  4988. {
  4989. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4990. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  4991. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4992. }
  4993. return coord.zw;
  4994. }
  4995. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4996. {
  4997. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4998. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  4999. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  5000. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  5001. {
  5002. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  5003. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  5004. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  5005. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  5006. }
  5007. return coord.zw;
  5008. }
  5009. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  5010. {
  5011. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  5012. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  5013. (texcoord.x += 0.500000f);
  5014. (texcoord.y += (0.142857f * offset));
  5015. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  5016. }
  5017. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  5018. {
  5019. float2 weights = float2(0.000000f, 0.000000f);
  5020. float4 d;
  5021. float2 end;
  5022. if ((e.x > 0.000000f))
  5023. {
  5024. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  5025. (d.x += float((end.y > 0.900000f)));
  5026. }
  5027. else
  5028. (d.xz = float2(0.000000f, 0.000000f));
  5029. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  5030. [branch]if (((d.x - 2.000000f) > -d.y))
  5031. {
  5032. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  5033. float4 c;
  5034. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  5035. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  5036. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  5037. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  5038. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  5039. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  5040. }
  5041. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  5042. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  5043. {
  5044. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  5045. (d.y += float((end.y > 0.900000f)));
  5046. }
  5047. else
  5048. (d.yw = float2(0.000000f, 0.000000f));
  5049. [branch]if (((d.x - 2.000000f) > -d.y))
  5050. {
  5051. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  5052. float4 c;
  5053. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  5054. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  5055. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  5056. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  5057. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  5058. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  5059. }
  5060. return weights;
  5061. }
  5062. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  5063. {
  5064. float2 scale = float2(33.000000f, -33.000000f);
  5065. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  5066. (scale += float2(-1.000000f, 1.000000f));
  5067. (bias += float2(0.500000f, -0.500000f));
  5068. (scale *= float2(0.015625f, 0.062500f));
  5069. (bias *= float2(0.015625f, 0.062500f));
  5070. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  5071. }
  5072. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5073. {
  5074. float2 e = float2(0.000000f, 1.000000f);
  5075. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  5076. {
  5077. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5078. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  5079. }
  5080. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  5081. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  5082. }
  5083. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5084. {
  5085. float2 e = float2(0.000000f, 1.000000f);
  5086. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  5087. {
  5088. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5089. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  5090. }
  5091. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  5092. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  5093. }
  5094. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5095. {
  5096. float2 e = float2(1.000000f, 0.000000f);
  5097. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  5098. {
  5099. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5100. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  5101. }
  5102. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  5103. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  5104. }
  5105. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5106. {
  5107. float2 e = float2(1.000000f, 0.000000f);
  5108. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  5109. {
  5110. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5111. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  5112. }
  5113. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  5114. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  5115. }
  5116. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  5117. {
  5118. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  5119. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  5120. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  5121. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  5122. }
  5123. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  5124. {
  5125. float2 leftRight = step(d.xy, d.yx);
  5126. float2 rounding = (1.000000f * leftRight);
  5127. (rounding /= (leftRight.x + leftRight.y));
  5128. float2 factor = float2(1.000000f, 1.000000f);
  5129. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5130. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5131. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5132. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5133. (weights *= saturate(factor));
  5134. }
  5135. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  5136. {
  5137. float2 leftRight = step(d.xy, d.yx);
  5138. float2 rounding = (1.000000f * leftRight);
  5139. (rounding /= (leftRight.x + leftRight.y));
  5140. float2 factor = float2(1.000000f, 1.000000f);
  5141. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5142. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5143. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5144. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5145. (weights *= saturate(factor));
  5146. }
  5147. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  5148. {
  5149. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  5150. float2 e = __tex2D(edgesTex, texcoord).xy;
  5151. [branch]if ((e.y > 0.000000f))
  5152. {
  5153. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  5154. [branch]if ((weights.x == -weights.y))
  5155. {
  5156. float2 d;
  5157. float3 coords;
  5158. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  5159. (coords.y = offset[1].y);
  5160. (d.x = coords.x);
  5161. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  5162. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  5163. (d.y = coords.z);
  5164. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  5165. float2 sqrt_d = sqrt(d);
  5166. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  5167. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  5168. (coords.y = texcoord.y);
  5169. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  5170. }
  5171. else
  5172. (e.x = 0.000000f);
  5173. }
  5174. [branch]if ((e.x > 0.000000f))
  5175. {
  5176. float2 d;
  5177. float3 coords;
  5178. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  5179. (coords.x = offset[0].x);
  5180. (d.x = coords.y);
  5181. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  5182. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  5183. (d.y = coords.z);
  5184. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  5185. float2 sqrt_d = sqrt(d);
  5186. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  5187. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  5188. (coords.x = texcoord.x);
  5189. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  5190. }
  5191. return weights;
  5192. }
  5193. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  5194. {
  5195. float4 a;
  5196. (a.x = __tex2D(blendTex, offset.xy).w);
  5197. (a.y = __tex2D(blendTex, offset.zw).y);
  5198. (a.wz = __tex2D(blendTex, texcoord).xz);
  5199. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  5200. {
  5201. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  5202. return color;
  5203. }
  5204. else
  5205. {
  5206. bool h = (max(a.x, a.z) > max(a.y, a.w));
  5207. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  5208. float2 blendingWeight = a.yw;
  5209. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  5210. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  5211. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  5212. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  5213. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  5214. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  5215. return color;
  5216. }
  5217. }
  5218. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  5219. {
  5220. float4 current = __tex2D(currentColorTex, texcoord);
  5221. float4 previous = __tex2D(previousColorTex, texcoord);
  5222. return lerp(current, previous, 0.500000f);
  5223. }
  5224. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  5225. {
  5226. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  5227. return FinalColor;
  5228. }
  5229. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  5230. {
  5231. _NSRFX_VS_PostProcess(id, position, texcoord);
  5232. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  5233. }
  5234. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  5235. {
  5236. _NSRFX_VS_PostProcess(id, position, texcoord);
  5237. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  5238. }
  5239. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  5240. {
  5241. _NSRFX_VS_PostProcess(id, position, texcoord);
  5242. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  5243. }
  5244. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  5245. {
  5246. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  5247. }
  5248. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  5249. {
  5250. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  5251. }
  5252. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  5253. {
  5254. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  5255. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  5256. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  5257. return color.xyz;
  5258. }
  5259. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  5260. {
  5261. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  5262. }
  5263.  
  5264.  
  5265. 08/08/2015 09:24:07:742 [07460] | TRACE | > Compiling shader 'RFX_VS_PostProcess':
  5266.  
  5267. struct __sampler2D { Texture2D t; SamplerState s; };
  5268. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  5269. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  5270. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  5271. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  5272. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  5273. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  5274. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  5275. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  5276. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  5277. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  5278. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  5279. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  5280. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  5281. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  5282. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  5283. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  5284. cbuffer __GLOBAL__ : register(b0)
  5285. {
  5286. extern uniform float _NSRFX_timer;
  5287. extern uniform float _NSRFX_timeleft;
  5288. extern uniform float _NSRFX_frametime;
  5289. };
  5290. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  5291. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  5292. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  5293. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  5294. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  5295. SamplerState __SamplerState0 : register(s0);
  5296. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  5297. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  5298. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  5299. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  5300. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  5301. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  5302. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  5303. SamplerState __SamplerState1 : register(s1);
  5304. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  5305. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  5306. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  5307. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  5308. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  5309. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  5310. SamplerState __SamplerState2 : register(s2);
  5311. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  5312. SamplerState __SamplerState3 : register(s3);
  5313. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  5314. SamplerState __SamplerState4 : register(s4);
  5315. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  5316. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  5317. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  5318. SamplerState __SamplerState5 : register(s5);
  5319. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  5320. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  5321. {
  5322. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  5323. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  5324. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  5325. }
  5326. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  5327. {
  5328. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  5329. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  5330. (color.xyz = float3(depth.xxx));
  5331. }
  5332. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  5333. {
  5334. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  5335. float2 tex = texcoord;
  5336. float3 color = colorInput.xyz;
  5337. float dither_bit = 8.000000f;
  5338. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  5339. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  5340. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  5341. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  5342. (color.xyz += dither_shift_RGB);
  5343. (colorInput.xyz = color.xyz);
  5344. (depthTexR = colorInput);
  5345. }
  5346. float _NSMFX_NSGetLinearDepth(in float depth)
  5347. {
  5348. return (1 / ((depth * -998.999939f) + 999.999939f));
  5349. }
  5350. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  5351. {
  5352. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  5353. }
  5354. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  5355. {
  5356. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  5357. return color;
  5358. }
  5359. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  5360. {
  5361. float3 color = colorInput.xyz;
  5362. float dither_bit = 8.000000f;
  5363. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  5364. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  5365. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  5366. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  5367. (color.xyz += dither_shift_RGB);
  5368. (colorInput.xyz = color.xyz);
  5369. return colorInput;
  5370. }
  5371. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  5372. {
  5373. float P = __tex2D(tex, texcoord).x;
  5374. float Pleft = __tex2D(tex, offset[0].xy).x;
  5375. float Ptop = __tex2D(tex, offset[0].zw).x;
  5376. return float3(P, Pleft, Ptop);
  5377. }
  5378. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  5379. {
  5380. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  5381. float2 delta = abs((neighbours.xx - neighbours.yz));
  5382. float2 edges = step(0.001000f, delta);
  5383. return (0.200000f * (1.000000f - (0.400000f * edges)));
  5384. }
  5385. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  5386. {
  5387. [flatten]if (cond.x)
  5388. (variable.x = value.x);
  5389. [flatten]if (cond.y)
  5390. (variable.y = value.y);
  5391. }
  5392. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  5393. {
  5394. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  5395. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  5396. }
  5397. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  5398. {
  5399. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  5400. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  5401. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  5402. }
  5403. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  5404. {
  5405. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  5406. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  5407. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  5408. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  5409. }
  5410. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  5411. {
  5412. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  5413. }
  5414. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  5415. {
  5416. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  5417. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  5418. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  5419. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  5420. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  5421. float4 delta;
  5422. (delta.xy = abs((L - float2(Lleft, Ltop))));
  5423. float2 edges = step(threshold, delta.xy);
  5424. if ((abs(edges.x) == -abs(edges.y)))
  5425. {
  5426. discard;
  5427. }
  5428. else
  5429. {
  5430. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  5431. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  5432. (delta.zw = abs((L - float2(Lright, Lbottom))));
  5433. float2 maxDelta = max(delta.xy, delta.zw);
  5434. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  5435. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  5436. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  5437. (maxDelta = max(maxDelta.xy, delta.zw));
  5438. float finalDelta = max(maxDelta.x, maxDelta.y);
  5439. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  5440. }
  5441. return edges;
  5442. }
  5443. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  5444. {
  5445. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  5446. float4 delta;
  5447. float3 C = __tex2D(colorTex, texcoord).xyz;
  5448. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  5449. float3 t = abs((C - Cleft));
  5450. (delta.x = max(max(t.x, t.y), t.z));
  5451. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  5452. (t = abs((C - Ctop)));
  5453. (delta.y = max(max(t.x, t.y), t.z));
  5454. float2 edges = step(threshold, delta.xy);
  5455. if ((abs(edges.x) == -abs(edges.y)))
  5456. {
  5457. discard;
  5458. }
  5459. else
  5460. {
  5461. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  5462. (t = abs((C - Cright)));
  5463. (delta.z = max(max(t.x, t.y), t.z));
  5464. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  5465. (t = abs((C - Cbottom)));
  5466. (delta.w = max(max(t.x, t.y), t.z));
  5467. float2 maxDelta = max(delta.xy, delta.zw);
  5468. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  5469. (t = abs((C - Cleftleft)));
  5470. (delta.z = max(max(t.x, t.y), t.z));
  5471. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  5472. (t = abs((C - Ctoptop)));
  5473. (delta.w = max(max(t.x, t.y), t.z));
  5474. (maxDelta = max(maxDelta.xy, delta.zw));
  5475. float finalDelta = max(maxDelta.x, maxDelta.y);
  5476. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  5477. }
  5478. return edges;
  5479. }
  5480. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  5481. {
  5482. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  5483. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  5484. float2 edges = step(0.010000f, delta);
  5485. if ((abs(edges.x) == -abs(edges.y)))
  5486. discard;
  5487. return edges;
  5488. }
  5489. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  5490. {
  5491. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  5492. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  5493. (e.y = (e.y >= 0.500000f));
  5494. (e.x = ((er1 * er2) - e.y));
  5495. return e;
  5496. }
  5497. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  5498. {
  5499. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  5500. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  5501. (e.y = (e.y >= 0.500000f));
  5502. (e.x = ((er1 * er2) - e.y));
  5503. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  5504. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  5505. (e.w = (e.w >= 0.500000f));
  5506. (e.z = ((eb1 * eb2) - e.w));
  5507. return e;
  5508. }
  5509. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  5510. {
  5511. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  5512. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  5513. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  5514. {
  5515. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  5516. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  5517. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  5518. }
  5519. return coord.zw;
  5520. }
  5521. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  5522. {
  5523. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  5524. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  5525. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  5526. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  5527. {
  5528. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  5529. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  5530. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  5531. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  5532. }
  5533. return coord.zw;
  5534. }
  5535. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  5536. {
  5537. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  5538. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  5539. (texcoord.x += 0.500000f);
  5540. (texcoord.y += (0.142857f * offset));
  5541. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  5542. }
  5543. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  5544. {
  5545. float2 weights = float2(0.000000f, 0.000000f);
  5546. float4 d;
  5547. float2 end;
  5548. if ((e.x > 0.000000f))
  5549. {
  5550. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  5551. (d.x += float((end.y > 0.900000f)));
  5552. }
  5553. else
  5554. (d.xz = float2(0.000000f, 0.000000f));
  5555. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  5556. [branch]if (((d.x - 2.000000f) > -d.y))
  5557. {
  5558. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  5559. float4 c;
  5560. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  5561. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  5562. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  5563. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  5564. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  5565. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  5566. }
  5567. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  5568. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  5569. {
  5570. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  5571. (d.y += float((end.y > 0.900000f)));
  5572. }
  5573. else
  5574. (d.yw = float2(0.000000f, 0.000000f));
  5575. [branch]if (((d.x - 2.000000f) > -d.y))
  5576. {
  5577. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  5578. float4 c;
  5579. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  5580. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  5581. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  5582. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  5583. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  5584. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  5585. }
  5586. return weights;
  5587. }
  5588. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  5589. {
  5590. float2 scale = float2(33.000000f, -33.000000f);
  5591. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  5592. (scale += float2(-1.000000f, 1.000000f));
  5593. (bias += float2(0.500000f, -0.500000f));
  5594. (scale *= float2(0.015625f, 0.062500f));
  5595. (bias *= float2(0.015625f, 0.062500f));
  5596. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  5597. }
  5598. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5599. {
  5600. float2 e = float2(0.000000f, 1.000000f);
  5601. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  5602. {
  5603. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5604. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  5605. }
  5606. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  5607. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  5608. }
  5609. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5610. {
  5611. float2 e = float2(0.000000f, 1.000000f);
  5612. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  5613. {
  5614. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5615. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  5616. }
  5617. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  5618. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  5619. }
  5620. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5621. {
  5622. float2 e = float2(1.000000f, 0.000000f);
  5623. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  5624. {
  5625. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5626. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  5627. }
  5628. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  5629. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  5630. }
  5631. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  5632. {
  5633. float2 e = float2(1.000000f, 0.000000f);
  5634. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  5635. {
  5636. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  5637. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  5638. }
  5639. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  5640. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  5641. }
  5642. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  5643. {
  5644. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  5645. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  5646. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  5647. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  5648. }
  5649. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  5650. {
  5651. float2 leftRight = step(d.xy, d.yx);
  5652. float2 rounding = (1.000000f * leftRight);
  5653. (rounding /= (leftRight.x + leftRight.y));
  5654. float2 factor = float2(1.000000f, 1.000000f);
  5655. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5656. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5657. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5658. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  5659. (weights *= saturate(factor));
  5660. }
  5661. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  5662. {
  5663. float2 leftRight = step(d.xy, d.yx);
  5664. float2 rounding = (1.000000f * leftRight);
  5665. (rounding /= (leftRight.x + leftRight.y));
  5666. float2 factor = float2(1.000000f, 1.000000f);
  5667. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5668. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5669. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5670. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  5671. (weights *= saturate(factor));
  5672. }
  5673. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  5674. {
  5675. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  5676. float2 e = __tex2D(edgesTex, texcoord).xy;
  5677. [branch]if ((e.y > 0.000000f))
  5678. {
  5679. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  5680. [branch]if ((weights.x == -weights.y))
  5681. {
  5682. float2 d;
  5683. float3 coords;
  5684. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  5685. (coords.y = offset[1].y);
  5686. (d.x = coords.x);
  5687. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  5688. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  5689. (d.y = coords.z);
  5690. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  5691. float2 sqrt_d = sqrt(d);
  5692. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  5693. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  5694. (coords.y = texcoord.y);
  5695. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  5696. }
  5697. else
  5698. (e.x = 0.000000f);
  5699. }
  5700. [branch]if ((e.x > 0.000000f))
  5701. {
  5702. float2 d;
  5703. float3 coords;
  5704. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  5705. (coords.x = offset[0].x);
  5706. (d.x = coords.y);
  5707. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  5708. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  5709. (d.y = coords.z);
  5710. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  5711. float2 sqrt_d = sqrt(d);
  5712. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  5713. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  5714. (coords.x = texcoord.x);
  5715. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  5716. }
  5717. return weights;
  5718. }
  5719. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  5720. {
  5721. float4 a;
  5722. (a.x = __tex2D(blendTex, offset.xy).w);
  5723. (a.y = __tex2D(blendTex, offset.zw).y);
  5724. (a.wz = __tex2D(blendTex, texcoord).xz);
  5725. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  5726. {
  5727. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  5728. return color;
  5729. }
  5730. else
  5731. {
  5732. bool h = (max(a.x, a.z) > max(a.y, a.w));
  5733. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  5734. float2 blendingWeight = a.yw;
  5735. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  5736. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  5737. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  5738. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  5739. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  5740. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  5741. return color;
  5742. }
  5743. }
  5744. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  5745. {
  5746. float4 current = __tex2D(currentColorTex, texcoord);
  5747. float4 previous = __tex2D(previousColorTex, texcoord);
  5748. return lerp(current, previous, 0.500000f);
  5749. }
  5750. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  5751. {
  5752. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  5753. return FinalColor;
  5754. }
  5755. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  5756. {
  5757. _NSRFX_VS_PostProcess(id, position, texcoord);
  5758. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  5759. }
  5760. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  5761. {
  5762. _NSRFX_VS_PostProcess(id, position, texcoord);
  5763. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  5764. }
  5765. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  5766. {
  5767. _NSRFX_VS_PostProcess(id, position, texcoord);
  5768. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  5769. }
  5770. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  5771. {
  5772. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  5773. }
  5774. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  5775. {
  5776. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  5777. }
  5778. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  5779. {
  5780. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  5781. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  5782. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  5783. return color.xyz;
  5784. }
  5785. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  5786. {
  5787. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  5788. }
  5789.  
  5790.  
  5791. 08/08/2015 09:24:07:749 [07460] | TRACE | > Compiling shader 'DisplayDepth':
  5792.  
  5793. struct __sampler2D { Texture2D t; SamplerState s; };
  5794. inline float4 __tex2D(__sampler2D s, float2 c) { return s.t.Sample(s.s, c); }
  5795. inline float4 __tex2Dfetch(__sampler2D s, int4 c) { return s.t.Load(c.xyw); }
  5796. inline float4 __tex2Dgrad(__sampler2D s, float2 c, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, c, ddx, ddy); }
  5797. inline float4 __tex2Dlod(__sampler2D s, float4 c) { return s.t.SampleLevel(s.s, c.xy, c.w); }
  5798. inline float4 __tex2Dlodoffset(__sampler2D s, float4 c, int2 offset) { return s.t.SampleLevel(s.s, c.xy, c.w, offset); }
  5799. inline float4 __tex2Doffset(__sampler2D s, float2 c, int2 offset) { return s.t.Sample(s.s, c, offset); }
  5800. inline float4 __tex2Dproj(__sampler2D s, float4 c) { return s.t.Sample(s.s, c.xy / c.w); }
  5801. inline int2 __tex2Dsize(__sampler2D s, int lod) { uint w, h, l; s.t.GetDimensions(lod, w, h, l); return int2(w, h); }
  5802. inline float4 __tex2Dgather0(__sampler2D s, float2 c) { return s.t.Gather(s.s, c); }
  5803. inline float4 __tex2Dgather0offset(__sampler2D s, float2 c, int2 offset) { return s.t.Gather(s.s, c, offset); }
  5804. inline float4 __tex2Dgather1(__sampler2D s, float2 c) { return s.t.GatherGreen(s.s, c); }
  5805. inline float4 __tex2Dgather1offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherGreen(s.s, c, offset); }
  5806. inline float4 __tex2Dgather2(__sampler2D s, float2 c) { return s.t.GatherBlue(s.s, c); }
  5807. inline float4 __tex2Dgather2offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherBlue(s.s, c, offset); }
  5808. inline float4 __tex2Dgather3(__sampler2D s, float2 c) { return s.t.GatherAlpha(s.s, c); }
  5809. inline float4 __tex2Dgather3offset(__sampler2D s, float2 c, int2 offset) { return s.t.GatherAlpha(s.s, c, offset); }
  5810. cbuffer __GLOBAL__ : register(b0)
  5811. {
  5812. extern uniform float _NSRFX_timer;
  5813. extern uniform float _NSRFX_timeleft;
  5814. extern uniform float _NSRFX_frametime;
  5815. };
  5816. Texture2D _NSRFX_depthBufferTex : register(t0), ___NSRFX_depthBufferTexSRGB : register(t1);
  5817. Texture2D _NSRFX_backbufferTex : register(t2), ___NSRFX_backbufferTexSRGB : register(t3);
  5818. Texture2D _NSRFX_originalTex : register(t4), ___NSRFX_originalTexSRGB : register(t5);
  5819. Texture2D _NSRFX_depthTex : register(t6), ___NSRFX_depthTexSRGB : register(t7);
  5820. Texture2D _NSRFX_depthTexPing : register(t8), ___NSRFX_depthTexPingSRGB : register(t9);
  5821. SamplerState __SamplerState0 : register(s0);
  5822. static const __sampler2D _NSRFX_depthColor = { _NSRFX_depthBufferTex, __SamplerState0 };
  5823. static const __sampler2D _NSRFX_backbufferColor = { _NSRFX_backbufferTex, __SamplerState0 };
  5824. static const __sampler2D _NSRFX_originalColor = { _NSRFX_originalTex, __SamplerState0 };
  5825. static const __sampler2D _NSRFX_depthTexColor = { _NSRFX_depthTex, __SamplerState0 };
  5826. static const __sampler2D _NSRFX_depthTexPingColor = { _NSRFX_depthTexPing, __SamplerState0 };
  5827. Texture2D _NSMFX_NStexHDR1 : register(t10), ___NSMFX_NStexHDR1SRGB : register(t11);
  5828. Texture2D _NSMFX_NStexHDR2 : register(t12), ___NSMFX_NStexHDR2SRGB : register(t13);
  5829. SamplerState __SamplerState1 : register(s1);
  5830. static const __sampler2D _NSMFX_NSSamplerHDR1 = { _NSMFX_NStexHDR1, __SamplerState1 };
  5831. static const __sampler2D _NSMFX_NSSamplerHDR2 = { _NSMFX_NStexHDR2, __SamplerState1 };
  5832. Texture2D _NSSFX_NSedgesTex : register(t14), ___NSSFX_NSedgesTexSRGB : register(t15);
  5833. Texture2D _NSSFX_NSblendTex : register(t16), ___NSSFX_NSblendTexSRGB : register(t17);
  5834. Texture2D _NSSFX_NSareaTex : register(t18), ___NSSFX_NSareaTexSRGB : register(t19);
  5835. Texture2D _NSSFX_NSsearchTex : register(t20), ___NSSFX_NSsearchTexSRGB : register(t21);
  5836. SamplerState __SamplerState2 : register(s2);
  5837. static const __sampler2D _NSSFX_NScolorLinearSampler = { ___NSRFX_backbufferTexSRGB, __SamplerState2 };
  5838. SamplerState __SamplerState3 : register(s3);
  5839. static const __sampler2D _NSSFX_NSBorderSampler = { _NSRFX_backbufferTex, __SamplerState3 };
  5840. SamplerState __SamplerState4 : register(s4);
  5841. static const __sampler2D _NSSFX_NSedgesSampler = { _NSSFX_NSedgesTex, __SamplerState4 };
  5842. static const __sampler2D _NSSFX_NSblendSampler = { _NSSFX_NSblendTex, __SamplerState4 };
  5843. static const __sampler2D _NSSFX_NSareaSampler = { _NSSFX_NSareaTex, __SamplerState4 };
  5844. SamplerState __SamplerState5 : register(s5);
  5845. static const __sampler2D _NSSFX_NSsearchSampler = { _NSSFX_NSsearchTex, __SamplerState5 };
  5846. void _NSRFX_VS_PostProcess(in uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 texcoord : TEXCOORD)
  5847. {
  5848. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  5849. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  5850. (pos = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  5851. }
  5852. void _NSRFX_CalcDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET0)
  5853. {
  5854. float depth = __tex2D(_NSRFX_depthColor, texcoord).x;
  5855. (depth = (1 / ((depth * -998.999939f) + 999.999939f)));
  5856. (color.xyz = float3(depth.xxx));
  5857. }
  5858. void _NSRFX_StoreDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float4 depthTexR : SV_TARGET0)
  5859. {
  5860. float4 colorInput = __tex2D(_NSRFX_depthTexPingColor, texcoord);
  5861. float2 tex = texcoord;
  5862. float3 color = colorInput.xyz;
  5863. float dither_bit = 8.000000f;
  5864. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  5865. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  5866. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  5867. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  5868. (color.xyz += dither_shift_RGB);
  5869. (colorInput.xyz = color.xyz);
  5870. (depthTexR = colorInput);
  5871. }
  5872. float _NSMFX_NSGetLinearDepth(in float depth)
  5873. {
  5874. return (1 / ((depth * -998.999939f) + 999.999939f));
  5875. }
  5876. void _NSMFX_NSPS_Init(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD, out float4 hdrT : SV_TARGET0)
  5877. {
  5878. (hdrT = __tex2D(_NSRFX_originalColor, texcoord.xy));
  5879. }
  5880. float4 _NSMFX_NSPS_Overlay(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
  5881. {
  5882. float4 color = __tex2D(_NSMFX_NSSamplerHDR2, texcoord.xy);
  5883. return color;
  5884. }
  5885. float4 _NSSFX_NSDitherPass(in float4 colorInput, in float2 tex)
  5886. {
  5887. float3 color = colorInput.xyz;
  5888. float dither_bit = 8.000000f;
  5889. float grid_position = frac((dot(tex, float2(120.000000f, 333.333344f)) + 0.250000f));
  5890. float dither_shift = (0.250000f * (1.000000f / (pow(2, dither_bit) - 1.000000f)));
  5891. float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift);
  5892. (dither_shift_RGB = lerp((2.000000f * dither_shift_RGB), (-2.000000f * dither_shift_RGB), grid_position));
  5893. (color.xyz += dither_shift_RGB);
  5894. (colorInput.xyz = color.xyz);
  5895. return colorInput;
  5896. }
  5897. float3 _NSSFX_NSSMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in __sampler2D tex)
  5898. {
  5899. float P = __tex2D(tex, texcoord).x;
  5900. float Pleft = __tex2D(tex, offset[0].xy).x;
  5901. float Ptop = __tex2D(tex, offset[0].zw).x;
  5902. return float3(P, Pleft, Ptop);
  5903. }
  5904. float2 _NSSFX_NSSMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in __sampler2D predicationTex)
  5905. {
  5906. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, predicationTex);
  5907. float2 delta = abs((neighbours.xx - neighbours.yz));
  5908. float2 edges = step(0.001000f, delta);
  5909. return (0.200000f * (1.000000f - (0.400000f * edges)));
  5910. }
  5911. void _NSSFX_NSSMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  5912. {
  5913. [flatten]if (cond.x)
  5914. (variable.x = value.x);
  5915. [flatten]if (cond.y)
  5916. (variable.y = value.y);
  5917. }
  5918. void _NSSFX_NSSMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  5919. {
  5920. _NSSFX_NSSMAAMovc(cond.xy, variable.xy, value.xy);
  5921. _NSSFX_NSSMAAMovc(cond.zw, variable.zw, value.zw);
  5922. }
  5923. void _NSSFX_NSSMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  5924. {
  5925. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  5926. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  5927. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  5928. }
  5929. void _NSSFX_NSSMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  5930. {
  5931. (pixcoord = (texcoord * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zw));
  5932. (offset[0] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  5933. (offset[1] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  5934. (offset[2] = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xxyy) * (float4(-196.000000f, 196.000000f, -196.000000f, 196.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  5935. }
  5936. void _NSSFX_NSSMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  5937. {
  5938. (offset = ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  5939. }
  5940. float2 _NSSFX_NSSMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  5941. {
  5942. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  5943. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  5944. float L = dot(__tex2D(colorTex, texcoord).xyz, weights);
  5945. float Lleft = dot(__tex2D(colorTex, offset[0].xy).xyz, weights);
  5946. float Ltop = dot(__tex2D(colorTex, offset[0].zw).xyz, weights);
  5947. float4 delta;
  5948. (delta.xy = abs((L - float2(Lleft, Ltop))));
  5949. float2 edges = step(threshold, delta.xy);
  5950. if ((abs(edges.x) == -abs(edges.y)))
  5951. {
  5952. discard;
  5953. }
  5954. else
  5955. {
  5956. float Lright = dot(__tex2D(colorTex, offset[1].xy).xyz, weights);
  5957. float Lbottom = dot(__tex2D(colorTex, offset[1].zw).xyz, weights);
  5958. (delta.zw = abs((L - float2(Lright, Lbottom))));
  5959. float2 maxDelta = max(delta.xy, delta.zw);
  5960. float Lleftleft = dot(__tex2D(colorTex, offset[2].xy).xyz, weights);
  5961. float Ltoptop = dot(__tex2D(colorTex, offset[2].zw).xyz, weights);
  5962. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  5963. (maxDelta = max(maxDelta.xy, delta.zw));
  5964. float finalDelta = max(maxDelta.x, maxDelta.y);
  5965. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  5966. }
  5967. return edges;
  5968. }
  5969. float2 _NSSFX_NSSMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D colorTex, in __sampler2D predicationTex)
  5970. {
  5971. float2 threshold = _NSSFX_NSSMAACalculatePredicatedThreshold(texcoord, offset, predicationTex);
  5972. float4 delta;
  5973. float3 C = __tex2D(colorTex, texcoord).xyz;
  5974. float3 Cleft = __tex2D(colorTex, offset[0].xy).xyz;
  5975. float3 t = abs((C - Cleft));
  5976. (delta.x = max(max(t.x, t.y), t.z));
  5977. float3 Ctop = __tex2D(colorTex, offset[0].zw).xyz;
  5978. (t = abs((C - Ctop)));
  5979. (delta.y = max(max(t.x, t.y), t.z));
  5980. float2 edges = step(threshold, delta.xy);
  5981. if ((abs(edges.x) == -abs(edges.y)))
  5982. {
  5983. discard;
  5984. }
  5985. else
  5986. {
  5987. float3 Cright = __tex2D(colorTex, offset[1].xy).xyz;
  5988. (t = abs((C - Cright)));
  5989. (delta.z = max(max(t.x, t.y), t.z));
  5990. float3 Cbottom = __tex2D(colorTex, offset[1].zw).xyz;
  5991. (t = abs((C - Cbottom)));
  5992. (delta.w = max(max(t.x, t.y), t.z));
  5993. float2 maxDelta = max(delta.xy, delta.zw);
  5994. float3 Cleftleft = __tex2D(colorTex, offset[2].xy).xyz;
  5995. (t = abs((C - Cleftleft)));
  5996. (delta.z = max(max(t.x, t.y), t.z));
  5997. float3 Ctoptop = __tex2D(colorTex, offset[2].zw).xyz;
  5998. (t = abs((C - Ctoptop)));
  5999. (delta.w = max(max(t.x, t.y), t.z));
  6000. (maxDelta = max(maxDelta.xy, delta.zw));
  6001. float finalDelta = max(maxDelta.x, maxDelta.y);
  6002. (edges.xy *= step(finalDelta, (delta.xy * 2.000000f)));
  6003. }
  6004. return edges;
  6005. }
  6006. float2 _NSSFX_NSSMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in __sampler2D depthTex)
  6007. {
  6008. float3 neighbours = _NSSFX_NSSMAAGatherNeighbours(texcoord, offset, depthTex);
  6009. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  6010. float2 edges = step(0.010000f, delta);
  6011. if ((abs(edges.x) == -abs(edges.y)))
  6012. discard;
  6013. return edges;
  6014. }
  6015. float2 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float2 e)
  6016. {
  6017. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  6018. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  6019. (e.y = (e.y >= 0.500000f));
  6020. (e.x = ((er1 * er2) - e.y));
  6021. return e;
  6022. }
  6023. float4 _NSSFX_NSSMAADecodeDiagBilinearAccess(in float4 e)
  6024. {
  6025. float er1 = ((e.x < 0.125000f) ? 0.000000f : 1.000000f);
  6026. float er2 = ((e.x > 0.875000f) ? 2.000000f : 1.000000f);
  6027. (e.y = (e.y >= 0.500000f));
  6028. (e.x = ((er1 * er2) - e.y));
  6029. float eb1 = ((e.z < 0.125000f) ? 0.000000f : 1.000000f);
  6030. float eb2 = ((e.z > 0.875000f) ? 2.000000f : 1.000000f);
  6031. (e.w = (e.w >= 0.500000f));
  6032. (e.z = ((eb1 * eb2) - e.w));
  6033. return e;
  6034. }
  6035. float2 _NSSFX_NSSMAASearchDiag1(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  6036. {
  6037. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  6038. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  6039. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  6040. {
  6041. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  6042. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  6043. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  6044. }
  6045. return coord.zw;
  6046. }
  6047. float2 _NSSFX_NSSMAASearchDiag2(in __sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  6048. {
  6049. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  6050. (coord.x += (0.250000f * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x));
  6051. float3 t = float3(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, 1.000000f);
  6052. while (((coord.z < 15.000000f) && (coord.w > 0.900000f)))
  6053. {
  6054. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  6055. (e = __tex2Dlod(edgesTex, float4(coord.xy, coord.xy)).xy);
  6056. (e = _NSSFX_NSSMAADecodeDiagBilinearAccess(e));
  6057. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  6058. }
  6059. return coord.zw;
  6060. }
  6061. float2 _NSSFX_NSSMAAAreaDiag(in __sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  6062. {
  6063. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  6064. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  6065. (texcoord.x += 0.500000f);
  6066. (texcoord.y += (0.142857f * offset));
  6067. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  6068. }
  6069. float2 _NSSFX_NSSMAACalculateDiagWeights(in __sampler2D edgesTex, in __sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  6070. {
  6071. float2 weights = float2(0.000000f, 0.000000f);
  6072. float4 d;
  6073. float2 end;
  6074. if ((e.x > 0.000000f))
  6075. {
  6076. (d.xz = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  6077. (d.x += float((end.y > 0.900000f)));
  6078. }
  6079. else
  6080. (d.xz = float2(0.000000f, 0.000000f));
  6081. (d.yw = _NSSFX_NSSMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  6082. [branch]if (((d.x - 2.000000f) > -d.y))
  6083. {
  6084. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  6085. float4 c;
  6086. (c.xy = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  6087. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).xy);
  6088. (c.yxwz = _NSSFX_NSSMAADecodeDiagBilinearAccess(c.xyzw));
  6089. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  6090. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  6091. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  6092. }
  6093. (d.xz = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  6094. if ((__tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x > 0.000000f))
  6095. {
  6096. (d.yw = _NSSFX_NSSMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  6097. (d.y += float((end.y > 0.900000f)));
  6098. }
  6099. else
  6100. (d.yw = float2(0.000000f, 0.000000f));
  6101. [branch]if (((d.x - 2.000000f) > -d.y))
  6102. {
  6103. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xyxy) + (texcoord.xyxy));
  6104. float4 c;
  6105. (c.x = __tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y);
  6106. (c.y = __tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xy + (int2(0, -1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x);
  6107. (c.zw = __tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zw + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).yx);
  6108. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  6109. _NSSFX_NSSMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  6110. (weights += _NSSFX_NSSMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  6111. }
  6112. return weights;
  6113. }
  6114. float _NSSFX_NSSMAASearchLength(in __sampler2D searchTex, in float2 e, in float offset)
  6115. {
  6116. float2 scale = float2(33.000000f, -33.000000f);
  6117. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  6118. (scale += float2(-1.000000f, 1.000000f));
  6119. (bias += float2(0.500000f, -0.500000f));
  6120. (scale *= float2(0.015625f, 0.062500f));
  6121. (bias *= float2(0.015625f, 0.062500f));
  6122. return __tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), ((scale) * (e) + (bias)))).x;
  6123. }
  6124. float _NSSFX_NSSMAASearchXLeft(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  6125. {
  6126. float2 e = float2(0.000000f, 1.000000f);
  6127. while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  6128. {
  6129. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  6130. (texcoord.x = ((-2.000000f) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) + (texcoord.x)));
  6131. }
  6132. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  6133. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  6134. }
  6135. float _NSSFX_NSSMAASearchXRight(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  6136. {
  6137. float2 e = float2(0.000000f, 1.000000f);
  6138. while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  6139. {
  6140. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  6141. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  6142. }
  6143. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  6144. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).x) * (offset) + (texcoord.x));
  6145. }
  6146. float _NSSFX_NSSMAASearchYUp(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  6147. {
  6148. float2 e = float2(1.000000f, 0.000000f);
  6149. while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  6150. {
  6151. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  6152. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  6153. }
  6154. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  6155. return ((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  6156. }
  6157. float _NSSFX_NSSMAASearchYDown(in __sampler2D edgesTex, in __sampler2D searchTex, in float2 texcoord, in float end)
  6158. {
  6159. float2 e = float2(1.000000f, 0.000000f);
  6160. while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  6161. {
  6162. (e = __tex2Dlod(edgesTex, float4(texcoord, texcoord)).xy);
  6163. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy) + (texcoord)));
  6164. }
  6165. float offset = ((-2.007874f) * (_NSSFX_NSSMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  6166. return ((-float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).y) * (offset) + (texcoord.y));
  6167. }
  6168. float2 _NSSFX_NSSMAAArea(in __sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  6169. {
  6170. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  6171. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  6172. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  6173. return __tex2Dlod(areaTex, float4(texcoord, texcoord)).xy;
  6174. }
  6175. void _NSSFX_NSSMAADetectHorizontalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  6176. {
  6177. float2 leftRight = step(d.xy, d.yx);
  6178. float2 rounding = (1.000000f * leftRight);
  6179. (rounding /= (leftRight.x + leftRight.y));
  6180. float2 factor = float2(1.000000f, 1.000000f);
  6181. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  6182. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  6183. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  6184. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x));
  6185. (weights *= saturate(factor));
  6186. }
  6187. void _NSSFX_NSSMAADetectVerticalCornerPattern(in __sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  6188. {
  6189. float2 leftRight = step(d.xy, d.yx);
  6190. float2 rounding = (1.000000f * leftRight);
  6191. (rounding /= (leftRight.x + leftRight.y));
  6192. float2 factor = float2(1.000000f, 1.000000f);
  6193. (factor.x -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  6194. (factor.x -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  6195. (factor.y -= (rounding.x * __tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  6196. (factor.y -= (rounding.y * __tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y));
  6197. (weights *= saturate(factor));
  6198. }
  6199. float4 _NSSFX_NSSMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in __sampler2D edgesTex, in __sampler2D areaTex, in __sampler2D searchTex, in float4 subsampleIndices)
  6200. {
  6201. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  6202. float2 e = __tex2D(edgesTex, texcoord).xy;
  6203. [branch]if ((e.y > 0.000000f))
  6204. {
  6205. (weights.xy = _NSSFX_NSSMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  6206. [branch]if ((weights.x == -weights.y))
  6207. {
  6208. float2 d;
  6209. float3 coords;
  6210. (coords.x = _NSSFX_NSSMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  6211. (coords.y = offset[1].y);
  6212. (d.x = coords.x);
  6213. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).x;
  6214. (coords.z = _NSSFX_NSSMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  6215. (d.y = coords.z);
  6216. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).zz) * (d) + (-pixcoord.xx)))));
  6217. float2 sqrt_d = sqrt(d);
  6218. float e2 = __tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.zy + (int2(1, 0) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).x;
  6219. (weights.xy = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  6220. (coords.y = texcoord.y);
  6221. _NSSFX_NSSMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  6222. }
  6223. else
  6224. (e.x = 0.000000f);
  6225. }
  6226. [branch]if ((e.x > 0.000000f))
  6227. {
  6228. float2 d;
  6229. float3 coords;
  6230. (coords.y = _NSSFX_NSSMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  6231. (coords.x = offset[0].x);
  6232. (d.x = coords.y);
  6233. float e1 = __tex2Dlod(edgesTex, float4(coords.xy, coords.xy)).y;
  6234. (coords.z = _NSSFX_NSSMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  6235. (d.y = coords.z);
  6236. (d = abs(round(((float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).ww) * (d) + (-pixcoord.yy)))));
  6237. float2 sqrt_d = sqrt(d);
  6238. float e2 = __tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)), (coords.xz + (int2(0, 1) * float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)))).y;
  6239. (weights.zw = _NSSFX_NSSMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  6240. (coords.x = texcoord.x);
  6241. _NSSFX_NSSMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  6242. }
  6243. return weights;
  6244. }
  6245. float4 _NSSFX_NSSMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in __sampler2D colorTex, in __sampler2D blendTex)
  6246. {
  6247. float4 a;
  6248. (a.x = __tex2D(blendTex, offset.xy).w);
  6249. (a.y = __tex2D(blendTex, offset.zw).y);
  6250. (a.wz = __tex2D(blendTex, texcoord).xz);
  6251. [branch]if ((((a.x + a.z) + (a.y + a.w)) < 0.000010f))
  6252. {
  6253. float4 color = __tex2Dlod(colorTex, float4(texcoord, texcoord));
  6254. return color;
  6255. }
  6256. else
  6257. {
  6258. bool h = (max(a.x, a.z) > max(a.y, a.w));
  6259. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  6260. float2 blendingWeight = a.yw;
  6261. _NSSFX_NSSMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  6262. _NSSFX_NSSMAAMovc(bool2(h, h), blendingWeight, a.xz);
  6263. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  6264. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy, -float4(0.000521f, 0.000833f, 1920.000000f, 1200.000000f).xy)) + (texcoord.xyxy));
  6265. float4 color = (blendingWeight.x * __tex2Dlod(colorTex, float4(blendingCoord.xy, blendingCoord.xy)));
  6266. (color += (blendingWeight.y * __tex2Dlod(colorTex, float4(blendingCoord.zw, blendingCoord.zw))));
  6267. return color;
  6268. }
  6269. }
  6270. float4 _NSSFX_NSSMAAResolvePS(in float2 texcoord, in __sampler2D currentColorTex, in __sampler2D previousColorTex)
  6271. {
  6272. float4 current = __tex2D(currentColorTex, texcoord);
  6273. float4 previous = __tex2D(previousColorTex, texcoord);
  6274. return lerp(current, previous, 0.500000f);
  6275. }
  6276. float4 _NSSFX_NSSharedPass(in float2 tex, in float4 FinalColor)
  6277. {
  6278. (FinalColor = _NSSFX_NSDitherPass(FinalColor, tex));
  6279. return FinalColor;
  6280. }
  6281. void _NSSFX_NSSMAAEdgeDetectionVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
  6282. {
  6283. _NSRFX_VS_PostProcess(id, position, texcoord);
  6284. _NSSFX_NSSMAAEdgeDetectionVS(texcoord, offset);
  6285. }
  6286. void _NSSFX_NSSMAABlendingWeightCalculationVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
  6287. {
  6288. _NSRFX_VS_PostProcess(id, position, texcoord);
  6289. _NSSFX_NSSMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  6290. }
  6291. void _NSSFX_NSSMAANeighborhoodBlendingVSWrap(in uint id : SV_VERTEXID, out float4 position : SV_POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  6292. {
  6293. _NSRFX_VS_PostProcess(id, position, texcoord);
  6294. _NSSFX_NSSMAANeighborhoodBlendingVS(texcoord, offset);
  6295. }
  6296. float2 _NSSFX_NSSMAAColorEdgeDetectionPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset[3] : TEXCOORD1) : SV_TARGET
  6297. {
  6298. return _NSSFX_NSSMAAColorEdgeDetectionPS(texcoord, offset, _NSRFX_backbufferColor, _NSRFX_depthColor).xy;
  6299. }
  6300. float4 _NSSFX_NSSMAABlendingWeightCalculationPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset[3] : TEXCOORD2) : SV_TARGET
  6301. {
  6302. return _NSSFX_NSSMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, _NSSFX_NSedgesSampler, _NSSFX_NSareaSampler, _NSSFX_NSsearchSampler, 0.000000f);
  6303. }
  6304. float3 _NSSFX_NSSMAANeighborhoodBlendingPSWrap(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : SV_TARGET
  6305. {
  6306. float3 color = _NSSFX_NSSMAANeighborhoodBlendingPS(texcoord, offset, _NSSFX_NScolorLinearSampler, _NSSFX_NSblendSampler).xyz;
  6307. (color.xyz = ((color.xyz <= 0.003131f) ? saturate((abs(color.xyz) * 12.920000f)) : ((1.055000f * saturate(pow(abs(color.xyz), 0.416667f))) - 0.055000f)));
  6308. (color.xyz = _NSSFX_NSSharedPass(texcoord, float4(color.xyzz)).xyz);
  6309. return color.xyz;
  6310. }
  6311. void _NSRFX_NSDisplayDepth(in float4 position : SV_POSITION, in float2 texcoord : TEXCOORD0, out float3 color : SV_TARGET)
  6312. {
  6313. (color.xyz = __tex2D(_NSRFX_depthTexColor, texcoord).xyz);
  6314. }
  6315.  
  6316.  
  6317. 08/08/2015 09:24:07:756 [07460] | INFO | > Successfully compiled effect.
  6318. 08/08/2015 09:24:26:640 [07460] | TRACE | Installing hook for '0x6C31A500' with '0x60F1C2F0' using method 2 ...
  6319. 08/08/2015 09:24:26:640 [07460] | TRACE | > Succeeded.
  6320. 08/08/2015 09:24:28:819 [07460] | TRACE | Adding depthstencil 0D52A3F8 (Width: 1920, Height: 1200, Format: 45) to list of possible depth candidates ...
  6321. 08/08/2015 09:24:29:013 [07460] | TRACE | Switched depth source to depthstencil 0D52A3F8.
  6322. 08/08/2015 09:25:08:922 [07460] | TRACE | Adding depthstencil 0D528F38 (Width: 1920, Height: 1200, Format: 45) to list of possible depth candidates ...
  6323. 08/08/2015 09:25:08:922 [07460] | TRACE | Removing depthstencil 0D528F38 from list of possible depth candidates ...
  6324. 08/08/2015 09:25:08:922 [07460] | INFO | Redirecting 'IDXGISwapChain::SetFullscreenState(0805B9D8, FALSE, 00000000)' ...
  6325. 08/08/2015 09:25:08:922 [07460] | INFO | Destroyed effect environment on runtime 08074AF0.
  6326. 08/08/2015 09:25:08:923 [07460] | TRACE | Removing depthstencil 0D52A3F8 from list of possible depth candidates ...
  6327. 08/08/2015 09:25:08:923 [07460] | WARN | Reference count for 'IDXGISwapChain' object 0805B9D8 is inconsistent: 1 vs 0.
  6328. 08/08/2015 09:25:08:923 [07460] | TRACE | Destroyed 'IDXGISwapChain' object 0805B9D8.
  6329. 08/08/2015 09:25:08:923 [07460] | TRACE | Destroyed 'IDXGISwapChain' object 0805B9D8.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement