diff --git a/Enhancements/CaptainToad_Shadows/rules.txt b/Enhancements/CaptainToad_Shadows/rules.txt deleted file mode 100644 index 17dbda173..000000000 --- a/Enhancements/CaptainToad_Shadows/rules.txt +++ /dev/null @@ -1,33 +0,0 @@ -[Definition] -titleIds = 0005000010180600,0005000010180700,0005000010180500 -name = Shadow Resolution -path = "Captain Toad: Treasure Tracker/Graphics/Shadow Resolution" -description = Note: Increasing shadow resolution is known to increase VRAM usage directly. Lowering this might give you a good boost in performance if you're limited on VRAM but makes shadows blockier. Medium is the original resolution. Made by Ryce-Fast. -version = 4 - -[Preset] -name = Medium (100%, Default) -$shadowRes = 1 - -[Preset] -name = Low (50%) -$shadowRes = 0.5 - -[Preset] -name = High (200%) -$shadowRes = 2 - -[Preset] -name = Ultra (300%) -$shadowRes = 3 - -[Preset] -name = Extreme (400%, Unstable) -$shadowRes = 4 - -[TextureRedefine] # Shadows -width = 1024 -height = 1024 -formats = 0x005 -overwriteWidth = $shadowRes * 1024 -overwriteHeight = $shadowRes * 1024 \ No newline at end of file diff --git a/Resolutions/CaptainToad_Resolution/37a4ec1a7dbc7391_00000000000003c9_ps.txt b/src/CaptainToad/Graphics/37a4ec1a7dbc7391_00000000000003c9_ps.txt similarity index 98% rename from Resolutions/CaptainToad_Resolution/37a4ec1a7dbc7391_00000000000003c9_ps.txt rename to src/CaptainToad/Graphics/37a4ec1a7dbc7391_00000000000003c9_ps.txt index 66b969b55..f21c2d0f9 100644 --- a/Resolutions/CaptainToad_Resolution/37a4ec1a7dbc7391_00000000000003c9_ps.txt +++ b/src/CaptainToad/Graphics/37a4ec1a7dbc7391_00000000000003c9_ps.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #extension GL_ARB_separate_shader_objects : enable #ifdef VULKAN @@ -11,16 +11,13 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) #endif // This shader was automatically converted to be cross-compatible with Vulkan and OpenGL. -// shader 37a4ec1a7dbc7391 //AA fix -const float resXScale = float($width)/float($gameWidth); -const float resYScale = float($height)/float($gameHeight); #ifdef VULKAN layout(set = 1, binding = 2) uniform ufBlock { @@ -31,6 +28,13 @@ uniform vec4 uf_fragCoordScale; uniform ivec4 uf_remappedPS[4]; uniform vec2 uf_fragCoordScale; #endif + +// shader 37a4ec1a7dbc7391 //AA fix +const float resXScale = float($width)/float($gameWidth); +const float resYScale = float($height)/float($gameHeight); +#define AAENABLE $AAEnable + +#if (AAENABLE == 1) TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0; TEXTURE_LAYOUT(1, 1, 1) uniform sampler2D textureUnitPS1; layout(location = 0) in vec4 passParameterSem2; @@ -209,3 +213,4 @@ activeMaskStackC[1] = activeMaskStack[0] == true && activeMaskStackC[0] == true; // export passPixelColor0 = vec4(R2f.x, R2f.y, R2f.z, R2f.w); } +#endif diff --git a/Resolutions/CaptainToad_Resolution/5c1761d13feccdff_0000000000000000_vs.txt b/src/CaptainToad/Graphics/5c1761d13feccdff_0000000000000000_vs.txt similarity index 95% rename from Resolutions/CaptainToad_Resolution/5c1761d13feccdff_0000000000000000_vs.txt rename to src/CaptainToad/Graphics/5c1761d13feccdff_0000000000000000_vs.txt index 322dd4ab4..a1a2bf66a 100644 --- a/Resolutions/CaptainToad_Resolution/5c1761d13feccdff_0000000000000000_vs.txt +++ b/src/CaptainToad/Graphics/5c1761d13feccdff_0000000000000000_vs.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #extension GL_ARB_separate_shader_objects : enable #ifdef VULKAN @@ -11,7 +11,7 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) @@ -20,8 +20,8 @@ // shader 5c1761d13feccdff //Bloom fix heat haze -const float resXScale = (float($width)/float($gameWidth)); -const float resYScale = (float($height)/float($gameHeight)); +const float resXScale = (float($width)/float($gameWidth)); +const float resYScale = (float($height)/float($gameHeight)); #ifdef VULKAN layout(set = 0, binding = 0) uniform ufBlock diff --git a/Resolutions/CaptainToad_Resolution/6f5412f28bd716e8_0000000000000000_vs.txt b/src/CaptainToad/Graphics/6f5412f28bd716e8_0000000000000000_vs.txt similarity index 98% rename from Resolutions/CaptainToad_Resolution/6f5412f28bd716e8_0000000000000000_vs.txt rename to src/CaptainToad/Graphics/6f5412f28bd716e8_0000000000000000_vs.txt index 1479d0906..42f96e941 100644 --- a/Resolutions/CaptainToad_Resolution/6f5412f28bd716e8_0000000000000000_vs.txt +++ b/src/CaptainToad/Graphics/6f5412f28bd716e8_0000000000000000_vs.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #ifdef VULKAN #define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) @@ -10,7 +10,7 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) @@ -124,4 +124,4 @@ passParameterSem0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); passParameterSem1 = vec4(R3f.x, R3f.y, R3f.z, R3f.w); // export passParameterSem2 = vec4(R4f.x, R4f.y, R4f.z, R4f.w); -} \ No newline at end of file +} diff --git a/Resolutions/CaptainToad_Resolution/83f42767ee584d5a_000000000007fffd_ps.txt b/src/CaptainToad/Graphics/83f42767ee584d5a_000000000007fffd_ps.txt similarity index 99% rename from Resolutions/CaptainToad_Resolution/83f42767ee584d5a_000000000007fffd_ps.txt rename to src/CaptainToad/Graphics/83f42767ee584d5a_000000000007fffd_ps.txt index 05e5c67d0..315e25a04 100644 --- a/Resolutions/CaptainToad_Resolution/83f42767ee584d5a_000000000007fffd_ps.txt +++ b/src/CaptainToad/Graphics/83f42767ee584d5a_000000000007fffd_ps.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #ifdef VULKAN #define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) @@ -10,7 +10,7 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) diff --git a/Resolutions/CaptainToad_Resolution/a0bda935c83e6f2a_0000000000000000_vs.txt b/src/CaptainToad/Graphics/a0bda935c83e6f2a_0000000000000000_vs.txt similarity index 98% rename from Resolutions/CaptainToad_Resolution/a0bda935c83e6f2a_0000000000000000_vs.txt rename to src/CaptainToad/Graphics/a0bda935c83e6f2a_0000000000000000_vs.txt index 7517312c6..432cc6192 100644 --- a/Resolutions/CaptainToad_Resolution/a0bda935c83e6f2a_0000000000000000_vs.txt +++ b/src/CaptainToad/Graphics/a0bda935c83e6f2a_0000000000000000_vs.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #ifdef VULKAN #define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) @@ -10,7 +10,7 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) @@ -122,4 +122,4 @@ passParameterSem1 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); passParameterSem2 = vec4(R2f.x, R2f.y, R2f.z, R2f.w); // export passParameterSem0 = vec4(R3f.x, R3f.y, R3f.z, R3f.w); -} \ No newline at end of file +} diff --git a/Resolutions/CaptainToad_Resolution/cc5b29e8cb801fb8_000000000007fff9_ps.txt b/src/CaptainToad/Graphics/cc5b29e8cb801fb8_000000000007fff9_ps.txt similarity index 99% rename from Resolutions/CaptainToad_Resolution/cc5b29e8cb801fb8_000000000007fff9_ps.txt rename to src/CaptainToad/Graphics/cc5b29e8cb801fb8_000000000007fff9_ps.txt index 234e2510a..7736a5fd6 100644 --- a/Resolutions/CaptainToad_Resolution/cc5b29e8cb801fb8_000000000007fff9_ps.txt +++ b/src/CaptainToad/Graphics/cc5b29e8cb801fb8_000000000007fff9_ps.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #ifdef VULKAN #define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) @@ -10,7 +10,7 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) diff --git a/Resolutions/CaptainToad_Resolution/d6228044a83341ca_000000000007fffd_ps.txt b/src/CaptainToad/Graphics/d6228044a83341ca_000000000007fffd_ps.txt similarity index 99% rename from Resolutions/CaptainToad_Resolution/d6228044a83341ca_000000000007fffd_ps.txt rename to src/CaptainToad/Graphics/d6228044a83341ca_000000000007fffd_ps.txt index 4b82201b6..3d8ce9ceb 100644 --- a/Resolutions/CaptainToad_Resolution/d6228044a83341ca_000000000007fffd_ps.txt +++ b/src/CaptainToad/Graphics/d6228044a83341ca_000000000007fffd_ps.txt @@ -1,4 +1,4 @@ -#version 420 +#version 430 #extension GL_ARB_texture_gather : enable #ifdef VULKAN #define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) @@ -10,7 +10,7 @@ #define gl_InstanceID gl_InstanceIndex #else #define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) #define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) #define SET_POSITION(_v) gl_Position = _v #define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) @@ -285,4 +285,4 @@ passPixelColor0 = vec4(R5f.x, R5f.y, R5f.z, R5f.w); passPixelColor1 = vec4(R6f.x, R6f.y, R6f.z, R6f.w); passPixelColor2 = vec4(R7f.x, R7f.y, R7f.z, R7f.w); passPixelColor3 = vec4(R8f.x, R8f.y, R8f.z, R8f.w); -} \ No newline at end of file +} diff --git a/Resolutions/CaptainToad_Resolution/patches.txt b/src/CaptainToad/Graphics/patch_resolution.asm similarity index 53% rename from Resolutions/CaptainToad_Resolution/patches.txt rename to src/CaptainToad/Graphics/patch_resolution.asm index 9f2f7312e..be683dbe9 100644 --- a/Resolutions/CaptainToad_Resolution/patches.txt +++ b/src/CaptainToad/Graphics/patch_resolution.asm @@ -1,23 +1,23 @@ -[KinopioAspectUW] -moduleMatches = 0x43781F76, 0xC64B0A12, 0xD80AD9B4 -#rodata constants -0x100A0EE0 = .float $width/$height -0x100BE2EC = .float $width/$height -0x100D79B4 = .float $width/$height -_aspectAddr = 0x100A0EE0 - -#Aspect Calculation -0x02368158 = lis r31, _aspectAddr@ha -0x0236815c = lfs f13, _aspectAddr@l(r31) - -[KinopioAspectUWv16] -moduleMatches = 0x9E0461E7, 0x1B377483, 0x0576A725 -#rodata constants +[CaptainToad_Resolution_v16] +moduleMatches = 0x1B377483, 0x9E0461E7, 0x0576A725 ; v16(EU), v16(NA), v16(JP) +;rodata constants 0x0100A2D38 = .float $width/$height 0x0100C0164 = .float $width/$height 0x0100D982C = .float $width/$height _aspectAddr = 0x0100A2D38 -#Aspect Calculation +;Aspect Calculation 0x02373530 = lis r31, _aspectAddr@ha 0x02373534 = lfs f13, _aspectAddr@l(r31) + +[CaptainToad_Resolution_v0] +moduleMatches = 0xC64B0A12, 0x43781F76, 0xD80AD9B4 ; v1(EU), v1(NA), v1(JP) +;rodata constants +0x100A0EE0 = .float $width/$height +0x100BE2EC = .float $width/$height +0x100D79B4 = .float $width/$height +_aspectAddr = 0x100A0EE0 + +;Aspect Calculation +0x02368158 = lis r31, _aspectAddr@ha +0x0236815C = lfs f13, _aspectAddr@l(r31) diff --git a/Resolutions/CaptainToad_Resolution/rules.txt b/src/CaptainToad/Graphics/rules.txt similarity index 89% rename from Resolutions/CaptainToad_Resolution/rules.txt rename to src/CaptainToad/Graphics/rules.txt index 271b8f456..961a440f4 100644 --- a/Resolutions/CaptainToad_Resolution/rules.txt +++ b/src/CaptainToad/Graphics/rules.txt @@ -1,99 +1,133 @@ [Definition] titleIds = 0005000010180600,0005000010180700,0005000010180500 -name = Resolution -path = "Captain Toad: Treasure Tracker/Graphics/Resolution" -description = Changes the resolution of the game. Made by getdls. -version = 4 +name = Graphics Settings +path = "Captain Toad: Treasure Tracker/Graphics" +description = Changes the resolution of the game and the quality of shadows.|Made by getdls and Ryce-Fast. +#Credits: getdls, Ryce-Fast +version = 6 -[Preset] -name = 1280x720 (Default) +[Default] $width = 1280 $height = 720 $gameWidth = 1280 $gameHeight = 720 +$shadowRes = 1.0 +$AAEnable:int = 1 # Performance [Preset] +category = Resolution name = 640x360 $width = 640 $height = 360 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 960x540 $width = 960 $height = 540 -$gameWidth = 1280 -$gameHeight = 720 + +[Preset] +category = Resolution +name = 1280x720 (Default) +default = 1 # Common HD Resolutions [Preset] +category = Resolution name = 1600x900 $width = 1600 $height = 900 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 1920x1080 $width = 1920 $height = 1080 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 2560x1440 $width = 2560 $height = 1440 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 3200x1800 $width = 3200 $height = 1800 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 3840x2160 $width = 3840 $height = 2160 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 5120x2880 $width = 5120 $height = 2880 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 7680x4320 $width = 7680 $height = 4320 -$gameWidth = 1280 -$gameHeight = 720 # Common Ultrawide Resolutions [Preset] +category = Resolution name = 2560x1080 (Ultrawide) $width = 2560 $height = 1080 -$gameWidth = 1280 -$gameHeight = 720 [Preset] +category = Resolution name = 3440x1440 (Ultrawide) $width = 3440 $height = 1440 -$gameWidth = 1280 -$gameHeight = 720 + + +[Preset] +category = Shadows +name = Low (50%) +$shadowRes = 0.5 + +[Preset] +category = Shadows +name = Medium (100%, Default) +default = 1 + +[Preset] +category = Shadows +name = High (200%) +$shadowRes = 2.0 + +[Preset] +category = Shadows +name = Ultra (300%) +$shadowRes = 3.0 + +[Preset] +category = Shadows +name = Extreme (400%, Unstable) +$shadowRes = 4.0 + + +[Preset] +category = Anti-Aliasing +name = Enable +$AAEnable:int = 1 + +[Preset] +category = Anti-Aliasing +name = Disable +$AAEnable:int = 0 + [TextureRedefine] width = 1280 @@ -120,8 +154,8 @@ overwriteHeight = ($height/$gameHeight) * 720 width = 1024 height = 1024 formats = 0x005 -overwriteWidth = ($width/$gameWidth) * 1024 -overwriteHeight = ($height/$gameHeight) * 1024 +overwriteWidth = $shadowRes * 1024 +overwriteHeight = $shadowRes * 1024 [TextureRedefine] #Zoom width = 1024