From 1dd3ffd406ef89aaea0878b661c30f86df6c8c58 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Fri, 17 Jan 2025 15:00:57 +0100 Subject: [PATCH] [BOTW] Support the Metal API --- ...0382e6fbbb3951_ff060c56c2a0897b_ps_msl.txt | 609 +++++ ...040a485a29d54e_ff060c183153097b_ps_msl.txt | 2307 +++++++++++++++++ ...f2cf86e789335f_44ab6e52279faa52_ps_msl.txt | 585 +++++ ...0e6e8cbec4502a_ff060c183060c54b_ps_msl.txt | 69 + 4 files changed, 3570 insertions(+) create mode 100644 src/BreathOfTheWild/Enhancements/340382e6fbbb3951_ff060c56c2a0897b_ps_msl.txt create mode 100644 src/BreathOfTheWild/Enhancements/37040a485a29d54e_ff060c183153097b_ps_msl.txt create mode 100644 src/BreathOfTheWild/Enhancements/8ff2cf86e789335f_44ab6e52279faa52_ps_msl.txt create mode 100644 src/BreathOfTheWild/Enhancements/cb0e6e8cbec4502a_ff060c183060c54b_ps_msl.txt diff --git a/src/BreathOfTheWild/Enhancements/340382e6fbbb3951_ff060c56c2a0897b_ps_msl.txt b/src/BreathOfTheWild/Enhancements/340382e6fbbb3951_ff060c56c2a0897b_ps_msl.txt new file mode 100644 index 000000000..1da8409d6 --- /dev/null +++ b/src/BreathOfTheWild/Enhancements/340382e6fbbb3951_ff060c56c2a0897b_ps_msl.txt @@ -0,0 +1,609 @@ +// shader 340382e6fbbb3951 +#include +using namespace metal; +#define SET_POSITION(_v) out.position = _v; out.position.z = (out.position.z + out.position.w) / 2.0 +// start of shader inputs/outputs, predetermined by Cemu. Do not touch +struct SupportBuffer { +int4 remapped[11]; +float2 fragCoordScale; +}; + +#define GET_FRAGCOORD() float4(in.position.xy * supportBuffer.fragCoordScale.xy, in.position.z, 1.0 / in.position.w) +struct FragmentIn { +float4 position [[position]]; +float4 passParameterSem0 [[user(locn0)]] [[center_no_perspective]]; +float4 passParameterSem1 [[user(locn1)]] [[center_no_perspective]]; +}; + +struct FragmentOut { +float4 passPixelColor0 [[color(0)]]; +}; + +// end of shader inputs/outputs +template +float sampleCompareEmulate(TextureT tex, sampler samplr, CoordT coord, float compareValue) { +return compareValue < tex.sample(samplr, coord).x ? 1.0 : 0.0; +} +template +float2 textureCalculateLod(TextureT tex, sampler samplr, CoordT coord) { +float lod = tex.calculate_unclamped_lod(samplr, coord); +return float2(floor(lod), fract(lod)); +} +int clampFI32(int v) +{ +if( v == 0x7FFFFFFF ) + return as_type(1.0); +else if( v == 0xFFFFFFFF ) + return as_type(0.0); +return as_type(clamp(as_type(v), 0.0, 1.0)); +} +float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } +fragment FragmentOut main0(FragmentIn in [[stage_in]], float2 pointCoord [[point_coord]], bool frontFacing [[front_facing]], constant SupportBuffer& supportBuffer [[buffer(0)]], texture2d_array tex0 [[texture(0)]], sampler samplr0 [[sampler(0)]], texture2d tex1 [[texture(1)]], sampler samplr1 [[sampler(1)]], texture2d tex2 [[texture(2)]], sampler samplr2 [[sampler(2)]]) { +FragmentOut out; +int4 R0i = int4(0); +int4 R1i = int4(0); +int4 R2i = int4(0); +int4 R3i = int4(0); +int4 R4i = int4(0); +int4 R5i = int4(0); +int4 R6i = int4(0); +int4 R7i = int4(0); +int4 R8i = int4(0); +int4 R9i = int4(0); +int4 R122i = int4(0); +int4 R123i = int4(0); +int4 R124i = int4(0); +int4 R125i = int4(0); +int4 R126i = int4(0); +int4 R127i = int4(0); +int backupReg0i, backupReg1i, backupReg2i, backupReg3i, backupReg4i; +int PV0ix = 0, PV0iy = 0, PV0iz = 0, PV0iw = 0, PV1ix = 0, PV1iy = 0, PV1iz = 0, PV1iw = 0; +int PS0i = 0, PS1i = 0; +int4 tempi = int4(0); +float tempResultf; +int tempResulti; +int4 ARi = int4(0); +bool predResult = true; +bool activeMaskStack[2]; +bool activeMaskStackC[3]; +activeMaskStack[0] = false; +activeMaskStackC[0] = false; +activeMaskStackC[1] = false; +activeMaskStack[0] = true; +activeMaskStackC[0] = true; +activeMaskStackC[1] = true; +R0i = as_type(in.passParameterSem0); +R1i = as_type(in.passParameterSem1); +if( activeMaskStackC[1] == true ) { +R7i.xyz = as_type(tex2.sample(samplr2, float2(as_type(R0i.x),as_type(R0i.y))).xyz); +R1i.w = as_type(tex1.sample(samplr1, float2(as_type(R0i.x),as_type(R0i.y))).x); +} +if( activeMaskStackC[1] == true ) { +// 0 +R127i.x = as_type(as_type(R7i.x) * 2.0 + -(1.0)); +R127i.y = as_type(as_type(R7i.y) * 2.0 + -(1.0)); +PV0iz = 0; +R127i.w = as_type(mul_nonIEEE(-(as_type(R1i.w)),as_type(supportBuffer.remapped[0].x)) + -(as_type(supportBuffer.remapped[1].z))); +R126i.w = int(0x3f800000); +// 1 +tempi.x = as_type(dot(float4(as_type(R127i.x),as_type(R127i.y),as_type(PV0iz),as_type(0x80000000)),float4(as_type(R127i.x),as_type(R127i.y),as_type(R127i.y),0.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R2i.x = as_type(mul_nonIEEE(as_type(R1i.x), as_type(R127i.w))); +// 2 +R125i.x = as_type(mul_nonIEEE(as_type(R1i.y), as_type(R127i.w))); +PV0iy = as_type(-(as_type(PV1ix)) + 1.0); +R126i.z = R127i.w; +R3i.w = as_type(max(as_type(R127i.w), -(as_type(R127i.w)))); +R125i.w = int(0x3f800000); +// 3 +tempi.x = as_type(dot(float4(as_type(R2i.x),as_type(R125i.x),as_type(R126i.z),as_type(R126i.w)),float4(as_type(supportBuffer.remapped[2].x),as_type(supportBuffer.remapped[2].y),as_type(supportBuffer.remapped[2].z),as_type(supportBuffer.remapped[2].w)))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +PS1i = as_type(sqrt(as_type(PV0iy))); +// 4 +R126i.x = 0; +R5i.y = 0; +R127i.z = as_type(-(as_type(PS1i))); +R127i.w = as_type(mul_nonIEEE(as_type(R126i.w), as_type(supportBuffer.remapped[3].w))); +R124i.w = as_type(1.0 / as_type(PV1ix)); +// 5 +tempi.x = as_type(dot(float4(as_type(R127i.x),as_type(R127i.y),as_type(R127i.z),as_type(0x80000000)),float4(as_type(R127i.x),as_type(R127i.y),as_type(R127i.z),0.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R6i.z = 0; +// 6 +tempi.x = as_type(dot(float4(as_type(R2i.x),as_type(R125i.x),as_type(R126i.z),as_type(R127i.w)),float4(as_type(supportBuffer.remapped[3].x),as_type(supportBuffer.remapped[3].y),as_type(supportBuffer.remapped[3].z),1.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +tempResultf = 1.0 / sqrt(as_type(PV1ix)); +PS0i = as_type(tempResultf); +// 7 +R1i.x = as_type(mul_nonIEEE(as_type(R127i.x), as_type(PS0i))); +R1i.y = as_type(mul_nonIEEE(as_type(R127i.y), as_type(PS0i))); +R3i.z = as_type(mul_nonIEEE(as_type(R127i.z), as_type(PS0i))); +R127i.w = as_type(mul_nonIEEE(as_type(R126i.w), as_type(supportBuffer.remapped[4].w))); +R6i.x = as_type(as_type(PV0ix) * as_type(R124i.w)); +// 8 +R124i.x = as_type(mul_nonIEEE(as_type(R1i.x),as_type(R3i.w)) + as_type(R2i.x)); +R127i.y = as_type(mul_nonIEEE(as_type(R1i.y),as_type(R3i.w)) + as_type(R125i.x)); +R127i.z = as_type(mul_nonIEEE(as_type(R3i.z),as_type(R3i.w)) + as_type(R126i.z)); +PV0iw = as_type(max(as_type(R1i.y), -(as_type(R1i.y)))); +tempResultf = max(0.0, as_type(supportBuffer.remapped[5].w)); +tempResultf = log2(tempResultf); +if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; +R4i.w = as_type(tempResultf); +// 9 +tempi.x = as_type(dot(float4(as_type(R124i.x),as_type(R127i.y),as_type(R127i.z),as_type(R125i.w)),float4(as_type(supportBuffer.remapped[2].x),as_type(supportBuffer.remapped[2].y),as_type(supportBuffer.remapped[2].z),as_type(supportBuffer.remapped[2].w)))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R6i.y = as_type(-(as_type(PV0iw)) + 1.0); +// 10 +tempi.x = as_type(dot(float4(as_type(R2i.x),as_type(R125i.x),as_type(R126i.z),as_type(R127i.w)),float4(as_type(supportBuffer.remapped[4].x),as_type(supportBuffer.remapped[4].y),as_type(supportBuffer.remapped[4].z),1.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R1i.x = as_type(1.0 / as_type(PV1ix)); +// 11 +tempi.x = as_type(dot(float4(as_type(R124i.x),as_type(R127i.y),as_type(R127i.z),as_type(R125i.w)),float4(as_type(supportBuffer.remapped[3].x),as_type(supportBuffer.remapped[3].y),as_type(supportBuffer.remapped[3].z),as_type(supportBuffer.remapped[3].w)))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R7i.y = as_type(as_type(PV0ix) * as_type(R124i.w)); +// 12 +tempi.x = as_type(dot(float4(as_type(R124i.x),as_type(R127i.y),as_type(R127i.z),as_type(R125i.w)),float4(as_type(supportBuffer.remapped[4].x),as_type(supportBuffer.remapped[4].y),as_type(supportBuffer.remapped[4].z),as_type(supportBuffer.remapped[4].w)))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +PS0i = as_type(as_type(PV1ix) * as_type(R1i.x)); +// 13 +R127i.x = as_type(-(as_type(R6i.x)) + as_type(PS0i)); +R126i.y = as_type(-(as_type(R6i.x)) + as_type(PS0i)); +PV1iz = as_type(as_type(PV0ix) * as_type(R1i.x)); +PV1iw = as_type(mul_nonIEEE(as_type(R125i.w), as_type(supportBuffer.remapped[6].w))); +PS1i = as_type(mul_nonIEEE(as_type(R126i.w), as_type(supportBuffer.remapped[6].w))); +// 14 +R3i.x = as_type(-(as_type(R7i.y)) + as_type(PV1iz)); +PV0iy = as_type(-(as_type(R7i.y)) + as_type(PV1iz)); +R127i.z = as_type(mul_nonIEEE(as_type(R127i.z),as_type(supportBuffer.remapped[6].z)) + as_type(PV1iw)); +R122i.x = as_type(mul_nonIEEE(as_type(R126i.z),as_type(supportBuffer.remapped[6].z)) + as_type(PS1i)); +// 15 +tempi.x = as_type(dot(float4(as_type(R127i.x),as_type(PV0iy),as_type(R126i.x),as_type(0x80000000)),float4(as_type(R127i.x),as_type(PV0iy),as_type(R126i.x),0.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R127i.x = as_type(mul_nonIEEE(as_type(R125i.x),as_type(supportBuffer.remapped[6].y)) + as_type(R122i.x)); +// 16 +tempi.x = as_type(dot(float4(as_type(R124i.x),as_type(R127i.y),as_type(R127i.z),0.0),float4(as_type(supportBuffer.remapped[6].x),as_type(supportBuffer.remapped[6].y),1.0,0.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +PS0i = as_type(sqrt(as_type(PV1ix))); +// 17 +R123i.z = as_type(mul_nonIEEE(as_type(R2i.x),as_type(supportBuffer.remapped[6].x)) + as_type(R127i.x)); +R126i.w = as_type(as_type(PV0ix) * as_type(R1i.x)); +PS1i = as_type(1.0 / as_type(PS0i)); +// 18 +R4i.z = as_type(as_type(R123i.z) * as_type(R124i.w)); +PV0iw = as_type(as_type(PS1i) * as_type(0x3db4b4b5)); +// 19 +PV1ix = as_type(mul_nonIEEE(as_type(PV0iw), as_type(supportBuffer.remapped[5].y))); +PV1iw = as_type(-(as_type(R4i.z)) + as_type(R126i.w)); +// 20 +R7i.x = as_type(mul_nonIEEE(as_type(R126i.y), as_type(PV1ix))); +R8i.y = as_type(mul_nonIEEE(as_type(R3i.x), as_type(PV1ix))); +R5i.z = as_type(mul_nonIEEE(as_type(PV1iw), as_type(PV1ix))); +} +while( activeMaskStackC[1] == true ) +{ +if( activeMaskStackC[1] == true ) { +activeMaskStack[1] = activeMaskStack[0]; +activeMaskStackC[2] = activeMaskStackC[1]; +// 0 +R1i.y = (($sampleCount > as_type(R6i.z))?-1:0); +// 1 +predResult = (R1i.y == 0); +activeMaskStack[1] = predResult; +activeMaskStackC[2] = predResult == true && activeMaskStackC[1] == true; +} +else { +activeMaskStack[1] = false; +activeMaskStackC[2] = false; +} +if( activeMaskStackC[2] == true ) { +// 0 +R1i.y = R5i.y; +} +if( activeMaskStackC[2] == true ) { +break; +} +activeMaskStackC[1] = activeMaskStack[0] == true && activeMaskStackC[0] == true; +if( activeMaskStackC[1] == true ) { +activeMaskStack[1] = activeMaskStack[0]; +activeMaskStackC[2] = activeMaskStackC[1]; +// 0 +R123i.w = as_type(as_type(R6i.z) * 4.0 + 0.0); +// 1 +R8i.x = as_type(as_type(R123i.w) + 1.0); +R9i.y = as_type(as_type(R123i.w) + 2.0); +R8i.z = as_type(as_type(R123i.w) + 3.0); +R5i.w = as_type(as_type(R123i.w) + 4.0); +// 2 +R1i.x = as_type(mul_nonIEEE(as_type(R7i.x),as_type(R8i.x)) + as_type(R6i.x)); +R1i.y = as_type(mul_nonIEEE(as_type(R8i.y),as_type(R8i.x)) + as_type(R7i.y)); +R1i.z = as_type(mul_nonIEEE(as_type(R7i.x),as_type(R9i.y)) + as_type(R6i.x)); +R1i.w = as_type(mul_nonIEEE(as_type(R8i.y),as_type(R9i.y)) + as_type(R7i.y)); +R2i.x = as_type(mul_nonIEEE(as_type(R7i.x),as_type(R8i.z)) + as_type(R6i.x)); +// 3 +PV1ix = as_type(max(as_type(R1i.y), -(1.0))); +R2i.y = as_type(mul_nonIEEE(as_type(R8i.y),as_type(R8i.z)) + as_type(R7i.y)); +PV1iz = as_type(max(as_type(R1i.x), -(1.0))); +PV1iw = as_type(max(as_type(R1i.z), -(1.0))); +R127i.w = as_type(max(as_type(R1i.w), -(1.0))); +// 4 +PV0ix = as_type(min(as_type(PV1iz), 1.0)); +PV0iy = as_type(min(as_type(PV1ix), 1.0)); +R2i.z = as_type(mul_nonIEEE(as_type(R7i.x),as_type(R5i.w)) + as_type(R6i.x)); +R2i.w = as_type(mul_nonIEEE(as_type(R8i.y),as_type(R5i.w)) + as_type(R7i.y)); +R127i.y = as_type(min(as_type(PV1iw), 1.0)); +// 5 +R127i.x = as_type(max(as_type(R2i.y), -(1.0))); +R126i.y = as_type(as_type(R1i.x) + -(as_type(PV0ix))); +PV1iz = as_type(max(as_type(R2i.x), -(1.0))); +PV1iw = as_type(min(as_type(R127i.w), 1.0)); +R125i.y = as_type(as_type(R1i.y) + -(as_type(PV0iy))); +// 6 +PV0ix = as_type(max(as_type(R2i.w), -(1.0))); +PV0iy = as_type(max(as_type(R2i.z), -(1.0))); +R127i.z = as_type(as_type(R1i.z) + -(as_type(R127i.y))); +R127i.w = as_type(as_type(R1i.w) + -(as_type(PV1iw))); +PS0i = as_type(min(as_type(PV1iz), 1.0)); +// 7 +PV1ix = as_type(min(as_type(R127i.x), 1.0)); +R127i.y = as_type(as_type(R2i.x) + -(as_type(PS0i))); +PV1iz = as_type(min(as_type(PV0iy), 1.0)); +PV1iw = as_type(min(as_type(PV0ix), 1.0)); +R3i.x = as_type(mul_nonIEEE(as_type(R5i.z),as_type(R8i.x)) + as_type(R4i.z)); +// 8 +PV0ix = as_type(0.0); +R124i.y = as_type(as_type(R2i.y) + -(as_type(PV1ix))); +R126i.z = as_type(as_type(R2i.z) + -(as_type(PV1iz))); +R126i.w = as_type(as_type(R2i.w) + -(as_type(PV1iw))); +R4i.y = as_type(mul_nonIEEE(as_type(R5i.z),as_type(R9i.y)) + as_type(R4i.z)); +// 9 +tempi.x = as_type(dot(float4(as_type(R126i.y),as_type(R125i.y),as_type(PV0ix),as_type(0x80000000)),float4(1.0,1.0,1.0,0.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R0i.z = as_type(mul_nonIEEE(as_type(R5i.z),as_type(R8i.z)) + as_type(R4i.z)); +// 10 +tempi.x = as_type(dot(float4(as_type(R127i.z),as_type(R127i.w),as_type(R127i.w),as_type(0x80000000)),float4(1.0,1.0,0.0,0.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R127i.z = ((as_type(PV1ix) != 0.0)?-1:0); +// 11 +tempi.x = as_type(dot(float4(as_type(R127i.y),as_type(R124i.y),as_type(R124i.y),as_type(0x80000000)),float4(1.0,1.0,0.0,0.0))); +PV1ix = tempi.x; +R127i.y = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +PS1i = ((as_type(PV0ix) != 0.0)?-1:0); +// 12 +tempi.x = as_type(dot(float4(as_type(R126i.z),as_type(R126i.w),as_type(R126i.w),as_type(0x80000000)),float4(1.0,1.0,0.0,0.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R127i.z = R127i.z | PS1i; +// 13 +PV1iy = ((as_type(R127i.y) != 0.0)?-1:0); +R126i.w = ((as_type(PV0ix) != 0.0)?-1:0); +R0i.w = as_type(mul_nonIEEE(as_type(R5i.z),as_type(R5i.w)) + as_type(R4i.z)); +// 14 +PV0ix = PV1iy | R127i.z; +// 15 +R3i.y = R126i.w | PV0ix; +// 16 +predResult = (R3i.y != 0); +activeMaskStack[1] = predResult; +activeMaskStackC[2] = predResult == true && activeMaskStackC[1] == true; +} +else { +activeMaskStack[1] = false; +activeMaskStackC[2] = false; +} +if( activeMaskStackC[2] == true ) { +// 0 +R1i.y = R5i.y; +} +if( activeMaskStackC[2] == true ) { +break; +} +activeMaskStackC[1] = activeMaskStack[0] == true && activeMaskStackC[0] == true; +if( activeMaskStackC[1] == true ) { +// 0 +PV0ix = R1i.z; +PV0ix = as_type(as_type(PV0ix) / 2.0); +PV0iy = as_type(-(as_type(R1i.w))); +PV0iy = as_type(as_type(PV0iy) / 2.0); +PV0iz = R1i.x; +PV0iz = as_type(as_type(PV0iz) / 2.0); +PV0iw = as_type(-(as_type(R1i.y))); +PV0iw = as_type(as_type(PV0iw) / 2.0); +R127i.y = R2i.x; +R127i.y = as_type(as_type(R127i.y) / 2.0); +// 1 +R1i.x = as_type(as_type(PV0iz) + 0.5); +R1i.y = as_type(as_type(PV0iw) + 0.5); +R1i.z = as_type(as_type(PV0ix) + 0.5); +R1i.w = as_type(as_type(PV0iy) + 0.5); +PS1i = as_type(-(as_type(R2i.y))); +PS1i = as_type(as_type(PS1i) / 2.0); +// 2 +R2i.x = as_type(as_type(R127i.y) + 0.5); +R2i.y = as_type(as_type(PS1i) + 0.5); +PV0iz = as_type(-(as_type(R2i.w))); +PV0iz = as_type(as_type(PV0iz) / 2.0); +PV0iw = R2i.z; +PV0iw = as_type(as_type(PV0iw) / 2.0); +R4i.x = 0; +// 3 +backupReg0i = R3i.x; +R3i.x = as_type(as_type(PV0iw) + 0.5); +R3i.y = as_type(as_type(PV0iz) + 0.5); +R2i.z = backupReg0i; +R2i.w = int(0x3f800000); +R5i.x = 0; +} +if( activeMaskStackC[1] == true ) { +R1i.x = as_type(tex1.sample(samplr1, float2(as_type(R1i.x),as_type(R1i.y))).x); +R1i.y = as_type(tex1.sample(samplr1, float2(as_type(R1i.z),as_type(R1i.w))).x); +R1i.z = as_type(tex1.sample(samplr1, float2(as_type(R2i.x),as_type(R2i.y))).x); +R1i.w = as_type(tex1.sample(samplr1, float2(as_type(R3i.x),as_type(R3i.y))).x); +} +if( activeMaskStackC[1] == true ) { +activeMaskStack[1] = activeMaskStack[0]; +activeMaskStackC[2] = activeMaskStackC[1]; +// 0 +R126i.x = 0; +R125i.y = R0i.z; +R127i.z = R4i.y; +R127i.w = int(0x3f800000); +R125i.w = int(0x3f800000); +// 1 +tempi.x = as_type(dot(float4(as_type(R4i.x),as_type(R4i.x),as_type(R2i.z),as_type(R2i.w)),float4(as_type(supportBuffer.remapped[7].x),as_type(supportBuffer.remapped[7].y),as_type(supportBuffer.remapped[7].z),as_type(supportBuffer.remapped[7].w)))); +PV1ix = tempi.x; +R127i.y = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R125i.x = 0; +// 2 +tempi.x = as_type(dot(float4(as_type(R5i.x),as_type(R5i.x),as_type(R127i.z),as_type(R127i.w)),float4(as_type(supportBuffer.remapped[7].x),as_type(supportBuffer.remapped[7].y),as_type(supportBuffer.remapped[7].z),as_type(supportBuffer.remapped[7].w)))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +R126i.w = tempi.x; +R126i.z = R0i.w; +// 3 +backupReg0i = R127i.y; +PV1ix = as_type(mul_nonIEEE(as_type(R2i.w), as_type(supportBuffer.remapped[8].w))); +R127i.y = as_type(mul_nonIEEE(as_type(R127i.w), as_type(supportBuffer.remapped[8].w))); +R127i.w = int(0x3f800000); +R127i.x = as_type(1.0 / as_type(backupReg0i)); +// 4 +tempi.x = as_type(dot(float4(as_type(R4i.x),as_type(R4i.x),as_type(R2i.z),as_type(PV1ix)),float4(as_type(supportBuffer.remapped[8].x),as_type(supportBuffer.remapped[8].y),as_type(supportBuffer.remapped[8].z),1.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R126i.y = as_type(1.0 / as_type(R126i.w)); +// 5 +tempi.x = as_type(dot(float4(as_type(R5i.x),as_type(R5i.x),as_type(R127i.z),as_type(R127i.y)),float4(as_type(supportBuffer.remapped[8].x),as_type(supportBuffer.remapped[8].y),as_type(supportBuffer.remapped[8].z),1.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R127i.z = as_type(as_type(PV0ix) * as_type(R127i.x)); +// 6 +tempi.x = as_type(dot(float4(as_type(R126i.x),as_type(R126i.x),as_type(R125i.y),as_type(R125i.w)),float4(as_type(supportBuffer.remapped[7].x),as_type(supportBuffer.remapped[7].y),as_type(supportBuffer.remapped[7].z),as_type(supportBuffer.remapped[7].w)))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R127i.x = as_type(as_type(PV1ix) * as_type(R126i.y)); +// 7 +tempi.x = as_type(dot(float4(as_type(R126i.x),as_type(R126i.x),as_type(R125i.y),as_type(R125i.w)),float4(as_type(supportBuffer.remapped[8].x),as_type(supportBuffer.remapped[8].y),as_type(supportBuffer.remapped[8].z),as_type(supportBuffer.remapped[8].w)))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +PS1i = as_type(1.0 / as_type(PV0ix)); +// 8 +tempi.x = as_type(dot(float4(as_type(R125i.x),as_type(R125i.x),as_type(R126i.z),as_type(R127i.w)),float4(as_type(supportBuffer.remapped[7].x),as_type(supportBuffer.remapped[7].y),as_type(supportBuffer.remapped[7].z),as_type(supportBuffer.remapped[7].w)))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R125i.y = as_type(as_type(PV1ix) * as_type(PS1i)); +// 9 +tempi.x = as_type(dot(float4(as_type(R125i.x),as_type(R125i.x),as_type(R126i.z),as_type(R127i.w)),float4(as_type(supportBuffer.remapped[8].x),as_type(supportBuffer.remapped[8].y),as_type(supportBuffer.remapped[8].z),as_type(supportBuffer.remapped[8].w)))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +PS1i = as_type(1.0 / as_type(PV0ix)); +// 10 +R123i.x = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[0].y),-(as_type(R127i.x))) + -(as_type(supportBuffer.remapped[0].z))); +R123i.y = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[0].y),-(as_type(R127i.z))) + -(as_type(supportBuffer.remapped[0].z))); +R123i.z = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[0].y),-(as_type(R125i.y))) + -(as_type(supportBuffer.remapped[0].z))); +PV0iw = as_type(as_type(PV1ix) * as_type(PS1i)); +// 11 +R1i.x = as_type(as_type(R1i.x) + -(as_type(R123i.y))); +R1i.y = as_type(as_type(R1i.y) + -(as_type(R123i.x))); +R0i.z = as_type(as_type(R1i.z) + -(as_type(R123i.z))); +R123i.w = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[0].y),-(as_type(PV0iw))) + -(as_type(supportBuffer.remapped[0].z))); +// 12 +R2i.x = ((0.0 > as_type(R1i.x))?-1:0); +R1i.z = ((0.0 > as_type(R0i.z))?-1:0); +R0i.w = ((0.0 > as_type(R1i.y))?-1:0); +R1i.w = as_type(as_type(R1i.w) + -(as_type(R123i.w))); +// 13 +PV1iy = R2i.x | R0i.w; +R2i.y = ((0.0 > as_type(R1i.w))?-1:0); +// 14 +PV0ix = R1i.z | PV1iy; +// 15 +R2i.z = R2i.y | PV0ix; +// 16 +predResult = (R2i.z != 0); +activeMaskStack[1] = predResult; +activeMaskStackC[2] = predResult == true && activeMaskStackC[1] == true; +} +else { +activeMaskStack[1] = false; +activeMaskStackC[2] = false; +} +if( activeMaskStackC[2] == true ) { +// 0 +int offset = as_type($sampleCount * 4.0); +R127i.x = ((R0i.w == 0)?(offset):(R9i.y)); +R127i.y = ((R2i.x == 0)?(offset):(R8i.x)); +R127i.z = ((R2i.y == 0)?(offset):(R5i.w)); +R127i.w = ((R1i.z == 0)?(offset):(R8i.z)); +PS0i = as_type(1.0 / as_type(supportBuffer.remapped[9].x)); +// 1 +R126i.x = as_type(as_type(R3i.w) * as_type(PS0i)); +R126i.x = clampFI32(R126i.x); +PV1iy = as_type(min(as_type(R127i.y), as_type(R127i.x))); +R126i.z = as_type(max(as_type(R1i.x), -(as_type(R1i.x)))); +R126i.w = as_type(max(as_type(R1i.y), -(as_type(R1i.y)))); +R125i.z = as_type(max(as_type(R0i.z), -(as_type(R0i.z)))); +// 2 +PV0ix = as_type(min(as_type(R127i.w), as_type(PV1iy))); +R126i.y = as_type(max(as_type(R1i.w), -(as_type(R1i.w)))); +// 3 +R5i.y = as_type(min(as_type(R127i.z), as_type(PV0ix))); +// 4 +backupReg0i = R127i.x; +backupReg1i = R127i.z; +R127i.x = ((as_type(R127i.y) == as_type(R5i.y))?-1:0); +R127i.y = ((as_type(R127i.w) == as_type(R5i.y))?-1:0); +R127i.z = ((as_type(backupReg0i) == as_type(R5i.y))?-1:0); +PV0iw = as_type(as_type(R5i.y) / ($sampleCount * 4.0)); // TODO: should $sampleCount be used here as well? +R125i.y = ((as_type(backupReg1i) == as_type(R5i.y))?-1:0); +// 5 +PV1iy = as_type(mul_nonIEEE(as_type(PV0iw), as_type(R6i.y))); +// 6 +PV0iw = as_type(mul_nonIEEE(as_type(R126i.x), as_type(PV1iy))); +PV0iw = clampFI32(PV0iw); +// 7 +PV1iz = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[5].z), as_type(PV0iw))); +// 8 +PV0ix = as_type(mul_nonIEEE(as_type(PV1iz), as_type(R4i.w))); +// 9 +PS1i = as_type(exp2(as_type(PV0ix))); +// 10 +PV0iw = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[5].x), as_type(PS1i))); +// 11 +PV1ix = ((as_type(PV0iw) > as_type(R126i.z))?-1:0); +PV1iy = ((as_type(PV0iw) > as_type(R125i.z))?-1:0); +PV1iz = ((as_type(PV0iw) > as_type(R126i.y))?-1:0); +PV1iw = ((as_type(PV0iw) > as_type(R126i.w))?-1:0); +// 12 +R123i.x = ((R127i.z == 0)?(0):(PV1iw)); +R127i.y = ((R127i.y == 0)?(0):(PV1iy)); +R123i.z = ((R127i.x == 0)?(0):(PV1ix)); +R126i.w = ((R125i.y == 0)?(0):(PV1iz)); +// 13 +PV1iz = R123i.z | R123i.x; +// 14 +PV0ix = R127i.y | PV1iz; +// 15 +R1i.y = R126i.w | PV0ix; +} +if( activeMaskStackC[2] == true ) { +break; +} +activeMaskStackC[1] = activeMaskStack[0] == true && activeMaskStackC[0] == true; +if( activeMaskStackC[1] == true ) { +// 0 +R6i.z = as_type(as_type(R6i.z) + 1.0); +} +} +if( activeMaskStackC[1] == true ) { +// 0 +R123i.x = as_type(as_type(R0i.x) * 2.0 + -(1.0)); +R127i.y = as_type(mul_nonIEEE(as_type(R7i.x),as_type(R5i.y)) + as_type(R6i.x)); +PV0iz = as_type(as_type(R5i.y) / ($sampleCount * 4.0)); +R123i.w = as_type(as_type(R0i.y) * 2.0 + -(1.0)); +PS0i = as_type(1.0 / as_type(R3i.z)); +// 1 +R123i.x = as_type(mul_nonIEEE(-(as_type(R123i.x)),as_type(R123i.x)) + 1.0); +PV1iy = as_type(-(as_type(PV0iz)) + 1.0); +R123i.z = as_type(mul_nonIEEE(-(as_type(R123i.w)),as_type(R123i.w)) + 1.0); +PV1iw = as_type(as_type(supportBuffer.remapped[9].w) * as_type(PS0i)); +PV1iw = clampFI32(PV1iw); +R126i.y = as_type(mul_nonIEEE(as_type(R8i.y),as_type(R5i.y)) + as_type(R7i.y)); +// 2 +backupReg0i = R1i.y; +PV0ix = as_type(max(as_type(PV1iy), as_type(0x3dcccccd))); +R1i.y = as_type(mul_nonIEEE(as_type(R123i.z), as_type(R123i.x))); +R2i.z = as_type(-(as_type(PV1iw)) + 1.0); +R0i.w = ((backupReg0i == 0)?(0):(int(0x3f800000))); +PS0i = R127i.y; +PS0i = as_type(as_type(PS0i) / 2.0); +// 3 +PV1ix = as_type(-(as_type(R126i.y))); +PV1ix = as_type(as_type(PV1ix) / 2.0); +R0i.z = as_type(rint(1.0)); +PV1iw = as_type(min(as_type(PV0ix), 1.0)); +R0i.x = as_type(as_type(PS0i) + 0.5); +// 4 +R0i.y = as_type(as_type(PV1ix) + 0.5); +R1i.z = as_type(mul_nonIEEE(as_type(PV1iw), as_type(PV1iw))); +} +if( activeMaskStackC[1] == true ) { +R0i.xyz = as_type(tex0.sample(samplr0, float2(as_type(R0i.x), as_type(R0i.y)), uint(rint(as_type(R0i.z)))).xyz); +} +if( activeMaskStackC[1] == true ) { +// 0 +PV0iw = as_type(mul_nonIEEE(as_type(R1i.z), as_type(supportBuffer.remapped[10].w))); +PV0iw = clampFI32(PV0iw); +// 1 +PV1iy = as_type(mul_nonIEEE(as_type(R7i.z), as_type(PV0iw))); +// 2 +PV0iw = as_type(mul_nonIEEE(as_type(PV1iy), as_type(R1i.y))); +// 3 +PV1iw = as_type(mul_nonIEEE(as_type(PV0iw), as_type(R2i.z))); +// 4 +PV0iy = as_type(mul_nonIEEE(as_type(PV1iw), as_type(R0i.w))); +// 5 +PV1ix = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[10].x), as_type(PV0iy))); +R2i.w = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[10].y), as_type(PV0iy))); +// 6 +R2i.x = as_type(mul_nonIEEE(as_type(R0i.x), as_type(PV1ix))); +R2i.y = as_type(mul_nonIEEE(as_type(R0i.y), as_type(PV1ix))); +R2i.z = as_type(mul_nonIEEE(as_type(R0i.z), as_type(PV1ix))); +} +// export +out.passPixelColor0 = as_type(float4(as_type(R2i.x), as_type(R2i.y), as_type(R2i.z), as_type(R2i.w))); +return out; +} diff --git a/src/BreathOfTheWild/Enhancements/37040a485a29d54e_ff060c183153097b_ps_msl.txt b/src/BreathOfTheWild/Enhancements/37040a485a29d54e_ff060c183153097b_ps_msl.txt new file mode 100644 index 000000000..06c468811 --- /dev/null +++ b/src/BreathOfTheWild/Enhancements/37040a485a29d54e_ff060c183153097b_ps_msl.txt @@ -0,0 +1,2307 @@ +// shader 37040a485a29d54e +#include +using namespace metal; + +#define SET_POSITION(_v) \ + out.position = _v; \ + out.position.z = (out.position.z + out.position.w) / 2.0 +struct SupportBuffer { + int4 remapped[1]; + float2 fragCoordScale; +}; + +#define GET_FRAGCOORD() \ + float4(in.position.xy *supportBuffer.fragCoordScale.xy, in.position.z, \ + 1.0 / in.position.w) +struct FragmentIn { + float4 position [[position]]; + float4 passParameterSem0 [[user(locn0)]]; +}; + +struct FragmentOut { + float4 passPixelColor0 [[color(0)]]; +}; + +template +float sampleCompareEmulate(TextureT tex, sampler samplr, CoordT coord, + float compareValue) { + return compareValue < tex.sample(samplr, coord).x ? 1.0 : 0.0; +} +template +float2 textureCalculateLod(TextureT tex, sampler samplr, CoordT coord) { + float lod = tex.calculate_unclamped_lod(samplr, coord); + return float2(floor(lod), fract(lod)); +} +int clampFI32(int v) { + if (v == 0x7FFFFFFF) + return as_type(1.0); + else if (v == 0xFFFFFFFF) + return as_type(0.0); + return as_type(clamp(as_type(v), 0.0, 1.0)); +} +float mul_nonIEEE(float a, float b) { + if (a == 0.0 || b == 0.0) + return 0.0; + return a * b; +} + +// ########################################################## + +// Being below game update version 1.4.0 will give you double-vision with recent +// graphic packs. + +// Clarity GFX +// Credit to Jamie for main coding. +// Credit to Kiri coding & Reshade logic. +// Credit to Crementif for additional assistance. +// Credit to all other creators for their time in making alternative presets. + +// Shader dumped from Cemu 1.11.2 from BotW 1.4.0 +// Added Cemu 1.13.x Preset support +// v 2.3 Final + +// ########################################################## + +#define Preset $preset + +// User Defined Preset 0 +// Bruz Preset 1 +// t3nka Neutral+ 2 +// Jamie Preset 3 +// Contrasty Preset 4 +// The Complaining Gamer Preset 5 +// Filmic Preset Preset 6 +// CellHunter Preset 7 +// Serfrost Preset (Bright Display) 8 +// Serfrost Preset (Dim Display) 9 +// Serfrost Preset (Default) 10 +// ViskClarity Preset 11 +// Survival of the Wild Preset (Warmer) 12 +// Survival of the Wild Preset (Colder) 13 +// Godot's Mexican Preset 14 +// Hexaae's Clear Preset 15 +// MaranBr Preset (Little More Intense) 16 +// YeMaoWuXin's Preset (Bright colors) 17 +// YeMaoWuXin's Preset (Vivid and clear) 18 +// Cobalt's Preset (Saturated & Bright) 19 + +// ########################################################## + +// THE WAY I'M TOGGLING THIS IS ***BAD*** + +#define disableClarity $disableClarity + +#if (disableClarity == 0) + +#if (Preset == 0) + +// User Defined, values to change are below. End before main presets. + +// ########################################################## + +#define adjust_bloom 1 // 0: disable, 1: enable. + +// BloomFactor +constant float bloomFactor = 1.00; // Default is 1.00 + +#define HDRpassing 0 // 0: disable, 1: enable. + +// Fake High Dynamic Range. +constant float HDRPower = 1.00; // 0.0 to 8.0 Default 1.30. +constant float radius1 = 1.00; // 0.0 to 8.0 Default 0.793 +constant float radius2 = + 0.80; // 0.0 to 8.0 Default 0.87 "Raising this seems to make the effect + // stronger and also brighter." + +#define lumapassing 0 // 0: disable, 1: enable. + +// LumaShapening +constant float sharp_strength = + 0.35; //[0.10 to 3.00] Strength of the sharpening Default is 0.65 +constant float sharp_clamp = + 0.85; //[0.000 to 1.000] Limits maximum amount of sharpening a pixel + // recieves - Default is 0.035 + +// Advanced sharpening settings +constant float offset_bias = + 1.0; //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern. + +#define Tone_map 0 + +// 0: disable, -1 to 9: enable. +// -1: disable, loss of bright detail/color but keep [0,1] intact +// 0: (Wii U) BotW original +// Reshade ToneMap Option 1 +// linearToneMapping Option 2 +// simpleReinhardToneMapping Option 3 +// lumaBasedReinhardToneMapping Option 4 +// whitePreservingLumaBasedReinhardToneMapping Option 5 +// RomBinDaHouseToneMapping Option 6 +// filmicToneMapping Option 7 +// Uncharted2ToneMapping Option 8 +// ACES Filmic Option 9 +// Reshade ToneMap Controls / "Contrasty" Parameters + +constant float Exposure = 1.17; // [0.0, 1.0+] Adjust exposure +constant float Bleach = 0.4; // "More bleach means more contrasted and less + // colorful image" min -0.5 max 1.0 Default 0.0 +constant float Gamma = + 1.00; // "Adjust midtones. 1.000 is neutral. This setting does exactly the + // same as the one in Lift Gamma Gain, only with less control." +constant float defog = 0.00; // Default is 0.0 //How much of the overall color + // you want removed form the values of FogColor. +constant float3 FogColor = + float3(1.0, 1.0, + 1.0); // Color you want to Add or Remove 0.25 would add .25 percent + // of that color 1.25 would remove .25 percent of the color." +constant float sat = 0.000; // "Adjust saturation" min -1.0 max 1.0 Default 0.0 +constant float crushContrast = + 0.000; // 0.0 is neutral. Use small increments, loss of shadow detail + +#define post_process 0 + +//----------------"BotW original" vibrance adjust-------------// +constant float satFactor = + 0.18; // 0.18 is default. Experimental, adjust native saturation +//------------------------------------------------------------// + +#define blacknwhitepass 0 // 0: disable, 1: enable. +// Levels Control +constant int BlackPoint = + 16; // [0, 255] The black point is the new black - literally. Everything + // darker than this will become completely black +constant int WhitePoint = 235; // [0, 255] The new white point. Everything + // brighter than this becomes completely white + +#define lggpass 0 // 0: disable, 1: enable. +// Lift Gamma Gain +constant float3 RGB_Lift = + float3(1.000, 1.000, + 1.000); // [0.000 to 2.000] Adjust shadows for Red, Green and Blue. +constant float3 RGB_Gamma = + float3(1.000, 1.000, + 1.000); // [0.000 to 2.000] Adjust midtones for Red, Green and Blue +constant float3 RGB_Gain = float3( + 1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust highlights for Red, Green + // and Blue Note that a value of 1.0 is a neutral + // setting that leave the color unchanged. + +#define vibpass 0 // 0: disable, 1: enable. +// VibrancePass +constant float Vibrance = + 0.150; // Default [0.150] "Intelligently saturates (or desaturates if you + // use negative values) the pixels depending on their original + // saturation." +constant float3 VibranceRGBBalance = float3( + 1.0, 1.0, 1.0); // "A per channel multiplier to the Vibrance strength so you + // can give more boost to certain colors over others."; + +#define Tech 0 // 0: disable, 1: enable. +// Technicolor +constant float Power = 4.0; // Min 0.0 Max 8.0 Default 4.0 +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; // Min 0.0 Max 1.0 Default 0.4 + +#define Techine 0 // 0: disable, 1: enable. +// Technicolor2 +constant float Technicolor2_Red_Strength = + 0.02; // "Higher means darker and more intense colors." Default 0.2 +constant float Technicolor2_Green_Strength = + 0.02; // "Higher means darker and more intense colors." Default 0.2 +constant float Technicolor2_Blue_Strength = + 0.02; // "Higher means darker and more intense colors." Default 0.2 +constant float Technicolor2_Brightness = + 1.00; // "Higher means brighter image." min 0.5 max 1.5 Default 1.0 +constant float Technicolor2_Strength = 1.00; // [Default is 1.0] +constant float Technicolor2_Saturation = + 1.00; // Default is 1.0 min 0.0 max 1.5 "Additional saturation control since + // this effect tends to oversaturate the image." + +#define cmatrix 0 +// Color Matrix +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; + +// Curves Contrast +#define CurvesPss 0 // 0: disable, 1: enable. +constant float Contrast = + 0.65; // Default 0.65 min -1.0 max = 1.0 "The amount of contrast you want." + +#define Filmicpass 0 // 0: disable, 1: enable. +// Filmic Pass +constant float Filmic_Contrast = 1.0; // Default 1.0 min 0.5 max 2.0 +constant float Filmic_Bleach = + 0.0; // "More bleach means more contrasted and less colorful image" min -0.5 + // max 1.0 Default 0.0 +constant float Saturation = -0.15; // min -1.0 max 1.0 Default -0.15 + +constant float Filmic_Strength = + 0.85; // "Strength of the color curve altering"; min 0.0 max 1.5 Default + // 0.85 +constant float Fade = 0.4; // "Decreases contrast to imitate faded image" min + // 0.0 max 0.6 Default 0.4 +constant float Linearization = 0.5; // min 0.5 max 2.0 Default 0.5 + +constant float BaseCurve = 1.5; // min 0.0 max 2.0 Default 1.5 +constant float BaseGamma = 1.00; // min 0.7 max 2.0 Default 1.0 +constant float EffectGamma = 0.68; // min 0.0 max 2.0 Default 0.68 + +#define dpxpass 0 +// DPX +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); + +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; + +constant float DPX_Strength = 0.20; + +// ########################################################### + +// Do not edit under this line, unless explicitly desired. Keep backups! + +// ########################################################### + +// Presets + +#elif (Preset == 1) // Bruz + +#define adjust_bloom 1 +constant float bloomFactor = 0.30; +#define HDRpassing 0 +constant float HDRPower = 1.3; +constant float radius1 = 0.795; +constant float radius2 = 0.85; +#define lumapassing 0 +constant float sharp_strength = 0.45; +constant float sharp_clamp = 0.085; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 0.9; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 1 +constant float satFactor = 0.25; +#define blacknwhitepass 1 +constant int BlackPoint = 0; +constant int WhitePoint = 255; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 0 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 1 +constant float Power = 8.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.3; +#define Techine 1 +constant float Technicolor2_Red_Strength = 0.05; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.12; +constant float Technicolor2_Brightness = 0.4; +constant float Technicolor2_Strength = 3.0; +constant float Technicolor2_Saturation = 1.0; +#define cmatrix 7 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.65; +#define Filmicpass 1 +constant float Filmic_Strength = 0.60; +constant float Filmic_Contrast = 1.03; +constant float Fade = 0.0; +constant float Linearization = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.25; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.0; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 2) // t3nka Neutral+ + +#define adjust_bloom 1 +constant float bloomFactor = 0.30; +#define HDRpassing 1 +constant float HDRPower = 1.50; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 0 +constant float sharp_strength = 0.35; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 1.00; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 1 +constant float satFactor = 0.25; +#define blacknwhitepass 0 +constant int BlackPoint = 16; +constant int WhitePoint = 235; +#define lggpass 0 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 0 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.02; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.02; +constant float Technicolor2_Brightness = 1.00; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.65; +#define Filmicpass 0 +constant float Filmic_Strength = 0.85; +constant float Filmic_Contrast = 1.00; +constant float Fade = 0.4; +constant float Linearization = 0.5; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.0; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 3) // Jamie + +#define adjust_bloom 1 +constant float bloomFactor = 0.020; +#define HDRpassing 1 +constant float HDRPower = 1.00; +constant float radius1 = 1.00; +constant float radius2 = 0.80; +#define lumapassing 1 +constant float sharp_strength = 0.35; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 1.00; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 1 +constant float satFactor = 0.25; +#define blacknwhitepass 0 +constant int BlackPoint = 16; +constant int WhitePoint = 235; +#define lggpass 1 +constant float3 RGB_Lift = float3(0.980, 0.980, 0.980); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 0 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.02; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.02; +constant float Technicolor2_Brightness = 1.00; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.65; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float Filmic_Strength = 0.85; +constant float Fade = 0.4; +constant float Linearization = 0.5; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.00; +constant float EffectGamma = 0.68; +#define dpxpass 1 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 0.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.20; + +#elif (Preset == 4) // Contrasty + +#define adjust_bloom 1 +constant float bloomFactor = 0.020; +#define HDRpassing 0 +constant float HDRPower = 1.00; +constant float radius1 = 1.00; +constant float radius2 = 0.80; +#define lumapassing 0 +constant float sharp_strength = 0.35; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 1 +constant float Exposure = 1.17; +constant float Bleach = 0.3; +constant float Gamma = 0.810; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 1 +constant float satFactor = 0.25; +#define blacknwhitepass 0 +constant int BlackPoint = 16; +constant int WhitePoint = 235; +#define lggpass 0 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 0 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.02; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.02; +constant float Technicolor2_Brightness = 1.00; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.65; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float Filmic_Strength = 0.85; +constant float Fade = 0.4; +constant float Linearization = 0.5; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.00; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 5) // The Complaining Gamer + +#define adjust_bloom 1 +constant float bloomFactor = 0.33; +#define HDRpassing 1 +constant float HDRPower = 1.020; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 1 +constant float sharp_strength = 0.25; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 1.00; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 0 +constant float satFactor = 0.25; +#define blacknwhitepass 0 +constant int BlackPoint = 16; +constant int WhitePoint = 235; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(0.600, 0.600, 0.600); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 1 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 1 +constant float Technicolor2_Red_Strength = 0.000; +constant float Technicolor2_Green_Strength = 0.000; +constant float Technicolor2_Blue_Strength = 0.000; +constant float Technicolor2_Brightness = 1.0; +constant float Technicolor2_Strength = 0.40; +constant float Technicolor2_Saturation = 0.51; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.65; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float Filmic_Strength = 0.85; +constant float Fade = 0.4; +constant float Linearization = 0.5; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.00; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 6) // Filmic + +#define adjust_bloom 1 +constant float bloomFactor = 0.020; +#define HDRpassing 1 +constant float HDRPower = 1.20; +constant float radius1 = 1.00; +constant float radius2 = 0.80; +#define lumapassing 1 +constant float sharp_strength = 0.35; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 1.00; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 1 +constant float satFactor = 0.25; +#define blacknwhitepass 0 +constant int BlackPoint = 16; +constant int WhitePoint = 235; +#define lggpass 0 +constant float3 RGB_Lift = float3(0.990, 0.990, 0.990); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 1 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.02; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.02; +constant float Technicolor2_Brightness = 1.00; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.65; +#define Filmicpass 1 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float Filmic_Strength = 0.85; +constant float Fade = 0.4; +constant float Linearization = 0.5; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.00; +constant float EffectGamma = 0.68; +#define dpxpass 1 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 2.0; +constant float Colorfulness = 1.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 7) // CellHunter + +#define adjust_bloom 1 +constant float bloomFactor = 0.215; +#define HDRpassing 1 +constant float HDRPower = 1.200; +constant float radius1 = 1.050; +constant float radius2 = 1.000; +#define lumapassing 0 +constant float sharp_strength = 0.45; +constant float sharp_clamp = 0.65; +constant float offset_bias = 1.00; +#define Tone_map 0 +constant float Exposure = 1.00; +constant float Bleach = 0.0; +constant float Gamma = 1.00; +constant float defog = 0.003; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 0 +constant float satFactor = 0.05; +#define blacknwhitepass 0 +constant int BlackPoint = 16; +constant int WhitePoint = 215; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 0.965, 1.010); +constant float3 RGB_Gain = float3(1.000, 0.975, 1.010); +#define vibpass 1 +constant float Vibrance = 0.335; +constant float3 VibranceRGBBalance = float3(0.7, 0.9, 0.7); +#define Tech 0 +constant float Power = 1.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.05; +#define Techine 1 +constant float Technicolor2_Red_Strength = 0.10; +constant float Technicolor2_Green_Strength = 0.15; +constant float Technicolor2_Blue_Strength = 0.15; +constant float Technicolor2_Brightness = 0.10; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 0.80; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.115; +#define Filmicpass 1 +constant float Filmic_Contrast = 1.00; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float Filmic_Strength = 0.60; +constant float Fade = 0.05; +constant float Linearization = 0.7; +constant float BaseCurve = 0.7; +constant float BaseGamma = 1.00; +constant float EffectGamma = 1.75; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 8) // Serfrost (Bright Display) + +#define adjust_bloom 1 +constant float bloomFactor = 0.40; +#define HDRpassing 1 +constant float HDRPower = 1.20; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 0 +constant float sharp_strength = 0.45; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.0; +constant float Gamma = 0.98; +constant float defog = 1.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.00; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 1 +constant int BlackPoint = 2; +constant int WhitePoint = 300; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.027, 1.027, 1.027); +constant float3 RGB_Gamma = float3(0.83, 0.83, 0.83); +constant float3 RGB_Gain = float3(1.10, 1.10, 1.10); +#define vibpass 1 +constant float Vibrance = 0.15; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 5.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.10; +#define Techine 1 +constant float Technicolor2_Red_Strength = -0.09; +constant float Technicolor2_Green_Strength = -0.09; +constant float Technicolor2_Blue_Strength = -0.00; +constant float Technicolor2_Brightness = 0.4; +constant float Technicolor2_Strength = 1.2; +constant float Technicolor2_Saturation = 1.1; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.0; +#define Filmicpass 1 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.17; +constant float Filmic_Strength = 0.48; +constant float Fade = 0.08; +constant float Linearization = 1.0; +constant float BaseCurve = 1.0; +constant float BaseGamma = 1.0; +constant float EffectGamma = 1.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.20; + +#elif (Preset == 9) // Serfrost (Dim Display) + +#define adjust_bloom 1 +constant float bloomFactor = 0.7; +#define HDRpassing 1 +constant float HDRPower = 1.20; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 0 +constant float sharp_strength = 0.45; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.17; +constant float Bleach = 0.0; +constant float Gamma = 1.05; +constant float defog = 1.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 1 +constant int BlackPoint = 1; +constant int WhitePoint = 235; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.027, 1.027, 1.027); +constant float3 RGB_Gamma = float3(0.83, 0.83, 0.83); +constant float3 RGB_Gain = float3(1.10, 1.10, 1.10); +#define vibpass 1 +constant float Vibrance = 0.45; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 5.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.10; +#define Techine 1 +constant float Technicolor2_Red_Strength = -0.09; +constant float Technicolor2_Green_Strength = -0.09; +constant float Technicolor2_Blue_Strength = -0.00; +constant float Technicolor2_Brightness = 0.4; +constant float Technicolor2_Strength = 1.2; +constant float Technicolor2_Saturation = 1.15; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.0; +#define Filmicpass 1 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.17; +constant float Filmic_Strength = 0.48; +constant float Fade = 0.08; +constant float Linearization = 1.0; +constant float BaseCurve = 1.0; +constant float BaseGamma = 1.0; +constant float EffectGamma = 1.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.20; + +#elif (Preset == 10) // Serfrost (Other) + +#define adjust_bloom 1 +constant float bloomFactor = 0.3; +#define HDRpassing 1 +constant float HDRPower = 1.15; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 1 +constant float sharp_strength = 0.45; +constant float sharp_clamp = 0.085; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.10; +constant float Bleach = 0.1; +constant float Gamma = 1.0; +constant float defog = 0.0; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 1 +constant int BlackPoint = 5; +constant int WhitePoint = 210; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.027, 1.027, 1.027); +constant float3 RGB_Gamma = float3(0.83, 0.83, 0.83); +constant float3 RGB_Gain = float3(1.10, 1.10, 1.10); +#define vibpass 1 +constant float Vibrance = 0.45; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.3); +#define Tech 1 +constant float Power = 6.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.3; +#define Techine 1 +constant float Technicolor2_Red_Strength = -0.12; +constant float Technicolor2_Green_Strength = -0.25; +constant float Technicolor2_Blue_Strength = -0.15; +constant float Technicolor2_Brightness = 0.4; +constant float Technicolor2_Strength = 1.0; +constant float Technicolor2_Saturation = 0.90; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.5; +#define Filmicpass 1 +constant float Filmic_Contrast = 1.03; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.35; +constant float Filmic_Strength = 0.60; +constant float Fade = 0.1; +constant float Linearization = 1.0; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.0; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.20; + +#elif (Preset == 11) // ViskClarity + +#define adjust_bloom 1 +constant float bloomFactor = 4.050; +#define HDRpassing 1 +constant float HDRPower = 1.3; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 1 +constant float sharp_strength = 0.50; +constant float sharp_clamp = 0.085; +constant float offset_bias = 0.0; +#define Tone_map 8 +constant float Exposure = 0.6; +constant float Bleach = 0.2; +constant float Gamma = 1.00; +constant float defog = 0.004; +constant float3 FogColor = float3(1.0, 1.5, 1.7); +constant float sat = 0.050; +constant float crushContrast = 0.000; +#define post_process 0 +constant float satFactor = 0; +#define blacknwhitepass 1 +constant int BlackPoint = 2; +constant int WhitePoint = 285; +#define lggpass 1 +constant float3 RGB_Lift = float3(0.994, 0.994, 0.994); +constant float3 RGB_Gamma = float3(1.0, 0.990, 1.0); +constant float3 RGB_Gain = float3(1.0, 0.990, 1.00); +#define vibpass 1 +constant float Vibrance = 0.500; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 1 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 1 +constant float Technicolor2_Red_Strength = 0.000; +constant float Technicolor2_Green_Strength = 0.000; +constant float Technicolor2_Blue_Strength = 0.000; +constant float Technicolor2_Brightness = 0.0; +constant float Technicolor2_Strength = 0.40; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = -0.35; +#define Filmicpass 1 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = 0; +constant float Filmic_Strength = 0.85; +constant float Fade = 0.1; +constant float Linearization = 0.5; +constant float BaseCurve = 1.5; +constant float BaseGamma = 0.7; +constant float EffectGamma = 0.65; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 1.5; +constant float DPX_Saturation = 0.8; +constant float Colorfulness = 0.8; +constant float DPX_Strength = 0.50; + +#elif (Preset == 12) // Survival of the Wild (Warmer) + +#define adjust_bloom 1 +constant float bloomFactor = 0.75; +#define HDRpassing 1 +constant float HDRPower = 1.20; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 1 +constant float sharp_strength = 0.15; +constant float sharp_clamp = 0.35; +constant float offset_bias = 0.1; +#define Tone_map 0 +constant float Exposure = 1.17; +constant float Bleach = 0.0; +constant float Gamma = 0.97; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 0 +constant int BlackPoint = 0; +constant int WhitePoint = 245; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.0, 1.0, 1.0); +constant float3 RGB_Gamma = float3(0.95, 0.95, 0.95); +constant float3 RGB_Gain = float3(1.0, 1.0, 1.0); +#define vibpass 1 +constant float Vibrance = 3.0; +constant float3 VibranceRGBBalance = float3(0.102656, 0.050158, 0.102186); +#define Tech 0 +constant float Power = 5.0; +constant float3 RGBNegativeAmount = float3(0.98, 0.98, 0.98); +constant float Strength = 0.10; +#define Techine 0 +constant float Technicolor2_Red_Strength = -0.10; +constant float Technicolor2_Green_Strength = -0.09; +constant float Technicolor2_Blue_Strength = 0.05; +constant float Technicolor2_Brightness = 0.5; +constant float Technicolor2_Strength = 1.2; +constant float Technicolor2_Saturation = 1.1; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.25; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.17; +constant float Filmic_Strength = 0.48; +constant float Fade = 0.08; +constant float Linearization = 1.0; +constant float BaseCurve = 1.0; +constant float BaseGamma = 1.0; +constant float EffectGamma = 1.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.5; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.10; + +#elif (Preset == 13) // Survival of the Wild (Colder) + +#define adjust_bloom 1 +constant float bloomFactor = 0.75; +#define HDRpassing 0 +constant float HDRPower = 1.20; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 1 +constant float sharp_strength = 0.22; +constant float sharp_clamp = 0.35; +constant float offset_bias = 0.05; +#define Tone_map 0 +constant float Exposure = 1.17; +constant float Bleach = 0.0; +constant float Gamma = 0.97; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 0 +constant int BlackPoint = 0; +constant int WhitePoint = 245; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.0, 1.0, 1.0); +constant float3 RGB_Gamma = float3(0.93, 0.93, 0.93); +constant float3 RGB_Gain = float3(1.0, 1.0, 1.0); +#define vibpass 1 +constant float Vibrance = 2.0; +constant float3 VibranceRGBBalance = float3(0.142656, 0.000158, 0.172186); +#define Tech 0 +constant float Power = 5.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.10; +#define Techine 1 +constant float Technicolor2_Red_Strength = -0.10; +constant float Technicolor2_Green_Strength = -0.09; +constant float Technicolor2_Blue_Strength = 0.05; +constant float Technicolor2_Brightness = 0.30; +constant float Technicolor2_Strength = 1.2; +constant float Technicolor2_Saturation = 1.1; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.1; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.17; +constant float Filmic_Strength = 0.48; +constant float Fade = 0.08; +constant float Linearization = 1.0; +constant float BaseCurve = 1.0; +constant float BaseGamma = 1.0; +constant float EffectGamma = 1.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.5; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.10; + +#elif (Preset == 14) // Godot's Mexican Preset + +#define adjust_bloom 1 +constant float bloomFactor = 0.684; +#define HDRpassing 1 +constant float HDRPower = 0.80; +constant float radius1 = 0.80; +constant float radius2 = 1.10; +#define lumapassing 1 +constant float sharp_strength = 0.23; +constant float sharp_clamp = 0.035; +constant float offset_bias = 1.0; +#define Tone_map 4 +constant float Exposure = 0.69; +constant float Bleach = 0.6; +constant float Gamma = 1.00; +constant float defog = 0; +constant float3 FogColor = float3(0, 0, 0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 1 +constant float satFactor = 0.16; +#define blacknwhitepass 1 +constant int BlackPoint = 5; +constant int WhitePoint = 167; +#define lggpass 0 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 0 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.02; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.02; +constant float Technicolor2_Brightness = 1.00; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 // 0: disable, 1: enable. +constant float Contrast = 0.92; +#define Filmicpass 1 +constant float Filmic_Contrast = 0.8; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.50; +constant float Filmic_Strength = 0.3; +constant float Fade = 0.0; +constant float Linearization = 0.7; +constant float BaseCurve = 1.5; +constant float BaseGamma = 0.93; +constant float EffectGamma = 0.69; +#define dpxpass 1 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 0.6; +constant float Colorfulness = 0.8; +constant float DPX_Strength = 0.10; + +#elif (Preset == 15) // Hexaae's Clear Preset + +#define adjust_bloom 1 +constant float bloomFactor = 0.593; +#define HDRpassing 1 +constant float HDRPower = 1.56; +constant float radius1 = 0.86; +constant float radius2 = 0.84; +#define lumapassing 0 +constant float sharp_strength = 0.45; +constant float sharp_clamp = 0.085; +constant float offset_bias = 1.0; +#define Tone_map 0 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 0.9; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = -0.002; +constant float crushContrast = 0.000; +#define post_process 0 +constant float satFactor = -0.006; +#define blacknwhitepass 1 +constant int BlackPoint = 0; +constant int WhitePoint = 277; +#define lggpass 0 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 0 +constant float Vibrance = 0.150; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 8.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.3; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.05; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.12; +constant float Technicolor2_Brightness = 0.4; +constant float Technicolor2_Strength = 3.0; +constant float Technicolor2_Saturation = 1.0; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.65; +#define Filmicpass 0 +constant float Filmic_Strength = 0.60; +constant float Filmic_Contrast = 1.03; +constant float Fade = 0.0; +constant float Linearization = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.25; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.0; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#elif (Preset == 16) // MaranBr Preset (Little More Intense) + +#define adjust_bloom 1 +constant float bloomFactor = 0.4; +#define HDRpassing 1 +constant float HDRPower = 1.15; +constant float radius1 = 0.793; +constant float radius2 = 0.87; +#define lumapassing 0 +constant float sharp_strength = 0.65; +constant float sharp_clamp = 0.035; +constant float offset_bias = 1.0; +#define Tone_map 8 +constant float Exposure = 1.12; +constant float Bleach = 0.0; +constant float Gamma = 1.0; +constant float defog = 0.0; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.0; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 0 +constant int BlackPoint = 5; +constant int WhitePoint = 210; +#define lggpass 0 +constant float3 RGB_Lift = float3(1.027, 1.027, 1.027); +constant float3 RGB_Gamma = float3(0.83, 0.83, 0.83); +constant float3 RGB_Gain = float3(1.10, 1.10, 1.10); +#define vibpass 0 +constant float Vibrance = 0.40; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.3); +#define Tech 0 +constant float Power = 8.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.3; +#define Techine 1 +constant float Technicolor2_Red_Strength = 0.0; +constant float Technicolor2_Green_Strength = 0.0; +constant float Technicolor2_Blue_Strength = 0.0; +constant float Technicolor2_Brightness = 0.5; +constant float Technicolor2_Strength = 1.0; +constant float Technicolor2_Saturation = 1.0; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.32; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.03; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.35; +constant float Filmic_Strength = 0.60; +constant float Fade = 0.1; +constant float Linearization = 1.0; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.0; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.2; + +#elif (Preset == 17) // YeMaoWuXin's Preset (Bright colors) + +#define adjust_bloom 1 +constant float bloomFactor = 0.75; +#define HDRpassing 1 +constant float HDRPower = 1.30; +constant float radius1 = 0.80; +constant float radius2 = 0.80; +#define lumapassing 1 +constant float sharp_strength = 0.85; +constant float sharp_clamp = 0.35; +constant float offset_bias = 0.0; +#define Tone_map 0 +constant float Exposure = 1.0; +constant float Bleach = 0.0; +constant float Gamma = 1.0; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 0 +constant int BlackPoint = 0; +constant int WhitePoint = 245; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.0, 1.0, 1.0); +constant float3 RGB_Gamma = float3(0.95, 0.95, 0.95); +constant float3 RGB_Gain = float3(1.075, 1.075, 1.125); +#define vibpass 1 +constant float Vibrance = 3.0; +constant float3 VibranceRGBBalance = float3(0.102656, 0.050158, 0.102186); +#define Tech 0 +constant float Power = 5.0; +constant float3 RGBNegativeAmount = float3(0.98, 0.98, 0.98); +constant float Strength = 0.10; +#define Techine 0 +constant float Technicolor2_Red_Strength = -0.10; +constant float Technicolor2_Green_Strength = -0.09; +constant float Technicolor2_Blue_Strength = 0.05; +constant float Technicolor2_Brightness = 0.5; +constant float Technicolor2_Strength = 1.2; +constant float Technicolor2_Saturation = 1.1; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.25; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.17; +constant float Filmic_Strength = 0.48; +constant float Fade = 0.08; +constant float Linearization = 1.0; +constant float BaseCurve = 1.0; +constant float BaseGamma = 1.0; +constant float EffectGamma = 1.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.5; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.10; + +#elif (Preset == 18) // YeMaoWuXin's Preset (Vivid and clear) + +#define adjust_bloom 1 +constant float bloomFactor = 0.75; +#define HDRpassing 1 +constant float HDRPower = 1.30; +constant float radius1 = 0.80; +constant float radius2 = 0.80; +#define lumapassing 1 +constant float sharp_strength = 0.85; +constant float sharp_clamp = 0.35; +constant float offset_bias = 0.0; +#define Tone_map 0 +constant float Exposure = 1.0; +constant float Bleach = 0.0; +constant float Gamma = 1.0; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.0; +constant float crushContrast = 0.00; +#define post_process 0 +constant float satFactor = 0.07; +#define blacknwhitepass 0 +constant int BlackPoint = 0; +constant int WhitePoint = 245; +#define lggpass 1 +constant float3 RGB_Lift = float3(1.0, 1.0, 1.0); +constant float3 RGB_Gamma = float3(0.97, 0.96, 0.98); +constant float3 RGB_Gain = float3(1.050, 1.000, 1.050); +#define vibpass 1 +constant float Vibrance = 2.5; +constant float3 VibranceRGBBalance = float3(0.082656, 0.055158, 0.102186); +#define Tech 0 +constant float Power = 5.0; +constant float3 RGBNegativeAmount = float3(0.98, 0.98, 0.98); +constant float Strength = 0.10; +#define Techine 0 +constant float Technicolor2_Red_Strength = -0.10; +constant float Technicolor2_Green_Strength = -0.09; +constant float Technicolor2_Blue_Strength = 0.05; +constant float Technicolor2_Brightness = 0.5; +constant float Technicolor2_Strength = 1.2; +constant float Technicolor2_Saturation = 1.1; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 0 +constant float Contrast = 0.25; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.17; +constant float Filmic_Strength = 0.48; +constant float Fade = 0.08; +constant float Linearization = 1.0; +constant float BaseCurve = 1.0; +constant float BaseGamma = 1.0; +constant float EffectGamma = 1.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.5; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 1.0; +constant float DPX_Strength = 0.10; + +#elif (Preset == 19) // Cobalt's preset (Saturated & Bright) + +#define adjust_bloom 1 +constant float bloomFactor = 1.00; +#define HDRpassing 0 +constant float HDRPower = 1.00; +constant float radius1 = 1.00; +constant float radius2 = 0.80; +#define lumapassing 0 +constant float sharp_strength = 0.35; +constant float sharp_clamp = 0.85; +constant float offset_bias = 1.0; +#define Tone_map 0 +constant float Exposure = 1.17; +constant float Bleach = 0.4; +constant float Gamma = 1.00; +constant float defog = 0.00; +constant float3 FogColor = float3(1.0, 1.0, 1.0); +constant float sat = 0.000; +constant float crushContrast = 0.000; +#define post_process 0 +constant float satFactor = 0.17; +#define blacknwhitepass 0 +constant int BlackPoint = 1; +constant int WhitePoint = 235; +#define lggpass 0 +constant float3 RGB_Lift = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gamma = float3(1.000, 1.000, 1.000); +constant float3 RGB_Gain = float3(1.000, 1.000, 1.000); +#define vibpass 1 +constant float Vibrance = 0; +constant float3 VibranceRGBBalance = float3(1.0, 1.0, 1.0); +#define Tech 0 +constant float Power = 4.0; +constant float3 RGBNegativeAmount = float3(0.88, 0.88, 0.88); +constant float Strength = 0.20; +#define Techine 0 +constant float Technicolor2_Red_Strength = 0.02; +constant float Technicolor2_Green_Strength = 0.02; +constant float Technicolor2_Blue_Strength = 0.02; +constant float Technicolor2_Brightness = 1.00; +constant float Technicolor2_Strength = 1.00; +constant float Technicolor2_Saturation = 1.00; +#define cmatrix 0 +constant float3 ColorMatrix_Red = float3(0.817, 0.183, 0.000); +constant float3 ColorMatrix_Green = float3(0.333, 0.667, 0.000); +constant float3 ColorMatrix_Blue = float3(0.000, 0.125, 0.875); +constant float CM_Strength = 1.0; +#define CurvesPss 1 +constant float Contrast = 0.74; +#define Filmicpass 0 +constant float Filmic_Contrast = 1.0; +constant float Filmic_Bleach = 0.0; +constant float Saturation = -0.15; +constant float Filmic_Strength = 0.85; +constant float Fade = 0.4; +constant float Linearization = 0.5; +constant float BaseCurve = 1.5; +constant float BaseGamma = 1.00; +constant float EffectGamma = 0.68; +#define dpxpass 0 +constant float3 RGB_Curve = float3(8.0, 8.0, 8.0); +constant float3 RGB_C = float3(0.36, 0.36, 0.34); +constant float DPX_Contrast = 0.1; +constant float DPX_Saturation = 3.0; +constant float Colorfulness = 2.5; +constant float DPX_Strength = 0.20; + +#endif + +// ########################################################### + +// Never touch anything below this line unless you plan to break and fix things. + +// ########################################################### + +// ToneMapping + +float3 linearToneMapping(float3 color) { + float exposure = 1.; + color = clamp(exposure * color, 0., 1.); + color = pow(color, float3(1. / Gamma)); + return color; +} + +float3 simpleReinhardToneMapping(float3 color) { + float exposure = 1.5; + color *= exposure / (1. + color / exposure); + color = pow(color, float3(1. / Gamma)); + return color; +} + +float3 lumaBasedReinhardToneMapping(float3 color) { + float luma = dot(color, float3(0.2126, 0.7152, 0.0722)); + float toneMappedLuma = luma / (1. + luma); + color *= toneMappedLuma / luma; + color = pow(color, float3(1. / Gamma)); + return color; +} + +float3 whitePreservingLumaBasedReinhardToneMapping(float3 color) { + float white = 2.; + float luma = dot(color, float3(0.2126, 0.7152, 0.0722)); + float toneMappedLuma = luma * (1. + luma / (white * white)) / (1. + luma); + color *= toneMappedLuma / luma; + color = pow(color, float3(1. / Gamma)); + return color; +} + +float3 RomBinDaHouseToneMapping(float3 color) { + color = exp(-1.0 / (2.72 * color + 0.15)); + color = pow(color, float3(1. / Gamma)); + return color; +} + +float3 filmicToneMapping(float3 color) { + color = max(float3(0.), color - float3(0.004)); + color = (color * (6.2 * color + .5)) / (color * (6.2 * color + 1.7) + 0.06); + return color; +} + +float3 Uncharted2ToneMapping(float3 color) { + float A = 0.15; + float B = 0.50; + float C = 0.10; + float D = 0.20; + float E = 0.02; + float F = 0.30; + float W = 11.2; + float exposure = 2.; + color *= exposure; + color = ((color * (A * color + C * B) + D * E) / + (color * (A * color + B) + D * F)) - + E / F; + float white = + ((W * (A * W + C * B) + D * E) / (W * (A * W + B) + D * F)) - E / F; + color /= white; + color = pow(color, float3(1. / Gamma)); + return color; +} + +float3 ReshadeToneMap(float3 inputColor) { + float3 color = inputColor; + color = clamp(color - defog * FogColor * 2.55, 0.0, 1.0); // defog + color *= Exposure / (1.0 + color / Exposure); // pow(2.0, Exposure); + color = pow(color, float3(1. / Gamma)); // Gamma + + float3 coefLuma = float3(0.2126, 0.7152, 0.0722); + float lum = dot(coefLuma, color); + + float L = clamp(10.0 * (lum - 0.45), 0.0, 1.0); + float3 A2 = Bleach * color; + + float3 result1 = 2.0f * color * lum; + float3 result2 = 1.0f - 2.0f * (1.0f - lum) * (1.0f - color); + + float3 newColor = mix(result1, result2, L); + float3 mixRGB = A2 * newColor; + color += ((1.0f - A2) * mixRGB); + + float3 middlegray = float3(dot(color, float3(1.0 / 3.0))); + float3 diffcolor = color - middlegray; + + color = (color + diffcolor * sat) / (1 + (diffcolor * sat)); // saturation + + return color; +} + +float getL601(float3 rgb) { return dot(rgb, float3(0.2989, 0.5866, 0.1145)); } + +float getL709(float3 rgb) { return dot(rgb, float3(0.2126, 0.7152, 0.0722)); } + +float3 BotWToneMap(float3 color) { + float Lumn = getL601(color); + float4 exptm = 1.0 - exp(-float4(color, Lumn)); + float3 cpre = exptm.w / Lumn * color; + float3 colorldr = mix(cpre, exptm.rgb, float3(pow(exptm.w, 2.0))); // refine + return colorldr; +} +float3 ACESFilm(float3 color) { + color *= Exposure; + float Lumn = getL709(color); + float4 tm = float4(color, Lumn); + tm = (tm * (2.51 * tm + 0.03)) / (tm * (2.43 * tm + 0.59) + 0.14); // tonemap + float3 cpre = tm.w / Lumn * color; + float3 colorldr = mix(cpre, tm.rgb, float3(pow(tm.w, 2.0))); // refine + return colorldr; +} + +// Curves + +float3 CurvesPass(float3 inputColor) { + float3 colorInput = inputColor; + float Contrast_blend = Contrast * 1.5; + float3 x = colorInput.rgb; + x = x - 0.5; + x = (x / (0.5 + abs(x))) + 0.5; + float3 color = x; + colorInput.rgb = mix(colorInput.rgb, color, Contrast_blend); + return colorInput; +} + +// TECHNICOLOR2 + +float3 Technicolor2(float3 inputColor) { + float3 color = inputColor; + float3 Color_Strength = + float3(Technicolor2_Red_Strength, Technicolor2_Green_Strength, + Technicolor2_Blue_Strength); + float3 source = color; + float3 temp = 1.0 - source; + float3 target = temp.grg; + float3 target2 = temp.bbr; + float3 temp2 = source * target; + temp2 *= target2; + + temp = temp2 * Color_Strength; + temp2 *= Technicolor2_Brightness; + + target = temp.grg; + target2 = temp.bbr; + + temp = source - target; + temp += temp2; + temp2 = temp - target2; + + color = mix(source, temp2, Technicolor2_Strength); + + color = + mix(float3(dot(color, float3(0.333))), color, Technicolor2_Saturation); + + return color; +} + +// Technicolor +float3 TechnicolorPass(float3 color) { + float3 cyanfilter = float3(0.0, 1.30, 1.0); + float3 magentafilter = float3(1.0, 0.0, 1.05); + float3 yellowfilter = float3(1.6, 1.6, 0.05); + float2 redorangefilter = float2(1.05, 0.620); // RG_ + float2 greenfilter = float2(0.30, 1.0); // RG_ + float2 magentafilter2 = magentafilter.rb; // R_B + + float3 tcol = color.rgb; + + float2 negative_mul_r = tcol.rg * (1.0 / (RGBNegativeAmount.r * Power)); + float2 negative_mul_g = tcol.rg * (1.0 / (RGBNegativeAmount.g * Power)); + float2 negative_mul_b = tcol.rb * (1.0 / (RGBNegativeAmount.b * Power)); + float3 output_r = float3(dot(redorangefilter, negative_mul_r)) + cyanfilter; + float3 output_g = float3(dot(greenfilter, negative_mul_g)) + magentafilter; + float3 output_b = float3(dot(magentafilter2, negative_mul_b)) + yellowfilter; + + return mix(tcol, output_r * output_g * output_b, Strength); +} + +// ColorMatrix +float3 ColorMatrixPass(float3 inputColor) { + float3 color = inputColor; + + float3x3 ColorMatrix = + float3x3(ColorMatrix_Red, ColorMatrix_Green, ColorMatrix_Blue); + // color = mix(color, * (ColorMatrix, color), CM_Strength); + color *= mix(color, (ColorMatrix, color), CM_Strength); + return clamp(color, 0.0, 1.); +} + +// Contrasty + +float3 BotWVibrance(float3 color) { + float avg = (color.r + color.g + color.b) / 3.0; + float maxc = max(color.r, max(color.g, color.b)); + float w = 1.0 - pow(1.0 - 2.0 * avg, 2.0); + float weight = 1.0 + w * satFactor; + float3 satcolor = mix(float3(maxc), color, weight); + return satcolor; +} + +float3 ReshadeVibrance(float3 color) { + float max_color = + max(color.r, max(color.g, color.b)); // Find the strongest color + float min_color = + min(color.r, min(color.g, color.b)); // Find the weakest color + float luma = getL709(color); + float color_saturation = + max_color - min_color; // The difference between the two is the saturation + float3 coeffVibrance = VibranceRGBBalance * Vibrance; + color = mix( + float3(luma), color, + 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); + return color; +} + +float3 Contrasty(float3 fColour) { + fColour = max(float3(0.0), fColour - float3(crushContrast)); + fColour = clamp(Exposure * fColour, 0.0, 1.0); + fColour = pow(fColour, float3(1.0 / Gamma)); + fColour = ReshadeVibrance(fColour); // reshade's identical, only a little + // stronger when at same setting + return fColour; +} + +// Levels + +float3 LevelsPass(float3 inputColor) { + float black_point_float = BlackPoint / 255.0; + float white_point_float = + WhitePoint == BlackPoint + ? (255.0 / 0.00025) + : (255.0 / + (WhitePoint - BlackPoint)); // Avoid division by zero if the white + // and black point are the same + + float3 color = inputColor; + color = color * white_point_float - (black_point_float * white_point_float); + + return color; +} + +// FilmPass + +float3 FilmPass(float3 inputColor) { + float3 B = inputColor.rgb; + float3 G = B; + float3 H = float3(0.0); + + B = clamp(B, 0.0, 1.); + B = pow(float3(B), float3(Linearization)); + B = mix(H, B, Filmic_Contrast); + + float3 LumCoeff = float3(0.2126, 0.7152, 0.0722); + float A = dot(B.rgb, LumCoeff); + float3 D = float3(A); + + B = pow(B, 1.0 / float3(BaseGamma)); + + float RedCurve = 1.0; + float GreenCurve = 1.0; + float BlueCurve = 1.0; + float a = RedCurve; + float b = GreenCurve; + float c = BlueCurve; + float d = BaseCurve; + + float y = 1.0 / (1.0 + exp(a / 2.0)); + float z = 1.0 / (1.0 + exp(b / 2.0)); + float w = 1.0 / (1.0 + exp(c / 2.0)); + float v = 1.0 / (1.0 + exp(d / 2.0)); + + float3 C = B; + + D.r = (1.0 / (1.0 + exp(-a * (D.r - 0.5))) - y) / (1.0 - 2.0 * y); + D.g = (1.0 / (1.0 + exp(-b * (D.g - 0.5))) - z) / (1.0 - 2.0 * z); + D.b = (1.0 / (1.0 + exp(-c * (D.b - 0.5))) - w) / (1.0 - 2.0 * w); + + D = pow(D, 1.0 / float3(EffectGamma)); + + float3 Di = 1.0 - D; + + D = mix(D, Di, Filmic_Bleach); + float EffectGammaR = 1.0; + float EffectGammaG = 1.0; + float EffectGammaB = 1.0; + D.r = pow(abs(D.r), 1.0 / EffectGammaR); + D.g = pow(abs(D.g), 1.0 / EffectGammaG); + D.b = pow(abs(D.b), 1.0 / EffectGammaB); + + if (D.r < 0.5) + C.r = (2.0 * D.r - 1.0) * (B.r - B.r * B.r) + B.r; + else + C.r = (2.0 * D.r - 1.0) * (sqrt(B.r) - B.r) + B.r; + + if (D.g < 0.5) + C.g = (2.0 * D.g - 1.0) * (B.g - B.g * B.g) + B.g; + else + C.g = (2.0 * D.g - 1.0) * (sqrt(B.g) - B.g) + B.g; + + if (D.b < 0.5) + C.b = (2.0 * D.b - 1.0) * (B.b - B.b * B.b) + B.b; + else + C.b = (2.0 * D.b - 1.0) * (sqrt(B.b) - B.b) + B.b; + + float3 F = mix(B, C, Filmic_Strength); + + F = (1.0 / (1.0 + exp(-d * (F - 0.5))) - v) / (1.0 - 2.0 * v); + + float r2R = 1.0 - Saturation; + float g2R = 0.0 + Saturation; + float b2R = 0.0 + Saturation; + + float r2G = 0.0 + Saturation; + float g2G = (1.0 - Fade) - Saturation; + float b2G = (0.0 + Fade) + Saturation; + + float r2B = 0.0 + Saturation; + float g2B = (0.0 + Fade) + Saturation; + float b2B = (1.0 - Fade) - Saturation; + + float3 iF = F; + + F.r = (iF.r * r2R + iF.g * g2R + iF.b * b2R); + F.g = (iF.r * r2G + iF.g * g2G + iF.b * b2G); + F.b = (iF.r * r2B + iF.g * g2B + iF.b * b2B); + + float N = dot(F.rgb, LumCoeff); + float3 Cn = F; + + if (N < 0.5) + Cn = (2.0 * N - 1.0) * (F - F * F) + F; + else + Cn = (2.0 * N - 1.0) * (sqrt(F) - F) + F; + + Cn = pow(max(Cn, 0), 1.0 / float3(Linearization)); + + float3 Fn = mix(B, Cn, Filmic_Strength); + return Fn; +} + +// DPX +constant float3x3 RGB = + float3x3(2.6714711726599600, -1.2672360578624100, -0.4109956021722270, + -1.0251070293466400, 1.9840911624108900, 0.0439502493584124, + 0.0610009456429445, -0.2236707508128630, 1.1590210416706100); +constant float3x3 XYZ = + float3x3(0.5003033835433160, 0.3380975732227390, 0.1645897795458570, + 0.2579688942747580, 0.6761952591447060, 0.0658358459823868, + 0.0234517888692628, 0.1126992737203000, 0.8668396731242010); +float3 DPXPass(float3 inputColor) { + float3 color = inputColor; + + float3 B = color; + B = B * (1.0 - DPX_Contrast) + (0.5 * DPX_Contrast); + float3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0))); + B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) + + (-Btemp / (-2.0 * Btemp + 1.0)); + + float value = max(max(B.r, B.g), B.b); + float3 Ztemp = B / value; + color = pow(abs(color), 1. / float3(Colorfulness)); + + float3 c0 = Ztemp * value; + c0 *= (XYZ, c0); + float luma = dot(c0, float3(0.30, 0.59, 0.11)); + c0 = (1.0 - DPX_Saturation) * luma + DPX_Saturation * c0; + c0 *= (RGB, c0); + + return mix(color, c0, DPX_Strength); +} + +// Lift Gamma Gain + +float3 LiftGammaGainPass(float3 colorInput) { + // -- Get input -- + float3 color = colorInput; + + // -- Lift -- + + color = color * (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; + color = clamp(color, 0.0, + 1.0); // isn't strictly necessary, but doesn't cost performance. + + // -- Gain -- + color *= RGB_Gain; + + // -- Gamma -- + color = pow(color, 1.0 / RGB_Gamma); // Gamma + + // -- Return output -- + return clamp(color, 0.0, 1.0); +} + +// VibrancePass +float3 VibrancePass(float3 color) { + + float3 coefLuma = float3(0.2126, 0.7152, 0.0722); + float luma = dot(coefLuma, color); + + float max_color = + max(color.r, max(color.g, color.b)); // Find the strongest color + float min_color = + min(color.r, min(color.g, color.b)); // Find the weakest color + + float color_saturation = + max_color - min_color; // The difference between the two is the saturation + + // Extrapolate between luma and original by 1 + (1-saturation) - current + float3 coeffVibrance = VibranceRGBBalance * Vibrance; + + color = mix( + float3(luma), color, + 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); + + return color; +} + +// LumaShapening + +#define px (1.0 / 1280.0 * supportBuffer.fragCoordScale.x) +#define py (1.0 / 720.0 * supportBuffer.fragCoordScale.y) +#define CoefLuma float3(0.2126, 0.7152, 0.0722) + +float lumasharping(constant SupportBuffer &supportBuffer, texture2d tex, + sampler samplr, float2 pos) { + float4 colorInput = tex.sample(samplr, pos); + + float3 ori = colorInput.rgb; + + // -- Combining the strength and luma multipliers -- + float3 sharp_strength_luma = (CoefLuma * sharp_strength); + + // -- Gaussian filter -- + // [ .25, .50, .25] [ 1 , 2 , 1 ] + // [ .50, 1, .50] = [ 2 , 4 , 2 ] + // [ .25, .50, .25] [ 1 , 2 , 1 ] + + float3 blur_ori = + tex.sample(samplr, pos + float2(px, -py) * 0.5 * offset_bias) + .rgb; // South East + blur_ori += tex.sample(samplr, pos + float2(-px, -py) * 0.5 * offset_bias) + .rgb; // South West + blur_ori += tex.sample(samplr, pos + float2(px, py) * 0.5 * offset_bias) + .rgb; // North East + blur_ori += tex.sample(samplr, pos + float2(-px, py) * 0.5 * offset_bias) + .rgb; // North West + + blur_ori *= 0.25; // ( /= 4) Divide by the number of texture fetches + + // -- Calculate the sharpening -- + float3 sharp = + ori - blur_ori; // Subtracting the blurred image from the original image + + // -- Adjust strength of the sharpening and clamp it-- + float4 sharp_strength_luma_clamp = + float4(sharp_strength_luma * (0.5 / sharp_clamp), + 0.5); // Roll part of the clamp into the dot + + float sharp_luma = + clamp((dot(float4(sharp, 1.0), sharp_strength_luma_clamp)), 0.0, + 1.0); // Calculate the luma, adjust the strength, scale up and clamp + sharp_luma = (sharp_clamp * 2.0) * sharp_luma - sharp_clamp; // scale down + + return sharp_luma; +} + +// Fake High Dynamic Range + +float3 HDRPass(constant SupportBuffer &supportBuffer, texture2d tex, + sampler samplr, float2 pos) { + float3 color = tex.sample(samplr, pos).rgb; + + float3 bloom_sum1 = + tex.sample(samplr, pos + float2(1.5, -1.5) * radius1 * float2(px, py)) + .rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(-1.5, -1.5) * radius1 * float2(px, py)) + .rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(1.5, 1.5) * radius1 * float2(px, py)).rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(-1.5, 1.5) * radius1 * float2(px, py)) + .rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(0.0, -2.5) * radius1 * float2(px, py)) + .rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(0.0, 2.5) * radius1 * float2(px, py)).rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(-2.5, 0.0) * radius1 * float2(px, py)) + .rgb; + bloom_sum1 += + tex.sample(samplr, pos + float2(2.5, 0.0) * radius1 * float2(px, py)).rgb; + + bloom_sum1 *= 0.005; + + float3 bloom_sum2 = + tex.sample(samplr, pos + float2(1.5, -1.5) * radius2 * float2(px, py)) + .rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(-1.5, -1.5) * radius2 * float2(px, py)) + .rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(1.5, 1.5) * radius2 * float2(px, py)).rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(-1.5, 1.5) * radius2 * float2(px, py)) + .rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(0.0, -2.5) * radius2 * float2(px, py)) + .rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(0.0, 2.5) * radius2 * float2(px, py)).rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(-2.5, 0.0) * radius2 * float2(px, py)) + .rgb; + bloom_sum2 += + tex.sample(samplr, pos + float2(2.5, 0.0) * radius2 * float2(px, py)).rgb; + + bloom_sum2 *= 0.010; + + float dist = radius2 - radius1; + float3 HDR = (color + (bloom_sum2 - bloom_sum1)) * dist; + + float3 blend = HDR + color; + color = pow(abs(blend), float3(abs(HDRPower))) + HDR; + + return color; +} + +fragment FragmentOut main0(FragmentIn in [[stage_in]], + float2 pointCoord [[point_coord]], + bool frontFacing [[front_facing]], + constant SupportBuffer &supportBuffer [[buffer(0)]], + texture2d tex0 [[texture(0)]], + sampler samplr0 [[sampler(0)]], + texture2d tex1 [[texture(1)]], + sampler samplr1 [[sampler(1)]]) { + // Bloom + float3 bloom = tex0.sample(samplr0, in.passParameterSem0.xy, level(1.0)).xyz; +#if (adjust_bloom == 1) + bloom *= bloomFactor; +#endif + + float3 color = float3(0.0); + + // HDR and LumaShapening +#if (HDRpassing == 1) + color = HDRPass(supportBuffer, tex1, samplr1, in.passParameterSem0.xy).xyz; +#endif +#if (HDRpassing == 0) + color = tex1.sample(samplr1, in.passParameterSem0.xy).xyz; +#endif +#if (lumapassing == 1) + float smask = + lumasharping(supportBuffer, tex1, samplr1, in.passParameterSem0.xy); + color += float3(smask); +#endif + + // Do not edit this + color += bloom; + //++++++++++++++++++++++++++++++++++ + + // Tonemapping +#if (Tone_map == -1) + color = clamp(color * Exposure, 0.0, 1.0); +#elif (Tone_map == 0) + color = BotWToneMap(color); +#elif (Tone_map == 1) + color = ReshadeToneMap(color); +#elif (Tone_map == 2) + color = linearToneMapping(color); +#elif (Tone_map == 3) + color = simpleReinhardToneMapping(color); +#elif (Tone_map == 4) + color = lumaBasedReinhardToneMapping(color); +#elif (Tone_map == 5) + color = whitePreservingLumaBasedReinhardToneMapping(color); +#elif (Tone_map == 6) + color = RomBinDaHouseToneMapping(color); +#elif (Tone_map == 7) + color = filmicToneMapping(color); +#elif (Tone_map == 8) + color = Uncharted2ToneMapping(color); +#elif (tone_mapping == 9) + color = ACESFilm(color); +#endif + + // Levels Control if we tone map to 16-235 , 0 - 255 or usr defined range. +#if (blacknwhitepass == 1) + color = LevelsPass(color); +#endif + + // Color matrix +#if (cmatrix == 1) + color = ColorMatrixPass(color); +#endif + + // Post Processing +#if (Tech == 1) + color = TechnicolorPass(color); +#endif +#if (Techine == 1) + color = Technicolor2(color); +#endif +#if (post_process == 0) + color = BotWVibrance(color); +#endif +#if (post_process == 1) + color = Contrasty(color); +#endif +#if (dpxpass == 1) + color = DPXPass(color); +#endif +#if (Filmicpass == 1) + color = FilmPass(color); +#endif +#if (lggpass == 1) + color = LiftGammaGainPass(color); +#endif +#if (CurvesPss == 1) + color = CurvesPass(color); +#endif +#if (vibpass == 1) + color = VibrancePass(color); +#endif + + return {float4(color, 1.0)}; +} + +#elif (disableClarity == 1) // I'M SORRY OKAY IT WORKS + +fragment FragmentOut main0(FragmentIn in [[stage_in]], + float2 pointCoord [[point_coord]], + bool frontFacing [[front_facing]], + constant SupportBuffer &supportBuffer [[buffer(0)]], + texture2d tex0 [[texture(0)]], + sampler samplr0 [[sampler(0)]], + texture2d tex1 [[texture(1)]], + sampler samplr1 [[sampler(1)]]) { + FragmentOut out; + float4 R0f = float4(0.0); + float4 R1f = float4(0.0); + float4 R123f = float4(0.0); + float4 R125f = float4(0.0); + float4 R126f = float4(0.0); + float4 R127f = float4(0.0); + float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f; + float PV0fx = 0.0, PV0fy = 0.0, PV0fz = 0.0, PV0fw = 0.0, PV1fx = 0.0, + PV1fy = 0.0, PV1fz = 0.0, PV1fw = 0.0; + float PS0f = 0.0, PS1f = 0.0; + float4 tempf = float4(0.0); + float tempResultf; + int tempResulti; + int4 ARi = int4(0); + bool predResult = true; + R0f = in.passParameterSem0; + R1f.xyz = (tex0.sample(samplr0, float2(R0f.x, R0f.y)).xyz); + R0f.xyz = (tex1.sample(samplr1, float2(R0f.x, R0f.y)).xyz); + // 0 + R126f.x = R1f.x + R0f.x; + R127f.y = R1f.y + R0f.y; + R126f.z = R1f.z + R0f.z; + R125f.w = 1.0; + // 1 + tempf.x = dot(float4(R126f.x, R127f.y, R126f.z, as_type(0x80000000)), + float4(as_type(0x3e99096c), as_type(0x3f162b6b), + as_type(0x3dea4a8c), 0.0)); + PV1fx = tempf.x; + PV1fy = tempf.x; + PV1fz = tempf.x; + PV1fw = tempf.x; + // 2 + R127f.x = -(R127f.y) * as_type(0x3fb8aa3b); + PV0fy = -(PV1fx)*as_type(0x3fb8aa3b); + R127f.z = -(R126f.x) * as_type(0x3fb8aa3b); + R127f.w = -(R126f.z) * as_type(0x3fb8aa3b); + R126f.w = 1.0 / PV1fx; + // 3 + PS1f = exp2(PV0fy); + // 4 + PV0fx = -(PS1f) + 1.0; + PS0f = exp2(R127f.x); + // 5 + R127f.x = -(PS0f) + 1.0; + R126f.y = mul_nonIEEE(PV0fx, PV0fx); + PV1fz = PV0fx * R126f.w; + PS1f = exp2(R127f.w); + // 6 + backupReg0f = R127f.z; + R126f.x = mul_nonIEEE(R126f.x, PV1fz); + PV0fy = -(PS1f) + 1.0; + R127f.z = mul_nonIEEE(R126f.z, PV1fz); + R127f.w = mul_nonIEEE(R127f.y, PV1fz); + PS0f = exp2(backupReg0f); + // 7 + PV1fx = R127f.x + -(R127f.w); + PV1fy = PV0fy + -(R127f.z); + PV1fw = -(PS0f) + 1.0; + // 8 + R127f.x = mul_nonIEEE(PV1fx, R126f.y) + R127f.w; + R127f.x = clamp(R127f.x, 0.0, 1.0); + PV0fy = PV1fw + -(R126f.x); + R127f.z = mul_nonIEEE(PV1fy, R126f.y) + R127f.z; + R127f.z = clamp(R127f.z, 0.0, 1.0); + // 9 + R126f.x = mul_nonIEEE(PV0fy, R126f.y) + R126f.x; + R126f.x = clamp(R126f.x, 0.0, 1.0); + PV1fw = max(R127f.x, R127f.z); + // 10 + tempf.x = dot(float4(R126f.x, R127f.x, R127f.z, R125f.w), + float4(as_type(0x3f2aaaab), as_type(0x3f2aaaab), + as_type(0x3f2aaaab), -(1.0))); + PV0fx = tempf.x; + PV0fy = tempf.x; + PV0fz = tempf.x; + PV0fw = tempf.x; + R126f.z = max(R126f.x, PV1fw); + // 11 + backupReg0f = R127f.x; + backupReg1f = R127f.z; + R127f.x = R126f.x + -(R126f.z); + R123f.y = mul_nonIEEE(-(PV0fx), PV0fx) + 1.0; + R127f.z = backupReg0f + -(R126f.z); + R125f.w = backupReg1f + -(R126f.z); + // 12 + R123f.x = mul_nonIEEE(R123f.y, as_type(supportBuffer.remapped[0].y)) + + as_type(supportBuffer.remapped[0].x); + // 13 + R0f.x = mul_nonIEEE(R127f.x, R123f.x) + R126f.z; + R0f.y = mul_nonIEEE(R127f.z, R123f.x) + R126f.z; + R0f.z = mul_nonIEEE(R125f.w, R123f.x) + R126f.z; + // export + out.passPixelColor0 = as_type(float4(R0f.x, R0f.y, R0f.z, R0f.w)); + return out; +} + +#endif diff --git a/src/BreathOfTheWild/Enhancements/8ff2cf86e789335f_44ab6e52279faa52_ps_msl.txt b/src/BreathOfTheWild/Enhancements/8ff2cf86e789335f_44ab6e52279faa52_ps_msl.txt new file mode 100644 index 000000000..a2c707103 --- /dev/null +++ b/src/BreathOfTheWild/Enhancements/8ff2cf86e789335f_44ab6e52279faa52_ps_msl.txt @@ -0,0 +1,585 @@ +// shader 8ff2cf86e789335f +#include +using namespace metal; +#define SET_POSITION(_v) out.position = _v; out.position.z = (out.position.z + out.position.w) / 2.0 +// start of shader inputs/outputs, predetermined by Cemu. Do not touch +struct SupportBuffer { +int4 remapped[10]; +float2 fragCoordScale; +}; + +#define GET_FRAGCOORD() float4(in.position.xy * supportBuffer.fragCoordScale.xy, in.position.z, 1.0 / in.position.w) +struct FragmentIn { +float4 position [[position]]; +float4 passParameterSem0 [[user(locn0)]]; +float4 passParameterSem1 [[user(locn1)]]; +float4 passParameterSem3 [[user(locn2)]]; +float4 passParameterSem4 [[user(locn3)]]; +float4 passParameterSem6 [[user(locn4)]]; +}; + +struct FragmentOut { +float4 passPixelColor0 [[color(0)]]; +}; + +// end of shader inputs/outputs +void redcCUBE(float4 src0, float4 src1, thread float3& stm, thread int& faceId) +{ +// stm -> x .. s, y .. t, z .. MajorAxis*2.0 +float3 inputCoord = normalize(float3(src1.y, src1.x, src0.x)); +float rx = inputCoord.x; +float ry = inputCoord.y; +float rz = inputCoord.z; +if( abs(rx) > abs(ry) && abs(rx) > abs(rz) ) +{ +stm.z = rx*2.0; +stm.xy = float2(ry,rz); +if( rx >= 0.0 ) +{ +faceId = 0; +} +else +{ +faceId = 1; +} +} +else if( abs(ry) > abs(rx) && abs(ry) > abs(rz) ) +{ +stm.z = ry*2.0; +stm.xy = float2(rx,rz); +if( ry >= 0.0 ) +{ +faceId = 2; +} +else +{ +faceId = 3; +} +} +else //if( abs(rz) > abs(ry) && abs(rz) > abs(rx) ) +{ +stm.z = rz*2.0; +stm.xy = float2(rx,ry); +if( rz >= 0.0 ) +{ +faceId = 4; +} +else +{ +faceId = 5; +} +} +} +float3 redcCUBEReverse(float2 st, int faceId) +{ +st.yx = st.xy; +float3 v; +float majorAxis = 1.0; +if( faceId == 0 ) +{ +v.yz = (st-float2(1.5))*(majorAxis*2.0); +v.x = 1.0; +} +else if( faceId == 1 ) +{ +v.yz = (st-float2(1.5))*(majorAxis*2.0); +v.x = -1.0; +} +else if( faceId == 2 ) +{ +v.xz = (st-float2(1.5))*(majorAxis*2.0); +v.y = 1.0; +} +else if( faceId == 3 ) +{ +v.xz = (st-float2(1.5))*(majorAxis*2.0); +v.y = -1.0; +} +else if( faceId == 4 ) +{ +v.xy = (st-float2(1.5))*(majorAxis*2.0); +v.z = 1.0; +} +else +{ +v.xy = (st-float2(1.5))*(majorAxis*2.0); +v.z = -1.0; +} +return v; +} +template +float sampleCompareEmulate(TextureT tex, sampler samplr, CoordT coord, float compareValue) { +return compareValue < tex.sample(samplr, coord).x ? 1.0 : 0.0; +} +template +float2 textureCalculateLod(TextureT tex, sampler samplr, CoordT coord) { +float lod = tex.calculate_unclamped_lod(samplr, coord); +return float2(floor(lod), fract(lod)); +} +int clampFI32(int v) +{ +if( v == 0x7FFFFFFF ) + return as_type(1.0); +else if( v == 0xFFFFFFFF ) + return as_type(0.0); +return as_type(clamp(as_type(v), 0.0, 1.0)); +} +float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } + +#define reflExtra $reflExtra + +fragment FragmentOut main0(FragmentIn in [[stage_in]], float2 pointCoord [[point_coord]], bool frontFacing [[front_facing]], constant SupportBuffer& supportBuffer [[buffer(0)]], texture2d tex1 [[texture(0)]], sampler samplr1 [[sampler(0)]], texture2d tex2 [[texture(1)]], sampler samplr2 [[sampler(1)]], texture2d tex3 [[texture(2)]], sampler samplr3 [[sampler(2)]], texture2d tex5 [[texture(3)]], sampler samplr5 [[sampler(3)]], texture2d tex7 [[texture(4)]], sampler samplr7 [[sampler(4)]], texture2d tex8 [[texture(5)]], sampler samplr8 [[sampler(5)]], texturecube_array tex9 [[texture(6)]], sampler samplr9 [[sampler(6)]], texture2d_array tex11 [[texture(7)]], sampler samplr11 [[sampler(7)]], texture2d tex12 [[texture(8)]], sampler samplr12 [[sampler(8)]], texture2d tex14 [[texture(9)]], sampler samplr14 [[sampler(9)]]) { +FragmentOut out; +int4 R0i = int4(0); +int4 R1i = int4(0); +int4 R2i = int4(0); +int4 R3i = int4(0); +int4 R4i = int4(0); +int4 R5i = int4(0); +int4 R6i = int4(0); +int4 R7i = int4(0); +int4 R8i = int4(0); +int4 R9i = int4(0); +int4 R10i = int4(0); +int4 R11i = int4(0); +int4 R12i = int4(0); +int4 R13i = int4(0); +int4 R122i = int4(0); +int4 R123i = int4(0); +int4 R124i = int4(0); +int4 R125i = int4(0); +int4 R126i = int4(0); +int4 R127i = int4(0); +int backupReg0i, backupReg1i, backupReg2i, backupReg3i, backupReg4i; +int PV0ix = 0, PV0iy = 0, PV0iz = 0, PV0iw = 0, PV1ix = 0, PV1iy = 0, PV1iz = 0, PV1iw = 0; +int PS0i = 0, PS1i = 0; +int4 tempi = int4(0); +float tempResultf; +int tempResulti; +int4 ARi = int4(0); +bool predResult = true; +float3 cubeMapSTM; +int cubeMapFaceId; +float cubeMapArrayIndex9 = 0.0; +R0i = as_type(in.passParameterSem0); +R1i = as_type(in.passParameterSem1); +R2i = as_type(in.passParameterSem3); +R3i = as_type(in.passParameterSem4); +R4i = as_type(in.passParameterSem6); +R7i.xyzw = as_type(tex3.sample(samplr3, float2(as_type(R4i.z),as_type(R4i.w))).xyzw); +R2i.w = as_type(tex5.sample(samplr5, float2(as_type(R0i.x),as_type(R0i.y))).x); +R5i.xyzw = as_type(tex7.gather(samplr7, float2(0.0001) + float2(as_type(R0i.x),as_type(R0i.y))).xyzw); +R6i.xyzw = as_type(tex8.gather(samplr8, float2(0.0001) + float2(as_type(R0i.x),as_type(R0i.y))).xyzw); +R8i.xyzw = as_type(tex1.sample(samplr1, float2(as_type(R4i.z),as_type(R4i.w))).xyzw); +// 0 +R127i.x = as_type(as_type(R7i.x) * 2.0 + -(1.0)); +R127i.y = as_type(as_type(R7i.y) * 2.0 + -(1.0)); +R126i.z = as_type(as_type(R7i.z) * 2.0 + -(1.0)); +R127i.w = as_type(mul_nonIEEE(as_type(R2i.w),as_type(supportBuffer.remapped[0].x)) + as_type(supportBuffer.remapped[1].x)); +R127i.z = as_type(-(as_type(R2i.w)) + as_type(R5i.x)); +// 1 +tempi.x = as_type(dot(float4(as_type(R127i.x),as_type(R127i.y),as_type(R126i.z),as_type(0x80000000)),float4(as_type(R127i.x),as_type(R127i.y),as_type(R126i.z),0.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R2i.z = as_type(-(as_type(R127i.w))); +// 2 +R12i.x = as_type(mul_nonIEEE(as_type(R0i.z), -(as_type(R127i.w)))); +R12i.y = as_type(mul_nonIEEE(as_type(R0i.w), -(as_type(R127i.w)))); +PV0iz = as_type(mul_nonIEEE(as_type(R127i.w), as_type(supportBuffer.remapped[2].y))); +R125i.w = as_type(max(as_type(R127i.z), -(as_type(R127i.z)))); +tempResultf = 1.0 / sqrt(as_type(PV1ix)); +R126i.y = as_type(tempResultf); +// 3 +R4i.x = as_type(mul_nonIEEE(as_type(R127i.x), as_type(R126i.y))); +R4i.y = as_type(mul_nonIEEE(as_type(R127i.y), as_type(R126i.y))); +R127i.z = as_type(-(as_type(R2i.w)) + as_type(R5i.y)); +R126i.w = as_type(-(as_type(R2i.w)) + as_type(R5i.z)); +R127i.w = as_type(1.0 / as_type(PV0iz)); +R127i.w = as_type(as_type(R127i.w) * 2.0); +// 4 +tempi.x = as_type(dot(float4(as_type(R12i.x),as_type(R12i.y),as_type(R2i.z),as_type(0x80000000)),float4(as_type(R12i.x),as_type(R12i.y),as_type(R2i.z),0.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R9i.x = as_type(mul_nonIEEE(as_type(R2i.x),as_type(R4i.x)) + as_type(R0i.x)); +// 5 +backupReg0i = R127i.z; +R126i.x = as_type(-(as_type(R2i.w)) + as_type(R5i.w)); +R9i.y = as_type(mul_nonIEEE(as_type(R2i.y),as_type(R4i.y)) + as_type(R0i.y)); +R127i.z = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[0].x), as_type(R127i.w))); +R127i.w = as_type(max(as_type(backupReg0i), -(as_type(backupReg0i)))); +PS1i = as_type(sqrt(as_type(PV0ix))); +// 6 +R127i.x = as_type(dot(float4(as_type(R7i.x),as_type(R7i.y),as_type(R7i.z),as_type(0x80000000)),float4(as_type(0x3eaaaaab),as_type(0x3eaaaaab),as_type(0x3eaaaaab),0.0))); +PV0iy = R127i.x; +PV0iz = R127i.x; +PV0iw = R127i.x; +PS0i = as_type(1.0 / as_type(PS1i)); +// 7 +R2i.x = as_type(mul_nonIEEE(as_type(R12i.x), as_type(PS0i))); +R13i.y = as_type(mul_nonIEEE(as_type(R12i.y), as_type(PS0i))); +R9i.z = as_type(mul_nonIEEE(as_type(R2i.z), as_type(PS0i))); +PV1iw = as_type(-(as_type(R127i.x)) + as_type(R6i.x)); +R125i.x = as_type(-(as_type(R127i.x)) + as_type(R6i.y)); +// 8 +backupReg0i = R127i.x; +R127i.x = as_type(max(as_type(R126i.w), -(as_type(R126i.w)))); +PV0iy = as_type(-(as_type(backupReg0i)) + as_type(R6i.w)); +R125i.z = as_type(max(as_type(R126i.x), -(as_type(R126i.x)))); +PV0iw = as_type(-(as_type(backupReg0i)) + as_type(R6i.z)); +PS0i = as_type(max(as_type(PV1iw), -(as_type(PV1iw)))); +PS0i = as_type(as_type(PS0i) * 4.0); +// 9 +backupReg0i = R126i.z; +PV1ix = as_type(max(as_type(R125i.x), -(as_type(R125i.x)))); +PV1ix = as_type(as_type(PV1ix) * 4.0); +PV1iy = as_type(max(as_type(PV0iy), -(as_type(PV0iy)))); +PV1iy = as_type(as_type(PV1iy) * 4.0); +R126i.z = as_type(mul_nonIEEE(as_type(R127i.z),as_type(R125i.w)) + as_type(PS0i)); +PV1iw = as_type(max(as_type(PV0iw), -(as_type(PV0iw)))); +PV1iw = as_type(as_type(PV1iw) * 4.0); +R5i.z = as_type(mul_nonIEEE(as_type(backupReg0i), as_type(R126i.y))); +// 10 +backupReg0i = R127i.z; +R123i.x = as_type(mul_nonIEEE(as_type(backupReg0i),as_type(R127i.w)) + as_type(PV1ix)); +R123i.y = as_type(mul_nonIEEE(as_type(backupReg0i),as_type(R125i.z)) + as_type(PV1iy)); +R127i.z = as_type(fract(as_type(R3i.x))); +R123i.w = as_type(mul_nonIEEE(as_type(backupReg0i),as_type(R127i.x)) + as_type(PV1iw)); +R125i.x = as_type(fract(as_type(R3i.y))); +// 11 +R127i.x = as_type(as_type(R126i.z) + -(as_type(R123i.w))); +R126i.y = R4i.x; +R126i.y = as_type(as_type(R126i.y) * 2.0); +R126i.z = as_type(-(as_type(R123i.x)) + as_type(R123i.y)); +R127i.w = R4i.y; +R127i.w = as_type(as_type(R127i.w) * 2.0); +R125i.w = R5i.z; +R125i.w = as_type(as_type(R125i.w) * 2.0); +// 12 +tempi.x = as_type(dot(float4(as_type(R4i.x),as_type(R4i.y),as_type(R5i.z),as_type(0x80000000)),float4(as_type(R2i.x),as_type(R13i.y),as_type(R9i.z),0.0))); +PV0ix = tempi.x; +R127i.y = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +PS0i = as_type(as_type(R126i.z) + as_type(R127i.x)); +// 13 +backupReg0i = R127i.x; +R127i.x = as_type(mul_nonIEEE(-(as_type(PV0ix)),as_type(R126i.y)) + as_type(R2i.x)); +PV1iy = as_type(as_type(R126i.z) + -(as_type(backupReg0i))); +R126i.z = as_type(mul_nonIEEE(-(as_type(PV0ix)),as_type(R127i.w)) + as_type(R13i.y)); +PV1iw = as_type(as_type(PS0i) + as_type(R127i.z)); +PV1iw = clampFI32(PV1iw); +R125i.z = as_type(mul_nonIEEE(-(as_type(PV0ix)),as_type(R125i.w)) + as_type(R9i.z)); +// 14 +R6i.x = as_type(mul_nonIEEE(as_type(R1i.x),as_type(R9i.x)) + as_type(R1i.z)); +PV0iy = as_type(as_type(PV1iy) + as_type(R125i.x)); +PV0iy = clampFI32(PV0iy); +R11i.z = as_type(rint(0.0)); +PV0iw = as_type(-(as_type(R127i.z)) + as_type(PV1iw)); +R10i.w = as_type(-(as_type(R7i.w)) * 3.0 + 3.0); +// 15 +R11i.x = as_type(mul_nonIEEE(as_type(R3i.z),as_type(PV0iw)) + as_type(R0i.x)); +R5i.y = as_type(mul_nonIEEE(as_type(R1i.y),as_type(R9i.y)) + as_type(R1i.w)); +R1i.z = as_type(as_type(R2i.x) + as_type(supportBuffer.remapped[3].x)); +PV1iw = as_type(-(as_type(R125i.x)) + as_type(PV0iy)); +R1i.y = as_type(as_type(R13i.y) + as_type(supportBuffer.remapped[3].y)); +// 16 +R125i.x = as_type(max(-(as_type(R127i.y)), 0.0)); +R11i.y = as_type(mul_nonIEEE(as_type(R3i.w),as_type(PV1iw)) + as_type(R0i.y)); +R6i.z = as_type(as_type(R9i.z) + as_type(supportBuffer.remapped[3].z)); +R127i.w = as_type(as_type(R8i.w) * 255.0); +R6i.y = as_type(-(as_type(R7i.w)) + 1.0); +// 17 +tempi.x = as_type(dot(float4(as_type(supportBuffer.remapped[4].x),as_type(supportBuffer.remapped[4].y),as_type(supportBuffer.remapped[4].z),as_type(0x80000000)),float4(as_type(R127i.x),as_type(R126i.z),as_type(R125i.z),0.0))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R1i.w = 0; +// 18 +R124i.x = as_type(dot(float4(as_type(supportBuffer.remapped[5].x),as_type(supportBuffer.remapped[5].y),as_type(supportBuffer.remapped[5].z),as_type(0x80000000)),float4(as_type(R127i.x),as_type(R126i.z),as_type(R125i.z),0.0))); +PV0iy = R124i.x; +PV0iz = R124i.x; +PV0iw = R124i.x; +R124i.z = as_type(-(as_type(PV1ix))); +// 19 +tempi.x = as_type(dot(float4(as_type(supportBuffer.remapped[6].x),as_type(supportBuffer.remapped[6].y),as_type(supportBuffer.remapped[6].z),as_type(0x80000000)),float4(as_type(R127i.x),as_type(R126i.z),as_type(R125i.z),0.0))); +PV1ix = tempi.x; +R124i.y = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +R4i.z = int(as_type(R127i.w)); +// 20 +redcCUBE(float4(as_type(R124i.z),as_type(R124i.z),as_type(R124i.x),as_type(PV1ix)),float4(as_type(PV1ix),as_type(R124i.x),as_type(R124i.z),as_type(R124i.z)),cubeMapSTM,cubeMapFaceId); +R0i.x = as_type(cubeMapSTM.x); +R0i.y = as_type(cubeMapSTM.y); +R0i.z = as_type(cubeMapSTM.z); +R0i.w = cubeMapFaceId; +R2i.y = as_type(min(as_type(R125i.x), 1.0)); +// 21 +R3i.x = 0; +R3i.y = as_type(as_type(R7i.w) * 255.0); +R10i.z = R0i.w; +R3i.w = as_type(mul_nonIEEE(-(as_type(R7i.w)),as_type(R6i.y)) + as_type(R6i.y)); +R3i.z = as_type(1.0 / abs(as_type(R0i.z))); +// 0 +R125i.x = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[3].x), as_type(supportBuffer.remapped[7].w))); +R123i.y = as_type(mul_nonIEEE(as_type(R0i.y),as_type(R3i.z)) + 1.5); +R124i.z = R4i.z & int(0xfc); +R123i.w = as_type(mul_nonIEEE(as_type(R0i.x),as_type(R3i.z)) + 1.5); +R127i.y = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[3].y), as_type(supportBuffer.remapped[7].w))); +// 1 +R10i.x = R123i.y; +R10i.y = R123i.w; +R125i.z = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[3].z), as_type(supportBuffer.remapped[7].w))); +R127i.w = as_type(as_type(R3i.w) + as_type(0x3c23d70a)); +R127i.w = clampFI32(R127i.w); +R126i.z = as_type(-(as_type(R2i.y)) + 1.0); +// 2 +tempi.x = as_type(dot(float4(as_type(R1i.z),as_type(R1i.y),as_type(R6i.z),as_type(0x80000000)),float4(as_type(R1i.z),as_type(R1i.y),as_type(R6i.z),0.0))); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R124i.y = int(as_type(R3i.y)); +// 3 +tempi.x = as_type(dot(float4(as_type(R4i.x),as_type(R4i.y),as_type(R5i.z),as_type(R5i.z)),float4(-(as_type(R125i.x)),-(as_type(R127i.y)),-(as_type(R125i.z)),-(as_type(R3i.x))))); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +R126i.w = tempi.x; +tempResultf = 1.0 / sqrt(as_type(PV0ix)); +PS1i = as_type(tempResultf); +// 4 +backupReg0i = R124i.z; +PV0ix = as_type(mul_nonIEEE(as_type(R1i.z), as_type(PS1i))); +PV0iy = as_type(mul_nonIEEE(as_type(R1i.y), as_type(PS1i))); +R124i.z = as_type(mul_nonIEEE(as_type(R127i.w), as_type(R127i.w))); +PV0iw = as_type(mul_nonIEEE(as_type(R6i.z), as_type(PS1i))); +R127i.x = as_type(float(backupReg0i)); +// 5 +backupReg0i = R126i.z; +R124i.x = as_type(mul_nonIEEE(as_type(PV0ix), as_type(supportBuffer.remapped[7].w))); +R126i.y = as_type(mul_nonIEEE(as_type(PV0iy), as_type(supportBuffer.remapped[7].w))); +R126i.z = as_type(mul_nonIEEE(as_type(PV0iw), as_type(supportBuffer.remapped[7].w))); +R127i.w = as_type(as_type(R6i.y) * 0.5 + 0.5); +R125i.y = as_type(mul_nonIEEE(-(as_type(R2i.y)),as_type(backupReg0i)) + as_type(backupReg0i)); +// 6 +tempi.x = as_type(dot(float4(as_type(R4i.x),as_type(R4i.y),as_type(R5i.z),as_type(R5i.z)),float4(-(as_type(R124i.x)),-(as_type(R126i.y)),-(as_type(R126i.z)),-(as_type(R1i.w))))); +tempi.x = clampFI32(tempi.x); +PV0ix = tempi.x; +PV0iy = tempi.x; +PV0iz = tempi.x; +PV0iw = tempi.x; +R126i.x = R124i.y & int(1); +// 7 +tempi.x = as_type(dot(float4(-(as_type(R125i.x)),-(as_type(R127i.y)),-(as_type(R125i.z)),as_type(0x80000000)),float4(-(as_type(R124i.x)),-(as_type(R126i.y)),-(as_type(R126i.z)),0.0))); +tempi.x = clampFI32(tempi.x); +PV1ix = tempi.x; +PV1iy = tempi.x; +PV1iz = tempi.x; +R125i.w = tempi.x; +PS1i = as_type(mul_nonIEEE(as_type(PV0ix), as_type(PV0ix))); +// 8 +R125i.x = as_type(mul_nonIEEE(as_type(R127i.w), as_type(R127i.w))); +R125i.x = as_type(as_type(R125i.x) / 2.0); +R127i.y = as_type(mul_nonIEEE(as_type(R124i.z),as_type(PS1i)) + -(as_type(PS1i))); +PV0iz = as_type(-(as_type(PV1ix)) + 1.0); +R3i.w = as_type(as_type(R127i.x) * as_type(0x3b820821)); +R122i.x = as_type(mul_nonIEEE(-(as_type(R2i.y)),as_type(R125i.y)) + as_type(R125i.y)); +// 9 +backupReg0i = R125i.y; +R127i.x = R126i.w; +R127i.x = as_type(as_type(R127i.x) * 2.0); +R125i.y = as_type(mul_nonIEEE(-(as_type(R125i.w)),as_type(PV0iz)) + as_type(PV0iz)); +R126i.z = as_type(-(as_type(R7i.w)) * 3.0 + 4.0); +R127i.w = as_type(mul_nonIEEE(as_type(backupReg0i), as_type(R122i.x))); +R7i.y = as_type(as_type(R3i.w) * 0.25 + 0.25); +// 10 +R3i.x = R126i.w; +R3i.x = clampFI32(R3i.x); +R126i.y = ((R126i.x == 0)?(0):(int(0x3f800000))); +PV0iz = as_type(as_type(R127i.y) + 1.0); +R123i.w = as_type(mul_nonIEEE(as_type(R2i.y),-(as_type(R125i.x))) + as_type(R2i.y)); +R125i.z = as_type(-(as_type(R3i.w)) * as_type(0x3d23d70a) + as_type(0x3d23d70a)); +// 11 +backupReg0i = R126i.z; +R123i.x = as_type(mul_nonIEEE(-(as_type(R125i.w)),as_type(R125i.y)) + as_type(R125i.y)); +R127i.y = as_type(mul_nonIEEE(as_type(R127i.y),as_type(PV0iz)) + as_type(PV0iz)); +R126i.z = as_type(as_type(R125i.x) + as_type(R123i.w)); +PV1iw = as_type(mul_nonIEEE(as_type(R126i.w), as_type(R127i.x))); +PS1i = as_type(1.0 / as_type(backupReg0i)); +// 12 +R124i.x = as_type(mul_nonIEEE(as_type(R127i.w), as_type(PS1i))); +R123i.y = as_type(mul_nonIEEE(as_type(R3i.x),-(as_type(R125i.x))) + as_type(R3i.x)); +R6i.z = as_type(mul_nonIEEE(as_type(R126i.y), as_type(PV1iw))); +R126i.w = as_type(mul_nonIEEE(as_type(R125i.y), as_type(R123i.x))); +R127i.x = as_type(mul_nonIEEE(as_type(R8i.y),as_type(R3i.w)) + as_type(R125i.z)); +// 13 +backupReg0i = R125i.x; +backupReg1i = R123i.y; +R125i.x = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[7].w), as_type(supportBuffer.remapped[7].w))); +R123i.y = as_type(mul_nonIEEE(as_type(R8i.x),as_type(R3i.w)) + as_type(R125i.z)); +R127i.z = as_type(as_type(backupReg0i) + as_type(backupReg1i)); +R127i.w = as_type(mul_nonIEEE(as_type(R8i.z),as_type(R3i.w)) + as_type(R125i.z)); +R125i.z = as_type(1.0 / as_type(R127i.y)); +// 14 +backupReg0i = R126i.z; +R126i.x = as_type(mul_nonIEEE(as_type(R123i.y),-(as_type(R124i.x))) + as_type(R123i.y)); +R127i.y = as_type(mul_nonIEEE(as_type(R127i.w),-(as_type(R126i.w))) + as_type(R127i.w)); +R126i.z = as_type(mul_nonIEEE(as_type(R127i.x),-(as_type(R126i.w))) + as_type(R127i.x)); +R123i.w = as_type(mul_nonIEEE(as_type(R123i.y),-(as_type(R126i.w))) + as_type(R123i.y)); +R7i.x = as_type(1.0 / as_type(backupReg0i)); +// 15 +backupReg0i = R127i.z; +R123i.x = as_type(mul_nonIEEE(as_type(R127i.x),-(as_type(R124i.x))) + as_type(R127i.x)); +R125i.y = as_type(mul_nonIEEE(as_type(R124i.z), as_type(R125i.z))); +R127i.z = as_type(as_type(R126i.w) + as_type(R123i.w)); +R127i.w = as_type(mul_nonIEEE(as_type(R127i.w),-(as_type(R124i.x))) + as_type(R127i.w)); +R126i.y = as_type(1.0 / as_type(backupReg0i)); +// 16 +backupReg0i = R126i.x; +R126i.x = as_type(as_type(R126i.w) + as_type(R127i.y)); +R2i.y = as_type(as_type(R124i.x) + as_type(backupReg0i)); +R7i.z = as_type(mul_nonIEEE(as_type(R125i.x), as_type(R125i.x))); +R126i.w = as_type(as_type(R126i.w) + as_type(R126i.z)); +R6i.y = as_type(as_type(R124i.x) + as_type(R123i.x)); +// 17 +backupReg0i = R7i.x; +R7i.x = as_type(as_type(R124i.x) + as_type(R127i.w)); +R3i.y = as_type(mul_nonIEEE(as_type(R126i.y), as_type(R125i.y))); +R3i.z = as_type(as_type(R8i.x) * as_type(0x3f895ef0) + as_type(0xba0a8ec8)); +R3i.z = clampFI32(R3i.z); +PV1iw = as_type(0.25 * as_type(backupReg0i)); +R0i.w = as_type(as_type(R8i.y) * as_type(0x3f895ef0) + as_type(0xba0a8ec8)); +R0i.w = clampFI32(R0i.w); +// 18 +PV0ix = as_type(mul_nonIEEE(as_type(R126i.x), as_type(PV1iw))); +PV0iy = as_type(mul_nonIEEE(as_type(R126i.w), as_type(PV1iw))); +PV0iz = as_type(mul_nonIEEE(as_type(R127i.z), as_type(PV1iw))); +R6i.w = as_type(as_type(R8i.z) * as_type(0x3f895ef0) + as_type(0xba0a8ec8)); +R6i.w = clampFI32(R6i.w); +PS0i = R4i.z & int(1); +// 19 +R8i.y = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[8].z), as_type(PV0ix))); +R5i.z = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[8].y), as_type(PV0iy))); +R7i.w = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[8].x), as_type(PV0iz))); +R8i.z = as_type(float(PS0i)); +// 20 +R4i.x = R11i.x; +R4i.y = R11i.y; +R4i.z = as_type(rint(1.0)); +R8i.w = as_type(tex5.sample(samplr5, float2(as_type(R9i.x),as_type(R9i.y))).x); +R13i.xzw = as_type(tex12.sample(samplr12, float2(as_type(R11i.x),as_type(R11i.y))).xzw); +R0i.xyz = as_type(tex11.sample(samplr11, float2(as_type(R11i.x), as_type(R11i.y)), uint(rint(as_type(R11i.z)))).xyz); +R1i.xyzw = as_type(tex2.sample(samplr2, float2(as_type(R11i.x),as_type(R11i.y)), level(0.0)).xyzw); +R4i.xyz = as_type(tex11.sample(samplr11, float2(as_type(R4i.x), as_type(R4i.y)), uint(rint(as_type(R4i.z)))).xyz); + +#if (reflExtra == 0) // Normal Reflections + +R10i.xyz = as_type(tex9.sample(samplr9, redcCUBEReverse(as_type(R10i.xy),R10i.z), uint(cubeMapArrayIndex9), level(as_type(R10i.w))).xyz); + +#elif (reflExtra == 1) // Enhanced Reflections + +R10i.xyz = as_type(tex9.sample(samplr9, redcCUBEReverse(as_type(R10i.xy),R10i.z), uint(cubeMapArrayIndex9), level(0.0)).xyz); + +#endif + +R11i.xyz = as_type(tex14.sample(samplr14, float2(as_type(R11i.x),as_type(R11i.y))).xyz); +// 0 +R123i.x = as_type(as_type(R13i.w) * 0.5 + 0.5); +R123i.y = as_type(mul_nonIEEE(as_type(R13i.w),-(as_type(R7i.y))) + as_type(R13i.w)); +R123i.z = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[0].x),as_type(R8i.w)) + as_type(supportBuffer.remapped[1].x)); +R126i.w = as_type(mul_nonIEEE(as_type(R13i.x), as_type(R3i.x))); +R127i.w = as_type(mul_nonIEEE(as_type(R1i.z),as_type(R7i.x)) + as_type(R4i.z)); +// 1 +PV1ix = as_type(-(as_type(R123i.z))); +PV1iy = as_type(as_type(R3i.x) + as_type(R123i.x)); +PV1iy = clampFI32(PV1iy); +PV1iz = as_type(mul_nonIEEE(-(as_type(R123i.z)), as_type(R5i.y))); +PV1iw = as_type(mul_nonIEEE(-(as_type(R123i.z)), as_type(R6i.x))); +PS1i = as_type(as_type(R7i.y) + as_type(R123i.y)); +// 2 +R126i.x = as_type(-(as_type(R12i.x)) + as_type(PV1iw)); +R126i.y = as_type(-(as_type(R12i.y)) + as_type(PV1iz)); +PV0iz = as_type(-(as_type(R2i.z)) + as_type(PV1ix)); +R8i.w = as_type(mul_nonIEEE(as_type(R126i.w), as_type(PV1iy))); +R125i.y = as_type(mul_nonIEEE(as_type(PS1i),-(as_type(R1i.w))) + as_type(PS1i)); +// 3 +tempi.x = as_type(dot(float4(as_type(R2i.x),as_type(R13i.y),as_type(R9i.z),as_type(0x80000000)),float4(as_type(R126i.x),as_type(R126i.y),as_type(PV0iz),0.0))); +PV1ix = tempi.x; +R127i.y = tempi.x; +PV1iz = tempi.x; +PV1iw = tempi.x; +PS1i = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[9].x), as_type(R126i.w))); +// 4 +backupReg0i = R126i.y; +R123i.x = as_type(mul_nonIEEE(-(as_type(R2i.x)),as_type(PV1ix)) + as_type(R126i.x)); +R126i.y = as_type(mul_nonIEEE(as_type(PS1i), as_type(R7i.z))); +R127i.z = as_type(mul_nonIEEE(as_type(R13i.z), as_type(R13i.z))); +R126i.w = as_type(mul_nonIEEE(-(as_type(R13i.y)),as_type(PV1ix)) + as_type(backupReg0i)); +// 5 +PV1ix = as_type(mul_nonIEEE(as_type(R125i.y), as_type(R2i.y))); +R123i.y = as_type(mul_nonIEEE(as_type(R1i.x),as_type(R2i.y)) + as_type(R4i.x)); +PV1iz = as_type(mul_nonIEEE(as_type(R123i.x), as_type(R123i.x))); +R125i.w = as_type(mul_nonIEEE(as_type(R125i.y), as_type(R6i.y))); +PS1i = as_type(mul_nonIEEE(as_type(R125i.y), as_type(R7i.x))); +// 6 +backupReg0i = R123i.y; +backupReg1i = R127i.z; +R123i.x = as_type(mul_nonIEEE(as_type(R1i.y),as_type(R6i.y)) + as_type(R4i.y)); +R123i.y = as_type(mul_nonIEEE(as_type(R126i.w),as_type(R126i.w)) + as_type(PV1iz)); +R127i.z = as_type(mul_nonIEEE(as_type(R10i.x),as_type(PV1ix)) + as_type(backupReg0i)); +R127i.w = as_type(mul_nonIEEE(as_type(R10i.z),as_type(PS1i)) + as_type(R127i.w)); +R4i.w = as_type(mul_nonIEEE(as_type(R8i.z), as_type(backupReg1i))); +// 7 +backupReg0i = R123i.y; +R123i.y = as_type(mul_nonIEEE(as_type(R10i.y),as_type(R125i.w)) + as_type(R123i.x)); +PV1iw = as_type(mul_nonIEEE(as_type(R126i.y), as_type(R3i.y))); +tempResultf = 1.0 / sqrt(as_type(backupReg0i)); +PS1i = as_type(tempResultf); +// 8 +R1i.x = as_type(mul_nonIEEE(as_type(R7i.w),as_type(PV1iw)) + as_type(R127i.z)); +R8i.y = as_type(mul_nonIEEE(as_type(R8i.y),as_type(PV1iw)) + as_type(R127i.w)); +R5i.z = as_type(mul_nonIEEE(as_type(R5i.z),as_type(PV1iw)) + as_type(R123i.y)); +PV0iw = as_type(mul_nonIEEE(as_type(R127i.y), as_type(PS1i))); +// 9 +PV1iz = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[2].z), as_type(PV0iw))); +// 10 +PV0iy = as_type(as_type(PV1iz) * as_type(0x3ced9168)); +PV0iy = clampFI32(PV0iy); +// 11 +R123i.y = as_type(mul_nonIEEE(as_type(PV0iy),as_type(R6i.z)) + 1.0); +// 12 +R10i.x = as_type(mul_nonIEEE(-(as_type(R3i.w)),as_type(R123i.y)) + as_type(R123i.y)); +// 0 +R123i.x = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[8].x),as_type(R8i.w)) + as_type(R0i.x)); +R123i.z = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[8].z),as_type(R8i.w)) + as_type(R0i.z)); +R123i.w = as_type(mul_nonIEEE(as_type(supportBuffer.remapped[8].y),as_type(R8i.w)) + as_type(R0i.y)); +// 1 +PV1iy = as_type(mul_nonIEEE(as_type(R123i.z), as_type(R10i.x))); +PV1iz = as_type(mul_nonIEEE(as_type(R123i.w), as_type(R10i.x))); +PV1iw = as_type(mul_nonIEEE(as_type(R123i.x), as_type(R10i.x))); +// 2 +PV0ix = as_type(mul_nonIEEE(as_type(PV1iz), as_type(R0i.w))); +PV0iy = as_type(mul_nonIEEE(as_type(PV1iw), as_type(R3i.z))); +PV0iw = as_type(mul_nonIEEE(as_type(PV1iy), as_type(R6i.w))); +// 3 +R123i.x = as_type(as_type(PV0iw) * as_type(0x3f6e896b) + as_type(0x3a011b1e)); +R123i.y = as_type(as_type(PV0ix) * as_type(0x3f6e896b) + as_type(0x3a011b1e)); +R123i.z = as_type(as_type(PV0iy) * as_type(0x3f6e896b) + as_type(0x3a011b1e)); +// 4 +PV0iy = as_type(as_type(R8i.y) + as_type(R123i.x)); +PV0iz = as_type(as_type(R5i.z) + as_type(R123i.y)); +PV0iw = as_type(as_type(R1i.x) + as_type(R123i.z)); +// 5 +R4i.x = as_type(mul_nonIEEE(as_type(R13i.z),as_type(PV0iw)) + as_type(R11i.x)); +R4i.y = as_type(mul_nonIEEE(as_type(R13i.z),as_type(PV0iz)) + as_type(R11i.y)); +R4i.z = as_type(mul_nonIEEE(as_type(R13i.z),as_type(PV0iy)) + as_type(R11i.z)); +// export +out.passPixelColor0 = as_type(float4(as_type(R4i.x), as_type(R4i.y), as_type(R4i.z), as_type(R4i.w))); +return out; +} diff --git a/src/BreathOfTheWild/Enhancements/cb0e6e8cbec4502a_ff060c183060c54b_ps_msl.txt b/src/BreathOfTheWild/Enhancements/cb0e6e8cbec4502a_ff060c183060c54b_ps_msl.txt new file mode 100644 index 000000000..e80565198 --- /dev/null +++ b/src/BreathOfTheWild/Enhancements/cb0e6e8cbec4502a_ff060c183060c54b_ps_msl.txt @@ -0,0 +1,69 @@ +// shader cb0e6e8cbec4502a +#include +using namespace metal; +#define SET_POSITION(_v) out.position = _v; out.position.z = (out.position.z + out.position.w) / 2.0 +// start of shader inputs/outputs, predetermined by Cemu. Do not touch +struct SupportBuffer { +float2 fragCoordScale; +}; + +#define GET_FRAGCOORD() float4(in.position.xy * supportBuffer.fragCoordScale.xy, in.position.z, 1.0 / in.position.w) +struct FragmentIn { +float4 position [[position]]; +float4 passParameterSem3 [[user(locn0)]]; +}; + +struct FragmentOut { +float4 passPixelColor0 [[color(0)]]; +}; + +// end of shader inputs/outputs +template +float sampleCompareEmulate(TextureT tex, sampler samplr, CoordT coord, float compareValue) { +return compareValue < tex.sample(samplr, coord).x ? 1.0 : 0.0; +} +template +float2 textureCalculateLod(TextureT tex, sampler samplr, CoordT coord) { +float lod = tex.calculate_unclamped_lod(samplr, coord); +return float2(floor(lod), fract(lod)); +} +int clampFI32(int v) +{ +if( v == 0x7FFFFFFF ) + return as_type(1.0); +else if( v == 0xFFFFFFFF ) + return as_type(0.0); +return as_type(clamp(as_type(v), 0.0, 1.0)); +} +float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } + +#define disableDOF $disableDOF + +#if (disableDOF == 0) // Keep DOF Enabled + +fragment FragmentOut main0(FragmentIn in [[stage_in]], float2 pointCoord [[point_coord]], bool frontFacing [[front_facing]], constant SupportBuffer& supportBuffer [[buffer(0)]], texture2d tex0 [[texture(0)]], sampler samplr0 [[sampler(0)]]) { + int radius = int(rint(2.0 / supportBuffer.fragCoordScale.y)); + float2 resolution = float2(tex0.get_width(), tex0.get_height()); + + float2 center = (in.passParameterSem3.xy + in.passParameterSem3.zw) / 2.0; + float3 result = float3(0.0); + float count = 0.0; + for (int x = 1 - radius; x <= radius - 1; x += 2) { + for (int y = 1 - radius; y <= radius - 1; y += 2) { + if (length(float2(x, y)) <= radius) { + result += tex0.sample(samplr0, center + float2(x, y) / resolution).xyz; + count += 1.0; + } + } + } + + return {float4(result / count, 1.0)}; +} + +#elif (disableDOF == 1) // Disable DOF + +fragment FragmentOut main0(FragmentIn in [[stage_in]], float2 pointCoord [[point_coord]], bool frontFacing [[front_facing]], constant SupportBuffer& supportBuffer [[buffer(0)]], texture2d tex0 [[texture(0)]], sampler samplr0 [[sampler(0)]]) { + return {tex0.sample(samplr0, in.passParameterSem3)}; +} + +#endif