switch gameboy shader to use LUTs again
|
@ -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
|
BIN
handheld/gameboy/resources/background.png
Normal file
After Width: | Height: | Size: 534 KiB |
BIN
handheld/gameboy/resources/palette.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
handheld/gameboy/resources/sample-bgs/dmg-bg.png
Normal file
After Width: | Height: | Size: 1.9 MiB |
BIN
handheld/gameboy/resources/sample-bgs/grainy-bg.png
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
handheld/gameboy/resources/sample-bgs/paper-bg.png
Normal file
After Width: | Height: | Size: 548 KiB |
BIN
handheld/gameboy/resources/sample-palettes/b-w-palette.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
handheld/gameboy/resources/sample-palettes/dmg-palette-0.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
handheld/gameboy/resources/sample-palettes/dmg-palette-1.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
handheld/gameboy/resources/sample-palettes/dmg-palette-2.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
handheld/gameboy/resources/sample-palettes/gblight-palette-1.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
handheld/gameboy/resources/sample-palettes/gblight-palette-2.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
handheld/gameboy/resources/sample-palettes/gblight-palette-3.png
Normal file
After Width: | Height: | Size: 478 B |
BIN
handheld/gameboy/resources/sample-palettes/gblight-palette.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
handheld/gameboy/resources/sample-palettes/gbp-palette.png
Normal file
After Width: | Height: | Size: 441 B |
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|