Skip to content

[TwilightPrincessHD] update to v6, new AA enable/remove option, remove hud fix #667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions Enhancements/TwilightPrincessHD_Anisotropic/rules.txt

This file was deleted.

12 changes: 0 additions & 12 deletions Mods/TwilightPrincessHD_RemoveHaze/patches.txt

This file was deleted.

48 changes: 0 additions & 48 deletions Resolutions/TwilightPrincessHD_Performance_Resolution/rules.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140)
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation)
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.z, 1.0/gl_FragCoord.w)

#else
#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location)
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140)
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation)
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw)

#endif

#ifdef VULKAN
Expand All @@ -26,11 +26,11 @@
uniform ivec4 uf_remappedPS[1]; // holds area specific bloom tint color
uniform vec4 uf_fragCoordScale;
};

#else
uniform ivec4 uf_remappedPS[1]; // holds area specific bloom tint color
uniform vec2 uf_fragCoordScale;

#endif

TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0; // bloom mask created in 6e2f31b2b2fcab1f
Expand All @@ -49,34 +49,34 @@ void main()
{
// get pixel coord
vec2 coord = passParameterSem0.xy;

// get bloom mask
vec3 mask = texture(textureUnitPS0, coord).xyz;

// get area specific color tint
vec4 tint = vec4(0.0);
tint.x = intBitsToFloat(uf_remappedPS[0].x);
tint.y = intBitsToFloat(uf_remappedPS[0].y);
tint.z = intBitsToFloat(uf_remappedPS[0].z);
tint.w = intBitsToFloat(uf_remappedPS[0].w);

// get luminance of tint: removes color, keeps intended brightness
float tintLuminance = dot(tint.xyz, vec3(0.299, 0.587, 0.114)); // percieved approximation

// apply custom tint color
tint.x = mixf(tintLuminance, tint.x, $bloom_tint_strength);
tint.y = mixf(tintLuminance, tint.y, $bloom_tint_strength);
tint.z = mixf(tintLuminance, tint.z, $bloom_tint_strength);

// apply tint on mask
vec4 outColor = vec4(0.0);
outColor.x = mask.x * tint.x;
outColor.y = mask.y * tint.y;
outColor.z = mask.z * tint.z;

// custom brightness reduction, only in shadow world below 1.0
outColor.w = mixf(1.0, tint.w, $shadow_world_darkening);

// export
passPixelColor0 = vec4(outColor.x, outColor.y, outColor.z, outColor.w);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140)
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation)
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.z, 1.0/gl_FragCoord.w)

layout(set = 1, binding = 1) uniform ufBlock
{
uniform ivec4 uf_remappedPS[1]; // grading
};

#else
#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location)
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140)
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation)
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw)

uniform ivec4 uf_remappedPS[1]; // grading

#endif


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140)
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation)
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.z, 1.0/gl_FragCoord.w)

#else
#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location)
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140)
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation)
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw)

#endif

#ifdef VULKAN
Expand All @@ -26,11 +26,11 @@
uniform ivec4 uf_remappedPS[1]; // mask threshold
uniform vec4 uf_fragCoordScale;
};

#else
uniform ivec4 uf_remappedPS[1]; // mask threshold
uniform vec2 uf_fragCoordScale;

#endif

TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0; // frame
Expand All @@ -42,26 +42,26 @@ void main()
// get mask threshold data
float cutoff = intBitsToFloat(uf_remappedPS[0].x); // ~0.39: 0-1, higher = less glowing pixels
float contrast = intBitsToFloat(uf_remappedPS[0].y); // 4.5: higher = sharper edges

// get texture coordinate of this pixel
vec4 coord = GET_FRAGCOORD();
coord.x = coord.x * intBitsToFloat(0x3b088889); // align to scale/grid?
coord.y = coord.y * intBitsToFloat(0x3b72b9d6);

// get color of this pixel
vec3 color = texture(textureUnitPS0, vec2(coord.x, coord.y)).xyz;

// calculate luminance = percieved brightness
float luminance = dot(color, vec3(0.299, 0.587, 0.114)); // percieved approximation

// apply threshold, removes dark areas from the mask
luminance = contrast * (luminance - cutoff) * $bloom_strength; // apply custom strength

// apply to color and clamp
color.x = clamp(luminance * color.x, 0.0, 1.0);
color.y = clamp(luminance * color.y, 0.0, 1.0);
color.z = clamp(luminance * color.z, 0.0, 1.0);

// export
passPixelColor0 = vec4(color.x, color.y, color.z, 0.0);
}
Loading