Advertisement
Guest User

REMEMBER ME SSAA OFF

a guest
Dec 28th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 273.58 KB | None | 0 0
  1. 28/12/2014 19:25:19,376 | INFO | Initializing Crosire's ReShade version '0.10.0.597' built on '2014-12-24 12:08:39' loaded from "G:\Program Files (x86)\Remember Me\Binaries\Win32\d3d9.dll" to "G:\Program Files (x86)\Remember Me\Binaries\Win32\RememberMe.exe" ...
  2. 28/12/2014 19:25:19,376 | TRACE | Installing hook for '0x764349A7' with '0x69AA6E30' using method 1 ...
  3. 28/12/2014 19:25:19,376 | TRACE | > Succeeded.
  4. 28/12/2014 19:25:19,376 | TRACE | Installing hook for '0x764348FB' with '0x69AA7270' using method 1 ...
  5. 28/12/2014 19:25:19,376 | TRACE | > Succeeded.
  6. 28/12/2014 19:25:19,376 | INFO | Registering hooks for "C:\Windows\system32\d3d8.dll" ...
  7. 28/12/2014 19:25:19,391 | INFO | > Delayed.
  8. 28/12/2014 19:25:19,391 | INFO | Registering hooks for "C:\Windows\system32\d3d9.dll" ...
  9. 28/12/2014 19:25:19,391 | INFO | > Libraries loaded.
  10. 28/12/2014 19:25:19,391 | TRACE | > Analyzing export table:
  11. 28/12/2014 19:25:19,391 | TRACE | +--------------------+---------+----------------------------------------------------+
  12. 28/12/2014 19:25:19,391 | TRACE | | Address | Ordinal | Name |
  13. 28/12/2014 19:25:19,391 | TRACE | +--------------------+---------+----------------------------------------------------+
  14. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A6571DB | 4 | D3DPERF_BeginEvent | <
  15. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A657249 | 5 | D3DPERF_EndEvent | <
  16. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A65746D | 6 | D3DPERF_GetStatus | <
  17. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A65738D | 7 | D3DPERF_QueryRepeatFrame | <
  18. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A6572B5 | 8 | D3DPERF_SetMarker | <
  19. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A657402 | 9 | D3DPERF_SetOptions | <
  20. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A657321 | 10 | D3DPERF_SetRegion | <
  21. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A6588B1 | 11 | DebugSetLevel |
  22. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A5E66C6 | 12 | DebugSetMute |
  23. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A610A62 | 13 | Direct3DCreate9 | <
  24. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A5BCCD5 | 14 | Direct3DCreate9Ex | <
  25. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A5EF5AF | 1 | Direct3DShaderValidatorCreate9 |
  26. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A64D77B | 2 | PSGPError |
  27. 28/12/2014 19:25:19,391 | TRACE | | 0x000000006A64D709 | 3 | PSGPSampleTexture |
  28. 28/12/2014 19:25:19,391 | TRACE | +--------------------+---------+----------------------------------------------------+
  29. 28/12/2014 19:25:19,391 | INFO | > Found 9 match(es). Installing ...
  30. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A6571DB' with '0x69AC0C30' using method 0 ...
  31. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  32. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A657249' with '0x69AC0C40' using method 0 ...
  33. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  34. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A65746D' with '0x69AC0C40' using method 0 ...
  35. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  36. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A65738D' with '0x69AC0C40' using method 0 ...
  37. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  38. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A6572B5' with '0x69AACDE0' using method 0 ...
  39. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  40. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A657402' with '0x69AB0BF0' using method 0 ...
  41. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  42. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A657321' with '0x69AACDE0' using method 0 ...
  43. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  44. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A610A62' with '0x69AC0C50' using method 0 ...
  45. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  46. 28/12/2014 19:25:19,391 | TRACE | Installing hook for '0x6A5BCCD5' with '0x69AC0E90' using method 0 ...
  47. 28/12/2014 19:25:19,391 | TRACE | > Succeeded.
  48. 28/12/2014 19:25:19,391 | INFO | > Installed 9 hook(s).
  49. 28/12/2014 19:25:19,407 | INFO | Registering hooks for "C:\Windows\system32\d3d10.dll" ...
  50. 28/12/2014 19:25:19,407 | INFO | > Delayed.
  51. 28/12/2014 19:25:19,407 | INFO | Registering hooks for "C:\Windows\system32\d3d10_1.dll" ...
  52. 28/12/2014 19:25:19,407 | INFO | > Delayed.
  53. 28/12/2014 19:25:19,407 | INFO | Registering hooks for "C:\Windows\system32\d3d11.dll" ...
  54. 28/12/2014 19:25:19,407 | INFO | > Delayed.
  55. 28/12/2014 19:25:19,407 | INFO | Registering hooks for "C:\Windows\system32\dxgi.dll" ...
  56. 28/12/2014 19:25:19,407 | INFO | > Delayed.
  57. 28/12/2014 19:25:19,407 | INFO | Registering hooks for "C:\Windows\system32\opengl32.dll" ...
  58. 28/12/2014 19:25:19,407 | INFO | > Delayed.
  59. 28/12/2014 19:25:19,407 | INFO | Registering hooks for "C:\Windows\system32\ws2_32.dll" ...
  60. 28/12/2014 19:25:19,422 | INFO | > Libraries loaded.
  61. 28/12/2014 19:25:19,422 | TRACE | > Analyzing export table:
  62. 28/12/2014 19:25:19,422 | TRACE | +--------------------+---------+----------------------------------------------------+
  63. 28/12/2014 19:25:19,422 | TRACE | | Address | Ordinal | Name |
  64. 28/12/2014 19:25:19,422 | TRACE | +--------------------+---------+----------------------------------------------------+
  65. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653E14D | 25 | FreeAddrInfoEx |
  66. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653E14D | 26 | FreeAddrInfoExW |
  67. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534B1B | 27 | FreeAddrInfoW |
  68. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654469B | 28 | GetAddrInfoExA |
  69. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653D1EA | 29 | GetAddrInfoExW |
  70. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534889 | 30 | GetAddrInfoW |
  71. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765366AF | 31 | GetNameInfoW |
  72. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543ABF | 32 | InetNtopW |
  73. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765439DC | 33 | InetPtonW |
  74. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765445F7 | 34 | SetAddrInfoExA |
  75. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653F4F6 | 35 | SetAddrInfoExW |
  76. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654E764 | 500 | WEP |
  77. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654E39B | 36 | WPUCompleteOverlappedRequest |
  78. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765368D6 | 37 | WSAAccept |
  79. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653331E | 38 | WSAAddressToStringA |
  80. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536CF6 | 39 | WSAAddressToStringW |
  81. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076550509 | 40 | WSAAdvertiseProvider |
  82. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654736B | 102 | WSAAsyncGetHostByAddr |
  83. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654726A | 103 | WSAAsyncGetHostByName |
  84. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654744E | 105 | WSAAsyncGetProtoByName |
  85. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654754F | 104 | WSAAsyncGetProtoByNumber |
  86. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765470A7 | 107 | WSAAsyncGetServByName |
  87. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765471AE | 106 | WSAAsyncGetServByPort |
  88. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654B014 | 101 | WSAAsyncSelect |
  89. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076547602 | 108 | WSACancelAsyncRequest |
  90. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076545343 | 113 | WSACancelBlockingCall |
  91. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076533C5F | 116 | WSACleanup |
  92. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653651F | 41 | WSACloseEvent |
  93. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653CC3F | 42 | WSAConnect |
  94. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654BFDD | 43 | WSAConnectByList |
  95. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654C8B6 | 44 | WSAConnectByNameA |
  96. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654C52F | 45 | WSAConnectByNameW |
  97. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765364FB | 46 | WSACreateEvent |
  98. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765461B6 | 47 | WSADuplicateSocketA |
  99. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076546128 | 48 | WSADuplicateSocketW |
  100. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076549FC1 | 49 | WSAEnumNameSpaceProvidersA |
  101. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A021 | 50 | WSAEnumNameSpaceProvidersExA |
  102. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A081 | 58 | WSAEnumNameSpaceProvidersExW |
  103. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653D8D3 | 59 | WSAEnumNameSpaceProvidersW |
  104. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765331B1 | 60 | WSAEnumNetworkEvents |
  105. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654627F | 61 | WSAEnumProtocolsA |
  106. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C8E1 | 62 | WSAEnumProtocolsW |
  107. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653648F | 63 | WSAEventSelect |
  108. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765337AD | 111 | WSAGetLastError |
  109. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076537489 | 64 | WSAGetOverlappedResult |
  110. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076549B68 | 65 | WSAGetQOSByName |
  111. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654AA00 | 66 | WSAGetServiceClassInfoA |
  112. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A849 | 67 | WSAGetServiceClassInfoW |
  113. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A44D | 68 | WSAGetServiceClassNameByClassIdA |
  114. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A651 | 69 | WSAGetServiceClassNameByClassIdW |
  115. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543B24 | 70 | WSAHtonl |
  116. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543C11 | 71 | WSAHtons |
  117. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A981 | 72 | WSAInstallServiceClassA |
  118. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A277 | 73 | WSAInstallServiceClassW |
  119. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076532FE7 | 74 | WSAIoctl |
  120. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765453BE | 114 | WSAIsBlocking |
  121. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654CA7D | 75 | WSAJoinLeaf |
  122. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653A642 | 76 | WSALookupServiceBeginA |
  123. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653575A | 77 | WSALookupServiceBeginW |
  124. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076535239 | 78 | WSALookupServiceEnd |
  125. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653A27B | 79 | WSALookupServiceNextA |
  126. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534CBC | 80 | WSALookupServiceNextW |
  127. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653EF85 | 81 | WSANSPIoctl |
  128. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543B24 | 82 | WSANtohl |
  129. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543C11 | 83 | WSANtohs |
  130. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654B0A5 | 84 | WSAPoll |
  131. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076550B79 | 85 | WSAProviderCompleteAsyncCall |
  132. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C22E | 86 | WSAProviderConfigChange |
  133. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076537089 | 87 | WSARecv | <
  134. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076549DBD | 88 | WSARecvDisconnect |
  135. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653CBA6 | 89 | WSARecvFrom | <
  136. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654A362 | 90 | WSARemoveServiceClass |
  137. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653CDC3 | 91 | WSAResetEvent |
  138. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534406 | 92 | WSASend | <
  139. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654B281 | 93 | WSASendDisconnect |
  140. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654B3CB | 94 | WSASendMsg |
  141. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654B30C | 95 | WSASendTo | <
  142. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654543D | 109 | WSASetBlockingHook |
  143. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653CDD4 | 96 | WSASetEvent |
  144. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765337D9 | 112 | WSASetLastError |
  145. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654AA92 | 97 | WSASetServiceA |
  146. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653F606 | 98 | WSASetServiceW |
  147. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C82A | 99 | WSASocketA |
  148. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076533CD3 | 100 | WSASocketW |
  149. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076533AB2 | 115 | WSAStartup |
  150. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653ED31 | 117 | WSAStringToAddressA |
  151. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536DDD | 118 | WSAStringToAddressW |
  152. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076550643 | 119 | WSAUnadvertiseProvider |
  153. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765454C1 | 110 | WSAUnhookBlockingHook |
  154. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653650E | 120 | WSAWaitForMultipleEvents |
  155. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654E546 | 24 | WSApSetPostRoutine |
  156. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654D775 | 121 | WSCDeinstallProvider |
  157. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765493AC | 122 | WSCEnableNSProvider |
  158. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653B8CF | 123 | WSCEnumProtocols |
  159. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654DF81 | 124 | WSCGetApplicationCategory |
  160. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654D961 | 125 | WSCGetProviderInfo |
  161. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C64E | 126 | WSCGetProviderPath |
  162. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765496A9 | 127 | WSCInstallNameSpace |
  163. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076549859 | 128 | WSCInstallNameSpaceEx |
  164. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654D751 | 129 | WSCInstallProvider |
  165. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076548793 | 130 | WSCInstallProviderAndChains |
  166. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654DB99 | 131 | WSCSetApplicationCategory |
  167. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654D1D1 | 132 | WSCSetProviderInfo |
  168. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076549A11 | 133 | WSCUnInstallNameSpace |
  169. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654CE2D | 134 | WSCUpdateProvider |
  170. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076549571 | 135 | WSCWriteNameSpaceOrder |
  171. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007654D099 | 136 | WSCWriteProviderOrder |
  172. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653AA67 | 137 | WahCloseApcHelper |
  173. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007655272D | 138 | WahCloseHandleHelper |
  174. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076553261 | 139 | WahCloseNotificationHandleHelper |
  175. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076552772 | 140 | WahCloseSocketHandle |
  176. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765332C4 | 141 | WahCloseThread |
  177. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765527C1 | 142 | WahCompleteRequest |
  178. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076537E65 | 143 | WahCreateHandleContextTable |
  179. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C3CB | 144 | WahCreateNotificationHandle |
  180. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076553080 | 145 | WahCreateSocketHandle |
  181. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653F268 | 146 | WahDestroyHandleContextTable |
  182. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765529FD | 147 | WahDisableNonIFSHandleSupport |
  183. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007655284F | 148 | WahEnableNonIFSHandleSupport |
  184. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653AA97 | 149 | WahEnumerateHandleContexts |
  185. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653412B | 150 | WahInsertHandleContext |
  186. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765532C3 | 152 | WahNotifyAllProcesses |
  187. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076538483 | 153 | WahOpenApcHelper |
  188. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765336A7 | 154 | WahOpenCurrentThread |
  189. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076552CB2 | 155 | WahOpenHandleHelper |
  190. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C1FA | 156 | WahOpenNotificationHandleHelper |
  191. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076552096 | 157 | WahQueueUserApc |
  192. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076532F20 | 158 | WahReferenceContextByHandle |
  193. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765339B0 | 159 | WahRemoveHandleContext |
  194. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653C2F0 | 160 | WahWaitForNotification |
  195. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076553665 | 161 | WahWriteLSPEvent |
  196. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536A8A | 151 | __WSAFDIsSet |
  197. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765368B6 | 1 | accept |
  198. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534582 | 2 | bind |
  199. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076533918 | 3 | closesocket |
  200. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536BDD | 4 | connect |
  201. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534B1B | 162 | freeaddrinfo |
  202. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076534296 | 163 | getaddrinfo |
  203. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076546C01 | 51 | gethostbyaddr |
  204. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076547673 | 52 | gethostbyname |
  205. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653A05B | 57 | gethostname |
  206. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765367B7 | 164 | getnameinfo |
  207. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076537147 | 5 | getpeername |
  208. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765468B3 | 53 | getprotobyname |
  209. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765467C4 | 54 | getprotobynumber |
  210. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076546EF3 | 55 | getservbyname |
  211. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076546D62 | 56 | getservbyport |
  212. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765330AF | 6 | getsockname |
  213. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653737D | 7 | getsockopt |
  214. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076532D57 | 8 | htonl |
  215. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076532D8B | 9 | htons |
  216. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653311B | 11 | inet_addr |
  217. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653B131 | 12 | inet_ntoa |
  218. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543A5A | 165 | inet_ntop |
  219. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076543969 | 166 | inet_pton |
  220. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076533084 | 10 | ioctlsocket |
  221. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653B001 | 13 | listen |
  222. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076532D57 | 14 | ntohl |
  223. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076532D8B | 15 | ntohs |
  224. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536B0E | 16 | recv | <
  225. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653B6DC | 17 | recvfrom | <
  226. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536989 | 18 | select |
  227. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076536F01 | 19 | send | <
  228. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765334B5 | 20 | sendto | <
  229. 28/12/2014 19:25:19,422 | TRACE | | 0x00000000765341B6 | 21 | setsockopt |
  230. 28/12/2014 19:25:19,422 | TRACE | | 0x000000007653449D | 22 | shutdown |
  231. 28/12/2014 19:25:19,422 | TRACE | | 0x0000000076533EB8 | 23 | socket |
  232. 28/12/2014 19:25:19,422 | TRACE | +--------------------+---------+----------------------------------------------------+
  233. 28/12/2014 19:25:19,422 | INFO | > Found 8 match(es). Installing ...
  234. 28/12/2014 19:25:19,422 | TRACE | Installing hook for '0x76537089' with '0x69AD8B50' using method 1 ...
  235. 28/12/2014 19:25:19,422 | TRACE | > Succeeded.
  236. 28/12/2014 19:25:19,422 | TRACE | Installing hook for '0x7653CBA6' with '0x69AD8CB0' using method 1 ...
  237. 28/12/2014 19:25:19,422 | TRACE | > Succeeded.
  238. 28/12/2014 19:25:19,422 | TRACE | Installing hook for '0x76534406' with '0x69AD8A50' using method 1 ...
  239. 28/12/2014 19:25:19,438 | TRACE | > Succeeded.
  240. 28/12/2014 19:25:19,438 | TRACE | Installing hook for '0x7654B30C' with '0x69AD8AD0' using method 1 ...
  241. 28/12/2014 19:25:19,438 | TRACE | > Succeeded.
  242. 28/12/2014 19:25:19,438 | TRACE | Installing hook for '0x76536B0E' with '0x69AD8970' using method 1 ...
  243. 28/12/2014 19:25:19,438 | TRACE | > Succeeded.
  244. 28/12/2014 19:25:19,438 | TRACE | Installing hook for '0x7653B6DC' with '0x69AD89E0' using method 1 ...
  245. 28/12/2014 19:25:19,454 | TRACE | > Succeeded.
  246. 28/12/2014 19:25:19,454 | TRACE | Installing hook for '0x76536F01' with '0x69AD88B0' using method 1 ...
  247. 28/12/2014 19:25:19,454 | TRACE | > Succeeded.
  248. 28/12/2014 19:25:19,454 | TRACE | Installing hook for '0x765334B5' with '0x69AD8910' using method 1 ...
  249. 28/12/2014 19:25:19,454 | TRACE | > Succeeded.
  250. 28/12/2014 19:25:19,454 | INFO | > Installed 8 hook(s).
  251. 28/12/2014 19:25:19,469 | INFO | Initialized.
  252. 28/12/2014 19:25:20,041 | INFO | Redirecting 'Direct3DCreate9(32)' ...
  253. 28/12/2014 19:25:20,047 | TRACE | Installing hook for '0x6A5D2E0E' with '0x69ABFF30' using method 1 ...
  254. 28/12/2014 19:25:20,052 | TRACE | > Succeeded.
  255. 28/12/2014 19:25:20,108 | INFO | Redirecting 'Direct3DCreate9(32)' ...
  256. 28/12/2014 19:25:21,527 | INFO | Redirecting 'IDirect3D9::CreateDevice(03E507E0, 0, 1, 001E02D6, 322, 0058CD94, 040A8C10)' ...
  257. 28/12/2014 19:25:21,527 | TRACE | > Dumping Presentation Parameters:
  258. 28/12/2014 19:25:21,527 | TRACE | +-----------------------------------------+-----------------------------------------+
  259. 28/12/2014 19:25:21,527 | TRACE | | Parameter | Value |
  260. 28/12/2014 19:25:21,527 | TRACE | +-----------------------------------------+-----------------------------------------+
  261. 28/12/2014 19:25:21,527 | TRACE | | BackBufferWidth | 1920 |
  262. 28/12/2014 19:25:21,527 | TRACE | | BackBufferHeight | 1080 |
  263. 28/12/2014 19:25:21,527 | TRACE | | BackBufferFormat | 21 |
  264. 28/12/2014 19:25:21,527 | TRACE | | BackBufferCount | 1 |
  265. 28/12/2014 19:25:21,527 | TRACE | | MultiSampleType | 0 |
  266. 28/12/2014 19:25:21,527 | TRACE | | MultiSampleQuality | 0 |
  267. 28/12/2014 19:25:21,527 | TRACE | | SwapEffect | 1 |
  268. 28/12/2014 19:25:21,527 | TRACE | | hDeviceWindow | 0x00000000000000000000000000000001E02D6 |
  269. 28/12/2014 19:25:21,527 | TRACE | | Windowed | 0 |
  270. 28/12/2014 19:25:21,527 | TRACE | | EnableAutoDepthStencil | 0 |
  271. 28/12/2014 19:25:21,527 | TRACE | | AutoDepthStencilFormat | 0 |
  272. 28/12/2014 19:25:21,527 | TRACE | | Flags | 0x0000000000000000000000000000000000001 |
  273. 28/12/2014 19:25:21,527 | TRACE | | FullScreen_RefreshRateInHz | 60 |
  274. 28/12/2014 19:25:21,527 | TRACE | | PresentationInterval | 1 |
  275. 28/12/2014 19:25:21,527 | TRACE | +-----------------------------------------+-----------------------------------------+
  276. 28/12/2014 19:25:21,527 | WARN | > Forcing tripple buffering.
  277. 28/12/2014 19:25:21,566 | INFO | Recreated effect environment on runtime 1E30ECD8.
  278. 28/12/2014 19:25:22,904 | INFO | Loading effect from "G:\Program Files (x86)\Remember Me\Binaries\Win32\Sweet.fx" ...
  279. 28/12/2014 19:25:22,904 | TRACE | > Running preprocessor ...
  280. 28/12/2014 19:25:22,976 | TRACE | > Running parser ...
  281. 28/12/2014 19:25:22,982 | TRACE | > Running compiler ...
  282. 28/12/2014 19:25:22,985 | TRACE | > Compiling shader 'SMAAEdgeDetectionVSWrap':
  283.  
  284. uniform float4 _PIXEL_SIZE_ : register(c223);
  285. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  286. uniform bool depthtoggle : register(c0);
  287. uniform float timer : register(c1);
  288. uniform float timeleft : register(c2);
  289. sampler2D colorGammaSampler : register(s0);
  290. sampler2D colorLinearSampler : register(s1);
  291. sampler2D transitionSampler : register(s2);
  292. sampler2D edgesSampler : register(s3);
  293. sampler2D blendSampler : register(s4);
  294. sampler2D areaSampler : register(s5);
  295. sampler2D searchSampler : register(s6);
  296. sampler2D depthSampler : register(s7);
  297. float4 CurvesPass(in float4 colorInput)
  298. {
  299. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  300. float Curves_contrast_blend = 0.150000f;
  301. float3 x = colorInput.xyz;
  302. (x = (x - 0.500000f));
  303. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  304. float3 color = x;
  305. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  306. return colorInput;
  307. }
  308. float4 main(in float2 tex, in float4 FinalColor)
  309. {
  310. (FinalColor = CurvesPass(FinalColor));
  311. return FinalColor;
  312. }
  313. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  314. {
  315. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  316. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  317. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  318. }
  319. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  320. {
  321. float P = tex2D(tex, texcoord).x;
  322. float Pleft = tex2D(tex, offset[0].xy).x;
  323. float Ptop = tex2D(tex, offset[0].zw).x;
  324. return float3(P, Pleft, Ptop);
  325. }
  326. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  327. {
  328. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  329. float2 delta = abs((neighbours.xx - neighbours.yz));
  330. float2 edges = step(0.010000f, delta);
  331. return (0.200000f * (1.000000f - (0.400000f * edges)));
  332. }
  333. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  334. {
  335. [flatten]if (cond.x)
  336. (variable.x = value.x);
  337. [flatten]if (cond.y)
  338. (variable.y = value.y);
  339. }
  340. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  341. {
  342. SMAAMovc(cond.xy, variable.xy, value.xy);
  343. SMAAMovc(cond.zw, variable.zw, value.zw);
  344. }
  345. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  346. {
  347. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  348. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  349. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  350. }
  351. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  352. {
  353. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  354. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  355. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  356. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  357. }
  358. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  359. {
  360. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  361. }
  362. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  363. {
  364. float2 threshold = float2(0.100000f, 0.100000f);
  365. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  366. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  367. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  368. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  369. float4 delta;
  370. (delta.xy = abs((L - float2(Lleft, Ltop))));
  371. float2 edges = step(threshold, delta.xy);
  372. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  373. discard;
  374. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  375. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  376. (delta.zw = abs((L - float2(Lright, Lbottom))));
  377. float2 maxDelta = max(delta.xy, delta.zw);
  378. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  379. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  380. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  381. (maxDelta = max(maxDelta.xy, delta.zw));
  382. float finalDelta = max(maxDelta.x, maxDelta.y);
  383. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  384. return edges;
  385. }
  386. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  387. {
  388. float2 threshold = float2(0.100000f, 0.100000f);
  389. float4 delta;
  390. float3 C = tex2D(colorTex, texcoord).xyz;
  391. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  392. float3 t = abs((C - Cleft));
  393. (delta.x = max(max(t.x, t.y), t.z));
  394. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  395. (t = abs((C - Ctop)));
  396. (delta.y = max(max(t.x, t.y), t.z));
  397. float2 edges = step(threshold, delta.xy);
  398. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  399. discard;
  400. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  401. (t = abs((C - Cright)));
  402. (delta.z = max(max(t.x, t.y), t.z));
  403. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  404. (t = abs((C - Cbottom)));
  405. (delta.w = max(max(t.x, t.y), t.z));
  406. float2 maxDelta = max(delta.xy, delta.zw);
  407. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  408. (t = abs((C - Cleftleft)));
  409. (delta.z = max(max(t.x, t.y), t.z));
  410. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  411. (t = abs((C - Ctoptop)));
  412. (delta.w = max(max(t.x, t.y), t.z));
  413. (maxDelta = max(maxDelta.xy, delta.zw));
  414. float finalDelta = max(maxDelta.x, maxDelta.y);
  415. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  416. return edges;
  417. }
  418. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  419. {
  420. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  421. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  422. float2 edges = step(0.010000f, delta);
  423. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  424. discard;
  425. return edges;
  426. }
  427. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  428. {
  429. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  430. return round(e);
  431. }
  432. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  433. {
  434. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  435. return round(e);
  436. }
  437. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  438. {
  439. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  440. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  441. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  442. {
  443. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  444. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  445. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  446. }
  447. return coord.zw;
  448. }
  449. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  450. {
  451. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  452. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  453. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  454. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  455. {
  456. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  457. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  458. (e = SMAADecodeDiagBilinearAccess(e));
  459. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  460. }
  461. return coord.zw;
  462. }
  463. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  464. {
  465. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  466. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  467. (texcoord.x += 0.500000f);
  468. (texcoord.y += (0.142857f * offset));
  469. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  470. }
  471. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  472. {
  473. float2 weights = float2(0.000000f, 0.000000f);
  474. float4 d;
  475. float2 end;
  476. []if ((e.x > 0.000000f))
  477. {
  478. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  479. (d.x += float((end.y > 0.900000f)));
  480. }
  481. else
  482. (d.xz = float2(0.000000f, 0.000000f));
  483. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  484. [branch]if (((d.x + d.y) > 2.000000f))
  485. {
  486. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  487. float4 c;
  488. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  489. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  490. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  491. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  492. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  493. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  494. }
  495. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  496. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  497. {
  498. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  499. (d.y += float((end.y > 0.900000f)));
  500. }
  501. else
  502. (d.yw = float2(0.000000f, 0.000000f));
  503. [branch]if (((d.x + d.y) > 2.000000f))
  504. {
  505. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  506. float4 c;
  507. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  508. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  509. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  510. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  511. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  512. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  513. }
  514. return weights;
  515. }
  516. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  517. {
  518. float2 scale = float2(33.000000f, -33.000000f);
  519. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  520. (scale += float2(-1.000000f, 1.000000f));
  521. (bias += float2(0.500000f, -0.500000f));
  522. (scale *= float2(0.015625f, 0.062500f));
  523. (bias *= float2(0.015625f, 0.062500f));
  524. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  525. }
  526. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  527. {
  528. float2 e = float2(0.000000f, 1.000000f);
  529. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  530. {
  531. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  532. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  533. }
  534. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  535. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  536. }
  537. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  538. {
  539. float2 e = float2(0.000000f, 1.000000f);
  540. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  541. {
  542. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  543. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  544. }
  545. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  546. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  547. }
  548. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  549. {
  550. float2 e = float2(1.000000f, 0.000000f);
  551. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  552. {
  553. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  554. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  555. }
  556. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  557. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  558. }
  559. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  560. {
  561. float2 e = float2(1.000000f, 0.000000f);
  562. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  563. {
  564. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  565. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  566. }
  567. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  568. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  569. }
  570. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  571. {
  572. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  573. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  574. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  575. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  576. }
  577. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  578. {
  579. float2 leftRight = step(d.xy, d.yx);
  580. float2 rounding = (1.000000f * leftRight);
  581. (rounding /= (leftRight.x + leftRight.y));
  582. float2 factor = float2(1.000000f, 1.000000f);
  583. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  584. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  585. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  586. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  587. (weights *= saturate(factor));
  588. }
  589. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  590. {
  591. float2 leftRight = step(d.xy, d.yx);
  592. float2 rounding = (1.000000f * leftRight);
  593. (rounding /= (leftRight.x + leftRight.y));
  594. float2 factor = float2(1.000000f, 1.000000f);
  595. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  596. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  597. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  598. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  599. (weights *= saturate(factor));
  600. }
  601. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  602. {
  603. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  604. float2 e = tex2D(edgesTex, texcoord).xy;
  605. [branch]if ((e.y > 0.000000f))
  606. {
  607. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  608. [branch]if ((weights.x == -weights.y))
  609. {
  610. float2 d;
  611. float3 coords;
  612. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  613. (coords.y = offset[1].y);
  614. (d.x = coords.x);
  615. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  616. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  617. (d.y = coords.z);
  618. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  619. float2 sqrt_d = sqrt(d);
  620. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  621. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  622. (coords.y = texcoord.y);
  623. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  624. }
  625. else
  626. (e.x = 0.000000f);
  627. }
  628. [branch]if ((e.x > 0.000000f))
  629. {
  630. float2 d;
  631. float3 coords;
  632. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  633. (coords.x = offset[0].x);
  634. (d.x = coords.y);
  635. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  636. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  637. (d.y = coords.z);
  638. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  639. float2 sqrt_d = sqrt(d);
  640. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  641. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  642. (coords.x = texcoord.x);
  643. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  644. }
  645. return weights;
  646. }
  647. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  648. {
  649. float4 a;
  650. (a.x = tex2D(blendTex, offset.xy).w);
  651. (a.y = tex2D(blendTex, offset.zw).y);
  652. (a.wz = tex2D(blendTex, texcoord).xz);
  653. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  654. {
  655. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  656. return color;
  657. }
  658. else
  659. {
  660. bool h = (max(a.x, a.z) > max(a.y, a.w));
  661. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  662. float2 blendingWeight = a.yw;
  663. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  664. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  665. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  666. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  667. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  668. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  669. return color;
  670. }
  671. }
  672. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  673. {
  674. float4 current = tex2D(currentColorTex, texcoord);
  675. float4 previous = tex2D(previousColorTex, texcoord);
  676. return lerp(current, previous, 0.500000f);
  677. }
  678. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  679. {
  680. float4 offset[3];
  681. FullscreenTriangle(id, position, texcoord);
  682. SMAAEdgeDetectionVS(texcoord, offset);
  683. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  684. }
  685. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  686. {
  687. float4 offset[3];
  688. FullscreenTriangle(id, position, texcoord);
  689. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  690. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  691. }
  692. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  693. {
  694. FullscreenTriangle(id, position, texcoord);
  695. SMAANeighborhoodBlendingVS(texcoord, offset);
  696. }
  697. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  698. {
  699. float4 offset[3] = { offset0, offset1, offset2 };
  700. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  701. }
  702. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  703. {
  704. float4 offset[3] = { offset0, offset1, offset2 };
  705. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  706. }
  707. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  708. {
  709. float4 offset[3] = { offset0, offset1, offset2 };
  710. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  711. }
  712. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  713. {
  714. float4 offset[3] = { offset0, offset1, offset2 };
  715. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  716. }
  717. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  718. {
  719. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  720. return color;
  721. }
  722. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  723. {
  724. (color = tex2D(colorGammaSampler, texcoord).xyz);
  725. float depth = tex2D(depthSampler, texcoord).x;
  726. []if (depthtoggle)
  727. {
  728. const float z_near = 1.000000f;
  729. const float z_far = 100.000000f;
  730. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  731. (color.xyz = float3(depth.xxx));
  732. }
  733. (color = main(texcoord, color.xyzz).xyz);
  734. }
  735. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  736. {
  737. (color = tex2D(colorGammaSampler, texcoord));
  738. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  739. }
  740. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  741. {
  742. (color = tex2D(colorGammaSampler, texcoord));
  743. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  744. }
  745. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  746. {
  747. const float curtain_time = 3500.000000f;
  748. float coord = abs((texcoord.x - 0.500000f));
  749. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  750. []if (((coord < factor) || (timer > 10000.000000f)))
  751. (color = tex2D(colorGammaSampler, texcoord));
  752. else
  753. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  754. }
  755. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  756. {
  757. float coord = abs((texcoord.x - 0.500000f));
  758. float factor = (timeleft / 8000.000000f);
  759. []if ((coord < factor))
  760. (color = tex2D(colorGammaSampler, texcoord));
  761. else
  762. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  763. }
  764. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  765. {
  766. float3 image = tex2D(transitionSampler, texcoord).xyz;
  767. (color = tex2D(colorGammaSampler, texcoord).xyz);
  768. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  769. }
  770. void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0, out float4 offset0 : TEXCOORD1, out float4 offset1 : TEXCOORD2, out float4 offset2 : TEXCOORD3)
  771. {
  772. SMAAEdgeDetectionVSWrap(id, position, texcoord, offset0, offset1, offset2);
  773. position.xy += _PIXEL_SIZE_.zw * position.ww;
  774. }
  775.  
  776.  
  777. 28/12/2014 19:25:22,998 | TRACE | > Compiling shader 'SMAAColorEdgeDetectionPSWrap':
  778.  
  779. uniform float4 _PIXEL_SIZE_ : register(c223);
  780. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  781. #define POSITION VPOS
  782. uniform bool depthtoggle : register(c0);
  783. uniform float timer : register(c1);
  784. uniform float timeleft : register(c2);
  785. sampler2D colorGammaSampler : register(s0);
  786. sampler2D colorLinearSampler : register(s1);
  787. sampler2D transitionSampler : register(s2);
  788. sampler2D edgesSampler : register(s3);
  789. sampler2D blendSampler : register(s4);
  790. sampler2D areaSampler : register(s5);
  791. sampler2D searchSampler : register(s6);
  792. sampler2D depthSampler : register(s7);
  793. float4 CurvesPass(in float4 colorInput)
  794. {
  795. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  796. float Curves_contrast_blend = 0.150000f;
  797. float3 x = colorInput.xyz;
  798. (x = (x - 0.500000f));
  799. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  800. float3 color = x;
  801. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  802. return colorInput;
  803. }
  804. float4 main(in float2 tex, in float4 FinalColor)
  805. {
  806. (FinalColor = CurvesPass(FinalColor));
  807. return FinalColor;
  808. }
  809. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  810. {
  811. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  812. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  813. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  814. }
  815. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  816. {
  817. float P = tex2D(tex, texcoord).x;
  818. float Pleft = tex2D(tex, offset[0].xy).x;
  819. float Ptop = tex2D(tex, offset[0].zw).x;
  820. return float3(P, Pleft, Ptop);
  821. }
  822. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  823. {
  824. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  825. float2 delta = abs((neighbours.xx - neighbours.yz));
  826. float2 edges = step(0.010000f, delta);
  827. return (0.200000f * (1.000000f - (0.400000f * edges)));
  828. }
  829. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  830. {
  831. [flatten]if (cond.x)
  832. (variable.x = value.x);
  833. [flatten]if (cond.y)
  834. (variable.y = value.y);
  835. }
  836. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  837. {
  838. SMAAMovc(cond.xy, variable.xy, value.xy);
  839. SMAAMovc(cond.zw, variable.zw, value.zw);
  840. }
  841. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  842. {
  843. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  844. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  845. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  846. }
  847. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  848. {
  849. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  850. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  851. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  852. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  853. }
  854. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  855. {
  856. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  857. }
  858. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  859. {
  860. float2 threshold = float2(0.100000f, 0.100000f);
  861. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  862. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  863. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  864. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  865. float4 delta;
  866. (delta.xy = abs((L - float2(Lleft, Ltop))));
  867. float2 edges = step(threshold, delta.xy);
  868. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  869. discard;
  870. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  871. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  872. (delta.zw = abs((L - float2(Lright, Lbottom))));
  873. float2 maxDelta = max(delta.xy, delta.zw);
  874. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  875. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  876. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  877. (maxDelta = max(maxDelta.xy, delta.zw));
  878. float finalDelta = max(maxDelta.x, maxDelta.y);
  879. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  880. return edges;
  881. }
  882. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  883. {
  884. float2 threshold = float2(0.100000f, 0.100000f);
  885. float4 delta;
  886. float3 C = tex2D(colorTex, texcoord).xyz;
  887. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  888. float3 t = abs((C - Cleft));
  889. (delta.x = max(max(t.x, t.y), t.z));
  890. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  891. (t = abs((C - Ctop)));
  892. (delta.y = max(max(t.x, t.y), t.z));
  893. float2 edges = step(threshold, delta.xy);
  894. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  895. discard;
  896. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  897. (t = abs((C - Cright)));
  898. (delta.z = max(max(t.x, t.y), t.z));
  899. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  900. (t = abs((C - Cbottom)));
  901. (delta.w = max(max(t.x, t.y), t.z));
  902. float2 maxDelta = max(delta.xy, delta.zw);
  903. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  904. (t = abs((C - Cleftleft)));
  905. (delta.z = max(max(t.x, t.y), t.z));
  906. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  907. (t = abs((C - Ctoptop)));
  908. (delta.w = max(max(t.x, t.y), t.z));
  909. (maxDelta = max(maxDelta.xy, delta.zw));
  910. float finalDelta = max(maxDelta.x, maxDelta.y);
  911. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  912. return edges;
  913. }
  914. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  915. {
  916. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  917. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  918. float2 edges = step(0.010000f, delta);
  919. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  920. discard;
  921. return edges;
  922. }
  923. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  924. {
  925. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  926. return round(e);
  927. }
  928. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  929. {
  930. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  931. return round(e);
  932. }
  933. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  934. {
  935. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  936. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  937. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  938. {
  939. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  940. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  941. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  942. }
  943. return coord.zw;
  944. }
  945. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  946. {
  947. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  948. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  949. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  950. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  951. {
  952. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  953. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  954. (e = SMAADecodeDiagBilinearAccess(e));
  955. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  956. }
  957. return coord.zw;
  958. }
  959. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  960. {
  961. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  962. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  963. (texcoord.x += 0.500000f);
  964. (texcoord.y += (0.142857f * offset));
  965. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  966. }
  967. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  968. {
  969. float2 weights = float2(0.000000f, 0.000000f);
  970. float4 d;
  971. float2 end;
  972. []if ((e.x > 0.000000f))
  973. {
  974. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  975. (d.x += float((end.y > 0.900000f)));
  976. }
  977. else
  978. (d.xz = float2(0.000000f, 0.000000f));
  979. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  980. [branch]if (((d.x + d.y) > 2.000000f))
  981. {
  982. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  983. float4 c;
  984. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  985. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  986. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  987. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  988. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  989. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  990. }
  991. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  992. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  993. {
  994. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  995. (d.y += float((end.y > 0.900000f)));
  996. }
  997. else
  998. (d.yw = float2(0.000000f, 0.000000f));
  999. [branch]if (((d.x + d.y) > 2.000000f))
  1000. {
  1001. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  1002. float4 c;
  1003. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  1004. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  1005. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  1006. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1007. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1008. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  1009. }
  1010. return weights;
  1011. }
  1012. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  1013. {
  1014. float2 scale = float2(33.000000f, -33.000000f);
  1015. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  1016. (scale += float2(-1.000000f, 1.000000f));
  1017. (bias += float2(0.500000f, -0.500000f));
  1018. (scale *= float2(0.015625f, 0.062500f));
  1019. (bias *= float2(0.015625f, 0.062500f));
  1020. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  1021. }
  1022. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1023. {
  1024. float2 e = float2(0.000000f, 1.000000f);
  1025. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1026. {
  1027. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1028. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1029. }
  1030. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  1031. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  1032. }
  1033. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1034. {
  1035. float2 e = float2(0.000000f, 1.000000f);
  1036. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1037. {
  1038. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1039. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1040. }
  1041. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  1042. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  1043. }
  1044. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1045. {
  1046. float2 e = float2(1.000000f, 0.000000f);
  1047. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1048. {
  1049. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1050. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1051. }
  1052. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  1053. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  1054. }
  1055. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1056. {
  1057. float2 e = float2(1.000000f, 0.000000f);
  1058. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1059. {
  1060. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1061. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1062. }
  1063. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  1064. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  1065. }
  1066. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  1067. {
  1068. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  1069. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1070. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  1071. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  1072. }
  1073. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1074. {
  1075. float2 leftRight = step(d.xy, d.yx);
  1076. float2 rounding = (1.000000f * leftRight);
  1077. (rounding /= (leftRight.x + leftRight.y));
  1078. float2 factor = float2(1.000000f, 1.000000f);
  1079. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1080. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1081. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1082. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1083. (weights *= saturate(factor));
  1084. }
  1085. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1086. {
  1087. float2 leftRight = step(d.xy, d.yx);
  1088. float2 rounding = (1.000000f * leftRight);
  1089. (rounding /= (leftRight.x + leftRight.y));
  1090. float2 factor = float2(1.000000f, 1.000000f);
  1091. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1092. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1093. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1094. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1095. (weights *= saturate(factor));
  1096. }
  1097. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  1098. {
  1099. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  1100. float2 e = tex2D(edgesTex, texcoord).xy;
  1101. [branch]if ((e.y > 0.000000f))
  1102. {
  1103. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  1104. [branch]if ((weights.x == -weights.y))
  1105. {
  1106. float2 d;
  1107. float3 coords;
  1108. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  1109. (coords.y = offset[1].y);
  1110. (d.x = coords.x);
  1111. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  1112. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  1113. (d.y = coords.z);
  1114. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  1115. float2 sqrt_d = sqrt(d);
  1116. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  1117. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  1118. (coords.y = texcoord.y);
  1119. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  1120. }
  1121. else
  1122. (e.x = 0.000000f);
  1123. }
  1124. [branch]if ((e.x > 0.000000f))
  1125. {
  1126. float2 d;
  1127. float3 coords;
  1128. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  1129. (coords.x = offset[0].x);
  1130. (d.x = coords.y);
  1131. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  1132. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  1133. (d.y = coords.z);
  1134. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  1135. float2 sqrt_d = sqrt(d);
  1136. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  1137. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  1138. (coords.x = texcoord.x);
  1139. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  1140. }
  1141. return weights;
  1142. }
  1143. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  1144. {
  1145. float4 a;
  1146. (a.x = tex2D(blendTex, offset.xy).w);
  1147. (a.y = tex2D(blendTex, offset.zw).y);
  1148. (a.wz = tex2D(blendTex, texcoord).xz);
  1149. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  1150. {
  1151. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  1152. return color;
  1153. }
  1154. else
  1155. {
  1156. bool h = (max(a.x, a.z) > max(a.y, a.w));
  1157. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  1158. float2 blendingWeight = a.yw;
  1159. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  1160. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  1161. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  1162. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  1163. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  1164. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  1165. return color;
  1166. }
  1167. }
  1168. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  1169. {
  1170. float4 current = tex2D(currentColorTex, texcoord);
  1171. float4 previous = tex2D(previousColorTex, texcoord);
  1172. return lerp(current, previous, 0.500000f);
  1173. }
  1174. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  1175. {
  1176. float4 offset[3];
  1177. FullscreenTriangle(id, position, texcoord);
  1178. SMAAEdgeDetectionVS(texcoord, offset);
  1179. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  1180. }
  1181. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  1182. {
  1183. float4 offset[3];
  1184. FullscreenTriangle(id, position, texcoord);
  1185. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  1186. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  1187. }
  1188. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  1189. {
  1190. FullscreenTriangle(id, position, texcoord);
  1191. SMAANeighborhoodBlendingVS(texcoord, offset);
  1192. }
  1193. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1194. {
  1195. float4 offset[3] = { offset0, offset1, offset2 };
  1196. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  1197. }
  1198. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1199. {
  1200. float4 offset[3] = { offset0, offset1, offset2 };
  1201. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  1202. }
  1203. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1204. {
  1205. float4 offset[3] = { offset0, offset1, offset2 };
  1206. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  1207. }
  1208. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1209. {
  1210. float4 offset[3] = { offset0, offset1, offset2 };
  1211. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  1212. }
  1213. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  1214. {
  1215. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  1216. return color;
  1217. }
  1218. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  1219. {
  1220. (color = tex2D(colorGammaSampler, texcoord).xyz);
  1221. float depth = tex2D(depthSampler, texcoord).x;
  1222. []if (depthtoggle)
  1223. {
  1224. const float z_near = 1.000000f;
  1225. const float z_far = 100.000000f;
  1226. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  1227. (color.xyz = float3(depth.xxx));
  1228. }
  1229. (color = main(texcoord, color.xyzz).xyz);
  1230. }
  1231. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  1232. {
  1233. (color = tex2D(colorGammaSampler, texcoord));
  1234. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  1235. }
  1236. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  1237. {
  1238. (color = tex2D(colorGammaSampler, texcoord));
  1239. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  1240. }
  1241. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  1242. {
  1243. const float curtain_time = 3500.000000f;
  1244. float coord = abs((texcoord.x - 0.500000f));
  1245. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  1246. []if (((coord < factor) || (timer > 10000.000000f)))
  1247. (color = tex2D(colorGammaSampler, texcoord));
  1248. else
  1249. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  1250. }
  1251. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  1252. {
  1253. float coord = abs((texcoord.x - 0.500000f));
  1254. float factor = (timeleft / 8000.000000f);
  1255. []if ((coord < factor))
  1256. (color = tex2D(colorGammaSampler, texcoord));
  1257. else
  1258. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  1259. }
  1260. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  1261. {
  1262. float3 image = tex2D(transitionSampler, texcoord).xyz;
  1263. (color = tex2D(colorGammaSampler, texcoord).xyz);
  1264. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  1265. }
  1266. float4 __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, in float4 offset0 : TEXCOORD1, in float4 offset1 : TEXCOORD2, in float4 offset2 : TEXCOORD3) : COLOR
  1267. {
  1268. float4 _return = float4(SMAAColorEdgeDetectionPSWrap(position, texcoord, offset0, offset1, offset2), 0.0f, 0.0f);
  1269. return _return;
  1270. }
  1271.  
  1272.  
  1273. 28/12/2014 19:25:23,026 | TRACE | > Compiling shader 'SMAABlendingWeightCalculationVSWrap':
  1274.  
  1275. uniform float4 _PIXEL_SIZE_ : register(c223);
  1276. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  1277. uniform bool depthtoggle : register(c0);
  1278. uniform float timer : register(c1);
  1279. uniform float timeleft : register(c2);
  1280. sampler2D colorGammaSampler : register(s0);
  1281. sampler2D colorLinearSampler : register(s1);
  1282. sampler2D transitionSampler : register(s2);
  1283. sampler2D edgesSampler : register(s3);
  1284. sampler2D blendSampler : register(s4);
  1285. sampler2D areaSampler : register(s5);
  1286. sampler2D searchSampler : register(s6);
  1287. sampler2D depthSampler : register(s7);
  1288. float4 CurvesPass(in float4 colorInput)
  1289. {
  1290. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  1291. float Curves_contrast_blend = 0.150000f;
  1292. float3 x = colorInput.xyz;
  1293. (x = (x - 0.500000f));
  1294. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  1295. float3 color = x;
  1296. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  1297. return colorInput;
  1298. }
  1299. float4 main(in float2 tex, in float4 FinalColor)
  1300. {
  1301. (FinalColor = CurvesPass(FinalColor));
  1302. return FinalColor;
  1303. }
  1304. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  1305. {
  1306. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  1307. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  1308. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  1309. }
  1310. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  1311. {
  1312. float P = tex2D(tex, texcoord).x;
  1313. float Pleft = tex2D(tex, offset[0].xy).x;
  1314. float Ptop = tex2D(tex, offset[0].zw).x;
  1315. return float3(P, Pleft, Ptop);
  1316. }
  1317. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  1318. {
  1319. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  1320. float2 delta = abs((neighbours.xx - neighbours.yz));
  1321. float2 edges = step(0.010000f, delta);
  1322. return (0.200000f * (1.000000f - (0.400000f * edges)));
  1323. }
  1324. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  1325. {
  1326. [flatten]if (cond.x)
  1327. (variable.x = value.x);
  1328. [flatten]if (cond.y)
  1329. (variable.y = value.y);
  1330. }
  1331. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  1332. {
  1333. SMAAMovc(cond.xy, variable.xy, value.xy);
  1334. SMAAMovc(cond.zw, variable.zw, value.zw);
  1335. }
  1336. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  1337. {
  1338. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  1339. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1340. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  1341. }
  1342. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  1343. {
  1344. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  1345. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  1346. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  1347. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  1348. }
  1349. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  1350. {
  1351. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1352. }
  1353. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  1354. {
  1355. float2 threshold = float2(0.100000f, 0.100000f);
  1356. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  1357. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  1358. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  1359. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  1360. float4 delta;
  1361. (delta.xy = abs((L - float2(Lleft, Ltop))));
  1362. float2 edges = step(threshold, delta.xy);
  1363. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  1364. discard;
  1365. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  1366. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  1367. (delta.zw = abs((L - float2(Lright, Lbottom))));
  1368. float2 maxDelta = max(delta.xy, delta.zw);
  1369. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  1370. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  1371. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  1372. (maxDelta = max(maxDelta.xy, delta.zw));
  1373. float finalDelta = max(maxDelta.x, maxDelta.y);
  1374. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  1375. return edges;
  1376. }
  1377. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  1378. {
  1379. float2 threshold = float2(0.100000f, 0.100000f);
  1380. float4 delta;
  1381. float3 C = tex2D(colorTex, texcoord).xyz;
  1382. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  1383. float3 t = abs((C - Cleft));
  1384. (delta.x = max(max(t.x, t.y), t.z));
  1385. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  1386. (t = abs((C - Ctop)));
  1387. (delta.y = max(max(t.x, t.y), t.z));
  1388. float2 edges = step(threshold, delta.xy);
  1389. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  1390. discard;
  1391. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  1392. (t = abs((C - Cright)));
  1393. (delta.z = max(max(t.x, t.y), t.z));
  1394. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  1395. (t = abs((C - Cbottom)));
  1396. (delta.w = max(max(t.x, t.y), t.z));
  1397. float2 maxDelta = max(delta.xy, delta.zw);
  1398. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  1399. (t = abs((C - Cleftleft)));
  1400. (delta.z = max(max(t.x, t.y), t.z));
  1401. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  1402. (t = abs((C - Ctoptop)));
  1403. (delta.w = max(max(t.x, t.y), t.z));
  1404. (maxDelta = max(maxDelta.xy, delta.zw));
  1405. float finalDelta = max(maxDelta.x, maxDelta.y);
  1406. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  1407. return edges;
  1408. }
  1409. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  1410. {
  1411. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  1412. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  1413. float2 edges = step(0.010000f, delta);
  1414. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  1415. discard;
  1416. return edges;
  1417. }
  1418. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  1419. {
  1420. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  1421. return round(e);
  1422. }
  1423. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  1424. {
  1425. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  1426. return round(e);
  1427. }
  1428. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1429. {
  1430. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1431. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  1432. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  1433. {
  1434. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1435. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  1436. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1437. }
  1438. return coord.zw;
  1439. }
  1440. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1441. {
  1442. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1443. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  1444. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  1445. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  1446. {
  1447. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1448. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  1449. (e = SMAADecodeDiagBilinearAccess(e));
  1450. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1451. }
  1452. return coord.zw;
  1453. }
  1454. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  1455. {
  1456. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  1457. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1458. (texcoord.x += 0.500000f);
  1459. (texcoord.y += (0.142857f * offset));
  1460. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  1461. }
  1462. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  1463. {
  1464. float2 weights = float2(0.000000f, 0.000000f);
  1465. float4 d;
  1466. float2 end;
  1467. []if ((e.x > 0.000000f))
  1468. {
  1469. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  1470. (d.x += float((end.y > 0.900000f)));
  1471. }
  1472. else
  1473. (d.xz = float2(0.000000f, 0.000000f));
  1474. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  1475. [branch]if (((d.x + d.y) > 2.000000f))
  1476. {
  1477. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  1478. float4 c;
  1479. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  1480. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  1481. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  1482. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1483. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1484. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  1485. }
  1486. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  1487. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  1488. {
  1489. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  1490. (d.y += float((end.y > 0.900000f)));
  1491. }
  1492. else
  1493. (d.yw = float2(0.000000f, 0.000000f));
  1494. [branch]if (((d.x + d.y) > 2.000000f))
  1495. {
  1496. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  1497. float4 c;
  1498. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  1499. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  1500. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  1501. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1502. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1503. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  1504. }
  1505. return weights;
  1506. }
  1507. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  1508. {
  1509. float2 scale = float2(33.000000f, -33.000000f);
  1510. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  1511. (scale += float2(-1.000000f, 1.000000f));
  1512. (bias += float2(0.500000f, -0.500000f));
  1513. (scale *= float2(0.015625f, 0.062500f));
  1514. (bias *= float2(0.015625f, 0.062500f));
  1515. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  1516. }
  1517. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1518. {
  1519. float2 e = float2(0.000000f, 1.000000f);
  1520. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1521. {
  1522. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1523. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1524. }
  1525. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  1526. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  1527. }
  1528. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1529. {
  1530. float2 e = float2(0.000000f, 1.000000f);
  1531. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  1532. {
  1533. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1534. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1535. }
  1536. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  1537. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  1538. }
  1539. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1540. {
  1541. float2 e = float2(1.000000f, 0.000000f);
  1542. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1543. {
  1544. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1545. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1546. }
  1547. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  1548. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  1549. }
  1550. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  1551. {
  1552. float2 e = float2(1.000000f, 0.000000f);
  1553. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  1554. {
  1555. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  1556. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  1557. }
  1558. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  1559. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  1560. }
  1561. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  1562. {
  1563. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  1564. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1565. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  1566. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  1567. }
  1568. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1569. {
  1570. float2 leftRight = step(d.xy, d.yx);
  1571. float2 rounding = (1.000000f * leftRight);
  1572. (rounding /= (leftRight.x + leftRight.y));
  1573. float2 factor = float2(1.000000f, 1.000000f);
  1574. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1575. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1576. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1577. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  1578. (weights *= saturate(factor));
  1579. }
  1580. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  1581. {
  1582. float2 leftRight = step(d.xy, d.yx);
  1583. float2 rounding = (1.000000f * leftRight);
  1584. (rounding /= (leftRight.x + leftRight.y));
  1585. float2 factor = float2(1.000000f, 1.000000f);
  1586. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1587. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1588. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1589. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  1590. (weights *= saturate(factor));
  1591. }
  1592. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  1593. {
  1594. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  1595. float2 e = tex2D(edgesTex, texcoord).xy;
  1596. [branch]if ((e.y > 0.000000f))
  1597. {
  1598. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  1599. [branch]if ((weights.x == -weights.y))
  1600. {
  1601. float2 d;
  1602. float3 coords;
  1603. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  1604. (coords.y = offset[1].y);
  1605. (d.x = coords.x);
  1606. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  1607. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  1608. (d.y = coords.z);
  1609. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  1610. float2 sqrt_d = sqrt(d);
  1611. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  1612. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  1613. (coords.y = texcoord.y);
  1614. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  1615. }
  1616. else
  1617. (e.x = 0.000000f);
  1618. }
  1619. [branch]if ((e.x > 0.000000f))
  1620. {
  1621. float2 d;
  1622. float3 coords;
  1623. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  1624. (coords.x = offset[0].x);
  1625. (d.x = coords.y);
  1626. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  1627. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  1628. (d.y = coords.z);
  1629. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  1630. float2 sqrt_d = sqrt(d);
  1631. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  1632. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  1633. (coords.x = texcoord.x);
  1634. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  1635. }
  1636. return weights;
  1637. }
  1638. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  1639. {
  1640. float4 a;
  1641. (a.x = tex2D(blendTex, offset.xy).w);
  1642. (a.y = tex2D(blendTex, offset.zw).y);
  1643. (a.wz = tex2D(blendTex, texcoord).xz);
  1644. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  1645. {
  1646. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  1647. return color;
  1648. }
  1649. else
  1650. {
  1651. bool h = (max(a.x, a.z) > max(a.y, a.w));
  1652. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  1653. float2 blendingWeight = a.yw;
  1654. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  1655. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  1656. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  1657. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  1658. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  1659. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  1660. return color;
  1661. }
  1662. }
  1663. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  1664. {
  1665. float4 current = tex2D(currentColorTex, texcoord);
  1666. float4 previous = tex2D(previousColorTex, texcoord);
  1667. return lerp(current, previous, 0.500000f);
  1668. }
  1669. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  1670. {
  1671. float4 offset[3];
  1672. FullscreenTriangle(id, position, texcoord);
  1673. SMAAEdgeDetectionVS(texcoord, offset);
  1674. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  1675. }
  1676. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  1677. {
  1678. float4 offset[3];
  1679. FullscreenTriangle(id, position, texcoord);
  1680. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  1681. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  1682. }
  1683. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  1684. {
  1685. FullscreenTriangle(id, position, texcoord);
  1686. SMAANeighborhoodBlendingVS(texcoord, offset);
  1687. }
  1688. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1689. {
  1690. float4 offset[3] = { offset0, offset1, offset2 };
  1691. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  1692. }
  1693. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1694. {
  1695. float4 offset[3] = { offset0, offset1, offset2 };
  1696. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  1697. }
  1698. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1699. {
  1700. float4 offset[3] = { offset0, offset1, offset2 };
  1701. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  1702. }
  1703. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  1704. {
  1705. float4 offset[3] = { offset0, offset1, offset2 };
  1706. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  1707. }
  1708. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  1709. {
  1710. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  1711. return color;
  1712. }
  1713. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  1714. {
  1715. (color = tex2D(colorGammaSampler, texcoord).xyz);
  1716. float depth = tex2D(depthSampler, texcoord).x;
  1717. []if (depthtoggle)
  1718. {
  1719. const float z_near = 1.000000f;
  1720. const float z_far = 100.000000f;
  1721. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  1722. (color.xyz = float3(depth.xxx));
  1723. }
  1724. (color = main(texcoord, color.xyzz).xyz);
  1725. }
  1726. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  1727. {
  1728. (color = tex2D(colorGammaSampler, texcoord));
  1729. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  1730. }
  1731. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  1732. {
  1733. (color = tex2D(colorGammaSampler, texcoord));
  1734. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  1735. }
  1736. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  1737. {
  1738. const float curtain_time = 3500.000000f;
  1739. float coord = abs((texcoord.x - 0.500000f));
  1740. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  1741. []if (((coord < factor) || (timer > 10000.000000f)))
  1742. (color = tex2D(colorGammaSampler, texcoord));
  1743. else
  1744. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  1745. }
  1746. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  1747. {
  1748. float coord = abs((texcoord.x - 0.500000f));
  1749. float factor = (timeleft / 8000.000000f);
  1750. []if ((coord < factor))
  1751. (color = tex2D(colorGammaSampler, texcoord));
  1752. else
  1753. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  1754. }
  1755. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  1756. {
  1757. float3 image = tex2D(transitionSampler, texcoord).xyz;
  1758. (color = tex2D(colorGammaSampler, texcoord).xyz);
  1759. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  1760. }
  1761. void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset0 : TEXCOORD2, out float4 offset1 : TEXCOORD3, out float4 offset2 : TEXCOORD4)
  1762. {
  1763. SMAABlendingWeightCalculationVSWrap(id, position, texcoord, pixcoord, offset0, offset1, offset2);
  1764. position.xy += _PIXEL_SIZE_.zw * position.ww;
  1765. }
  1766.  
  1767.  
  1768. 28/12/2014 19:25:23,038 | TRACE | > Compiling shader 'SMAABlendingWeightCalculationPSWrap':
  1769.  
  1770. uniform float4 _PIXEL_SIZE_ : register(c223);
  1771. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  1772. #define POSITION VPOS
  1773. uniform bool depthtoggle : register(c0);
  1774. uniform float timer : register(c1);
  1775. uniform float timeleft : register(c2);
  1776. sampler2D colorGammaSampler : register(s0);
  1777. sampler2D colorLinearSampler : register(s1);
  1778. sampler2D transitionSampler : register(s2);
  1779. sampler2D edgesSampler : register(s3);
  1780. sampler2D blendSampler : register(s4);
  1781. sampler2D areaSampler : register(s5);
  1782. sampler2D searchSampler : register(s6);
  1783. sampler2D depthSampler : register(s7);
  1784. float4 CurvesPass(in float4 colorInput)
  1785. {
  1786. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  1787. float Curves_contrast_blend = 0.150000f;
  1788. float3 x = colorInput.xyz;
  1789. (x = (x - 0.500000f));
  1790. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  1791. float3 color = x;
  1792. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  1793. return colorInput;
  1794. }
  1795. float4 main(in float2 tex, in float4 FinalColor)
  1796. {
  1797. (FinalColor = CurvesPass(FinalColor));
  1798. return FinalColor;
  1799. }
  1800. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  1801. {
  1802. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  1803. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  1804. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  1805. }
  1806. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  1807. {
  1808. float P = tex2D(tex, texcoord).x;
  1809. float Pleft = tex2D(tex, offset[0].xy).x;
  1810. float Ptop = tex2D(tex, offset[0].zw).x;
  1811. return float3(P, Pleft, Ptop);
  1812. }
  1813. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  1814. {
  1815. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  1816. float2 delta = abs((neighbours.xx - neighbours.yz));
  1817. float2 edges = step(0.010000f, delta);
  1818. return (0.200000f * (1.000000f - (0.400000f * edges)));
  1819. }
  1820. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  1821. {
  1822. [flatten]if (cond.x)
  1823. (variable.x = value.x);
  1824. [flatten]if (cond.y)
  1825. (variable.y = value.y);
  1826. }
  1827. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  1828. {
  1829. SMAAMovc(cond.xy, variable.xy, value.xy);
  1830. SMAAMovc(cond.zw, variable.zw, value.zw);
  1831. }
  1832. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  1833. {
  1834. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  1835. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1836. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  1837. }
  1838. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  1839. {
  1840. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  1841. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  1842. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  1843. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  1844. }
  1845. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  1846. {
  1847. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  1848. }
  1849. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  1850. {
  1851. float2 threshold = float2(0.100000f, 0.100000f);
  1852. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  1853. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  1854. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  1855. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  1856. float4 delta;
  1857. (delta.xy = abs((L - float2(Lleft, Ltop))));
  1858. float2 edges = step(threshold, delta.xy);
  1859. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  1860. discard;
  1861. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  1862. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  1863. (delta.zw = abs((L - float2(Lright, Lbottom))));
  1864. float2 maxDelta = max(delta.xy, delta.zw);
  1865. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  1866. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  1867. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  1868. (maxDelta = max(maxDelta.xy, delta.zw));
  1869. float finalDelta = max(maxDelta.x, maxDelta.y);
  1870. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  1871. return edges;
  1872. }
  1873. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  1874. {
  1875. float2 threshold = float2(0.100000f, 0.100000f);
  1876. float4 delta;
  1877. float3 C = tex2D(colorTex, texcoord).xyz;
  1878. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  1879. float3 t = abs((C - Cleft));
  1880. (delta.x = max(max(t.x, t.y), t.z));
  1881. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  1882. (t = abs((C - Ctop)));
  1883. (delta.y = max(max(t.x, t.y), t.z));
  1884. float2 edges = step(threshold, delta.xy);
  1885. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  1886. discard;
  1887. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  1888. (t = abs((C - Cright)));
  1889. (delta.z = max(max(t.x, t.y), t.z));
  1890. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  1891. (t = abs((C - Cbottom)));
  1892. (delta.w = max(max(t.x, t.y), t.z));
  1893. float2 maxDelta = max(delta.xy, delta.zw);
  1894. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  1895. (t = abs((C - Cleftleft)));
  1896. (delta.z = max(max(t.x, t.y), t.z));
  1897. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  1898. (t = abs((C - Ctoptop)));
  1899. (delta.w = max(max(t.x, t.y), t.z));
  1900. (maxDelta = max(maxDelta.xy, delta.zw));
  1901. float finalDelta = max(maxDelta.x, maxDelta.y);
  1902. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  1903. return edges;
  1904. }
  1905. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  1906. {
  1907. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  1908. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  1909. float2 edges = step(0.010000f, delta);
  1910. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  1911. discard;
  1912. return edges;
  1913. }
  1914. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  1915. {
  1916. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  1917. return round(e);
  1918. }
  1919. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  1920. {
  1921. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  1922. return round(e);
  1923. }
  1924. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1925. {
  1926. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1927. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  1928. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  1929. {
  1930. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1931. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  1932. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1933. }
  1934. return coord.zw;
  1935. }
  1936. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  1937. {
  1938. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  1939. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  1940. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  1941. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  1942. {
  1943. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  1944. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  1945. (e = SMAADecodeDiagBilinearAccess(e));
  1946. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  1947. }
  1948. return coord.zw;
  1949. }
  1950. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  1951. {
  1952. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  1953. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  1954. (texcoord.x += 0.500000f);
  1955. (texcoord.y += (0.142857f * offset));
  1956. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  1957. }
  1958. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  1959. {
  1960. float2 weights = float2(0.000000f, 0.000000f);
  1961. float4 d;
  1962. float2 end;
  1963. []if ((e.x > 0.000000f))
  1964. {
  1965. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  1966. (d.x += float((end.y > 0.900000f)));
  1967. }
  1968. else
  1969. (d.xz = float2(0.000000f, 0.000000f));
  1970. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  1971. [branch]if (((d.x + d.y) > 2.000000f))
  1972. {
  1973. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  1974. float4 c;
  1975. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  1976. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  1977. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  1978. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1979. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1980. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  1981. }
  1982. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  1983. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  1984. {
  1985. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  1986. (d.y += float((end.y > 0.900000f)));
  1987. }
  1988. else
  1989. (d.yw = float2(0.000000f, 0.000000f));
  1990. [branch]if (((d.x + d.y) > 2.000000f))
  1991. {
  1992. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  1993. float4 c;
  1994. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  1995. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  1996. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  1997. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  1998. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  1999. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  2000. }
  2001. return weights;
  2002. }
  2003. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  2004. {
  2005. float2 scale = float2(33.000000f, -33.000000f);
  2006. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  2007. (scale += float2(-1.000000f, 1.000000f));
  2008. (bias += float2(0.500000f, -0.500000f));
  2009. (scale *= float2(0.015625f, 0.062500f));
  2010. (bias *= float2(0.015625f, 0.062500f));
  2011. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  2012. }
  2013. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2014. {
  2015. float2 e = float2(0.000000f, 1.000000f);
  2016. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2017. {
  2018. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2019. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2020. }
  2021. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  2022. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  2023. }
  2024. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2025. {
  2026. float2 e = float2(0.000000f, 1.000000f);
  2027. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2028. {
  2029. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2030. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2031. }
  2032. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  2033. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  2034. }
  2035. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2036. {
  2037. float2 e = float2(1.000000f, 0.000000f);
  2038. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2039. {
  2040. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2041. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2042. }
  2043. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  2044. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  2045. }
  2046. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2047. {
  2048. float2 e = float2(1.000000f, 0.000000f);
  2049. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2050. {
  2051. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2052. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2053. }
  2054. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  2055. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  2056. }
  2057. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  2058. {
  2059. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  2060. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2061. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  2062. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  2063. }
  2064. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  2065. {
  2066. float2 leftRight = step(d.xy, d.yx);
  2067. float2 rounding = (1.000000f * leftRight);
  2068. (rounding /= (leftRight.x + leftRight.y));
  2069. float2 factor = float2(1.000000f, 1.000000f);
  2070. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2071. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2072. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2073. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2074. (weights *= saturate(factor));
  2075. }
  2076. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  2077. {
  2078. float2 leftRight = step(d.xy, d.yx);
  2079. float2 rounding = (1.000000f * leftRight);
  2080. (rounding /= (leftRight.x + leftRight.y));
  2081. float2 factor = float2(1.000000f, 1.000000f);
  2082. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2083. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2084. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2085. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2086. (weights *= saturate(factor));
  2087. }
  2088. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  2089. {
  2090. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  2091. float2 e = tex2D(edgesTex, texcoord).xy;
  2092. [branch]if ((e.y > 0.000000f))
  2093. {
  2094. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  2095. [branch]if ((weights.x == -weights.y))
  2096. {
  2097. float2 d;
  2098. float3 coords;
  2099. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  2100. (coords.y = offset[1].y);
  2101. (d.x = coords.x);
  2102. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  2103. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  2104. (d.y = coords.z);
  2105. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  2106. float2 sqrt_d = sqrt(d);
  2107. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  2108. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  2109. (coords.y = texcoord.y);
  2110. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  2111. }
  2112. else
  2113. (e.x = 0.000000f);
  2114. }
  2115. [branch]if ((e.x > 0.000000f))
  2116. {
  2117. float2 d;
  2118. float3 coords;
  2119. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  2120. (coords.x = offset[0].x);
  2121. (d.x = coords.y);
  2122. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  2123. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  2124. (d.y = coords.z);
  2125. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  2126. float2 sqrt_d = sqrt(d);
  2127. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  2128. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  2129. (coords.x = texcoord.x);
  2130. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  2131. }
  2132. return weights;
  2133. }
  2134. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  2135. {
  2136. float4 a;
  2137. (a.x = tex2D(blendTex, offset.xy).w);
  2138. (a.y = tex2D(blendTex, offset.zw).y);
  2139. (a.wz = tex2D(blendTex, texcoord).xz);
  2140. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  2141. {
  2142. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  2143. return color;
  2144. }
  2145. else
  2146. {
  2147. bool h = (max(a.x, a.z) > max(a.y, a.w));
  2148. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  2149. float2 blendingWeight = a.yw;
  2150. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  2151. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  2152. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  2153. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  2154. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  2155. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  2156. return color;
  2157. }
  2158. }
  2159. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  2160. {
  2161. float4 current = tex2D(currentColorTex, texcoord);
  2162. float4 previous = tex2D(previousColorTex, texcoord);
  2163. return lerp(current, previous, 0.500000f);
  2164. }
  2165. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  2166. {
  2167. float4 offset[3];
  2168. FullscreenTriangle(id, position, texcoord);
  2169. SMAAEdgeDetectionVS(texcoord, offset);
  2170. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  2171. }
  2172. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  2173. {
  2174. float4 offset[3];
  2175. FullscreenTriangle(id, position, texcoord);
  2176. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  2177. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  2178. }
  2179. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  2180. {
  2181. FullscreenTriangle(id, position, texcoord);
  2182. SMAANeighborhoodBlendingVS(texcoord, offset);
  2183. }
  2184. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2185. {
  2186. float4 offset[3] = { offset0, offset1, offset2 };
  2187. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  2188. }
  2189. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2190. {
  2191. float4 offset[3] = { offset0, offset1, offset2 };
  2192. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  2193. }
  2194. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2195. {
  2196. float4 offset[3] = { offset0, offset1, offset2 };
  2197. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  2198. }
  2199. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2200. {
  2201. float4 offset[3] = { offset0, offset1, offset2 };
  2202. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  2203. }
  2204. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  2205. {
  2206. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  2207. return color;
  2208. }
  2209. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  2210. {
  2211. (color = tex2D(colorGammaSampler, texcoord).xyz);
  2212. float depth = tex2D(depthSampler, texcoord).x;
  2213. []if (depthtoggle)
  2214. {
  2215. const float z_near = 1.000000f;
  2216. const float z_far = 100.000000f;
  2217. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  2218. (color.xyz = float3(depth.xxx));
  2219. }
  2220. (color = main(texcoord, color.xyzz).xyz);
  2221. }
  2222. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  2223. {
  2224. (color = tex2D(colorGammaSampler, texcoord));
  2225. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  2226. }
  2227. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  2228. {
  2229. (color = tex2D(colorGammaSampler, texcoord));
  2230. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  2231. }
  2232. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  2233. {
  2234. const float curtain_time = 3500.000000f;
  2235. float coord = abs((texcoord.x - 0.500000f));
  2236. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  2237. []if (((coord < factor) || (timer > 10000.000000f)))
  2238. (color = tex2D(colorGammaSampler, texcoord));
  2239. else
  2240. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  2241. }
  2242. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  2243. {
  2244. float coord = abs((texcoord.x - 0.500000f));
  2245. float factor = (timeleft / 8000.000000f);
  2246. []if ((coord < factor))
  2247. (color = tex2D(colorGammaSampler, texcoord));
  2248. else
  2249. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  2250. }
  2251. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  2252. {
  2253. float3 image = tex2D(transitionSampler, texcoord).xyz;
  2254. (color = tex2D(colorGammaSampler, texcoord).xyz);
  2255. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  2256. }
  2257. float4 __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, in float2 pixcoord : TEXCOORD1, in float4 offset0 : TEXCOORD2, in float4 offset1 : TEXCOORD3, in float4 offset2 : TEXCOORD4) : COLOR
  2258. {
  2259. float4 _return = SMAABlendingWeightCalculationPSWrap(position, texcoord, pixcoord, offset0, offset1, offset2);
  2260. return _return;
  2261. }
  2262.  
  2263.  
  2264. 28/12/2014 19:25:23,408 | TRACE | > Compiling shader 'SMAANeighborhoodBlendingVSWrap':
  2265.  
  2266. uniform float4 _PIXEL_SIZE_ : register(c223);
  2267. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  2268. uniform bool depthtoggle : register(c0);
  2269. uniform float timer : register(c1);
  2270. uniform float timeleft : register(c2);
  2271. sampler2D colorGammaSampler : register(s0);
  2272. sampler2D colorLinearSampler : register(s1);
  2273. sampler2D transitionSampler : register(s2);
  2274. sampler2D edgesSampler : register(s3);
  2275. sampler2D blendSampler : register(s4);
  2276. sampler2D areaSampler : register(s5);
  2277. sampler2D searchSampler : register(s6);
  2278. sampler2D depthSampler : register(s7);
  2279. float4 CurvesPass(in float4 colorInput)
  2280. {
  2281. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  2282. float Curves_contrast_blend = 0.150000f;
  2283. float3 x = colorInput.xyz;
  2284. (x = (x - 0.500000f));
  2285. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  2286. float3 color = x;
  2287. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  2288. return colorInput;
  2289. }
  2290. float4 main(in float2 tex, in float4 FinalColor)
  2291. {
  2292. (FinalColor = CurvesPass(FinalColor));
  2293. return FinalColor;
  2294. }
  2295. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  2296. {
  2297. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  2298. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  2299. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  2300. }
  2301. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  2302. {
  2303. float P = tex2D(tex, texcoord).x;
  2304. float Pleft = tex2D(tex, offset[0].xy).x;
  2305. float Ptop = tex2D(tex, offset[0].zw).x;
  2306. return float3(P, Pleft, Ptop);
  2307. }
  2308. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  2309. {
  2310. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  2311. float2 delta = abs((neighbours.xx - neighbours.yz));
  2312. float2 edges = step(0.010000f, delta);
  2313. return (0.200000f * (1.000000f - (0.400000f * edges)));
  2314. }
  2315. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  2316. {
  2317. [flatten]if (cond.x)
  2318. (variable.x = value.x);
  2319. [flatten]if (cond.y)
  2320. (variable.y = value.y);
  2321. }
  2322. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  2323. {
  2324. SMAAMovc(cond.xy, variable.xy, value.xy);
  2325. SMAAMovc(cond.zw, variable.zw, value.zw);
  2326. }
  2327. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  2328. {
  2329. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  2330. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2331. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  2332. }
  2333. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  2334. {
  2335. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  2336. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  2337. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  2338. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  2339. }
  2340. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  2341. {
  2342. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2343. }
  2344. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  2345. {
  2346. float2 threshold = float2(0.100000f, 0.100000f);
  2347. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  2348. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  2349. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  2350. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  2351. float4 delta;
  2352. (delta.xy = abs((L - float2(Lleft, Ltop))));
  2353. float2 edges = step(threshold, delta.xy);
  2354. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  2355. discard;
  2356. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  2357. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  2358. (delta.zw = abs((L - float2(Lright, Lbottom))));
  2359. float2 maxDelta = max(delta.xy, delta.zw);
  2360. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  2361. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  2362. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  2363. (maxDelta = max(maxDelta.xy, delta.zw));
  2364. float finalDelta = max(maxDelta.x, maxDelta.y);
  2365. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  2366. return edges;
  2367. }
  2368. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  2369. {
  2370. float2 threshold = float2(0.100000f, 0.100000f);
  2371. float4 delta;
  2372. float3 C = tex2D(colorTex, texcoord).xyz;
  2373. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  2374. float3 t = abs((C - Cleft));
  2375. (delta.x = max(max(t.x, t.y), t.z));
  2376. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  2377. (t = abs((C - Ctop)));
  2378. (delta.y = max(max(t.x, t.y), t.z));
  2379. float2 edges = step(threshold, delta.xy);
  2380. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  2381. discard;
  2382. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  2383. (t = abs((C - Cright)));
  2384. (delta.z = max(max(t.x, t.y), t.z));
  2385. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  2386. (t = abs((C - Cbottom)));
  2387. (delta.w = max(max(t.x, t.y), t.z));
  2388. float2 maxDelta = max(delta.xy, delta.zw);
  2389. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  2390. (t = abs((C - Cleftleft)));
  2391. (delta.z = max(max(t.x, t.y), t.z));
  2392. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  2393. (t = abs((C - Ctoptop)));
  2394. (delta.w = max(max(t.x, t.y), t.z));
  2395. (maxDelta = max(maxDelta.xy, delta.zw));
  2396. float finalDelta = max(maxDelta.x, maxDelta.y);
  2397. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  2398. return edges;
  2399. }
  2400. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  2401. {
  2402. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  2403. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  2404. float2 edges = step(0.010000f, delta);
  2405. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  2406. discard;
  2407. return edges;
  2408. }
  2409. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  2410. {
  2411. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  2412. return round(e);
  2413. }
  2414. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  2415. {
  2416. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  2417. return round(e);
  2418. }
  2419. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2420. {
  2421. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2422. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  2423. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  2424. {
  2425. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2426. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  2427. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2428. }
  2429. return coord.zw;
  2430. }
  2431. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2432. {
  2433. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2434. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  2435. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  2436. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  2437. {
  2438. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2439. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  2440. (e = SMAADecodeDiagBilinearAccess(e));
  2441. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2442. }
  2443. return coord.zw;
  2444. }
  2445. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  2446. {
  2447. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  2448. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2449. (texcoord.x += 0.500000f);
  2450. (texcoord.y += (0.142857f * offset));
  2451. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  2452. }
  2453. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  2454. {
  2455. float2 weights = float2(0.000000f, 0.000000f);
  2456. float4 d;
  2457. float2 end;
  2458. []if ((e.x > 0.000000f))
  2459. {
  2460. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  2461. (d.x += float((end.y > 0.900000f)));
  2462. }
  2463. else
  2464. (d.xz = float2(0.000000f, 0.000000f));
  2465. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  2466. [branch]if (((d.x + d.y) > 2.000000f))
  2467. {
  2468. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  2469. float4 c;
  2470. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  2471. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  2472. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  2473. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2474. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2475. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  2476. }
  2477. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  2478. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  2479. {
  2480. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  2481. (d.y += float((end.y > 0.900000f)));
  2482. }
  2483. else
  2484. (d.yw = float2(0.000000f, 0.000000f));
  2485. [branch]if (((d.x + d.y) > 2.000000f))
  2486. {
  2487. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  2488. float4 c;
  2489. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  2490. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  2491. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  2492. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2493. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2494. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  2495. }
  2496. return weights;
  2497. }
  2498. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  2499. {
  2500. float2 scale = float2(33.000000f, -33.000000f);
  2501. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  2502. (scale += float2(-1.000000f, 1.000000f));
  2503. (bias += float2(0.500000f, -0.500000f));
  2504. (scale *= float2(0.015625f, 0.062500f));
  2505. (bias *= float2(0.015625f, 0.062500f));
  2506. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  2507. }
  2508. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2509. {
  2510. float2 e = float2(0.000000f, 1.000000f);
  2511. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2512. {
  2513. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2514. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2515. }
  2516. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  2517. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  2518. }
  2519. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2520. {
  2521. float2 e = float2(0.000000f, 1.000000f);
  2522. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  2523. {
  2524. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2525. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2526. }
  2527. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  2528. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  2529. }
  2530. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2531. {
  2532. float2 e = float2(1.000000f, 0.000000f);
  2533. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2534. {
  2535. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2536. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2537. }
  2538. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  2539. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  2540. }
  2541. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  2542. {
  2543. float2 e = float2(1.000000f, 0.000000f);
  2544. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  2545. {
  2546. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  2547. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  2548. }
  2549. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  2550. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  2551. }
  2552. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  2553. {
  2554. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  2555. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2556. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  2557. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  2558. }
  2559. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  2560. {
  2561. float2 leftRight = step(d.xy, d.yx);
  2562. float2 rounding = (1.000000f * leftRight);
  2563. (rounding /= (leftRight.x + leftRight.y));
  2564. float2 factor = float2(1.000000f, 1.000000f);
  2565. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2566. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2567. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2568. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  2569. (weights *= saturate(factor));
  2570. }
  2571. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  2572. {
  2573. float2 leftRight = step(d.xy, d.yx);
  2574. float2 rounding = (1.000000f * leftRight);
  2575. (rounding /= (leftRight.x + leftRight.y));
  2576. float2 factor = float2(1.000000f, 1.000000f);
  2577. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2578. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2579. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2580. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  2581. (weights *= saturate(factor));
  2582. }
  2583. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  2584. {
  2585. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  2586. float2 e = tex2D(edgesTex, texcoord).xy;
  2587. [branch]if ((e.y > 0.000000f))
  2588. {
  2589. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  2590. [branch]if ((weights.x == -weights.y))
  2591. {
  2592. float2 d;
  2593. float3 coords;
  2594. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  2595. (coords.y = offset[1].y);
  2596. (d.x = coords.x);
  2597. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  2598. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  2599. (d.y = coords.z);
  2600. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  2601. float2 sqrt_d = sqrt(d);
  2602. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  2603. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  2604. (coords.y = texcoord.y);
  2605. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  2606. }
  2607. else
  2608. (e.x = 0.000000f);
  2609. }
  2610. [branch]if ((e.x > 0.000000f))
  2611. {
  2612. float2 d;
  2613. float3 coords;
  2614. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  2615. (coords.x = offset[0].x);
  2616. (d.x = coords.y);
  2617. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  2618. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  2619. (d.y = coords.z);
  2620. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  2621. float2 sqrt_d = sqrt(d);
  2622. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  2623. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  2624. (coords.x = texcoord.x);
  2625. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  2626. }
  2627. return weights;
  2628. }
  2629. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  2630. {
  2631. float4 a;
  2632. (a.x = tex2D(blendTex, offset.xy).w);
  2633. (a.y = tex2D(blendTex, offset.zw).y);
  2634. (a.wz = tex2D(blendTex, texcoord).xz);
  2635. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  2636. {
  2637. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  2638. return color;
  2639. }
  2640. else
  2641. {
  2642. bool h = (max(a.x, a.z) > max(a.y, a.w));
  2643. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  2644. float2 blendingWeight = a.yw;
  2645. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  2646. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  2647. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  2648. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  2649. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  2650. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  2651. return color;
  2652. }
  2653. }
  2654. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  2655. {
  2656. float4 current = tex2D(currentColorTex, texcoord);
  2657. float4 previous = tex2D(previousColorTex, texcoord);
  2658. return lerp(current, previous, 0.500000f);
  2659. }
  2660. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  2661. {
  2662. float4 offset[3];
  2663. FullscreenTriangle(id, position, texcoord);
  2664. SMAAEdgeDetectionVS(texcoord, offset);
  2665. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  2666. }
  2667. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  2668. {
  2669. float4 offset[3];
  2670. FullscreenTriangle(id, position, texcoord);
  2671. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  2672. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  2673. }
  2674. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  2675. {
  2676. FullscreenTriangle(id, position, texcoord);
  2677. SMAANeighborhoodBlendingVS(texcoord, offset);
  2678. }
  2679. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2680. {
  2681. float4 offset[3] = { offset0, offset1, offset2 };
  2682. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  2683. }
  2684. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2685. {
  2686. float4 offset[3] = { offset0, offset1, offset2 };
  2687. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  2688. }
  2689. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2690. {
  2691. float4 offset[3] = { offset0, offset1, offset2 };
  2692. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  2693. }
  2694. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  2695. {
  2696. float4 offset[3] = { offset0, offset1, offset2 };
  2697. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  2698. }
  2699. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  2700. {
  2701. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  2702. return color;
  2703. }
  2704. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  2705. {
  2706. (color = tex2D(colorGammaSampler, texcoord).xyz);
  2707. float depth = tex2D(depthSampler, texcoord).x;
  2708. []if (depthtoggle)
  2709. {
  2710. const float z_near = 1.000000f;
  2711. const float z_far = 100.000000f;
  2712. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  2713. (color.xyz = float3(depth.xxx));
  2714. }
  2715. (color = main(texcoord, color.xyzz).xyz);
  2716. }
  2717. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  2718. {
  2719. (color = tex2D(colorGammaSampler, texcoord));
  2720. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  2721. }
  2722. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  2723. {
  2724. (color = tex2D(colorGammaSampler, texcoord));
  2725. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  2726. }
  2727. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  2728. {
  2729. const float curtain_time = 3500.000000f;
  2730. float coord = abs((texcoord.x - 0.500000f));
  2731. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  2732. []if (((coord < factor) || (timer > 10000.000000f)))
  2733. (color = tex2D(colorGammaSampler, texcoord));
  2734. else
  2735. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  2736. }
  2737. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  2738. {
  2739. float coord = abs((texcoord.x - 0.500000f));
  2740. float factor = (timeleft / 8000.000000f);
  2741. []if ((coord < factor))
  2742. (color = tex2D(colorGammaSampler, texcoord));
  2743. else
  2744. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  2745. }
  2746. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  2747. {
  2748. float3 image = tex2D(transitionSampler, texcoord).xyz;
  2749. (color = tex2D(colorGammaSampler, texcoord).xyz);
  2750. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  2751. }
  2752. void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
  2753. {
  2754. SMAANeighborhoodBlendingVSWrap(id, position, texcoord, offset);
  2755. position.xy += _PIXEL_SIZE_.zw * position.ww;
  2756. }
  2757.  
  2758.  
  2759. 28/12/2014 19:25:23,418 | TRACE | > Compiling shader 'SMAANeighborhoodBlendingPSWrap':
  2760.  
  2761. uniform float4 _PIXEL_SIZE_ : register(c223);
  2762. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  2763. #define POSITION VPOS
  2764. uniform bool depthtoggle : register(c0);
  2765. uniform float timer : register(c1);
  2766. uniform float timeleft : register(c2);
  2767. sampler2D colorGammaSampler : register(s0);
  2768. sampler2D colorLinearSampler : register(s1);
  2769. sampler2D transitionSampler : register(s2);
  2770. sampler2D edgesSampler : register(s3);
  2771. sampler2D blendSampler : register(s4);
  2772. sampler2D areaSampler : register(s5);
  2773. sampler2D searchSampler : register(s6);
  2774. sampler2D depthSampler : register(s7);
  2775. float4 CurvesPass(in float4 colorInput)
  2776. {
  2777. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  2778. float Curves_contrast_blend = 0.150000f;
  2779. float3 x = colorInput.xyz;
  2780. (x = (x - 0.500000f));
  2781. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  2782. float3 color = x;
  2783. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  2784. return colorInput;
  2785. }
  2786. float4 main(in float2 tex, in float4 FinalColor)
  2787. {
  2788. (FinalColor = CurvesPass(FinalColor));
  2789. return FinalColor;
  2790. }
  2791. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  2792. {
  2793. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  2794. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  2795. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  2796. }
  2797. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  2798. {
  2799. float P = tex2D(tex, texcoord).x;
  2800. float Pleft = tex2D(tex, offset[0].xy).x;
  2801. float Ptop = tex2D(tex, offset[0].zw).x;
  2802. return float3(P, Pleft, Ptop);
  2803. }
  2804. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  2805. {
  2806. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  2807. float2 delta = abs((neighbours.xx - neighbours.yz));
  2808. float2 edges = step(0.010000f, delta);
  2809. return (0.200000f * (1.000000f - (0.400000f * edges)));
  2810. }
  2811. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  2812. {
  2813. [flatten]if (cond.x)
  2814. (variable.x = value.x);
  2815. [flatten]if (cond.y)
  2816. (variable.y = value.y);
  2817. }
  2818. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  2819. {
  2820. SMAAMovc(cond.xy, variable.xy, value.xy);
  2821. SMAAMovc(cond.zw, variable.zw, value.zw);
  2822. }
  2823. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  2824. {
  2825. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  2826. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2827. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  2828. }
  2829. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  2830. {
  2831. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  2832. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  2833. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  2834. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  2835. }
  2836. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  2837. {
  2838. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  2839. }
  2840. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  2841. {
  2842. float2 threshold = float2(0.100000f, 0.100000f);
  2843. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  2844. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  2845. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  2846. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  2847. float4 delta;
  2848. (delta.xy = abs((L - float2(Lleft, Ltop))));
  2849. float2 edges = step(threshold, delta.xy);
  2850. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  2851. discard;
  2852. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  2853. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  2854. (delta.zw = abs((L - float2(Lright, Lbottom))));
  2855. float2 maxDelta = max(delta.xy, delta.zw);
  2856. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  2857. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  2858. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  2859. (maxDelta = max(maxDelta.xy, delta.zw));
  2860. float finalDelta = max(maxDelta.x, maxDelta.y);
  2861. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  2862. return edges;
  2863. }
  2864. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  2865. {
  2866. float2 threshold = float2(0.100000f, 0.100000f);
  2867. float4 delta;
  2868. float3 C = tex2D(colorTex, texcoord).xyz;
  2869. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  2870. float3 t = abs((C - Cleft));
  2871. (delta.x = max(max(t.x, t.y), t.z));
  2872. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  2873. (t = abs((C - Ctop)));
  2874. (delta.y = max(max(t.x, t.y), t.z));
  2875. float2 edges = step(threshold, delta.xy);
  2876. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  2877. discard;
  2878. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  2879. (t = abs((C - Cright)));
  2880. (delta.z = max(max(t.x, t.y), t.z));
  2881. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  2882. (t = abs((C - Cbottom)));
  2883. (delta.w = max(max(t.x, t.y), t.z));
  2884. float2 maxDelta = max(delta.xy, delta.zw);
  2885. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  2886. (t = abs((C - Cleftleft)));
  2887. (delta.z = max(max(t.x, t.y), t.z));
  2888. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  2889. (t = abs((C - Ctoptop)));
  2890. (delta.w = max(max(t.x, t.y), t.z));
  2891. (maxDelta = max(maxDelta.xy, delta.zw));
  2892. float finalDelta = max(maxDelta.x, maxDelta.y);
  2893. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  2894. return edges;
  2895. }
  2896. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  2897. {
  2898. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  2899. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  2900. float2 edges = step(0.010000f, delta);
  2901. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  2902. discard;
  2903. return edges;
  2904. }
  2905. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  2906. {
  2907. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  2908. return round(e);
  2909. }
  2910. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  2911. {
  2912. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  2913. return round(e);
  2914. }
  2915. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2916. {
  2917. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2918. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  2919. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  2920. {
  2921. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2922. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  2923. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2924. }
  2925. return coord.zw;
  2926. }
  2927. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  2928. {
  2929. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  2930. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  2931. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  2932. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  2933. {
  2934. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  2935. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  2936. (e = SMAADecodeDiagBilinearAccess(e));
  2937. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  2938. }
  2939. return coord.zw;
  2940. }
  2941. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  2942. {
  2943. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  2944. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  2945. (texcoord.x += 0.500000f);
  2946. (texcoord.y += (0.142857f * offset));
  2947. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  2948. }
  2949. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  2950. {
  2951. float2 weights = float2(0.000000f, 0.000000f);
  2952. float4 d;
  2953. float2 end;
  2954. []if ((e.x > 0.000000f))
  2955. {
  2956. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  2957. (d.x += float((end.y > 0.900000f)));
  2958. }
  2959. else
  2960. (d.xz = float2(0.000000f, 0.000000f));
  2961. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  2962. [branch]if (((d.x + d.y) > 2.000000f))
  2963. {
  2964. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  2965. float4 c;
  2966. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  2967. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  2968. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  2969. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2970. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2971. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  2972. }
  2973. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  2974. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  2975. {
  2976. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  2977. (d.y += float((end.y > 0.900000f)));
  2978. }
  2979. else
  2980. (d.yw = float2(0.000000f, 0.000000f));
  2981. [branch]if (((d.x + d.y) > 2.000000f))
  2982. {
  2983. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  2984. float4 c;
  2985. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  2986. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  2987. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  2988. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  2989. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  2990. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  2991. }
  2992. return weights;
  2993. }
  2994. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  2995. {
  2996. float2 scale = float2(33.000000f, -33.000000f);
  2997. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  2998. (scale += float2(-1.000000f, 1.000000f));
  2999. (bias += float2(0.500000f, -0.500000f));
  3000. (scale *= float2(0.015625f, 0.062500f));
  3001. (bias *= float2(0.015625f, 0.062500f));
  3002. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  3003. }
  3004. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3005. {
  3006. float2 e = float2(0.000000f, 1.000000f);
  3007. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3008. {
  3009. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3010. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3011. }
  3012. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  3013. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  3014. }
  3015. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3016. {
  3017. float2 e = float2(0.000000f, 1.000000f);
  3018. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3019. {
  3020. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3021. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3022. }
  3023. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  3024. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  3025. }
  3026. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3027. {
  3028. float2 e = float2(1.000000f, 0.000000f);
  3029. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3030. {
  3031. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3032. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3033. }
  3034. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  3035. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  3036. }
  3037. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3038. {
  3039. float2 e = float2(1.000000f, 0.000000f);
  3040. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3041. {
  3042. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3043. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3044. }
  3045. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  3046. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  3047. }
  3048. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  3049. {
  3050. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  3051. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3052. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  3053. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  3054. }
  3055. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3056. {
  3057. float2 leftRight = step(d.xy, d.yx);
  3058. float2 rounding = (1.000000f * leftRight);
  3059. (rounding /= (leftRight.x + leftRight.y));
  3060. float2 factor = float2(1.000000f, 1.000000f);
  3061. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3062. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3063. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3064. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3065. (weights *= saturate(factor));
  3066. }
  3067. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3068. {
  3069. float2 leftRight = step(d.xy, d.yx);
  3070. float2 rounding = (1.000000f * leftRight);
  3071. (rounding /= (leftRight.x + leftRight.y));
  3072. float2 factor = float2(1.000000f, 1.000000f);
  3073. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3074. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3075. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3076. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3077. (weights *= saturate(factor));
  3078. }
  3079. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  3080. {
  3081. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  3082. float2 e = tex2D(edgesTex, texcoord).xy;
  3083. [branch]if ((e.y > 0.000000f))
  3084. {
  3085. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  3086. [branch]if ((weights.x == -weights.y))
  3087. {
  3088. float2 d;
  3089. float3 coords;
  3090. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  3091. (coords.y = offset[1].y);
  3092. (d.x = coords.x);
  3093. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  3094. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  3095. (d.y = coords.z);
  3096. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  3097. float2 sqrt_d = sqrt(d);
  3098. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  3099. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  3100. (coords.y = texcoord.y);
  3101. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  3102. }
  3103. else
  3104. (e.x = 0.000000f);
  3105. }
  3106. [branch]if ((e.x > 0.000000f))
  3107. {
  3108. float2 d;
  3109. float3 coords;
  3110. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  3111. (coords.x = offset[0].x);
  3112. (d.x = coords.y);
  3113. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  3114. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  3115. (d.y = coords.z);
  3116. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  3117. float2 sqrt_d = sqrt(d);
  3118. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  3119. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  3120. (coords.x = texcoord.x);
  3121. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  3122. }
  3123. return weights;
  3124. }
  3125. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  3126. {
  3127. float4 a;
  3128. (a.x = tex2D(blendTex, offset.xy).w);
  3129. (a.y = tex2D(blendTex, offset.zw).y);
  3130. (a.wz = tex2D(blendTex, texcoord).xz);
  3131. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  3132. {
  3133. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  3134. return color;
  3135. }
  3136. else
  3137. {
  3138. bool h = (max(a.x, a.z) > max(a.y, a.w));
  3139. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  3140. float2 blendingWeight = a.yw;
  3141. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  3142. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  3143. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  3144. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  3145. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  3146. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  3147. return color;
  3148. }
  3149. }
  3150. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  3151. {
  3152. float4 current = tex2D(currentColorTex, texcoord);
  3153. float4 previous = tex2D(previousColorTex, texcoord);
  3154. return lerp(current, previous, 0.500000f);
  3155. }
  3156. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  3157. {
  3158. float4 offset[3];
  3159. FullscreenTriangle(id, position, texcoord);
  3160. SMAAEdgeDetectionVS(texcoord, offset);
  3161. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  3162. }
  3163. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  3164. {
  3165. float4 offset[3];
  3166. FullscreenTriangle(id, position, texcoord);
  3167. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  3168. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  3169. }
  3170. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  3171. {
  3172. FullscreenTriangle(id, position, texcoord);
  3173. SMAANeighborhoodBlendingVS(texcoord, offset);
  3174. }
  3175. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3176. {
  3177. float4 offset[3] = { offset0, offset1, offset2 };
  3178. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  3179. }
  3180. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3181. {
  3182. float4 offset[3] = { offset0, offset1, offset2 };
  3183. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  3184. }
  3185. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3186. {
  3187. float4 offset[3] = { offset0, offset1, offset2 };
  3188. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  3189. }
  3190. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3191. {
  3192. float4 offset[3] = { offset0, offset1, offset2 };
  3193. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  3194. }
  3195. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  3196. {
  3197. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  3198. return color;
  3199. }
  3200. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  3201. {
  3202. (color = tex2D(colorGammaSampler, texcoord).xyz);
  3203. float depth = tex2D(depthSampler, texcoord).x;
  3204. []if (depthtoggle)
  3205. {
  3206. const float z_near = 1.000000f;
  3207. const float z_far = 100.000000f;
  3208. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  3209. (color.xyz = float3(depth.xxx));
  3210. }
  3211. (color = main(texcoord, color.xyzz).xyz);
  3212. }
  3213. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  3214. {
  3215. (color = tex2D(colorGammaSampler, texcoord));
  3216. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  3217. }
  3218. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  3219. {
  3220. (color = tex2D(colorGammaSampler, texcoord));
  3221. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  3222. }
  3223. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  3224. {
  3225. const float curtain_time = 3500.000000f;
  3226. float coord = abs((texcoord.x - 0.500000f));
  3227. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  3228. []if (((coord < factor) || (timer > 10000.000000f)))
  3229. (color = tex2D(colorGammaSampler, texcoord));
  3230. else
  3231. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  3232. }
  3233. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  3234. {
  3235. float coord = abs((texcoord.x - 0.500000f));
  3236. float factor = (timeleft / 8000.000000f);
  3237. []if ((coord < factor))
  3238. (color = tex2D(colorGammaSampler, texcoord));
  3239. else
  3240. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  3241. }
  3242. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  3243. {
  3244. float3 image = tex2D(transitionSampler, texcoord).xyz;
  3245. (color = tex2D(colorGammaSampler, texcoord).xyz);
  3246. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  3247. }
  3248. float4 __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : COLOR
  3249. {
  3250. float4 _return = float4(SMAANeighborhoodBlendingPSWrap(position, texcoord, offset), 0.0f);
  3251. return _return;
  3252. }
  3253.  
  3254.  
  3255. 28/12/2014 19:25:23,432 | TRACE | > Compiling shader 'FullscreenTriangle':
  3256.  
  3257. uniform float4 _PIXEL_SIZE_ : register(c223);
  3258. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  3259. uniform bool depthtoggle : register(c0);
  3260. uniform float timer : register(c1);
  3261. uniform float timeleft : register(c2);
  3262. sampler2D colorGammaSampler : register(s0);
  3263. sampler2D colorLinearSampler : register(s1);
  3264. sampler2D transitionSampler : register(s2);
  3265. sampler2D edgesSampler : register(s3);
  3266. sampler2D blendSampler : register(s4);
  3267. sampler2D areaSampler : register(s5);
  3268. sampler2D searchSampler : register(s6);
  3269. sampler2D depthSampler : register(s7);
  3270. float4 CurvesPass(in float4 colorInput)
  3271. {
  3272. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  3273. float Curves_contrast_blend = 0.150000f;
  3274. float3 x = colorInput.xyz;
  3275. (x = (x - 0.500000f));
  3276. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  3277. float3 color = x;
  3278. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  3279. return colorInput;
  3280. }
  3281. float4 main(in float2 tex, in float4 FinalColor)
  3282. {
  3283. (FinalColor = CurvesPass(FinalColor));
  3284. return FinalColor;
  3285. }
  3286. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  3287. {
  3288. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  3289. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  3290. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  3291. }
  3292. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  3293. {
  3294. float P = tex2D(tex, texcoord).x;
  3295. float Pleft = tex2D(tex, offset[0].xy).x;
  3296. float Ptop = tex2D(tex, offset[0].zw).x;
  3297. return float3(P, Pleft, Ptop);
  3298. }
  3299. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  3300. {
  3301. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  3302. float2 delta = abs((neighbours.xx - neighbours.yz));
  3303. float2 edges = step(0.010000f, delta);
  3304. return (0.200000f * (1.000000f - (0.400000f * edges)));
  3305. }
  3306. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  3307. {
  3308. [flatten]if (cond.x)
  3309. (variable.x = value.x);
  3310. [flatten]if (cond.y)
  3311. (variable.y = value.y);
  3312. }
  3313. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  3314. {
  3315. SMAAMovc(cond.xy, variable.xy, value.xy);
  3316. SMAAMovc(cond.zw, variable.zw, value.zw);
  3317. }
  3318. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  3319. {
  3320. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  3321. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3322. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  3323. }
  3324. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  3325. {
  3326. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  3327. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  3328. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  3329. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  3330. }
  3331. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  3332. {
  3333. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3334. }
  3335. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  3336. {
  3337. float2 threshold = float2(0.100000f, 0.100000f);
  3338. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  3339. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  3340. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  3341. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  3342. float4 delta;
  3343. (delta.xy = abs((L - float2(Lleft, Ltop))));
  3344. float2 edges = step(threshold, delta.xy);
  3345. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  3346. discard;
  3347. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  3348. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  3349. (delta.zw = abs((L - float2(Lright, Lbottom))));
  3350. float2 maxDelta = max(delta.xy, delta.zw);
  3351. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  3352. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  3353. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  3354. (maxDelta = max(maxDelta.xy, delta.zw));
  3355. float finalDelta = max(maxDelta.x, maxDelta.y);
  3356. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  3357. return edges;
  3358. }
  3359. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  3360. {
  3361. float2 threshold = float2(0.100000f, 0.100000f);
  3362. float4 delta;
  3363. float3 C = tex2D(colorTex, texcoord).xyz;
  3364. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  3365. float3 t = abs((C - Cleft));
  3366. (delta.x = max(max(t.x, t.y), t.z));
  3367. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  3368. (t = abs((C - Ctop)));
  3369. (delta.y = max(max(t.x, t.y), t.z));
  3370. float2 edges = step(threshold, delta.xy);
  3371. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  3372. discard;
  3373. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  3374. (t = abs((C - Cright)));
  3375. (delta.z = max(max(t.x, t.y), t.z));
  3376. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  3377. (t = abs((C - Cbottom)));
  3378. (delta.w = max(max(t.x, t.y), t.z));
  3379. float2 maxDelta = max(delta.xy, delta.zw);
  3380. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  3381. (t = abs((C - Cleftleft)));
  3382. (delta.z = max(max(t.x, t.y), t.z));
  3383. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  3384. (t = abs((C - Ctoptop)));
  3385. (delta.w = max(max(t.x, t.y), t.z));
  3386. (maxDelta = max(maxDelta.xy, delta.zw));
  3387. float finalDelta = max(maxDelta.x, maxDelta.y);
  3388. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  3389. return edges;
  3390. }
  3391. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  3392. {
  3393. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  3394. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  3395. float2 edges = step(0.010000f, delta);
  3396. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  3397. discard;
  3398. return edges;
  3399. }
  3400. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  3401. {
  3402. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  3403. return round(e);
  3404. }
  3405. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  3406. {
  3407. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  3408. return round(e);
  3409. }
  3410. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3411. {
  3412. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3413. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  3414. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  3415. {
  3416. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3417. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  3418. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3419. }
  3420. return coord.zw;
  3421. }
  3422. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3423. {
  3424. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3425. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  3426. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  3427. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  3428. {
  3429. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3430. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  3431. (e = SMAADecodeDiagBilinearAccess(e));
  3432. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3433. }
  3434. return coord.zw;
  3435. }
  3436. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  3437. {
  3438. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  3439. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3440. (texcoord.x += 0.500000f);
  3441. (texcoord.y += (0.142857f * offset));
  3442. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  3443. }
  3444. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  3445. {
  3446. float2 weights = float2(0.000000f, 0.000000f);
  3447. float4 d;
  3448. float2 end;
  3449. []if ((e.x > 0.000000f))
  3450. {
  3451. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  3452. (d.x += float((end.y > 0.900000f)));
  3453. }
  3454. else
  3455. (d.xz = float2(0.000000f, 0.000000f));
  3456. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  3457. [branch]if (((d.x + d.y) > 2.000000f))
  3458. {
  3459. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  3460. float4 c;
  3461. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  3462. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  3463. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  3464. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3465. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3466. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  3467. }
  3468. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  3469. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  3470. {
  3471. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  3472. (d.y += float((end.y > 0.900000f)));
  3473. }
  3474. else
  3475. (d.yw = float2(0.000000f, 0.000000f));
  3476. [branch]if (((d.x + d.y) > 2.000000f))
  3477. {
  3478. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  3479. float4 c;
  3480. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  3481. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  3482. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  3483. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3484. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3485. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  3486. }
  3487. return weights;
  3488. }
  3489. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  3490. {
  3491. float2 scale = float2(33.000000f, -33.000000f);
  3492. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  3493. (scale += float2(-1.000000f, 1.000000f));
  3494. (bias += float2(0.500000f, -0.500000f));
  3495. (scale *= float2(0.015625f, 0.062500f));
  3496. (bias *= float2(0.015625f, 0.062500f));
  3497. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  3498. }
  3499. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3500. {
  3501. float2 e = float2(0.000000f, 1.000000f);
  3502. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3503. {
  3504. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3505. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3506. }
  3507. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  3508. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  3509. }
  3510. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3511. {
  3512. float2 e = float2(0.000000f, 1.000000f);
  3513. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3514. {
  3515. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3516. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3517. }
  3518. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  3519. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  3520. }
  3521. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3522. {
  3523. float2 e = float2(1.000000f, 0.000000f);
  3524. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3525. {
  3526. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3527. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3528. }
  3529. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  3530. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  3531. }
  3532. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3533. {
  3534. float2 e = float2(1.000000f, 0.000000f);
  3535. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  3536. {
  3537. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  3538. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  3539. }
  3540. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  3541. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  3542. }
  3543. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  3544. {
  3545. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  3546. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3547. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  3548. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  3549. }
  3550. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3551. {
  3552. float2 leftRight = step(d.xy, d.yx);
  3553. float2 rounding = (1.000000f * leftRight);
  3554. (rounding /= (leftRight.x + leftRight.y));
  3555. float2 factor = float2(1.000000f, 1.000000f);
  3556. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3557. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3558. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3559. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  3560. (weights *= saturate(factor));
  3561. }
  3562. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  3563. {
  3564. float2 leftRight = step(d.xy, d.yx);
  3565. float2 rounding = (1.000000f * leftRight);
  3566. (rounding /= (leftRight.x + leftRight.y));
  3567. float2 factor = float2(1.000000f, 1.000000f);
  3568. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3569. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3570. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3571. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  3572. (weights *= saturate(factor));
  3573. }
  3574. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  3575. {
  3576. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  3577. float2 e = tex2D(edgesTex, texcoord).xy;
  3578. [branch]if ((e.y > 0.000000f))
  3579. {
  3580. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  3581. [branch]if ((weights.x == -weights.y))
  3582. {
  3583. float2 d;
  3584. float3 coords;
  3585. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  3586. (coords.y = offset[1].y);
  3587. (d.x = coords.x);
  3588. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  3589. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  3590. (d.y = coords.z);
  3591. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  3592. float2 sqrt_d = sqrt(d);
  3593. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  3594. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  3595. (coords.y = texcoord.y);
  3596. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  3597. }
  3598. else
  3599. (e.x = 0.000000f);
  3600. }
  3601. [branch]if ((e.x > 0.000000f))
  3602. {
  3603. float2 d;
  3604. float3 coords;
  3605. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  3606. (coords.x = offset[0].x);
  3607. (d.x = coords.y);
  3608. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  3609. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  3610. (d.y = coords.z);
  3611. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  3612. float2 sqrt_d = sqrt(d);
  3613. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  3614. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  3615. (coords.x = texcoord.x);
  3616. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  3617. }
  3618. return weights;
  3619. }
  3620. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  3621. {
  3622. float4 a;
  3623. (a.x = tex2D(blendTex, offset.xy).w);
  3624. (a.y = tex2D(blendTex, offset.zw).y);
  3625. (a.wz = tex2D(blendTex, texcoord).xz);
  3626. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  3627. {
  3628. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  3629. return color;
  3630. }
  3631. else
  3632. {
  3633. bool h = (max(a.x, a.z) > max(a.y, a.w));
  3634. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  3635. float2 blendingWeight = a.yw;
  3636. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  3637. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  3638. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  3639. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  3640. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  3641. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  3642. return color;
  3643. }
  3644. }
  3645. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  3646. {
  3647. float4 current = tex2D(currentColorTex, texcoord);
  3648. float4 previous = tex2D(previousColorTex, texcoord);
  3649. return lerp(current, previous, 0.500000f);
  3650. }
  3651. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  3652. {
  3653. float4 offset[3];
  3654. FullscreenTriangle(id, position, texcoord);
  3655. SMAAEdgeDetectionVS(texcoord, offset);
  3656. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  3657. }
  3658. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  3659. {
  3660. float4 offset[3];
  3661. FullscreenTriangle(id, position, texcoord);
  3662. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  3663. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  3664. }
  3665. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  3666. {
  3667. FullscreenTriangle(id, position, texcoord);
  3668. SMAANeighborhoodBlendingVS(texcoord, offset);
  3669. }
  3670. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3671. {
  3672. float4 offset[3] = { offset0, offset1, offset2 };
  3673. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  3674. }
  3675. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3676. {
  3677. float4 offset[3] = { offset0, offset1, offset2 };
  3678. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  3679. }
  3680. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3681. {
  3682. float4 offset[3] = { offset0, offset1, offset2 };
  3683. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  3684. }
  3685. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  3686. {
  3687. float4 offset[3] = { offset0, offset1, offset2 };
  3688. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  3689. }
  3690. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  3691. {
  3692. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  3693. return color;
  3694. }
  3695. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  3696. {
  3697. (color = tex2D(colorGammaSampler, texcoord).xyz);
  3698. float depth = tex2D(depthSampler, texcoord).x;
  3699. []if (depthtoggle)
  3700. {
  3701. const float z_near = 1.000000f;
  3702. const float z_far = 100.000000f;
  3703. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  3704. (color.xyz = float3(depth.xxx));
  3705. }
  3706. (color = main(texcoord, color.xyzz).xyz);
  3707. }
  3708. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  3709. {
  3710. (color = tex2D(colorGammaSampler, texcoord));
  3711. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  3712. }
  3713. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  3714. {
  3715. (color = tex2D(colorGammaSampler, texcoord));
  3716. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  3717. }
  3718. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  3719. {
  3720. const float curtain_time = 3500.000000f;
  3721. float coord = abs((texcoord.x - 0.500000f));
  3722. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  3723. []if (((coord < factor) || (timer > 10000.000000f)))
  3724. (color = tex2D(colorGammaSampler, texcoord));
  3725. else
  3726. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  3727. }
  3728. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  3729. {
  3730. float coord = abs((texcoord.x - 0.500000f));
  3731. float factor = (timeleft / 8000.000000f);
  3732. []if ((coord < factor))
  3733. (color = tex2D(colorGammaSampler, texcoord));
  3734. else
  3735. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  3736. }
  3737. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  3738. {
  3739. float3 image = tex2D(transitionSampler, texcoord).xyz;
  3740. (color = tex2D(colorGammaSampler, texcoord).xyz);
  3741. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  3742. }
  3743. void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0)
  3744. {
  3745. FullscreenTriangle(id, position, texcoord);
  3746. position.xy += _PIXEL_SIZE_.zw * position.ww;
  3747. }
  3748.  
  3749.  
  3750. 28/12/2014 19:25:23,441 | TRACE | > Compiling shader 'SharedWrap':
  3751.  
  3752. uniform float4 _PIXEL_SIZE_ : register(c223);
  3753. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  3754. #define POSITION VPOS
  3755. uniform bool depthtoggle : register(c0);
  3756. uniform float timer : register(c1);
  3757. uniform float timeleft : register(c2);
  3758. sampler2D colorGammaSampler : register(s0);
  3759. sampler2D colorLinearSampler : register(s1);
  3760. sampler2D transitionSampler : register(s2);
  3761. sampler2D edgesSampler : register(s3);
  3762. sampler2D blendSampler : register(s4);
  3763. sampler2D areaSampler : register(s5);
  3764. sampler2D searchSampler : register(s6);
  3765. sampler2D depthSampler : register(s7);
  3766. float4 CurvesPass(in float4 colorInput)
  3767. {
  3768. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  3769. float Curves_contrast_blend = 0.150000f;
  3770. float3 x = colorInput.xyz;
  3771. (x = (x - 0.500000f));
  3772. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  3773. float3 color = x;
  3774. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  3775. return colorInput;
  3776. }
  3777. float4 main(in float2 tex, in float4 FinalColor)
  3778. {
  3779. (FinalColor = CurvesPass(FinalColor));
  3780. return FinalColor;
  3781. }
  3782. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  3783. {
  3784. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  3785. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  3786. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  3787. }
  3788. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  3789. {
  3790. float P = tex2D(tex, texcoord).x;
  3791. float Pleft = tex2D(tex, offset[0].xy).x;
  3792. float Ptop = tex2D(tex, offset[0].zw).x;
  3793. return float3(P, Pleft, Ptop);
  3794. }
  3795. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  3796. {
  3797. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  3798. float2 delta = abs((neighbours.xx - neighbours.yz));
  3799. float2 edges = step(0.010000f, delta);
  3800. return (0.200000f * (1.000000f - (0.400000f * edges)));
  3801. }
  3802. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  3803. {
  3804. [flatten]if (cond.x)
  3805. (variable.x = value.x);
  3806. [flatten]if (cond.y)
  3807. (variable.y = value.y);
  3808. }
  3809. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  3810. {
  3811. SMAAMovc(cond.xy, variable.xy, value.xy);
  3812. SMAAMovc(cond.zw, variable.zw, value.zw);
  3813. }
  3814. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  3815. {
  3816. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  3817. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3818. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  3819. }
  3820. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  3821. {
  3822. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  3823. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  3824. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  3825. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  3826. }
  3827. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  3828. {
  3829. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  3830. }
  3831. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  3832. {
  3833. float2 threshold = float2(0.100000f, 0.100000f);
  3834. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  3835. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  3836. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  3837. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  3838. float4 delta;
  3839. (delta.xy = abs((L - float2(Lleft, Ltop))));
  3840. float2 edges = step(threshold, delta.xy);
  3841. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  3842. discard;
  3843. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  3844. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  3845. (delta.zw = abs((L - float2(Lright, Lbottom))));
  3846. float2 maxDelta = max(delta.xy, delta.zw);
  3847. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  3848. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  3849. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  3850. (maxDelta = max(maxDelta.xy, delta.zw));
  3851. float finalDelta = max(maxDelta.x, maxDelta.y);
  3852. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  3853. return edges;
  3854. }
  3855. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  3856. {
  3857. float2 threshold = float2(0.100000f, 0.100000f);
  3858. float4 delta;
  3859. float3 C = tex2D(colorTex, texcoord).xyz;
  3860. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  3861. float3 t = abs((C - Cleft));
  3862. (delta.x = max(max(t.x, t.y), t.z));
  3863. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  3864. (t = abs((C - Ctop)));
  3865. (delta.y = max(max(t.x, t.y), t.z));
  3866. float2 edges = step(threshold, delta.xy);
  3867. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  3868. discard;
  3869. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  3870. (t = abs((C - Cright)));
  3871. (delta.z = max(max(t.x, t.y), t.z));
  3872. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  3873. (t = abs((C - Cbottom)));
  3874. (delta.w = max(max(t.x, t.y), t.z));
  3875. float2 maxDelta = max(delta.xy, delta.zw);
  3876. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  3877. (t = abs((C - Cleftleft)));
  3878. (delta.z = max(max(t.x, t.y), t.z));
  3879. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  3880. (t = abs((C - Ctoptop)));
  3881. (delta.w = max(max(t.x, t.y), t.z));
  3882. (maxDelta = max(maxDelta.xy, delta.zw));
  3883. float finalDelta = max(maxDelta.x, maxDelta.y);
  3884. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  3885. return edges;
  3886. }
  3887. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  3888. {
  3889. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  3890. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  3891. float2 edges = step(0.010000f, delta);
  3892. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  3893. discard;
  3894. return edges;
  3895. }
  3896. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  3897. {
  3898. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  3899. return round(e);
  3900. }
  3901. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  3902. {
  3903. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  3904. return round(e);
  3905. }
  3906. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3907. {
  3908. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3909. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  3910. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  3911. {
  3912. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3913. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  3914. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3915. }
  3916. return coord.zw;
  3917. }
  3918. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  3919. {
  3920. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  3921. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  3922. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  3923. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  3924. {
  3925. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  3926. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  3927. (e = SMAADecodeDiagBilinearAccess(e));
  3928. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  3929. }
  3930. return coord.zw;
  3931. }
  3932. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  3933. {
  3934. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  3935. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  3936. (texcoord.x += 0.500000f);
  3937. (texcoord.y += (0.142857f * offset));
  3938. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  3939. }
  3940. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  3941. {
  3942. float2 weights = float2(0.000000f, 0.000000f);
  3943. float4 d;
  3944. float2 end;
  3945. []if ((e.x > 0.000000f))
  3946. {
  3947. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  3948. (d.x += float((end.y > 0.900000f)));
  3949. }
  3950. else
  3951. (d.xz = float2(0.000000f, 0.000000f));
  3952. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  3953. [branch]if (((d.x + d.y) > 2.000000f))
  3954. {
  3955. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  3956. float4 c;
  3957. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  3958. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  3959. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  3960. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3961. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3962. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  3963. }
  3964. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  3965. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  3966. {
  3967. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  3968. (d.y += float((end.y > 0.900000f)));
  3969. }
  3970. else
  3971. (d.yw = float2(0.000000f, 0.000000f));
  3972. [branch]if (((d.x + d.y) > 2.000000f))
  3973. {
  3974. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  3975. float4 c;
  3976. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  3977. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  3978. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  3979. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  3980. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  3981. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  3982. }
  3983. return weights;
  3984. }
  3985. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  3986. {
  3987. float2 scale = float2(33.000000f, -33.000000f);
  3988. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  3989. (scale += float2(-1.000000f, 1.000000f));
  3990. (bias += float2(0.500000f, -0.500000f));
  3991. (scale *= float2(0.015625f, 0.062500f));
  3992. (bias *= float2(0.015625f, 0.062500f));
  3993. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  3994. }
  3995. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  3996. {
  3997. float2 e = float2(0.000000f, 1.000000f);
  3998. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  3999. {
  4000. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4001. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4002. }
  4003. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  4004. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  4005. }
  4006. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4007. {
  4008. float2 e = float2(0.000000f, 1.000000f);
  4009. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4010. {
  4011. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4012. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4013. }
  4014. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  4015. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  4016. }
  4017. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4018. {
  4019. float2 e = float2(1.000000f, 0.000000f);
  4020. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4021. {
  4022. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4023. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4024. }
  4025. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  4026. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  4027. }
  4028. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4029. {
  4030. float2 e = float2(1.000000f, 0.000000f);
  4031. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4032. {
  4033. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4034. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4035. }
  4036. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  4037. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  4038. }
  4039. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  4040. {
  4041. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  4042. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4043. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  4044. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  4045. }
  4046. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4047. {
  4048. float2 leftRight = step(d.xy, d.yx);
  4049. float2 rounding = (1.000000f * leftRight);
  4050. (rounding /= (leftRight.x + leftRight.y));
  4051. float2 factor = float2(1.000000f, 1.000000f);
  4052. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4053. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4054. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4055. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4056. (weights *= saturate(factor));
  4057. }
  4058. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4059. {
  4060. float2 leftRight = step(d.xy, d.yx);
  4061. float2 rounding = (1.000000f * leftRight);
  4062. (rounding /= (leftRight.x + leftRight.y));
  4063. float2 factor = float2(1.000000f, 1.000000f);
  4064. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4065. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4066. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4067. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4068. (weights *= saturate(factor));
  4069. }
  4070. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  4071. {
  4072. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  4073. float2 e = tex2D(edgesTex, texcoord).xy;
  4074. [branch]if ((e.y > 0.000000f))
  4075. {
  4076. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  4077. [branch]if ((weights.x == -weights.y))
  4078. {
  4079. float2 d;
  4080. float3 coords;
  4081. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  4082. (coords.y = offset[1].y);
  4083. (d.x = coords.x);
  4084. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  4085. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  4086. (d.y = coords.z);
  4087. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  4088. float2 sqrt_d = sqrt(d);
  4089. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  4090. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  4091. (coords.y = texcoord.y);
  4092. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  4093. }
  4094. else
  4095. (e.x = 0.000000f);
  4096. }
  4097. [branch]if ((e.x > 0.000000f))
  4098. {
  4099. float2 d;
  4100. float3 coords;
  4101. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  4102. (coords.x = offset[0].x);
  4103. (d.x = coords.y);
  4104. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  4105. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  4106. (d.y = coords.z);
  4107. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  4108. float2 sqrt_d = sqrt(d);
  4109. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  4110. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  4111. (coords.x = texcoord.x);
  4112. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  4113. }
  4114. return weights;
  4115. }
  4116. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  4117. {
  4118. float4 a;
  4119. (a.x = tex2D(blendTex, offset.xy).w);
  4120. (a.y = tex2D(blendTex, offset.zw).y);
  4121. (a.wz = tex2D(blendTex, texcoord).xz);
  4122. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  4123. {
  4124. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  4125. return color;
  4126. }
  4127. else
  4128. {
  4129. bool h = (max(a.x, a.z) > max(a.y, a.w));
  4130. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  4131. float2 blendingWeight = a.yw;
  4132. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  4133. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  4134. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  4135. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  4136. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  4137. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  4138. return color;
  4139. }
  4140. }
  4141. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  4142. {
  4143. float4 current = tex2D(currentColorTex, texcoord);
  4144. float4 previous = tex2D(previousColorTex, texcoord);
  4145. return lerp(current, previous, 0.500000f);
  4146. }
  4147. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  4148. {
  4149. float4 offset[3];
  4150. FullscreenTriangle(id, position, texcoord);
  4151. SMAAEdgeDetectionVS(texcoord, offset);
  4152. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  4153. }
  4154. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  4155. {
  4156. float4 offset[3];
  4157. FullscreenTriangle(id, position, texcoord);
  4158. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  4159. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  4160. }
  4161. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  4162. {
  4163. FullscreenTriangle(id, position, texcoord);
  4164. SMAANeighborhoodBlendingVS(texcoord, offset);
  4165. }
  4166. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4167. {
  4168. float4 offset[3] = { offset0, offset1, offset2 };
  4169. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  4170. }
  4171. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4172. {
  4173. float4 offset[3] = { offset0, offset1, offset2 };
  4174. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  4175. }
  4176. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4177. {
  4178. float4 offset[3] = { offset0, offset1, offset2 };
  4179. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  4180. }
  4181. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4182. {
  4183. float4 offset[3] = { offset0, offset1, offset2 };
  4184. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  4185. }
  4186. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  4187. {
  4188. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  4189. return color;
  4190. }
  4191. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  4192. {
  4193. (color = tex2D(colorGammaSampler, texcoord).xyz);
  4194. float depth = tex2D(depthSampler, texcoord).x;
  4195. []if (depthtoggle)
  4196. {
  4197. const float z_near = 1.000000f;
  4198. const float z_far = 100.000000f;
  4199. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  4200. (color.xyz = float3(depth.xxx));
  4201. }
  4202. (color = main(texcoord, color.xyzz).xyz);
  4203. }
  4204. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  4205. {
  4206. (color = tex2D(colorGammaSampler, texcoord));
  4207. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  4208. }
  4209. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  4210. {
  4211. (color = tex2D(colorGammaSampler, texcoord));
  4212. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  4213. }
  4214. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  4215. {
  4216. const float curtain_time = 3500.000000f;
  4217. float coord = abs((texcoord.x - 0.500000f));
  4218. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  4219. []if (((coord < factor) || (timer > 10000.000000f)))
  4220. (color = tex2D(colorGammaSampler, texcoord));
  4221. else
  4222. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  4223. }
  4224. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  4225. {
  4226. float coord = abs((texcoord.x - 0.500000f));
  4227. float factor = (timeleft / 8000.000000f);
  4228. []if ((coord < factor))
  4229. (color = tex2D(colorGammaSampler, texcoord));
  4230. else
  4231. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  4232. }
  4233. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  4234. {
  4235. float3 image = tex2D(transitionSampler, texcoord).xyz;
  4236. (color = tex2D(colorGammaSampler, texcoord).xyz);
  4237. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  4238. }
  4239. void __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, out float4 color : COLOR)
  4240. {
  4241. color = float4(0.0f, 0.0f, 0.0f, 0.0f);
  4242. SharedWrap(position, texcoord, color.xyz);
  4243. }
  4244.  
  4245.  
  4246. 28/12/2014 19:25:23,452 | TRACE | > Compiling shader 'FullscreenTriangle':
  4247.  
  4248. uniform float4 _PIXEL_SIZE_ : register(c223);
  4249. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  4250. uniform bool depthtoggle : register(c0);
  4251. uniform float timer : register(c1);
  4252. uniform float timeleft : register(c2);
  4253. sampler2D colorGammaSampler : register(s0);
  4254. sampler2D colorLinearSampler : register(s1);
  4255. sampler2D transitionSampler : register(s2);
  4256. sampler2D edgesSampler : register(s3);
  4257. sampler2D blendSampler : register(s4);
  4258. sampler2D areaSampler : register(s5);
  4259. sampler2D searchSampler : register(s6);
  4260. sampler2D depthSampler : register(s7);
  4261. float4 CurvesPass(in float4 colorInput)
  4262. {
  4263. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  4264. float Curves_contrast_blend = 0.150000f;
  4265. float3 x = colorInput.xyz;
  4266. (x = (x - 0.500000f));
  4267. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  4268. float3 color = x;
  4269. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  4270. return colorInput;
  4271. }
  4272. float4 main(in float2 tex, in float4 FinalColor)
  4273. {
  4274. (FinalColor = CurvesPass(FinalColor));
  4275. return FinalColor;
  4276. }
  4277. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  4278. {
  4279. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  4280. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  4281. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  4282. }
  4283. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  4284. {
  4285. float P = tex2D(tex, texcoord).x;
  4286. float Pleft = tex2D(tex, offset[0].xy).x;
  4287. float Ptop = tex2D(tex, offset[0].zw).x;
  4288. return float3(P, Pleft, Ptop);
  4289. }
  4290. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  4291. {
  4292. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  4293. float2 delta = abs((neighbours.xx - neighbours.yz));
  4294. float2 edges = step(0.010000f, delta);
  4295. return (0.200000f * (1.000000f - (0.400000f * edges)));
  4296. }
  4297. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  4298. {
  4299. [flatten]if (cond.x)
  4300. (variable.x = value.x);
  4301. [flatten]if (cond.y)
  4302. (variable.y = value.y);
  4303. }
  4304. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  4305. {
  4306. SMAAMovc(cond.xy, variable.xy, value.xy);
  4307. SMAAMovc(cond.zw, variable.zw, value.zw);
  4308. }
  4309. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  4310. {
  4311. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  4312. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4313. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  4314. }
  4315. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  4316. {
  4317. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  4318. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  4319. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  4320. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  4321. }
  4322. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  4323. {
  4324. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4325. }
  4326. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  4327. {
  4328. float2 threshold = float2(0.100000f, 0.100000f);
  4329. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  4330. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  4331. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  4332. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  4333. float4 delta;
  4334. (delta.xy = abs((L - float2(Lleft, Ltop))));
  4335. float2 edges = step(threshold, delta.xy);
  4336. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  4337. discard;
  4338. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  4339. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  4340. (delta.zw = abs((L - float2(Lright, Lbottom))));
  4341. float2 maxDelta = max(delta.xy, delta.zw);
  4342. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  4343. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  4344. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  4345. (maxDelta = max(maxDelta.xy, delta.zw));
  4346. float finalDelta = max(maxDelta.x, maxDelta.y);
  4347. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  4348. return edges;
  4349. }
  4350. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  4351. {
  4352. float2 threshold = float2(0.100000f, 0.100000f);
  4353. float4 delta;
  4354. float3 C = tex2D(colorTex, texcoord).xyz;
  4355. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  4356. float3 t = abs((C - Cleft));
  4357. (delta.x = max(max(t.x, t.y), t.z));
  4358. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  4359. (t = abs((C - Ctop)));
  4360. (delta.y = max(max(t.x, t.y), t.z));
  4361. float2 edges = step(threshold, delta.xy);
  4362. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  4363. discard;
  4364. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  4365. (t = abs((C - Cright)));
  4366. (delta.z = max(max(t.x, t.y), t.z));
  4367. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  4368. (t = abs((C - Cbottom)));
  4369. (delta.w = max(max(t.x, t.y), t.z));
  4370. float2 maxDelta = max(delta.xy, delta.zw);
  4371. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  4372. (t = abs((C - Cleftleft)));
  4373. (delta.z = max(max(t.x, t.y), t.z));
  4374. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  4375. (t = abs((C - Ctoptop)));
  4376. (delta.w = max(max(t.x, t.y), t.z));
  4377. (maxDelta = max(maxDelta.xy, delta.zw));
  4378. float finalDelta = max(maxDelta.x, maxDelta.y);
  4379. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  4380. return edges;
  4381. }
  4382. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  4383. {
  4384. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  4385. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  4386. float2 edges = step(0.010000f, delta);
  4387. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  4388. discard;
  4389. return edges;
  4390. }
  4391. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  4392. {
  4393. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  4394. return round(e);
  4395. }
  4396. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  4397. {
  4398. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  4399. return round(e);
  4400. }
  4401. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4402. {
  4403. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4404. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  4405. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  4406. {
  4407. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4408. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  4409. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4410. }
  4411. return coord.zw;
  4412. }
  4413. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4414. {
  4415. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4416. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  4417. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  4418. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  4419. {
  4420. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4421. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  4422. (e = SMAADecodeDiagBilinearAccess(e));
  4423. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4424. }
  4425. return coord.zw;
  4426. }
  4427. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  4428. {
  4429. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  4430. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4431. (texcoord.x += 0.500000f);
  4432. (texcoord.y += (0.142857f * offset));
  4433. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  4434. }
  4435. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  4436. {
  4437. float2 weights = float2(0.000000f, 0.000000f);
  4438. float4 d;
  4439. float2 end;
  4440. []if ((e.x > 0.000000f))
  4441. {
  4442. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  4443. (d.x += float((end.y > 0.900000f)));
  4444. }
  4445. else
  4446. (d.xz = float2(0.000000f, 0.000000f));
  4447. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  4448. [branch]if (((d.x + d.y) > 2.000000f))
  4449. {
  4450. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  4451. float4 c;
  4452. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  4453. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  4454. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  4455. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4456. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4457. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  4458. }
  4459. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  4460. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  4461. {
  4462. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  4463. (d.y += float((end.y > 0.900000f)));
  4464. }
  4465. else
  4466. (d.yw = float2(0.000000f, 0.000000f));
  4467. [branch]if (((d.x + d.y) > 2.000000f))
  4468. {
  4469. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  4470. float4 c;
  4471. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  4472. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  4473. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  4474. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4475. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4476. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  4477. }
  4478. return weights;
  4479. }
  4480. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  4481. {
  4482. float2 scale = float2(33.000000f, -33.000000f);
  4483. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  4484. (scale += float2(-1.000000f, 1.000000f));
  4485. (bias += float2(0.500000f, -0.500000f));
  4486. (scale *= float2(0.015625f, 0.062500f));
  4487. (bias *= float2(0.015625f, 0.062500f));
  4488. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  4489. }
  4490. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4491. {
  4492. float2 e = float2(0.000000f, 1.000000f);
  4493. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4494. {
  4495. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4496. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4497. }
  4498. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  4499. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  4500. }
  4501. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4502. {
  4503. float2 e = float2(0.000000f, 1.000000f);
  4504. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4505. {
  4506. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4507. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4508. }
  4509. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  4510. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  4511. }
  4512. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4513. {
  4514. float2 e = float2(1.000000f, 0.000000f);
  4515. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4516. {
  4517. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4518. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4519. }
  4520. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  4521. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  4522. }
  4523. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4524. {
  4525. float2 e = float2(1.000000f, 0.000000f);
  4526. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  4527. {
  4528. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4529. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4530. }
  4531. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  4532. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  4533. }
  4534. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  4535. {
  4536. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  4537. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4538. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  4539. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  4540. }
  4541. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4542. {
  4543. float2 leftRight = step(d.xy, d.yx);
  4544. float2 rounding = (1.000000f * leftRight);
  4545. (rounding /= (leftRight.x + leftRight.y));
  4546. float2 factor = float2(1.000000f, 1.000000f);
  4547. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4548. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4549. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4550. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  4551. (weights *= saturate(factor));
  4552. }
  4553. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  4554. {
  4555. float2 leftRight = step(d.xy, d.yx);
  4556. float2 rounding = (1.000000f * leftRight);
  4557. (rounding /= (leftRight.x + leftRight.y));
  4558. float2 factor = float2(1.000000f, 1.000000f);
  4559. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4560. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4561. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4562. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  4563. (weights *= saturate(factor));
  4564. }
  4565. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  4566. {
  4567. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  4568. float2 e = tex2D(edgesTex, texcoord).xy;
  4569. [branch]if ((e.y > 0.000000f))
  4570. {
  4571. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  4572. [branch]if ((weights.x == -weights.y))
  4573. {
  4574. float2 d;
  4575. float3 coords;
  4576. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  4577. (coords.y = offset[1].y);
  4578. (d.x = coords.x);
  4579. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  4580. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  4581. (d.y = coords.z);
  4582. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  4583. float2 sqrt_d = sqrt(d);
  4584. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  4585. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  4586. (coords.y = texcoord.y);
  4587. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  4588. }
  4589. else
  4590. (e.x = 0.000000f);
  4591. }
  4592. [branch]if ((e.x > 0.000000f))
  4593. {
  4594. float2 d;
  4595. float3 coords;
  4596. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  4597. (coords.x = offset[0].x);
  4598. (d.x = coords.y);
  4599. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  4600. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  4601. (d.y = coords.z);
  4602. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  4603. float2 sqrt_d = sqrt(d);
  4604. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  4605. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  4606. (coords.x = texcoord.x);
  4607. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  4608. }
  4609. return weights;
  4610. }
  4611. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  4612. {
  4613. float4 a;
  4614. (a.x = tex2D(blendTex, offset.xy).w);
  4615. (a.y = tex2D(blendTex, offset.zw).y);
  4616. (a.wz = tex2D(blendTex, texcoord).xz);
  4617. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  4618. {
  4619. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  4620. return color;
  4621. }
  4622. else
  4623. {
  4624. bool h = (max(a.x, a.z) > max(a.y, a.w));
  4625. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  4626. float2 blendingWeight = a.yw;
  4627. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  4628. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  4629. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  4630. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  4631. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  4632. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  4633. return color;
  4634. }
  4635. }
  4636. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  4637. {
  4638. float4 current = tex2D(currentColorTex, texcoord);
  4639. float4 previous = tex2D(previousColorTex, texcoord);
  4640. return lerp(current, previous, 0.500000f);
  4641. }
  4642. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  4643. {
  4644. float4 offset[3];
  4645. FullscreenTriangle(id, position, texcoord);
  4646. SMAAEdgeDetectionVS(texcoord, offset);
  4647. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  4648. }
  4649. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  4650. {
  4651. float4 offset[3];
  4652. FullscreenTriangle(id, position, texcoord);
  4653. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  4654. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  4655. }
  4656. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  4657. {
  4658. FullscreenTriangle(id, position, texcoord);
  4659. SMAANeighborhoodBlendingVS(texcoord, offset);
  4660. }
  4661. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4662. {
  4663. float4 offset[3] = { offset0, offset1, offset2 };
  4664. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  4665. }
  4666. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4667. {
  4668. float4 offset[3] = { offset0, offset1, offset2 };
  4669. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  4670. }
  4671. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4672. {
  4673. float4 offset[3] = { offset0, offset1, offset2 };
  4674. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  4675. }
  4676. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  4677. {
  4678. float4 offset[3] = { offset0, offset1, offset2 };
  4679. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  4680. }
  4681. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  4682. {
  4683. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  4684. return color;
  4685. }
  4686. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  4687. {
  4688. (color = tex2D(colorGammaSampler, texcoord).xyz);
  4689. float depth = tex2D(depthSampler, texcoord).x;
  4690. []if (depthtoggle)
  4691. {
  4692. const float z_near = 1.000000f;
  4693. const float z_far = 100.000000f;
  4694. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  4695. (color.xyz = float3(depth.xxx));
  4696. }
  4697. (color = main(texcoord, color.xyzz).xyz);
  4698. }
  4699. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  4700. {
  4701. (color = tex2D(colorGammaSampler, texcoord));
  4702. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  4703. }
  4704. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  4705. {
  4706. (color = tex2D(colorGammaSampler, texcoord));
  4707. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  4708. }
  4709. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  4710. {
  4711. const float curtain_time = 3500.000000f;
  4712. float coord = abs((texcoord.x - 0.500000f));
  4713. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  4714. []if (((coord < factor) || (timer > 10000.000000f)))
  4715. (color = tex2D(colorGammaSampler, texcoord));
  4716. else
  4717. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  4718. }
  4719. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  4720. {
  4721. float coord = abs((texcoord.x - 0.500000f));
  4722. float factor = (timeleft / 8000.000000f);
  4723. []if ((coord < factor))
  4724. (color = tex2D(colorGammaSampler, texcoord));
  4725. else
  4726. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  4727. }
  4728. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  4729. {
  4730. float3 image = tex2D(transitionSampler, texcoord).xyz;
  4731. (color = tex2D(colorGammaSampler, texcoord).xyz);
  4732. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  4733. }
  4734. void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0)
  4735. {
  4736. FullscreenTriangle(id, position, texcoord);
  4737. position.xy += _PIXEL_SIZE_.zw * position.ww;
  4738. }
  4739.  
  4740.  
  4741. 28/12/2014 19:25:23,461 | TRACE | > Compiling shader 'CurtainOpen':
  4742.  
  4743. uniform float4 _PIXEL_SIZE_ : register(c223);
  4744. float4 __tex2Dgather(sampler2D s, float2 c) { return float4(tex2D(s, c + float2(0, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 1) * _PIXEL_SIZE_.xy).r, tex2D(s, c + float2(1, 0) * _PIXEL_SIZE_.xy).r, tex2D(s, c).r); }
  4745. #define POSITION VPOS
  4746. uniform bool depthtoggle : register(c0);
  4747. uniform float timer : register(c1);
  4748. uniform float timeleft : register(c2);
  4749. sampler2D colorGammaSampler : register(s0);
  4750. sampler2D colorLinearSampler : register(s1);
  4751. sampler2D transitionSampler : register(s2);
  4752. sampler2D edgesSampler : register(s3);
  4753. sampler2D blendSampler : register(s4);
  4754. sampler2D areaSampler : register(s5);
  4755. sampler2D searchSampler : register(s6);
  4756. sampler2D depthSampler : register(s7);
  4757. float4 CurvesPass(in float4 colorInput)
  4758. {
  4759. float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
  4760. float Curves_contrast_blend = 0.150000f;
  4761. float3 x = colorInput.xyz;
  4762. (x = (x - 0.500000f));
  4763. (x = ((x / (0.500000f + abs(x))) + 0.500000f));
  4764. float3 color = x;
  4765. (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
  4766. return colorInput;
  4767. }
  4768. float4 main(in float2 tex, in float4 FinalColor)
  4769. {
  4770. (FinalColor = CurvesPass(FinalColor));
  4771. return FinalColor;
  4772. }
  4773. void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
  4774. {
  4775. (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
  4776. (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
  4777. (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
  4778. }
  4779. float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
  4780. {
  4781. float P = tex2D(tex, texcoord).x;
  4782. float Pleft = tex2D(tex, offset[0].xy).x;
  4783. float Ptop = tex2D(tex, offset[0].zw).x;
  4784. return float3(P, Pleft, Ptop);
  4785. }
  4786. float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
  4787. {
  4788. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
  4789. float2 delta = abs((neighbours.xx - neighbours.yz));
  4790. float2 edges = step(0.010000f, delta);
  4791. return (0.200000f * (1.000000f - (0.400000f * edges)));
  4792. }
  4793. void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
  4794. {
  4795. [flatten]if (cond.x)
  4796. (variable.x = value.x);
  4797. [flatten]if (cond.y)
  4798. (variable.y = value.y);
  4799. }
  4800. void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
  4801. {
  4802. SMAAMovc(cond.xy, variable.xy, value.xy);
  4803. SMAAMovc(cond.zw, variable.zw, value.zw);
  4804. }
  4805. void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
  4806. {
  4807. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
  4808. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4809. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
  4810. }
  4811. void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
  4812. {
  4813. (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
  4814. (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
  4815. (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
  4816. (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xxyy) * (float4(-32.000000f, 32.000000f, -32.000000f, 32.000000f)) + (float4(offset[0].xz, offset[1].yw))));
  4817. }
  4818. void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
  4819. {
  4820. (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
  4821. }
  4822. float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  4823. {
  4824. float2 threshold = float2(0.100000f, 0.100000f);
  4825. float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
  4826. float L = dot(tex2D(colorTex, texcoord).xyz, weights);
  4827. float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
  4828. float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
  4829. float4 delta;
  4830. (delta.xy = abs((L - float2(Lleft, Ltop))));
  4831. float2 edges = step(threshold, delta.xy);
  4832. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  4833. discard;
  4834. float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
  4835. float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
  4836. (delta.zw = abs((L - float2(Lright, Lbottom))));
  4837. float2 maxDelta = max(delta.xy, delta.zw);
  4838. float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
  4839. float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
  4840. (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
  4841. (maxDelta = max(maxDelta.xy, delta.zw));
  4842. float finalDelta = max(maxDelta.x, maxDelta.y);
  4843. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  4844. return edges;
  4845. }
  4846. float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
  4847. {
  4848. float2 threshold = float2(0.100000f, 0.100000f);
  4849. float4 delta;
  4850. float3 C = tex2D(colorTex, texcoord).xyz;
  4851. float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
  4852. float3 t = abs((C - Cleft));
  4853. (delta.x = max(max(t.x, t.y), t.z));
  4854. float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
  4855. (t = abs((C - Ctop)));
  4856. (delta.y = max(max(t.x, t.y), t.z));
  4857. float2 edges = step(threshold, delta.xy);
  4858. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  4859. discard;
  4860. float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
  4861. (t = abs((C - Cright)));
  4862. (delta.z = max(max(t.x, t.y), t.z));
  4863. float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
  4864. (t = abs((C - Cbottom)));
  4865. (delta.w = max(max(t.x, t.y), t.z));
  4866. float2 maxDelta = max(delta.xy, delta.zw);
  4867. float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
  4868. (t = abs((C - Cleftleft)));
  4869. (delta.z = max(max(t.x, t.y), t.z));
  4870. float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
  4871. (t = abs((C - Ctoptop)));
  4872. (delta.w = max(max(t.x, t.y), t.z));
  4873. (maxDelta = max(maxDelta.xy, delta.zw));
  4874. float finalDelta = max(maxDelta.x, maxDelta.y);
  4875. (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
  4876. return edges;
  4877. }
  4878. float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
  4879. {
  4880. float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
  4881. float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
  4882. float2 edges = step(0.010000f, delta);
  4883. []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
  4884. discard;
  4885. return edges;
  4886. }
  4887. float2 SMAADecodeDiagBilinearAccess(in float2 e)
  4888. {
  4889. (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
  4890. return round(e);
  4891. }
  4892. float4 SMAADecodeDiagBilinearAccess(in float4 e)
  4893. {
  4894. (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
  4895. return round(e);
  4896. }
  4897. float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4898. {
  4899. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4900. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  4901. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  4902. {
  4903. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4904. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  4905. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4906. }
  4907. return coord.zw;
  4908. }
  4909. float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
  4910. {
  4911. float4 coord = float4(texcoord, -1.000000f, 1.000000f);
  4912. (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
  4913. float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
  4914. []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
  4915. {
  4916. (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
  4917. (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
  4918. (e = SMAADecodeDiagBilinearAccess(e));
  4919. (coord.w = dot(e, float2(0.500000f, 0.500000f)));
  4920. }
  4921. return coord.zw;
  4922. }
  4923. float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
  4924. {
  4925. float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
  4926. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  4927. (texcoord.x += 0.500000f);
  4928. (texcoord.y += (0.142857f * offset));
  4929. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  4930. }
  4931. float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
  4932. {
  4933. float2 weights = float2(0.000000f, 0.000000f);
  4934. float4 d;
  4935. float2 end;
  4936. []if ((e.x > 0.000000f))
  4937. {
  4938. (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
  4939. (d.x += float((end.y > 0.900000f)));
  4940. }
  4941. else
  4942. (d.xz = float2(0.000000f, 0.000000f));
  4943. (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
  4944. [branch]if (((d.x + d.y) > 2.000000f))
  4945. {
  4946. float4 coords = ((float4((-d.x + 0.250000f), d.x, d.y, (-d.y - 0.250000f))) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  4947. float4 c;
  4948. (c.xy = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  4949. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).xy);
  4950. (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
  4951. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4952. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4953. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
  4954. }
  4955. (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
  4956. []if ((tex2Dlod(edgesTex, float4((texcoord + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x > 0.000000f))
  4957. {
  4958. (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
  4959. (d.y += float((end.y > 0.900000f)));
  4960. }
  4961. else
  4962. (d.yw = float2(0.000000f, 0.000000f));
  4963. [branch]if (((d.x + d.y) > 2.000000f))
  4964. {
  4965. float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
  4966. float4 c;
  4967. (c.x = tex2Dlod(edgesTex, float4((coords.xy + (int2(-1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y);
  4968. (c.y = tex2Dlod(edgesTex, float4((coords.xy + (int2(0, -1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x);
  4969. (c.zw = tex2Dlod(edgesTex, float4((coords.zw + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).yx);
  4970. float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
  4971. SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
  4972. (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
  4973. }
  4974. return weights;
  4975. }
  4976. float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
  4977. {
  4978. float2 scale = float2(33.000000f, -33.000000f);
  4979. float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
  4980. (scale += float2(-1.000000f, 1.000000f));
  4981. (bias += float2(0.500000f, -0.500000f));
  4982. (scale *= float2(0.015625f, 0.062500f));
  4983. (bias *= float2(0.015625f, 0.062500f));
  4984. return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
  4985. }
  4986. float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4987. {
  4988. float2 e = float2(0.000000f, 1.000000f);
  4989. []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  4990. {
  4991. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  4992. (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  4993. }
  4994. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
  4995. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  4996. }
  4997. float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  4998. {
  4999. float2 e = float2(0.000000f, 1.000000f);
  5000. []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
  5001. {
  5002. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  5003. (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  5004. }
  5005. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
  5006. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
  5007. }
  5008. float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  5009. {
  5010. float2 e = float2(1.000000f, 0.000000f);
  5011. []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  5012. {
  5013. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  5014. (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  5015. }
  5016. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
  5017. return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  5018. }
  5019. float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
  5020. {
  5021. float2 e = float2(1.000000f, 0.000000f);
  5022. []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
  5023. {
  5024. (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
  5025. (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
  5026. }
  5027. float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
  5028. return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
  5029. }
  5030. float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
  5031. {
  5032. float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
  5033. (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
  5034. (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
  5035. return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
  5036. }
  5037. void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  5038. {
  5039. float2 leftRight = step(d.xy, d.yx);
  5040. float2 rounding = (1.000000f * leftRight);
  5041. (rounding /= (leftRight.x + leftRight.y));
  5042. float2 factor = float2(1.000000f, 1.000000f);
  5043. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  5044. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  5045. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(0, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  5046. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, -2) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x));
  5047. (weights *= saturate(factor));
  5048. }
  5049. void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
  5050. {
  5051. float2 leftRight = step(d.xy, d.yx);
  5052. float2 rounding = (1.000000f * leftRight);
  5053. (rounding /= (leftRight.x + leftRight.y));
  5054. float2 factor = float2(1.000000f, 1.000000f);
  5055. (factor.x -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  5056. (factor.x -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(1, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  5057. (factor.y -= (rounding.x * tex2Dlod(edgesTex, float4((texcoord.xy + (int2(-2, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  5058. (factor.y -= (rounding.y * tex2Dlod(edgesTex, float4((texcoord.zw + (int2(-2, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y));
  5059. (weights *= saturate(factor));
  5060. }
  5061. float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
  5062. {
  5063. float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
  5064. float2 e = tex2D(edgesTex, texcoord).xy;
  5065. [branch]if ((e.y > 0.000000f))
  5066. {
  5067. (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
  5068. [branch]if ((weights.x == -weights.y))
  5069. {
  5070. float2 d;
  5071. float3 coords;
  5072. (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
  5073. (coords.y = offset[1].y);
  5074. (d.x = coords.x);
  5075. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
  5076. (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
  5077. (d.y = coords.z);
  5078. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
  5079. float2 sqrt_d = sqrt(d);
  5080. float e2 = tex2Dlod(edgesTex, float4((coords.zy + (int2(1, 0) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).x;
  5081. (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
  5082. (coords.y = texcoord.y);
  5083. SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
  5084. }
  5085. else
  5086. (e.x = 0.000000f);
  5087. }
  5088. [branch]if ((e.x > 0.000000f))
  5089. {
  5090. float2 d;
  5091. float3 coords;
  5092. (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
  5093. (coords.x = offset[0].x);
  5094. (d.x = coords.y);
  5095. float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
  5096. (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
  5097. (d.y = coords.z);
  5098. (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
  5099. float2 sqrt_d = sqrt(d);
  5100. float e2 = tex2Dlod(edgesTex, float4((coords.xz + (int2(0, 1) * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)), 0.000000f, 0.000000f)).y;
  5101. (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
  5102. (coords.x = texcoord.x);
  5103. SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
  5104. }
  5105. return weights;
  5106. }
  5107. float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
  5108. {
  5109. float4 a;
  5110. (a.x = tex2D(blendTex, offset.xy).w);
  5111. (a.y = tex2D(blendTex, offset.zw).y);
  5112. (a.wz = tex2D(blendTex, texcoord).xz);
  5113. [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
  5114. {
  5115. float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
  5116. return color;
  5117. }
  5118. else
  5119. {
  5120. bool h = (max(a.x, a.z) > max(a.y, a.w));
  5121. float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
  5122. float2 blendingWeight = a.yw;
  5123. SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
  5124. SMAAMovc(bool2(h, h), blendingWeight, a.xz);
  5125. (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
  5126. float4 blendingCoord = ((blendingOffset) * (float4(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, -float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy)) + (texcoord.xyxy));
  5127. float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
  5128. (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
  5129. return color;
  5130. }
  5131. }
  5132. float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
  5133. {
  5134. float4 current = tex2D(currentColorTex, texcoord);
  5135. float4 previous = tex2D(previousColorTex, texcoord);
  5136. return lerp(current, previous, 0.500000f);
  5137. }
  5138. void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  5139. {
  5140. float4 offset[3];
  5141. FullscreenTriangle(id, position, texcoord);
  5142. SMAAEdgeDetectionVS(texcoord, offset);
  5143. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  5144. }
  5145. void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
  5146. {
  5147. float4 offset[3];
  5148. FullscreenTriangle(id, position, texcoord);
  5149. SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
  5150. (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
  5151. }
  5152. void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
  5153. {
  5154. FullscreenTriangle(id, position, texcoord);
  5155. SMAANeighborhoodBlendingVS(texcoord, offset);
  5156. }
  5157. float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  5158. {
  5159. float4 offset[3] = { offset0, offset1, offset2 };
  5160. return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  5161. }
  5162. float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  5163. {
  5164. float4 offset[3] = { offset0, offset1, offset2 };
  5165. return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
  5166. }
  5167. float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  5168. {
  5169. float4 offset[3] = { offset0, offset1, offset2 };
  5170. return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
  5171. }
  5172. float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
  5173. {
  5174. float4 offset[3] = { offset0, offset1, offset2 };
  5175. return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
  5176. }
  5177. float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
  5178. {
  5179. float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
  5180. return color;
  5181. }
  5182. void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
  5183. {
  5184. (color = tex2D(colorGammaSampler, texcoord).xyz);
  5185. float depth = tex2D(depthSampler, texcoord).x;
  5186. []if (depthtoggle)
  5187. {
  5188. const float z_near = 1.000000f;
  5189. const float z_far = 100.000000f;
  5190. (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
  5191. (color.xyz = float3(depth.xxx));
  5192. }
  5193. (color = main(texcoord, color.xyzz).xyz);
  5194. }
  5195. void FadeIn(in float4 position, in float2 texcoord, out float4 color)
  5196. {
  5197. (color = tex2D(colorGammaSampler, texcoord));
  5198. (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
  5199. }
  5200. void FadeOut(in float4 position, in float2 texcoord, out float4 color)
  5201. {
  5202. (color = tex2D(colorGammaSampler, texcoord));
  5203. (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
  5204. }
  5205. void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
  5206. {
  5207. const float curtain_time = 3500.000000f;
  5208. float coord = abs((texcoord.x - 0.500000f));
  5209. float factor = saturate((1.000000f - (timeleft / curtain_time)));
  5210. []if (((coord < factor) || (timer > 10000.000000f)))
  5211. (color = tex2D(colorGammaSampler, texcoord));
  5212. else
  5213. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  5214. }
  5215. void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
  5216. {
  5217. float coord = abs((texcoord.x - 0.500000f));
  5218. float factor = (timeleft / 8000.000000f);
  5219. []if ((coord < factor))
  5220. (color = tex2D(colorGammaSampler, texcoord));
  5221. else
  5222. (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
  5223. }
  5224. void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
  5225. {
  5226. float3 image = tex2D(transitionSampler, texcoord).xyz;
  5227. (color = tex2D(colorGammaSampler, texcoord).xyz);
  5228. (color = lerp(color, image, saturate((timeleft * 0.001000f))));
  5229. }
  5230. void __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, out float4 color : COLOR)
  5231. {
  5232. color = float4(0.0f, 0.0f, 0.0f, 0.0f);
  5233. CurtainOpen(position, texcoord, color.xyzw);
  5234. }
  5235.  
  5236.  
  5237. 28/12/2014 19:25:23,471 | INFO | > Successfully compiled effect.
  5238. 28/12/2014 19:25:43,142 | TRACE | Adding depthstencil 24815FC0 (Width: 1920, Height: 1080, Format: 75) to list of possible depth candidates ...
  5239. 28/12/2014 19:25:43,538 | TRACE | Switched depth source to depthstencil 24815FC0.
  5240. 28/12/2014 19:26:01,943 | INFO | Destroyed effect environment on runtime 1E30ECD8.
  5241. 28/12/2014 19:26:02,091 | INFO | Exiting ...
  5242. 28/12/2014 19:26:02,091 | INFO | Uninstalling 20 hook(s) ...
  5243. 28/12/2014 19:26:02,091 | TRACE | Uninstalling hook for '0x764349A7' ...
  5244. 28/12/2014 19:26:02,095 | TRACE | > Succeeded.
  5245. 28/12/2014 19:26:02,095 | TRACE | Uninstalling hook for '0x764348FB' ...
  5246. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5247. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A6571DB' ...
  5248. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5249. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A657249' ...
  5250. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5251. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A65746D' ...
  5252. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5253. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A65738D' ...
  5254. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5255. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A6572B5' ...
  5256. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5257. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A657402' ...
  5258. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5259. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A657321' ...
  5260. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5261. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A610A62' ...
  5262. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5263. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x6A5BCCD5' ...
  5264. 28/12/2014 19:26:02,100 | TRACE | > Succeeded.
  5265. 28/12/2014 19:26:02,100 | TRACE | Uninstalling hook for '0x76537089' ...
  5266. 28/12/2014 19:26:02,104 | TRACE | > Succeeded.
  5267. 28/12/2014 19:26:02,104 | TRACE | Uninstalling hook for '0x7653CBA6' ...
  5268. 28/12/2014 19:26:02,108 | TRACE | > Succeeded.
  5269. 28/12/2014 19:26:02,108 | TRACE | Uninstalling hook for '0x76534406' ...
  5270. 28/12/2014 19:26:02,113 | TRACE | > Succeeded.
  5271. 28/12/2014 19:26:02,113 | TRACE | Uninstalling hook for '0x7654B30C' ...
  5272. 28/12/2014 19:26:02,117 | TRACE | > Succeeded.
  5273. 28/12/2014 19:26:02,117 | TRACE | Uninstalling hook for '0x76536B0E' ...
  5274. 28/12/2014 19:26:02,121 | TRACE | > Succeeded.
  5275. 28/12/2014 19:26:02,121 | TRACE | Uninstalling hook for '0x7653B6DC' ...
  5276. 28/12/2014 19:26:02,126 | TRACE | > Succeeded.
  5277. 28/12/2014 19:26:02,126 | TRACE | Uninstalling hook for '0x76536F01' ...
  5278. 28/12/2014 19:26:02,130 | TRACE | > Succeeded.
  5279. 28/12/2014 19:26:02,130 | TRACE | Uninstalling hook for '0x765334B5' ...
  5280. 28/12/2014 19:26:02,135 | TRACE | > Succeeded.
  5281. 28/12/2014 19:26:02,135 | TRACE | Uninstalling hook for '0x6A5D2E0E' ...
  5282. 28/12/2014 19:26:02,139 | TRACE | > Succeeded.
  5283. 28/12/2014 19:26:02,139 | INFO | Exited.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement