mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-11-23 18:19:16 +01:00
908ab8acdc
Splitted Super Mario 3D World and Captain Toad: Treasure Tracker as both are getting their own shaders. Both are partial due to mips which are hard to scale and due to the rarity of some of the bloom shaders (only in the latest world. Might fix them later but they're awfully long and weird)
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
// shader 4102408f48cb6b94
|
|
// Used for: Vertical Blur 1
|
|
const float blurFactor = 1.0; //Higher is less blur
|
|
|
|
// Implementation of http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;
|
|
layout(location = 0) in vec4 passParameterSem0;
|
|
layout(location = 0) out vec4 passPixelColor0;
|
|
|
|
// Calculated with BlurNinja with as parameters: --expand 4 --reduce 4 17 --linear
|
|
uniform float weight[] = float[](0.16122494, 0.26575540, 0.12180456, 0.02865990, 0.00316767);
|
|
uniform float offset[] = float[](0.00000000, 1.44000000, 3.36000000, 5.28000000, 7.20000000);
|
|
|
|
ivec2 inputRes = textureSize(textureUnitPS0, 0);
|
|
vec2 outputRes = vec2(float(inputRes.x), float(inputRes.y));
|
|
vec2 scale = outputRes * blurFactor;
|
|
void main()
|
|
{
|
|
vec2 R0f = vec2(passParameterSem0.x, passParameterSem0.w);
|
|
vec4 R1f = texture(textureUnitPS0, R0f) * weight[0];
|
|
for (int i = 1; i<4; i++) {
|
|
R1f += texture(textureUnitPS0, R0f + (vec2(0.0, offset[i]) / scale)) * weight[i];
|
|
R1f += texture(textureUnitPS0, R0f - (vec2(0.0, offset[i]) / scale)) * weight[i];
|
|
}
|
|
passPixelColor0 = R1f;
|
|
} |