switch gameboy shader to use LUTs again

This commit is contained in:
hunterk 2016-08-02 12:32:59 -05:00
parent 46df8c20c6
commit e3767d39bc
17 changed files with 13 additions and 11 deletions

View file

@ -30,9 +30,9 @@ scale_type4 = source
scale4 = 1.0
alias4 = "PASS4"
//LUTs commented out until added to the spec
//textures = COLOR_PALETTE;BACKGROUND
//COLOR_PALETTE = resources/palette.png
//COLOR_PALETTE_linear = false
//BACKGROUND = resources/background.png
//BACKGROUND_linear = true
textures = COLOR_PALETTE;BACKGROUND
COLOR_PALETTE = resources/palette.png
COLOR_PALETTE_linear = false
BACKGROUND = resources/background.png
BACKGROUND_linear = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

View file

@ -97,12 +97,13 @@ layout(set = 0, binding = 6) uniform sampler2D OriginalHistory4;
layout(set = 0, binding = 7) uniform sampler2D OriginalHistory5;
layout(set = 0, binding = 8) uniform sampler2D OriginalHistory6;
layout(set = 0, binding = 9) uniform sampler2D OriginalHistory7;
layout(set = 0, binding = 10) uniform sampler2D COLOR_PALETTE;
////////////////////////////////////////////////////////////////////////////////
//fragment definitions //
////////////////////////////////////////////////////////////////////////////////
#define foreground_color vec3(0.11, 0.4141, 0.41) //tex2D(COLOR_PALETTE, fixed2(0.75, 0.5)).rgb //hardcoded to look up the foreground color from the right half of the palette image
#define foreground_color texture(COLOR_PALETTE, vec2(0.75, 0.5)).rgb //hardcoded to look up the foreground color from the right half of the palette image
//#define rgb_to_alpha(rgb) ( ((rgb.r + rgb.g + rgb.b) / 3.0) + (is_on_dot * vec2(baseline_alpha), 1.0) ) //averages rgb values (allows it to work with color games), modified for contrast and base alpha
@ -144,7 +145,7 @@ void main()
// Overlay the matrix
// If the fragment is not on a dot, set its alpha value to 0
out_color.a *= is_on_dot;
out_color.a *= is_on_dot;
FragColor = out_color;
}

View file

@ -93,9 +93,10 @@ layout(location = 1) in vec2 texel;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 1) uniform sampler2D Source;
layout(set = 0, binding = 2) uniform sampler2D PassOutput1;
layout(set = 0, binding = 3) uniform sampler2D BACKGROUND;
layout(set = 0, binding = 4) uniform sampler2D COLOR_PALETTE;
//#define bg_color tex2D(COLOR_PALETTE, vec2(0.25, 0.5))
#define bg_color vec4(0.625, 0.664, 0.25, 0.5)
#define bg_color texture(COLOR_PALETTE, vec2(0.25, 0.5))
// Sample the background color from the palette
#define shadow_alpha (contrast * shadow_opacity)
@ -117,7 +118,7 @@ void main()
// Sample all the relevant textures
vec4 foreground = texture(PassOutput1, tex - screen_offset);
vec4 background = vec4(0.5); // Hardcoded value rather than LUT
vec4 background = texture(BACKGROUND, vTexCoord);
vec4 shadows = texture(Source, vTexCoord - (shadow_offset + screen_offset));
vec4 background_color = bg_color;