Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 28/12/2014 19:10:47,343 | 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" ...
- 28/12/2014 19:10:47,343 | TRACE | Installing hook for '0x764349A7' with '0x69BE6E30' using method 1 ...
- 28/12/2014 19:10:47,343 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,343 | TRACE | Installing hook for '0x764348FB' with '0x69BE7270' using method 1 ...
- 28/12/2014 19:10:47,343 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,343 | INFO | Registering hooks for "C:\Windows\system32\d3d8.dll" ...
- 28/12/2014 19:10:47,343 | INFO | > Delayed.
- 28/12/2014 19:10:47,343 | INFO | Registering hooks for "C:\Windows\system32\d3d9.dll" ...
- 28/12/2014 19:10:47,359 | INFO | > Libraries loaded.
- 28/12/2014 19:10:47,359 | TRACE | > Analyzing export table:
- 28/12/2014 19:10:47,359 | TRACE | +--------------------+---------+----------------------------------------------------+
- 28/12/2014 19:10:47,359 | TRACE | | Address | Ordinal | Name |
- 28/12/2014 19:10:47,359 | TRACE | +--------------------+---------+----------------------------------------------------+
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A6571DB | 4 | D3DPERF_BeginEvent | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A657249 | 5 | D3DPERF_EndEvent | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A65746D | 6 | D3DPERF_GetStatus | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A65738D | 7 | D3DPERF_QueryRepeatFrame | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A6572B5 | 8 | D3DPERF_SetMarker | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A657402 | 9 | D3DPERF_SetOptions | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A657321 | 10 | D3DPERF_SetRegion | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A6588B1 | 11 | DebugSetLevel |
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A5E66C6 | 12 | DebugSetMute |
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A610A62 | 13 | Direct3DCreate9 | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A5BCCD5 | 14 | Direct3DCreate9Ex | <
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A5EF5AF | 1 | Direct3DShaderValidatorCreate9 |
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A64D77B | 2 | PSGPError |
- 28/12/2014 19:10:47,359 | TRACE | | 0x000000006A64D709 | 3 | PSGPSampleTexture |
- 28/12/2014 19:10:47,359 | TRACE | +--------------------+---------+----------------------------------------------------+
- 28/12/2014 19:10:47,359 | INFO | > Found 9 match(es). Installing ...
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A6571DB' with '0x69C00C30' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A657249' with '0x69C00C40' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A65746D' with '0x69C00C40' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A65738D' with '0x69C00C40' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A6572B5' with '0x69BECDE0' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A657402' with '0x69BF0BF0' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A657321' with '0x69BECDE0' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A610A62' with '0x69C00C50' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | TRACE | Installing hook for '0x6A5BCCD5' with '0x69C00E90' using method 0 ...
- 28/12/2014 19:10:47,359 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,359 | INFO | > Installed 9 hook(s).
- 28/12/2014 19:10:47,374 | INFO | Registering hooks for "C:\Windows\system32\d3d10.dll" ...
- 28/12/2014 19:10:47,374 | INFO | > Delayed.
- 28/12/2014 19:10:47,374 | INFO | Registering hooks for "C:\Windows\system32\d3d10_1.dll" ...
- 28/12/2014 19:10:47,374 | INFO | > Delayed.
- 28/12/2014 19:10:47,374 | INFO | Registering hooks for "C:\Windows\system32\d3d11.dll" ...
- 28/12/2014 19:10:47,374 | INFO | > Delayed.
- 28/12/2014 19:10:47,374 | INFO | Registering hooks for "C:\Windows\system32\dxgi.dll" ...
- 28/12/2014 19:10:47,374 | INFO | > Delayed.
- 28/12/2014 19:10:47,374 | INFO | Registering hooks for "C:\Windows\system32\opengl32.dll" ...
- 28/12/2014 19:10:47,374 | INFO | > Delayed.
- 28/12/2014 19:10:47,374 | INFO | Registering hooks for "C:\Windows\system32\ws2_32.dll" ...
- 28/12/2014 19:10:47,390 | INFO | > Libraries loaded.
- 28/12/2014 19:10:47,390 | TRACE | > Analyzing export table:
- 28/12/2014 19:10:47,390 | TRACE | +--------------------+---------+----------------------------------------------------+
- 28/12/2014 19:10:47,390 | TRACE | | Address | Ordinal | Name |
- 28/12/2014 19:10:47,390 | TRACE | +--------------------+---------+----------------------------------------------------+
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653E14D | 25 | FreeAddrInfoEx |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653E14D | 26 | FreeAddrInfoExW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534B1B | 27 | FreeAddrInfoW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654469B | 28 | GetAddrInfoExA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653D1EA | 29 | GetAddrInfoExW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534889 | 30 | GetAddrInfoW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765366AF | 31 | GetNameInfoW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543ABF | 32 | InetNtopW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765439DC | 33 | InetPtonW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765445F7 | 34 | SetAddrInfoExA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653F4F6 | 35 | SetAddrInfoExW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654E764 | 500 | WEP |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654E39B | 36 | WPUCompleteOverlappedRequest |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765368D6 | 37 | WSAAccept |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653331E | 38 | WSAAddressToStringA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536CF6 | 39 | WSAAddressToStringW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076550509 | 40 | WSAAdvertiseProvider |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654736B | 102 | WSAAsyncGetHostByAddr |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654726A | 103 | WSAAsyncGetHostByName |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654744E | 105 | WSAAsyncGetProtoByName |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654754F | 104 | WSAAsyncGetProtoByNumber |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765470A7 | 107 | WSAAsyncGetServByName |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765471AE | 106 | WSAAsyncGetServByPort |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654B014 | 101 | WSAAsyncSelect |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076547602 | 108 | WSACancelAsyncRequest |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076545343 | 113 | WSACancelBlockingCall |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076533C5F | 116 | WSACleanup |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653651F | 41 | WSACloseEvent |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653CC3F | 42 | WSAConnect |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654BFDD | 43 | WSAConnectByList |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654C8B6 | 44 | WSAConnectByNameA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654C52F | 45 | WSAConnectByNameW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765364FB | 46 | WSACreateEvent |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765461B6 | 47 | WSADuplicateSocketA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076546128 | 48 | WSADuplicateSocketW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076549FC1 | 49 | WSAEnumNameSpaceProvidersA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A021 | 50 | WSAEnumNameSpaceProvidersExA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A081 | 58 | WSAEnumNameSpaceProvidersExW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653D8D3 | 59 | WSAEnumNameSpaceProvidersW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765331B1 | 60 | WSAEnumNetworkEvents |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654627F | 61 | WSAEnumProtocolsA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C8E1 | 62 | WSAEnumProtocolsW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653648F | 63 | WSAEventSelect |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765337AD | 111 | WSAGetLastError |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076537489 | 64 | WSAGetOverlappedResult |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076549B68 | 65 | WSAGetQOSByName |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654AA00 | 66 | WSAGetServiceClassInfoA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A849 | 67 | WSAGetServiceClassInfoW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A44D | 68 | WSAGetServiceClassNameByClassIdA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A651 | 69 | WSAGetServiceClassNameByClassIdW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543B24 | 70 | WSAHtonl |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543C11 | 71 | WSAHtons |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A981 | 72 | WSAInstallServiceClassA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A277 | 73 | WSAInstallServiceClassW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076532FE7 | 74 | WSAIoctl |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765453BE | 114 | WSAIsBlocking |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654CA7D | 75 | WSAJoinLeaf |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653A642 | 76 | WSALookupServiceBeginA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653575A | 77 | WSALookupServiceBeginW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076535239 | 78 | WSALookupServiceEnd |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653A27B | 79 | WSALookupServiceNextA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534CBC | 80 | WSALookupServiceNextW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653EF85 | 81 | WSANSPIoctl |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543B24 | 82 | WSANtohl |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543C11 | 83 | WSANtohs |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654B0A5 | 84 | WSAPoll |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076550B79 | 85 | WSAProviderCompleteAsyncCall |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C22E | 86 | WSAProviderConfigChange |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076537089 | 87 | WSARecv | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076549DBD | 88 | WSARecvDisconnect |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653CBA6 | 89 | WSARecvFrom | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654A362 | 90 | WSARemoveServiceClass |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653CDC3 | 91 | WSAResetEvent |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534406 | 92 | WSASend | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654B281 | 93 | WSASendDisconnect |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654B3CB | 94 | WSASendMsg |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654B30C | 95 | WSASendTo | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654543D | 109 | WSASetBlockingHook |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653CDD4 | 96 | WSASetEvent |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765337D9 | 112 | WSASetLastError |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654AA92 | 97 | WSASetServiceA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653F606 | 98 | WSASetServiceW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C82A | 99 | WSASocketA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076533CD3 | 100 | WSASocketW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076533AB2 | 115 | WSAStartup |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653ED31 | 117 | WSAStringToAddressA |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536DDD | 118 | WSAStringToAddressW |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076550643 | 119 | WSAUnadvertiseProvider |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765454C1 | 110 | WSAUnhookBlockingHook |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653650E | 120 | WSAWaitForMultipleEvents |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654E546 | 24 | WSApSetPostRoutine |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654D775 | 121 | WSCDeinstallProvider |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765493AC | 122 | WSCEnableNSProvider |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653B8CF | 123 | WSCEnumProtocols |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654DF81 | 124 | WSCGetApplicationCategory |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654D961 | 125 | WSCGetProviderInfo |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C64E | 126 | WSCGetProviderPath |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765496A9 | 127 | WSCInstallNameSpace |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076549859 | 128 | WSCInstallNameSpaceEx |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654D751 | 129 | WSCInstallProvider |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076548793 | 130 | WSCInstallProviderAndChains |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654DB99 | 131 | WSCSetApplicationCategory |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654D1D1 | 132 | WSCSetProviderInfo |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076549A11 | 133 | WSCUnInstallNameSpace |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654CE2D | 134 | WSCUpdateProvider |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076549571 | 135 | WSCWriteNameSpaceOrder |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007654D099 | 136 | WSCWriteProviderOrder |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653AA67 | 137 | WahCloseApcHelper |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007655272D | 138 | WahCloseHandleHelper |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076553261 | 139 | WahCloseNotificationHandleHelper |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076552772 | 140 | WahCloseSocketHandle |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765332C4 | 141 | WahCloseThread |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765527C1 | 142 | WahCompleteRequest |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076537E65 | 143 | WahCreateHandleContextTable |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C3CB | 144 | WahCreateNotificationHandle |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076553080 | 145 | WahCreateSocketHandle |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653F268 | 146 | WahDestroyHandleContextTable |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765529FD | 147 | WahDisableNonIFSHandleSupport |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007655284F | 148 | WahEnableNonIFSHandleSupport |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653AA97 | 149 | WahEnumerateHandleContexts |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653412B | 150 | WahInsertHandleContext |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765532C3 | 152 | WahNotifyAllProcesses |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076538483 | 153 | WahOpenApcHelper |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765336A7 | 154 | WahOpenCurrentThread |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076552CB2 | 155 | WahOpenHandleHelper |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C1FA | 156 | WahOpenNotificationHandleHelper |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076552096 | 157 | WahQueueUserApc |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076532F20 | 158 | WahReferenceContextByHandle |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765339B0 | 159 | WahRemoveHandleContext |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653C2F0 | 160 | WahWaitForNotification |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076553665 | 161 | WahWriteLSPEvent |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536A8A | 151 | __WSAFDIsSet |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765368B6 | 1 | accept |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534582 | 2 | bind |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076533918 | 3 | closesocket |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536BDD | 4 | connect |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534B1B | 162 | freeaddrinfo |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076534296 | 163 | getaddrinfo |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076546C01 | 51 | gethostbyaddr |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076547673 | 52 | gethostbyname |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653A05B | 57 | gethostname |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765367B7 | 164 | getnameinfo |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076537147 | 5 | getpeername |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765468B3 | 53 | getprotobyname |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765467C4 | 54 | getprotobynumber |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076546EF3 | 55 | getservbyname |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076546D62 | 56 | getservbyport |
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765330AF | 6 | getsockname |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653737D | 7 | getsockopt |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076532D57 | 8 | htonl |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076532D8B | 9 | htons |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653311B | 11 | inet_addr |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653B131 | 12 | inet_ntoa |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543A5A | 165 | inet_ntop |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076543969 | 166 | inet_pton |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076533084 | 10 | ioctlsocket |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653B001 | 13 | listen |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076532D57 | 14 | ntohl |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076532D8B | 15 | ntohs |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536B0E | 16 | recv | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653B6DC | 17 | recvfrom | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536989 | 18 | select |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076536F01 | 19 | send | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765334B5 | 20 | sendto | <
- 28/12/2014 19:10:47,390 | TRACE | | 0x00000000765341B6 | 21 | setsockopt |
- 28/12/2014 19:10:47,390 | TRACE | | 0x000000007653449D | 22 | shutdown |
- 28/12/2014 19:10:47,390 | TRACE | | 0x0000000076533EB8 | 23 | socket |
- 28/12/2014 19:10:47,390 | TRACE | +--------------------+---------+----------------------------------------------------+
- 28/12/2014 19:10:47,390 | INFO | > Found 8 match(es). Installing ...
- 28/12/2014 19:10:47,390 | TRACE | Installing hook for '0x76537089' with '0x69C18B50' using method 1 ...
- 28/12/2014 19:10:47,390 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,390 | TRACE | Installing hook for '0x7653CBA6' with '0x69C18CB0' using method 1 ...
- 28/12/2014 19:10:47,390 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,390 | TRACE | Installing hook for '0x76534406' with '0x69C18A50' using method 1 ...
- 28/12/2014 19:10:47,406 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,406 | TRACE | Installing hook for '0x7654B30C' with '0x69C18AD0' using method 1 ...
- 28/12/2014 19:10:47,406 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,406 | TRACE | Installing hook for '0x76536B0E' with '0x69C18970' using method 1 ...
- 28/12/2014 19:10:47,406 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,406 | TRACE | Installing hook for '0x7653B6DC' with '0x69C189E0' using method 1 ...
- 28/12/2014 19:10:47,406 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,406 | TRACE | Installing hook for '0x76536F01' with '0x69C188B0' using method 1 ...
- 28/12/2014 19:10:47,421 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,421 | TRACE | Installing hook for '0x765334B5' with '0x69C18910' using method 1 ...
- 28/12/2014 19:10:47,421 | TRACE | > Succeeded.
- 28/12/2014 19:10:47,421 | INFO | > Installed 8 hook(s).
- 28/12/2014 19:10:47,437 | INFO | Initialized.
- 28/12/2014 19:10:48,011 | INFO | Redirecting 'Direct3DCreate9(32)' ...
- 28/12/2014 19:10:48,018 | TRACE | Installing hook for '0x6A5D2E0E' with '0x69BFFF30' using method 1 ...
- 28/12/2014 19:10:48,023 | TRACE | > Succeeded.
- 28/12/2014 19:10:48,082 | INFO | Redirecting 'Direct3DCreate9(32)' ...
- 28/12/2014 19:10:49,591 | INFO | Redirecting 'IDirect3D9::CreateDevice(03F007E0, 0, 1, 001105AC, 322, 0073D28C, 01128C10)' ...
- 28/12/2014 19:10:49,591 | TRACE | > Dumping Presentation Parameters:
- 28/12/2014 19:10:49,591 | TRACE | +-----------------------------------------+-----------------------------------------+
- 28/12/2014 19:10:49,591 | TRACE | | Parameter | Value |
- 28/12/2014 19:10:49,591 | TRACE | +-----------------------------------------+-----------------------------------------+
- 28/12/2014 19:10:49,591 | TRACE | | BackBufferWidth | 1920 |
- 28/12/2014 19:10:49,591 | TRACE | | BackBufferHeight | 1080 |
- 28/12/2014 19:10:49,591 | TRACE | | BackBufferFormat | 21 |
- 28/12/2014 19:10:49,591 | TRACE | | BackBufferCount | 1 |
- 28/12/2014 19:10:49,591 | TRACE | | MultiSampleType | 0 |
- 28/12/2014 19:10:49,591 | TRACE | | MultiSampleQuality | 0 |
- 28/12/2014 19:10:49,591 | TRACE | | SwapEffect | 1 |
- 28/12/2014 19:10:49,591 | TRACE | | hDeviceWindow | 0x00000000000000000000000000000001105AC |
- 28/12/2014 19:10:49,591 | TRACE | | Windowed | 0 |
- 28/12/2014 19:10:49,591 | TRACE | | EnableAutoDepthStencil | 0 |
- 28/12/2014 19:10:49,591 | TRACE | | AutoDepthStencilFormat | 0 |
- 28/12/2014 19:10:49,591 | TRACE | | Flags | 0x0000000000000000000000000000000000001 |
- 28/12/2014 19:10:49,591 | TRACE | | FullScreen_RefreshRateInHz | 60 |
- 28/12/2014 19:10:49,591 | TRACE | | PresentationInterval | 1 |
- 28/12/2014 19:10:49,591 | TRACE | +-----------------------------------------+-----------------------------------------+
- 28/12/2014 19:10:49,591 | WARN | > Forcing tripple buffering.
- 28/12/2014 19:10:49,661 | INFO | Recreated effect environment on runtime 1DB97290.
- 28/12/2014 19:10:51,004 | INFO | Loading effect from "G:\Program Files (x86)\Remember Me\Binaries\Win32\Sweet.fx" ...
- 28/12/2014 19:10:51,004 | TRACE | > Running preprocessor ...
- 28/12/2014 19:10:51,076 | TRACE | > Running parser ...
- 28/12/2014 19:10:51,082 | TRACE | > Running compiler ...
- 28/12/2014 19:10:51,085 | TRACE | > Compiling shader 'SMAAEdgeDetectionVSWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- 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)
- {
- SMAAEdgeDetectionVSWrap(id, position, texcoord, offset0, offset1, offset2);
- position.xy += _PIXEL_SIZE_.zw * position.ww;
- }
- 28/12/2014 19:10:51,099 | TRACE | > Compiling shader 'SMAAColorEdgeDetectionPSWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- #define POSITION VPOS
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- float4 __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, in float4 offset0 : TEXCOORD1, in float4 offset1 : TEXCOORD2, in float4 offset2 : TEXCOORD3) : COLOR
- {
- float4 _return = float4(SMAAColorEdgeDetectionPSWrap(position, texcoord, offset0, offset1, offset2), 0.0f, 0.0f);
- return _return;
- }
- 28/12/2014 19:10:51,126 | TRACE | > Compiling shader 'SMAABlendingWeightCalculationVSWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- 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)
- {
- SMAABlendingWeightCalculationVSWrap(id, position, texcoord, pixcoord, offset0, offset1, offset2);
- position.xy += _PIXEL_SIZE_.zw * position.ww;
- }
- 28/12/2014 19:10:51,139 | TRACE | > Compiling shader 'SMAABlendingWeightCalculationPSWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- #define POSITION VPOS
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- 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
- {
- float4 _return = SMAABlendingWeightCalculationPSWrap(position, texcoord, pixcoord, offset0, offset1, offset2);
- return _return;
- }
- 28/12/2014 19:10:51,514 | TRACE | > Compiling shader 'SMAANeighborhoodBlendingVSWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
- {
- SMAANeighborhoodBlendingVSWrap(id, position, texcoord, offset);
- position.xy += _PIXEL_SIZE_.zw * position.ww;
- }
- 28/12/2014 19:10:51,524 | TRACE | > Compiling shader 'SMAANeighborhoodBlendingPSWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- #define POSITION VPOS
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- float4 __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, in float4 offset : TEXCOORD1) : COLOR
- {
- float4 _return = float4(SMAANeighborhoodBlendingPSWrap(position, texcoord, offset), 0.0f);
- return _return;
- }
- 28/12/2014 19:10:51,538 | TRACE | > Compiling shader 'FullscreenTriangle':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0)
- {
- FullscreenTriangle(id, position, texcoord);
- position.xy += _PIXEL_SIZE_.zw * position.ww;
- }
- 28/12/2014 19:10:51,547 | TRACE | > Compiling shader 'SharedWrap':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- #define POSITION VPOS
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- void __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, out float4 color : COLOR)
- {
- color = float4(0.0f, 0.0f, 0.0f, 0.0f);
- SharedWrap(position, texcoord, color.xyz);
- }
- 28/12/2014 19:10:51,558 | TRACE | > Compiling shader 'FullscreenTriangle':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- void __main(in uint id : TEXCOORD0, out float4 position : POSITION, out float2 texcoord : TEXCOORD0)
- {
- FullscreenTriangle(id, position, texcoord);
- position.xy += _PIXEL_SIZE_.zw * position.ww;
- }
- 28/12/2014 19:10:51,567 | TRACE | > Compiling shader 'CurtainOpen':
- uniform float4 _PIXEL_SIZE_ : register(c223);
- 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); }
- #define POSITION VPOS
- uniform bool depthtoggle : register(c0);
- uniform float timer : register(c1);
- uniform float timeleft : register(c2);
- sampler2D colorGammaSampler : register(s0);
- sampler2D colorLinearSampler : register(s1);
- sampler2D transitionSampler : register(s2);
- sampler2D edgesSampler : register(s3);
- sampler2D blendSampler : register(s4);
- sampler2D areaSampler : register(s5);
- sampler2D searchSampler : register(s6);
- sampler2D depthSampler : register(s7);
- float4 CurvesPass(in float4 colorInput)
- {
- float3 lumCoeff = float3(0.212600f, 0.715200f, 0.072200f);
- float Curves_contrast_blend = 0.150000f;
- float3 x = colorInput.xyz;
- (x = (x - 0.500000f));
- (x = ((x / (0.500000f + abs(x))) + 0.500000f));
- float3 color = x;
- (colorInput.xyz = lerp(colorInput.xyz, color, Curves_contrast_blend));
- return colorInput;
- }
- float4 main(in float2 tex, in float4 FinalColor)
- {
- (FinalColor = CurvesPass(FinalColor));
- return FinalColor;
- }
- void FullscreenTriangle(in uint id, out float4 position, out float2 texcoord)
- {
- (texcoord.x = ((id == 2) ? 2.000000f : 0.000000f));
- (texcoord.y = ((id == 1) ? 2.000000f : 0.000000f));
- (position = float4(((texcoord * float2(2.000000f, -2.000000f)) + float2(-1.000000f, 1.000000f)), 0.000000f, 1.000000f));
- }
- float3 SMAAGatherNeighbours(in float2 texcoord, in float4 offset[3], in sampler2D tex)
- {
- float P = tex2D(tex, texcoord).x;
- float Pleft = tex2D(tex, offset[0].xy).x;
- float Ptop = tex2D(tex, offset[0].zw).x;
- return float3(P, Pleft, Ptop);
- }
- float2 SMAACalculatePredicatedThreshold(in float2 texcoord, in float4 offset[3], in sampler2D predicationTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, predicationTex);
- float2 delta = abs((neighbours.xx - neighbours.yz));
- float2 edges = step(0.010000f, delta);
- return (0.200000f * (1.000000f - (0.400000f * edges)));
- }
- void SMAAMovc(in bool2 cond, inout float2 variable, in float2 value)
- {
- [flatten]if (cond.x)
- (variable.x = value.x);
- [flatten]if (cond.y)
- (variable.y = value.y);
- }
- void SMAAMovc(in bool4 cond, inout float4 variable, in float4 value)
- {
- SMAAMovc(cond.xy, variable.xy, value.xy);
- SMAAMovc(cond.zw, variable.zw, value.zw);
- }
- void SMAAEdgeDetectionVS(in float2 texcoord, out float4 offset[3])
- {
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-1.000000f, 0.000000f, 0.000000f, -1.000000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- (offset[2] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-2.000000f, 0.000000f, 0.000000f, -2.000000f)) + (texcoord.xyxy)));
- }
- void SMAABlendingWeightCalculationVS(in float2 texcoord, out float2 pixcoord, out float4 offset[3])
- {
- (pixcoord = (texcoord * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zw));
- (offset[0] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.250000f, -0.125000f, 1.250000f, -0.125000f)) + (texcoord.xyxy)));
- (offset[1] = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(-0.125000f, -0.250000f, -0.125000f, 1.250000f)) + (texcoord.xyxy)));
- (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))));
- }
- void SMAANeighborhoodBlendingVS(in float2 texcoord, out float4 offset)
- {
- (offset = ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) * (float4(1.000000f, 0.000000f, 0.000000f, 1.000000f)) + (texcoord.xyxy)));
- }
- float2 SMAALumaEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float3 weights = float3(0.212600f, 0.715200f, 0.072200f);
- float L = dot(tex2D(colorTex, texcoord).xyz, weights);
- float Lleft = dot(tex2D(colorTex, offset[0].xy).xyz, weights);
- float Ltop = dot(tex2D(colorTex, offset[0].zw).xyz, weights);
- float4 delta;
- (delta.xy = abs((L - float2(Lleft, Ltop))));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float Lright = dot(tex2D(colorTex, offset[1].xy).xyz, weights);
- float Lbottom = dot(tex2D(colorTex, offset[1].zw).xyz, weights);
- (delta.zw = abs((L - float2(Lright, Lbottom))));
- float2 maxDelta = max(delta.xy, delta.zw);
- float Lleftleft = dot(tex2D(colorTex, offset[2].xy).xyz, weights);
- float Ltoptop = dot(tex2D(colorTex, offset[2].zw).xyz, weights);
- (delta.zw = abs((float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop))));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAAColorEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D colorTex)
- {
- float2 threshold = float2(0.100000f, 0.100000f);
- float4 delta;
- float3 C = tex2D(colorTex, texcoord).xyz;
- float3 Cleft = tex2D(colorTex, offset[0].xy).xyz;
- float3 t = abs((C - Cleft));
- (delta.x = max(max(t.x, t.y), t.z));
- float3 Ctop = tex2D(colorTex, offset[0].zw).xyz;
- (t = abs((C - Ctop)));
- (delta.y = max(max(t.x, t.y), t.z));
- float2 edges = step(threshold, delta.xy);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- float3 Cright = tex2D(colorTex, offset[1].xy).xyz;
- (t = abs((C - Cright)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Cbottom = tex2D(colorTex, offset[1].zw).xyz;
- (t = abs((C - Cbottom)));
- (delta.w = max(max(t.x, t.y), t.z));
- float2 maxDelta = max(delta.xy, delta.zw);
- float3 Cleftleft = tex2D(colorTex, offset[2].xy).xyz;
- (t = abs((C - Cleftleft)));
- (delta.z = max(max(t.x, t.y), t.z));
- float3 Ctoptop = tex2D(colorTex, offset[2].zw).xyz;
- (t = abs((C - Ctoptop)));
- (delta.w = max(max(t.x, t.y), t.z));
- (maxDelta = max(maxDelta.xy, delta.zw));
- float finalDelta = max(maxDelta.x, maxDelta.y);
- (edges.xy *= step(finalDelta, (2.000000f * delta.xy)));
- return edges;
- }
- float2 SMAADepthEdgeDetectionPS(in float2 texcoord, in float4 offset[3], in sampler2D depthTex)
- {
- float3 neighbours = SMAAGatherNeighbours(texcoord, offset, depthTex);
- float2 delta = abs((neighbours.xx - float2(neighbours.y, neighbours.z)));
- float2 edges = step(0.010000f, delta);
- []if ((dot(edges, float2(1.000000f, 1.000000f)) == 0.000000f))
- discard;
- return edges;
- }
- float2 SMAADecodeDiagBilinearAccess(in float2 e)
- {
- (e.x = (e.x * abs(((5.000000f * e.x) - 3.750000f))));
- return round(e);
- }
- float4 SMAADecodeDiagBilinearAccess(in float4 e)
- {
- (e.xz = (e.xz * abs(((5.000000f * e.xz) - 3.750000f))));
- return round(e);
- }
- float2 SMAASearchDiag1(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAASearchDiag2(in sampler2D edgesTex, in float2 texcoord, in float2 dir, out float2 e)
- {
- float4 coord = float4(texcoord, -1.000000f, 1.000000f);
- (coord.x += (0.250000f * float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x));
- float3 t = float3(float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy, 1.000000f);
- []while (((coord.z < 5.000000f) && (coord.w > 0.900000f)))
- {
- (coord.xyz = ((t) * (float3(dir, 1.000000f)) + (coord.xyz)));
- (e = tex2Dlod(edgesTex, float4(coord.xy, 0.000000f, 0.000000f)).xy);
- (e = SMAADecodeDiagBilinearAccess(e));
- (coord.w = dot(e, float2(0.500000f, 0.500000f)));
- }
- return coord.zw;
- }
- float2 SMAAAreaDiag(in sampler2D areaTex, in float2 dist, in float2 e, in float offset)
- {
- float2 texcoord = ((float2(20.000000f, 20.000000f)) * (e) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.x += 0.500000f);
- (texcoord.y += (0.142857f * offset));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- float2 SMAACalculateDiagWeights(in sampler2D edgesTex, in sampler2D areaTex, in float2 texcoord, in float2 e, in float4 subsampleIndices)
- {
- float2 weights = float2(0.000000f, 0.000000f);
- float4 d;
- float2 end;
- []if ((e.x > 0.000000f))
- {
- (d.xz = SMAASearchDiag1(edgesTex, texcoord, float2(-1.000000f, 1.000000f), end));
- (d.x += float((end.y > 0.900000f)));
- }
- else
- (d.xz = float2(0.000000f, 0.000000f));
- (d.yw = SMAASearchDiag1(edgesTex, texcoord, float2(1.000000f, -1.000000f), end));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- 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));
- float4 c;
- (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);
- (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);
- (c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw));
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.z));
- }
- (d.xz = SMAASearchDiag2(edgesTex, texcoord, float2(-1.000000f, -1.000000f), end));
- []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))
- {
- (d.yw = SMAASearchDiag2(edgesTex, texcoord, float2(1.000000f, 1.000000f), end));
- (d.y += float((end.y > 0.900000f)));
- }
- else
- (d.yw = float2(0.000000f, 0.000000f));
- [branch]if (((d.x + d.y) > 2.000000f))
- {
- float4 coords = ((float4(-d.x, -d.x, d.y, d.y)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xyxy) + (texcoord.xyxy));
- float4 c;
- (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);
- (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);
- (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);
- float2 cc = ((float2(2.000000f, 2.000000f)) * (c.xz) + (c.yw));
- SMAAMovc(bool2(step(0.900000f, d.zw)), cc, float2(0.000000f, 0.000000f));
- (weights += SMAAAreaDiag(areaTex, d.xy, cc, subsampleIndices.w).yx);
- }
- return weights;
- }
- float SMAASearchLength(in sampler2D searchTex, in float2 e, in float offset)
- {
- float2 scale = float2(33.000000f, -33.000000f);
- float2 bias = (float2(66.000000f, 33.000000f) * float2(offset, 1.000000f));
- (scale += float2(-1.000000f, 1.000000f));
- (bias += float2(0.500000f, -0.500000f));
- (scale *= float2(0.015625f, 0.062500f));
- (bias *= float2(0.015625f, 0.062500f));
- return tex2Dlod(searchTex, float4(((scale) * (e) + (bias)), 0.000000f, 0.000000f)).x;
- }
- float SMAASearchXLeft(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x > end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-2.000000f, -0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchXRight(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(0.000000f, 1.000000f);
- []while ((((texcoord.x < end) && (e.y > 0.828100f)) && (e.x == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(2.000000f, 0.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).x) * (offset) + (texcoord.x));
- }
- float SMAASearchYUp(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y > end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(-0.000000f, -2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.000000f)) + (3.250000f));
- return ((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float SMAASearchYDown(in sampler2D edgesTex, in sampler2D searchTex, in float2 texcoord, in float end)
- {
- float2 e = float2(1.000000f, 0.000000f);
- []while ((((texcoord.y < end) && (e.x > 0.828100f)) && (e.y == 0.000000f)))
- {
- (e = tex2Dlod(edgesTex, float4(texcoord, 0.000000f, 0.000000f)).xy);
- (texcoord = ((float2(0.000000f, 2.000000f)) * (float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).xy) + (texcoord)));
- }
- float offset = ((-2.007874f) * (SMAASearchLength(searchTex, e.yx, 0.500000f)) + (3.250000f));
- return ((-float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).y) * (offset) + (texcoord.y));
- }
- float2 SMAAArea(in sampler2D areaTex, in float2 dist, in float e1, in float e2, in float offset)
- {
- float2 texcoord = ((float2(16.000000f, 16.000000f)) * (round((4.000000f * float2(e1, e2)))) + (dist));
- (texcoord = ((float2(0.006250f, 0.001786f)) * (texcoord) + (float2(0.003125f, 0.000893f))));
- (texcoord.y = ((0.142857f) * (offset) + (texcoord.y)));
- return tex2Dlod(areaTex, float4(texcoord, 0.000000f, 0.000000f)).xy;
- }
- void SMAADetectHorizontalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- void SMAADetectVerticalCornerPattern(in sampler2D edgesTex, inout float2 weights, in float4 texcoord, in float2 d)
- {
- float2 leftRight = step(d.xy, d.yx);
- float2 rounding = (1.000000f * leftRight);
- (rounding /= (leftRight.x + leftRight.y));
- float2 factor = float2(1.000000f, 1.000000f);
- (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));
- (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));
- (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));
- (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));
- (weights *= saturate(factor));
- }
- float4 SMAABlendingWeightCalculationPS(in float2 texcoord, in float2 pixcoord, in float4 offset[3], in sampler2D edgesTex, in sampler2D areaTex, in sampler2D searchTex, in float4 subsampleIndices)
- {
- float4 weights = float4(0.000000f, 0.000000f, 0.000000f, 0.000000f);
- float2 e = tex2D(edgesTex, texcoord).xy;
- [branch]if ((e.y > 0.000000f))
- {
- (weights.xy = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices));
- [branch]if ((weights.x == -weights.y))
- {
- float2 d;
- float3 coords;
- (coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x));
- (coords.y = offset[1].y);
- (d.x = coords.x);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).x;
- (coords.z = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).zz) * (d) + (-pixcoord.xx)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.xy = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.y));
- (coords.y = texcoord.y);
- SMAADetectHorizontalCornerPattern(edgesTex, weights.xy, coords.xyzy, d);
- }
- else
- (e.x = 0.000000f);
- }
- [branch]if ((e.x > 0.000000f))
- {
- float2 d;
- float3 coords;
- (coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z));
- (coords.x = offset[0].x);
- (d.x = coords.y);
- float e1 = tex2Dlod(edgesTex, float4(coords.xy, 0.000000f, 0.000000f)).y;
- (coords.z = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w));
- (d.y = coords.z);
- (d = abs(round(((float4(0.000521f, 0.000926f, 1920.000000f, 1080.000000f).ww) * (d) + (-pixcoord.yy)))));
- float2 sqrt_d = sqrt(d);
- 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;
- (weights.zw = SMAAArea(areaTex, sqrt_d, e1, e2, subsampleIndices.x));
- (coords.x = texcoord.x);
- SMAADetectVerticalCornerPattern(edgesTex, weights.zw, coords.xyxz, d);
- }
- return weights;
- }
- float4 SMAANeighborhoodBlendingPS(in float2 texcoord, in float4 offset, in sampler2D colorTex, in sampler2D blendTex)
- {
- float4 a;
- (a.x = tex2D(blendTex, offset.xy).w);
- (a.y = tex2D(blendTex, offset.zw).y);
- (a.wz = tex2D(blendTex, texcoord).xz);
- [branch]if ((dot(a, float4(1.000000f, 1.000000f, 1.000000f, 1.000000f)) < 0.000010f))
- {
- float4 color = tex2Dlod(colorTex, float4(texcoord, 0.000000f, 0.000000f));
- return color;
- }
- else
- {
- bool h = (max(a.x, a.z) > max(a.y, a.w));
- float4 blendingOffset = float4(0.000000f, a.y, 0.000000f, a.w);
- float2 blendingWeight = a.yw;
- SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.000000f, a.z, 0.000000f));
- SMAAMovc(bool2(h, h), blendingWeight, a.xz);
- (blendingWeight /= dot(blendingWeight, float2(1.000000f, 1.000000f)));
- 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));
- float4 color = (blendingWeight.x * tex2Dlod(colorTex, float4(blendingCoord.xy, 0.000000f, 0.000000f)));
- (color += (blendingWeight.y * tex2Dlod(colorTex, float4(blendingCoord.zw, 0.000000f, 0.000000f))));
- return color;
- }
- }
- float4 SMAAResolvePS(in float2 texcoord, in sampler2D currentColorTex, in sampler2D previousColorTex)
- {
- float4 current = tex2D(currentColorTex, texcoord);
- float4 previous = tex2D(previousColorTex, texcoord);
- return lerp(current, previous, 0.500000f);
- }
- void SMAAEdgeDetectionVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAAEdgeDetectionVS(texcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAABlendingWeightCalculationVSWrap(in uint id, out float4 position, out float2 texcoord, out float2 pixcoord, out float4 offset0, out float4 offset1, out float4 offset2)
- {
- float4 offset[3];
- FullscreenTriangle(id, position, texcoord);
- SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
- (offset0 = offset[0]), (offset1 = offset[1]), (offset2 = offset[2]);
- }
- void SMAANeighborhoodBlendingVSWrap(in uint id, out float4 position, out float2 texcoord, out float4 offset)
- {
- FullscreenTriangle(id, position, texcoord);
- SMAANeighborhoodBlendingVS(texcoord, offset);
- }
- float2 SMAALumaEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAALumaEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAAColorEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAAColorEdgeDetectionPS(texcoord, offset, colorGammaSampler);
- }
- float2 SMAADepthEdgeDetectionPSWrap(in float4 position, in float2 texcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAADepthEdgeDetectionPS(texcoord, offset, depthSampler);
- }
- float4 SMAABlendingWeightCalculationPSWrap(in float4 position, in float2 texcoord, in float2 pixcoord, in float4 offset0, in float4 offset1, in float4 offset2)
- {
- float4 offset[3] = { offset0, offset1, offset2 };
- return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesSampler, areaSampler, searchSampler, 0.000000f);
- }
- float3 SMAANeighborhoodBlendingPSWrap(in float4 position, in float2 texcoord, in float4 offset)
- {
- float3 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorLinearSampler, blendSampler).xyz;
- return color;
- }
- void SharedWrap(in float4 position, in float2 texcoord, out float3 color)
- {
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- float depth = tex2D(depthSampler, texcoord).x;
- []if (depthtoggle)
- {
- const float z_near = 1.000000f;
- const float z_far = 100.000000f;
- (depth = ((2.000000f * z_near) / ((-(z_far - z_near) * depth) + (z_far + z_near))));
- (color.xyz = float3(depth.xxx));
- }
- (color = main(texcoord, color.xyzz).xyz);
- }
- void FadeIn(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((-timeleft * 0.000125f) + 1.000000f));
- }
- void FadeOut(in float4 position, in float2 texcoord, out float4 color)
- {
- (color = tex2D(colorGammaSampler, texcoord));
- (color.xyz *= ((timeleft * 0.000125f) - 1.000000f));
- }
- void CurtainOpen(in float4 position, in float2 texcoord, out float4 color)
- {
- const float curtain_time = 3500.000000f;
- float coord = abs((texcoord.x - 0.500000f));
- float factor = saturate((1.000000f - (timeleft / curtain_time)));
- []if (((coord < factor) || (timer > 10000.000000f)))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void CurtainClose(in float4 position, in float2 texcoord, out float4 color)
- {
- float coord = abs((texcoord.x - 0.500000f));
- float factor = (timeleft / 8000.000000f);
- []if ((coord < factor))
- (color = tex2D(colorGammaSampler, texcoord));
- else
- (color = tex2D(transitionSampler, (texcoord + float2(((texcoord.x < 0.500000f) ? factor : -factor), 0))));
- }
- void ImageFadeOut(in float4 position, in float2 texcoord, out float3 color)
- {
- float3 image = tex2D(transitionSampler, texcoord).xyz;
- (color = tex2D(colorGammaSampler, texcoord).xyz);
- (color = lerp(color, image, saturate((timeleft * 0.001000f))));
- }
- void __main(in float4 position : POSITION, in float2 texcoord : TEXCOORD0, out float4 color : COLOR)
- {
- color = float4(0.0f, 0.0f, 0.0f, 0.0f);
- CurtainOpen(position, texcoord, color.xyzw);
- }
- 28/12/2014 19:10:51,576 | INFO | > Successfully compiled effect.
- 28/12/2014 19:11:11,308 | TRACE | Adding depthstencil 22360660 (Width: 1920, Height: 1080, Format: 75) to list of possible depth candidates ...
- 28/12/2014 19:11:11,650 | TRACE | Switched depth source to depthstencil 22360660.
- 28/12/2014 19:11:53,465 | INFO | Destroyed effect environment on runtime 1DB97290.
- 28/12/2014 19:11:53,603 | INFO | Exiting ...
- 28/12/2014 19:11:53,603 | INFO | Uninstalling 20 hook(s) ...
- 28/12/2014 19:11:53,603 | TRACE | Uninstalling hook for '0x764349A7' ...
- 28/12/2014 19:11:53,607 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,607 | TRACE | Uninstalling hook for '0x764348FB' ...
- 28/12/2014 19:11:53,611 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,611 | TRACE | Uninstalling hook for '0x6A6571DB' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A657249' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A65746D' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A65738D' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A6572B5' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A657402' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A657321' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A610A62' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x6A5BCCD5' ...
- 28/12/2014 19:11:53,612 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,612 | TRACE | Uninstalling hook for '0x76537089' ...
- 28/12/2014 19:11:53,616 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,616 | TRACE | Uninstalling hook for '0x7653CBA6' ...
- 28/12/2014 19:11:53,620 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,620 | TRACE | Uninstalling hook for '0x76534406' ...
- 28/12/2014 19:11:53,625 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,625 | TRACE | Uninstalling hook for '0x7654B30C' ...
- 28/12/2014 19:11:53,629 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,629 | TRACE | Uninstalling hook for '0x76536B0E' ...
- 28/12/2014 19:11:53,633 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,633 | TRACE | Uninstalling hook for '0x7653B6DC' ...
- 28/12/2014 19:11:53,638 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,638 | TRACE | Uninstalling hook for '0x76536F01' ...
- 28/12/2014 19:11:53,642 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,642 | TRACE | Uninstalling hook for '0x765334B5' ...
- 28/12/2014 19:11:53,646 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,646 | TRACE | Uninstalling hook for '0x6A5D2E0E' ...
- 28/12/2014 19:11:53,651 | TRACE | > Succeeded.
- 28/12/2014 19:11:53,651 | INFO | Exited.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement