Fix handheld shader composition after viewport passes (#569)

This commit is contained in:
fishcu authored and GitHub committed 2026-09-15 21:44:36 -05:00
1 parent 235448f244
commit 1bf3eb49bf
83 files changed
+527 -175

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "ConsoleBorderGameBoyDotMatrixAlphaBlend"
shader2 = shader-files/gb-pass2.glsl
filter_linear2 = false
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -1,6 +1,7 @@
shaders = 6
shader0 = shader-files/gb-pass0.glsl
shader1 = ../shaders/gameboy/shader-files/gb-pass1.glsl
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = ../shaders/gameboy/shader-files/gb-pass2.glsl
shader3 = ../shaders/gameboy/shader-files/gb-pass3.glsl
shader4 = ../shaders/gameboy/shader-files/gb-pass4.glsl
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gba-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/gba-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "2.0"
SCALE = "1.0"
OUT_X = "1600.0"
OUT_Y = "800.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gba-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/gba-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "3.0"
SCALE = "1.0"
OUT_X = "2400.0"
OUT_Y = "1200.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gba-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/gba-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "4.0"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gba-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/gba-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "5.0"
SCALE = "1.0"
OUT_X = "4000.0"
OUT_Y = "2000.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gba-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/gba-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "6.0"
SCALE = "1.0"
OUT_X = "4800.0"
OUT_Y = "2400.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gbc-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/color-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "2.0"
SCALE = "1.0"
OUT_X = "1600.0"
OUT_Y = "800.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gbc-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/color-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "3.0"
SCALE = "1.0"
OUT_X = "2400.0"
OUT_Y = "1200.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gbc-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/color-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "4.0"
SCALE = "1.0"
OUT_X = "3200.0"
OUT_Y = "1600.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gbc-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/color-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "5.0"
SCALE = "1.0"
OUT_X = "4000.0"
OUT_Y = "2000.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gbc-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/color-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "6.0"
SCALE = "1.0"
OUT_X = "4800.0"
OUT_Y = "2400.0"
@@ -2,7 +2,7 @@ shaders = 4
shader0 = ../../motionblur/shaders/response-time.glsl
shader1 = ../shaders/lcd-cgwg/lcd-grid-v2.glsl
shader2 = ../shaders/color/gbc-color.glsl
shader3 = shader-files/gb-pass-5.glsl
shader3 = shader-files/gb-pass-5-original-size.glsl
scale_type0 = source
scale0 = 1
@@ -23,7 +23,8 @@ textures = BORDER
BORDER = resources/color-border-square-4x.png
BORDER_linear = true
parameters = "SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
parameters = "video_scale;SCALE;OUT_X;OUT_Y;RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR"
video_scale = "7.0"
SCALE = "1.0"
OUT_X = "5600.0"
OUT_Y = "2800.0"
@@ -0,0 +1,116 @@
// Parameter lines go here:
#pragma parameter SCALE "Box Scale" 0.6667 0.6667 1.5 0.33333
#pragma parameter OUT_X "Out X" 1600.0 1600.0 4800.0 8000.0
#pragma parameter OUT_Y "Out Y" 800.0 800.0 2400.0 400.0
#pragma parameter video_scale "Video Scale" 3.0 2.0 20.0 1.0
#if defined(VERTEX)
#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#define COMPAT_ATTRIBUTE attribute
#define COMPAT_TEXTURE texture2D
#endif
#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 COLOR;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 COL0;
COMPAT_VARYING vec4 TEX0;
uniform mat4 MVPMatrix;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
COMPAT_VARYING vec2 tex_border;
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#ifdef PARAMETER_UNIFORM
// All parameter floats need to have COMPAT_PRECISION in front of them
uniform COMPAT_PRECISION float SCALE;
uniform COMPAT_PRECISION float OUT_X;
uniform COMPAT_PRECISION float OUT_Y;
uniform COMPAT_PRECISION float video_scale;
#else
#define SCALE 0.66667
#define OUT_X 1600.0
#define OUT_Y 800.0
#define video_scale 3.0
#endif
void main()
{
gl_Position = MVPMatrix * VertexCoord;
vec2 scale = (OutputSize.xy / (OrigInputSize.xy * video_scale)) / SCALE;
vec2 middle = vec2(0.5, 0.5) * InputSize.xy / TextureSize.xy;
vec2 diff = TexCoord.xy - middle;
TEX0.xy = middle + diff * scale;
middle = vec2(0.5, 0.5);
tex_border = TEX0.xy * (TextureSize.xy / InputSize.xy);
vec2 dist = tex_border - middle;
tex_border = middle + dist * OutputSize.xy / vec2(OUT_X, OUT_Y) / scale;
}
#elif defined(FRAGMENT)
#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#endif
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform sampler2D Texture;
uniform sampler2D BORDER;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec2 tex_border;
// compatibility #defines
#define Source Texture
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
vec4 frame = COMPAT_TEXTURE(Source, vTexCoord).rgba;
vec4 border = COMPAT_TEXTURE(BORDER, tex_border).rgba;
FragColor = vec4(mix(frame, border, border.a));
}
#endif
@@ -73,6 +73,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float baseline_alpha;
@@ -105,12 +106,13 @@ uniform COMPAT_PRECISION float video_scale;
void main()
{
vec2 scaled_video_out = (InputSize.xy * vec2(video_scale));
vec2 scaled_video_out = (OrigInputSize.xy * vec2(video_scale));
vec2 original_texel = InputSize.xy / (TextureSize.xy * OrigInputSize.xy);
// Remaps position to integer scaled output
gl_Position = MVPMatrix * VertexCoord / vec4( vec2(outsize.xy / scaled_video_out), 1.0, 1.0 );
TEX0.xy = TexCoord.xy + half_pixel;
dot_size = SourceSize.zw;
one_texel = 1.0 / (SourceSize.xy * video_scale);
dot_size = original_texel;
one_texel = original_texel / video_scale;
}
#elif defined(FRAGMENT)
@@ -144,6 +146,21 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform sampler2D Texture;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D PrevTexture;
@@ -181,14 +198,16 @@ uniform COMPAT_PRECISION float video_scale;
// Frame sampling definitions
#define active_coord (vTexCoord * TextureSize.xy / InputSize.xy)
#define history_coord(input_size, texture_size) (all(equal(InputSize, OrigInputSize)) ? vTexCoord : active_coord * input_size / texture_size)
#define curr_rgb abs(1.0 - COMPAT_TEXTURE(Source, vTexCoord).rgb)
#define prev0_rgb abs(1.0 - COMPAT_TEXTURE(PrevTexture, vTexCoord).rgb)
#define prev1_rgb abs(1.0 - COMPAT_TEXTURE(Prev1Texture, vTexCoord).rgb)
#define prev2_rgb abs(1.0 - COMPAT_TEXTURE(Prev2Texture, vTexCoord).rgb)
#define prev3_rgb abs(1.0 - COMPAT_TEXTURE(Prev3Texture, vTexCoord).rgb)
#define prev4_rgb abs(1.0 - COMPAT_TEXTURE(Prev4Texture, vTexCoord).rgb)
#define prev5_rgb abs(1.0 - COMPAT_TEXTURE(Prev5Texture, vTexCoord).rgb)
#define prev6_rgb abs(1.0 - COMPAT_TEXTURE(Prev6Texture, vTexCoord).rgb)
#define prev0_rgb abs(1.0 - COMPAT_TEXTURE(PrevTexture, history_coord(PrevInputSize.xy, PrevTextureSize.xy)).rgb)
#define prev1_rgb abs(1.0 - COMPAT_TEXTURE(Prev1Texture, history_coord(Prev1InputSize.xy, Prev1TextureSize.xy)).rgb)
#define prev2_rgb abs(1.0 - COMPAT_TEXTURE(Prev2Texture, history_coord(Prev2InputSize.xy, Prev2TextureSize.xy)).rgb)
#define prev3_rgb abs(1.0 - COMPAT_TEXTURE(Prev3Texture, history_coord(Prev3InputSize.xy, Prev3TextureSize.xy)).rgb)
#define prev4_rgb abs(1.0 - COMPAT_TEXTURE(Prev4Texture, history_coord(Prev4InputSize.xy, Prev4TextureSize.xy)).rgb)
#define prev5_rgb abs(1.0 - COMPAT_TEXTURE(Prev5Texture, history_coord(Prev5InputSize.xy, Prev5TextureSize.xy)).rgb)
#define prev6_rgb abs(1.0 - COMPAT_TEXTURE(Prev6Texture, history_coord(Prev6InputSize.xy, Prev6TextureSize.xy)).rgb)
void main()
{
@@ -1,3 +1,5 @@
#pragma name ConsoleBorderGameBoyDotMatrixAlphaBlend
///////////////////////////////////////////////////////////////////////////
// //
// Gameboy Classic Shader v0.2.2 //
@@ -133,10 +133,12 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 ConsoleBorderGameBoyDotMatrixAlphaBlendTextureSize;
uniform COMPAT_PRECISION vec2 ConsoleBorderGameBoyDotMatrixAlphaBlendInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D Pass2Texture;
uniform sampler2D ConsoleBorderGameBoyDotMatrixAlphaBlendTexture;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec2 texel;
@@ -186,12 +188,12 @@ uniform COMPAT_PRECISION float screen_offset_y;
void main()
{
// vec2 tex = floor(outsize.xy * vTexCoord);
// tex = (tex + 0.5) * outsize.zw;
vec2 tex = vTexCoord.xy;
vec2 active_coord = vTexCoord * TextureSize.xy / InputSize.xy;
vec2 tex = floor(ConsoleBorderGameBoyDotMatrixAlphaBlendInputSize * active_coord);
tex = (tex + 0.5) / ConsoleBorderGameBoyDotMatrixAlphaBlendTextureSize;
// Sample all the relevant textures
vec4 foreground = COMPAT_TEXTURE(Pass2Texture, tex - screen_offset);
vec4 foreground = COMPAT_TEXTURE(ConsoleBorderGameBoyDotMatrixAlphaBlendTexture, tex - screen_offset);
vec4 background = COMPAT_TEXTURE(BACKGROUND, vTexCoord);
vec4 shadows = COMPAT_TEXTURE(Source, vTexCoord - (shadow_offset + screen_offset));
vec4 background_color = bg_color;
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shaders/gameboy/shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = shaders/gameboy/shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shaders/gameboy/shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = shaders/gameboy/shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -10,7 +10,7 @@ shader1 = shaders/gameboy/shader-files/gb-pass1.glsl
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
shader2 = shaders/gameboy/shader-files/gb-pass2.glsl
filter_linear2 = false
+1 -1
View File
@@ -13,7 +13,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -13,7 +13,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -13,7 +13,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -13,7 +13,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -13,7 +13,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -16,7 +16,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -16,7 +16,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+1 -1
View File
@@ -16,7 +16,7 @@ shader1 = "shaders/gameboy-dm-color/gb-pass1.glsl"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "PASS1"
alias1 = "GameBoyDotMatrixAlphaBlend"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
+4 -1
View File
@@ -96,6 +96,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -134,7 +135,9 @@ vec3 bevel(vec2 pos, vec3 color)
void main()
{
vec2 position = fract(vTexCoord*SourceSize.xy);
vec2 position = fract(vTexCoord * SourceSize.xy);
if (any(notEqual(InputSize, OrigInputSize)))
position = fract(vTexCoord * TextureSize.xy / InputSize.xy * OrigInputSize.xy);
vec3 color = GAMMA_IN(COMPAT_TEXTURE(Source, vTexCoord).rgb);
@@ -60,6 +60,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float baseline_alpha;
@@ -85,8 +86,8 @@ uniform COMPAT_PRECISION float console_border_enable;
void main()
{
// Ensure proper scale calculation
float scale_x = max(outsize.x / InputSize.x, 1.0);
float scale_y = max(outsize.y / InputSize.y, 1.0);
float scale_x = max(outsize.x / OrigInputSize.x, 1.0);
float scale_y = max(outsize.y / OrigInputSize.y, 1.0);
float video_scale_factor = max(scale_x, scale_y);
// Override video scale factor if border is enabled
@@ -95,7 +96,8 @@ void main()
}
// Compute the final output scaling
vec2 scaled_video_out = InputSize.xy * vec2(video_scale_factor);
vec2 scaled_video_out = OrigInputSize.xy * vec2(video_scale_factor);
vec2 original_texel = InputSize.xy / (TextureSize.xy * OrigInputSize.xy);
// Assign vertex transformation and attributes
gl_Position = MVPMatrix * VertexCoord;
@@ -103,8 +105,8 @@ void main()
TEX0.xy = TexCoord.xy + half_pixel;
// Define texel size based on final scale
dot_size = SourceSize.zw;
one_texel = 1.0 / (SourceSize.xy * video_scale_factor);
dot_size = original_texel;
one_texel = original_texel / video_scale_factor;
}
#elif defined(FRAGMENT)
@@ -139,6 +141,21 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform sampler2D Texture;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D PrevTexture;
@@ -157,6 +174,7 @@ COMPAT_VARYING vec2 one_texel;
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#define history_coord(input_size, texture_size) (all(equal(InputSize, OrigInputSize)) ? TEX0.xy : active_coord * input_size / texture_size)
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float baseline_alpha;
@@ -189,13 +207,14 @@ void main()
// Apply response time smoothing with a decreasing impact of each previous frame
float base_factor = pow(response_time, 2.0); // Adjust the exponent for a smoother curve
input_rgb += (COMPAT_TEXTURE(PrevTexture, TEX0.xy).rgb - input_rgb) * response_time;
input_rgb += (COMPAT_TEXTURE(Prev1Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.5;
input_rgb += (COMPAT_TEXTURE(Prev2Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.25;
input_rgb += (COMPAT_TEXTURE(Prev3Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.125;
input_rgb += (COMPAT_TEXTURE(Prev4Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.0625;
input_rgb += (COMPAT_TEXTURE(Prev5Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.03125;
input_rgb += (COMPAT_TEXTURE(Prev6Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.015625;
vec2 active_coord = TEX0.xy * TextureSize.xy / InputSize.xy;
input_rgb += (COMPAT_TEXTURE(PrevTexture, history_coord(PrevInputSize.xy, PrevTextureSize.xy)).rgb - input_rgb) * response_time;
input_rgb += (COMPAT_TEXTURE(Prev1Texture, history_coord(Prev1InputSize.xy, Prev1TextureSize.xy)).rgb - input_rgb) * base_factor * 0.5;
input_rgb += (COMPAT_TEXTURE(Prev2Texture, history_coord(Prev2InputSize.xy, Prev2TextureSize.xy)).rgb - input_rgb) * base_factor * 0.25;
input_rgb += (COMPAT_TEXTURE(Prev3Texture, history_coord(Prev3InputSize.xy, Prev3TextureSize.xy)).rgb - input_rgb) * base_factor * 0.125;
input_rgb += (COMPAT_TEXTURE(Prev4Texture, history_coord(Prev4InputSize.xy, Prev4TextureSize.xy)).rgb - input_rgb) * base_factor * 0.0625;
input_rgb += (COMPAT_TEXTURE(Prev5Texture, history_coord(Prev5InputSize.xy, Prev5TextureSize.xy)).rgb - input_rgb) * base_factor * 0.03125;
input_rgb += (COMPAT_TEXTURE(Prev6Texture, history_coord(Prev6InputSize.xy, Prev6TextureSize.xy)).rgb - input_rgb) * base_factor * 0.015625;
// Calculate the alpha based on the weighted input RGB
float rgb_to_alpha = (input_rgb.r + input_rgb.g + input_rgb.b) / 3.0 + (is_on_dot * baseline_alpha);
+31 -12
View File
@@ -60,6 +60,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float baseline_alpha;
@@ -85,18 +86,19 @@ uniform COMPAT_PRECISION float console_border_enable;
void main()
{
float scale_x = floor(outsize.x / InputSize.x);
float scale_y = floor(outsize.y / InputSize.y);
float scale_x = floor(outsize.x / OrigInputSize.x);
float scale_y = floor(outsize.y / OrigInputSize.y);
float video_scale_factor = min(scale_x, scale_y);
if (console_border_enable > 0.5) {
video_scale_factor = video_scale;
}
vec2 scaled_video_out = InputSize.xy * vec2(video_scale_factor);
vec2 scaled_video_out = OrigInputSize.xy * vec2(video_scale_factor);
vec2 original_texel = InputSize.xy / (TextureSize.xy * OrigInputSize.xy);
gl_Position = MVPMatrix * VertexCoord / vec4(outsize.xy / scaled_video_out, 1.0, 1.0);
COL0 = COLOR;
TEX0.xy = TexCoord.xy + half_pixel;
dot_size = SourceSize.zw;
one_texel = 1.0 / (SourceSize.xy * video_scale_factor);
dot_size = original_texel;
one_texel = original_texel / video_scale_factor;
}
#elif defined(FRAGMENT)
@@ -131,6 +133,21 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform sampler2D Texture;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D PrevTexture;
@@ -149,6 +166,7 @@ COMPAT_VARYING vec2 one_texel;
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#define history_coord(input_size, texture_size) (all(equal(InputSize, OrigInputSize)) ? TEX0.xy : active_coord * input_size / texture_size)
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float baseline_alpha;
@@ -181,13 +199,14 @@ void main()
// Apply response time smoothing with a decreasing impact of each previous frame
float base_factor = pow(response_time, 2.0); // Adjust the exponent for a smoother curve
input_rgb += (COMPAT_TEXTURE(PrevTexture, TEX0.xy).rgb - input_rgb) * response_time;
input_rgb += (COMPAT_TEXTURE(Prev1Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.5;
input_rgb += (COMPAT_TEXTURE(Prev2Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.25;
input_rgb += (COMPAT_TEXTURE(Prev3Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.125;
input_rgb += (COMPAT_TEXTURE(Prev4Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.0625;
input_rgb += (COMPAT_TEXTURE(Prev5Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.03125;
input_rgb += (COMPAT_TEXTURE(Prev6Texture, TEX0.xy).rgb - input_rgb) * base_factor * 0.015625;
vec2 active_coord = TEX0.xy * TextureSize.xy / InputSize.xy;
input_rgb += (COMPAT_TEXTURE(PrevTexture, history_coord(PrevInputSize.xy, PrevTextureSize.xy)).rgb - input_rgb) * response_time;
input_rgb += (COMPAT_TEXTURE(Prev1Texture, history_coord(Prev1InputSize.xy, Prev1TextureSize.xy)).rgb - input_rgb) * base_factor * 0.5;
input_rgb += (COMPAT_TEXTURE(Prev2Texture, history_coord(Prev2InputSize.xy, Prev2TextureSize.xy)).rgb - input_rgb) * base_factor * 0.25;
input_rgb += (COMPAT_TEXTURE(Prev3Texture, history_coord(Prev3InputSize.xy, Prev3TextureSize.xy)).rgb - input_rgb) * base_factor * 0.125;
input_rgb += (COMPAT_TEXTURE(Prev4Texture, history_coord(Prev4InputSize.xy, Prev4TextureSize.xy)).rgb - input_rgb) * base_factor * 0.0625;
input_rgb += (COMPAT_TEXTURE(Prev5Texture, history_coord(Prev5InputSize.xy, Prev5TextureSize.xy)).rgb - input_rgb) * base_factor * 0.03125;
input_rgb += (COMPAT_TEXTURE(Prev6Texture, history_coord(Prev6InputSize.xy, Prev6TextureSize.xy)).rgb - input_rgb) * base_factor * 0.015625;
// Calculate the alpha based on the weighted input RGB
float rgb_to_alpha = (input_rgb.r + input_rgb.g + input_rgb.b) / 3.0 + (is_on_dot * baseline_alpha);
@@ -1,3 +1,5 @@
#pragma name GameBoyDotMatrixAlphaBlend
///////////////////////////////////////////////////////////////////////////
// //
// Gameboy Color Dot Matrix v0.9 //
@@ -133,10 +133,12 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 GameBoyDotMatrixAlphaBlendTextureSize;
uniform COMPAT_PRECISION vec2 GameBoyDotMatrixAlphaBlendInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D Pass2Texture;
uniform sampler2D GameBoyDotMatrixAlphaBlendTexture;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec2 texel;
@@ -186,12 +188,12 @@ uniform COMPAT_PRECISION float screen_offset_y;
void main()
{
// vec2 tex = floor(outsize.xy * vTexCoord);
// tex = (tex + 0.5) * outsize.zw;
vec2 tex = vTexCoord.xy;
vec2 active_coord = vTexCoord * TextureSize.xy / InputSize.xy;
vec2 tex = floor(GameBoyDotMatrixAlphaBlendInputSize * active_coord);
tex = (tex + 0.5) / GameBoyDotMatrixAlphaBlendTextureSize;
// Sample all the relevant textures
vec4 foreground = COMPAT_TEXTURE(Pass2Texture, tex - screen_offset);
vec4 foreground = COMPAT_TEXTURE(GameBoyDotMatrixAlphaBlendTexture, tex - screen_offset);
vec4 background = COMPAT_TEXTURE(BACKGROUND, vTexCoord);
vec4 shadows = COMPAT_TEXTURE(Source, vTexCoord - (shadow_offset + screen_offset));
vec4 background_color = bg_color;
@@ -76,6 +76,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float baseline_alpha;
@@ -110,15 +111,16 @@ uniform COMPAT_PRECISION float video_scale;
void main()
{
float video_scale_factor = floor(outsize.y / InputSize.y);
float video_scale_factor = floor(outsize.y / OrigInputSize.y);
if (console_border_enable > 0.5) video_scale_factor = video_scale;
vec2 scaled_video_out = (InputSize.xy * vec2(video_scale_factor));
vec2 scaled_video_out = (OrigInputSize.xy * vec2(video_scale_factor));
vec2 original_texel = InputSize.xy / (TextureSize.xy * OrigInputSize.xy);
// Remaps position to integer scaled output
gl_Position = MVPMatrix * VertexCoord / vec4( vec2(outsize.xy / scaled_video_out), 1.0, 1.0 );
COL0 = COLOR;
TEX0.xy = TexCoord.xy + half_pixel;
dot_size = SourceSize.zw;
one_texel = 1.0 / (SourceSize.xy * video_scale_factor);
dot_size = original_texel;
one_texel = original_texel / video_scale_factor;
}
#elif defined(FRAGMENT)
@@ -152,6 +154,21 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform sampler2D Texture;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D PrevTexture;
@@ -189,14 +206,16 @@ uniform COMPAT_PRECISION float video_scale;
// Frame sampling definitions
#define active_coord (vTexCoord * TextureSize.xy / InputSize.xy)
#define history_coord(input_size, texture_size) (all(equal(InputSize, OrigInputSize)) ? vTexCoord : active_coord * input_size / texture_size)
#define curr_rgb abs(1.0 - COMPAT_TEXTURE(Source, vTexCoord).rgb)
#define prev0_rgb abs(1.0 - COMPAT_TEXTURE(PrevTexture, vTexCoord).rgb)
#define prev1_rgb abs(1.0 - COMPAT_TEXTURE(Prev1Texture, vTexCoord).rgb)
#define prev2_rgb abs(1.0 - COMPAT_TEXTURE(Prev2Texture, vTexCoord).rgb)
#define prev3_rgb abs(1.0 - COMPAT_TEXTURE(Prev3Texture, vTexCoord).rgb)
#define prev4_rgb abs(1.0 - COMPAT_TEXTURE(Prev4Texture, vTexCoord).rgb)
#define prev5_rgb abs(1.0 - COMPAT_TEXTURE(Prev5Texture, vTexCoord).rgb)
#define prev6_rgb abs(1.0 - COMPAT_TEXTURE(Prev6Texture, vTexCoord).rgb)
#define prev0_rgb abs(1.0 - COMPAT_TEXTURE(PrevTexture, history_coord(PrevInputSize.xy, PrevTextureSize.xy)).rgb)
#define prev1_rgb abs(1.0 - COMPAT_TEXTURE(Prev1Texture, history_coord(Prev1InputSize.xy, Prev1TextureSize.xy)).rgb)
#define prev2_rgb abs(1.0 - COMPAT_TEXTURE(Prev2Texture, history_coord(Prev2InputSize.xy, Prev2TextureSize.xy)).rgb)
#define prev3_rgb abs(1.0 - COMPAT_TEXTURE(Prev3Texture, history_coord(Prev3InputSize.xy, Prev3TextureSize.xy)).rgb)
#define prev4_rgb abs(1.0 - COMPAT_TEXTURE(Prev4Texture, history_coord(Prev4InputSize.xy, Prev4TextureSize.xy)).rgb)
#define prev5_rgb abs(1.0 - COMPAT_TEXTURE(Prev5Texture, history_coord(Prev5InputSize.xy, Prev5TextureSize.xy)).rgb)
#define prev6_rgb abs(1.0 - COMPAT_TEXTURE(Prev6Texture, history_coord(Prev6InputSize.xy, Prev6TextureSize.xy)).rgb)
void main()
{
@@ -1,3 +1,5 @@
#pragma name GameBoyDotMatrixAlphaBlend
///////////////////////////////////////////////////////////////////////////
// //
// Gameboy Classic Shader v0.2.2 //
@@ -133,10 +133,12 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 GameBoyDotMatrixAlphaBlendTextureSize;
uniform COMPAT_PRECISION vec2 GameBoyDotMatrixAlphaBlendInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
uniform sampler2D COLOR_PALETTE;
uniform sampler2D Pass2Texture;
uniform sampler2D GameBoyDotMatrixAlphaBlendTexture;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec2 texel;
@@ -186,12 +188,12 @@ uniform COMPAT_PRECISION float screen_offset_y;
void main()
{
// vec2 tex = floor(outsize.xy * vTexCoord);
// tex = (tex + 0.5) * outsize.zw;
vec2 tex = vTexCoord.xy;
vec2 active_coord = vTexCoord * TextureSize.xy / InputSize.xy;
vec2 tex = floor(GameBoyDotMatrixAlphaBlendInputSize * active_coord);
tex = (tex + 0.5) / GameBoyDotMatrixAlphaBlendTextureSize;
// Sample all the relevant textures
vec4 foreground = COMPAT_TEXTURE(Pass2Texture, tex - screen_offset);
vec4 foreground = COMPAT_TEXTURE(GameBoyDotMatrixAlphaBlendTexture, tex - screen_offset);
vec4 background = COMPAT_TEXTURE(BACKGROUND, vTexCoord);
vec4 shadows = COMPAT_TEXTURE(Source, vTexCoord - (shadow_offset + screen_offset));
vec4 background_color = bg_color;
+4 -2
View File
@@ -84,6 +84,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -129,7 +130,8 @@ uniform COMPAT_PRECISION float BGR;
#define BGR 0
#endif
#define fetch_offset(coord, offset) (pow(vec3(gain) * texelFetchOffset(Source, (coord), 0, (offset)).rgb + vec3(blacklevel), vec3(gamma)) + vec3(ambient))
#define OriginalTexelSize (InputSize.xy / (TextureSize.xy * OrigInputSize.xy))
#define fetch_offset(coord, offset) (pow(vec3(gain) * COMPAT_TEXTURE(Source, (vec2((coord) + (offset)) + 0.5) * OriginalTexelSize).rgb + vec3(blacklevel), vec3(gamma)) + vec3(ambient))
// integral of (1 - x^2 - x^4 + x^6)^2
float coeffs_x[7] = float[](1.0, -2.0/3.0, -1.0/5.0, 4.0/7.0, -1.0/9.0, -2.0/11.0, 1.0/13.0);
@@ -157,7 +159,7 @@ float intsmear(float x, float dx, float d, float coeffs[7])
void main()
{
vec2 texelSize = SourceSize.zw;
vec2 texelSize = OriginalTexelSize;
/* float2 range = IN.video_size / (IN.output_size * IN.texture_size); */
vec2 range = InputSize.xy / (OutputSize.xy * TextureSize.xy);//outsize.zw;
+3 -1
View File
@@ -68,6 +68,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -106,10 +107,11 @@ float intsmear(float x, float dx)
#define round(x) floor( (x) + 0.5 )
#define TEX2D(c) pow(COMPAT_TEXTURE(Source, (c)), vec4(gamma))
#define OriginalTexelSize (InputSize.xy / (TextureSize.xy * OrigInputSize.xy))
void main()
{
vec2 texelSize = 1.0 / TextureSize.xy;
vec2 texelSize = OriginalTexelSize;
vec2 subtexelSize = texelSize / vec2(3.0,1.0);
vec2 range;
range = InputSize.xy / (OutputSize.xy * TextureSize.xy);
+49 -14
View File
@@ -70,6 +70,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
void main()
{
vec2 _oTexCoord;
@@ -79,15 +80,28 @@ void main()
_r0011 = _r0011 + VertexCoord.y*MVPMatrix[1];
_r0011 = _r0011 + VertexCoord.z*MVPMatrix[2];
_r0011 = _r0011 + VertexCoord.w*MVPMatrix[3];
_x0013 = OutputSize.y/InputSize.y;
_TMP2 = floor(_x0013);
_TMP7 = OutputSize/(InputSize*_TMP2);
if (any(notEqual(InputSize, OrigInputSize)))
{
_x0013 = OutputSize.y/OrigInputSize.y;
_TMP2 = floor(_x0013);
_TMP7 = OutputSize/(OrigInputSize*_TMP2);
_x0015 = OutputSize.y/OrigInputSize.y;
_TMP3 = floor(_x0015);
_TMP6._cell_height = float((InputSize.y/(TextureSize.y*OrigInputSize.y)));
_TMP6._texel_height = float((_TMP6._cell_height/_TMP3));
}
else
{
_x0013 = OutputSize.y/InputSize.y;
_TMP2 = floor(_x0013);
_TMP7 = OutputSize/(InputSize*_TMP2);
_x0015 = OutputSize.y/InputSize.y;
_TMP3 = floor(_x0015);
_TMP6._cell_height = float((1.00000000E+00/TextureSize.y));
_TMP6._texel_height = float((1.00000000E+00/(TextureSize.y*_TMP3)));
}
_oPosition1 = _r0011/vec4(_TMP7.x, _TMP7.y, 1.00000000E+00, 1.00000000E+00);
_oTexCoord = TexCoord.xy + 5.00000000E-01/OutputSize;
_x0015 = OutputSize.y/InputSize.y;
_TMP3 = floor(_x0015);
_TMP6._cell_height = float((1.00000000E+00/TextureSize.y));
_TMP6._texel_height = float((1.00000000E+00/(TextureSize.y*_TMP3)));
_oLineData1._cell_height = _TMP6._cell_height;
_oLineData1._texel_height = _TMP6._texel_height;
gl_Position = _oPosition1;
@@ -187,11 +201,32 @@ uniform sampler2D Prev3Texture;
uniform sampler2D Prev2Texture;
uniform sampler2D Prev1Texture;
uniform sampler2D PrevTexture;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
vec2 get_history_coord(vec2 history_input_size, vec2 history_texture_size)
{
if (all(equal(InputSize, OrigInputSize)))
return TEX0.xy;
return TEX0.xy*TextureSize.xy/InputSize.xy*history_input_size/history_texture_size;
}
void main()
{
vec3 _input_dummy_rgb;
@@ -200,19 +235,19 @@ void main()
vec3 _TMP28;
_TMP0 = COMPAT_TEXTURE(Texture, TEX0.xy);
_input_dummy_rgb = vec3(float(_TMP0.x), float(_TMP0.y), float(_TMP0.z));
_TMP1 = COMPAT_TEXTURE(PrevTexture, TEX0.xy);
_TMP1 = COMPAT_TEXTURE(PrevTexture, get_history_coord(PrevInputSize.xy, PrevTextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP1.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.33000004E-01).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP1.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.33000004E-01).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP1.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.33000004E-01).z));
_TMP2 = COMPAT_TEXTURE(Prev1Texture, TEX0.xy);
_TMP2 = COMPAT_TEXTURE(Prev1Texture, get_history_coord(Prev1InputSize.xy, Prev1TextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP2.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.10889003E-01).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP2.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.10889003E-01).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP2.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.10889003E-01).z));
_TMP4 = COMPAT_TEXTURE(Prev2Texture, TEX0.xy);
_TMP4 = COMPAT_TEXTURE(Prev2Texture, get_history_coord(Prev2InputSize.xy, Prev2TextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP4.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.69260386E-02).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP4.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.69260386E-02).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP4.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*3.69260386E-02).z));
_TMP6 = COMPAT_TEXTURE(Prev3Texture, TEX0.xy);
_TMP6 = COMPAT_TEXTURE(Prev3Texture, get_history_coord(Prev3InputSize.xy, Prev3TextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP6.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.22963712E-02).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP6.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.22963712E-02).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP6.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.22963712E-02).z));
_TMP8 = COMPAT_TEXTURE(Prev4Texture, TEX0.xy);
_TMP8 = COMPAT_TEXTURE(Prev4Texture, get_history_coord(Prev4InputSize.xy, Prev4TextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP8.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.09469148E-03).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP8.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.09469148E-03).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP8.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.09469148E-03).z));
_TMP10 = COMPAT_TEXTURE(Prev5Texture, TEX0.xy);
_TMP10 = COMPAT_TEXTURE(Prev5Texture, get_history_coord(Prev5InputSize.xy, Prev5TextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP10.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.36353227E-03).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP10.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.36353227E-03).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP10.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*1.36353227E-03).z));
_TMP12 = COMPAT_TEXTURE(Prev6Texture, TEX0.xy);
_TMP12 = COMPAT_TEXTURE(Prev6Texture, get_history_coord(Prev6InputSize.xy, Prev6TextureSize.xy));
_input_dummy_rgb = vec3(float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP12.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.54056280E-04).x), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP12.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.54056280E-04).y), float((vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)) + (_TMP12.xyz - vec3(float(_input_dummy_rgb.x), float(_input_dummy_rgb.y), float(_input_dummy_rgb.z)))*4.54056280E-04).z));
_out_color = vec4(_input_dummy_rgb.x, _input_dummy_rgb.y, _input_dummy_rgb.z, 1.00000000E+00);
_b0047 = float(TEX1.x);
+2 -2
View File
@@ -100,7 +100,7 @@ vec3 _TMP27;
COMPAT_VARYING vec4 TEX0;
uniform sampler2D Texture;
uniform sampler2D Pass1Texture;
uniform sampler2D PassPrev2Texture;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
@@ -115,7 +115,7 @@ void main()
vec3 _TMP12;
_TMP0 = COMPAT_TEXTURE(Texture, TEX0.xy);
_lcd_color = vec4(float(_TMP0.x), float(_TMP0.y), float(_TMP0.z), float(_TMP0.w));
_TMP1 = COMPAT_TEXTURE(Pass1Texture, TEX0.xy);
_TMP1 = COMPAT_TEXTURE(PassPrev2Texture, TEX0.xy);
_input_dummy_color = vec4(float(_TMP1.x), float(_TMP1.y), float(_TMP1.z), float(_TMP1.w));
_TMP2 = COMPAT_TEXTURE(BACKGROUND, TEX0.xy);
_bg_color = vec4(float(_TMP2.x), float(_TMP2.y), float(_TMP2.z), float(_TMP2.w));
+3 -3
View File
@@ -156,7 +156,7 @@ COMPAT_VARYING vec4 TEX3;
COMPAT_VARYING vec4 TEX4;
uniform sampler2D Texture;
uniform sampler2D Pass1Texture;
uniform sampler2D PassPrev3Texture;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
@@ -188,10 +188,10 @@ void main()
_TMP5 = COMPAT_TEXTURE(Texture, _c0035);
_adjacent_texel_20019 = vec4(float(_TMP5.x), float(_TMP5.y), float(_TMP5.z), float(_TMP5.w));
_c0037 = vec2(float(_TMP20.x), float(_TMP20.y));
_TMP6 = COMPAT_TEXTURE(Pass1Texture, _c0037);
_TMP6 = COMPAT_TEXTURE(PassPrev3Texture, _c0037);
_adjacent_texel_30019 = vec4(float(_TMP6.x), float(_TMP6.y), float(_TMP6.z), float(_TMP6.w));
_c0039 = vec2(float(_TMP26.x), float(_TMP26.y));
_TMP7 = COMPAT_TEXTURE(Pass1Texture, _c0039);
_TMP7 = COMPAT_TEXTURE(PassPrev3Texture, _c0039);
_adjacent_texel_40019 = vec4(float(_TMP7.x), float(_TMP7.y), float(_TMP7.z), float(_TMP7.w));
_LCD_color0019 = ((_out_color.xyz - _adjacent_texel_10019.xyz) + (_out_color.xyz - _adjacent_texel_20019.xyz))*2.00195312E-01;
_original_color0019 = ((_out_color.xyz - _adjacent_texel_30019.xyz) + (_out_color.xyz - _adjacent_texel_40019.xyz))*2.00195312E-01;
+4 -2
View File
@@ -79,6 +79,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -92,6 +93,7 @@ COMPAT_VARYING vec4 TEX0;
void main()
{
vec4 color = COMPAT_TEXTURE(Source, vTexCoord);
vec2 original_coord = vTexCoord * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
vec3 arrayX[4];
arrayX[0] = vec3(1.0, 0.2, 0.2);
arrayX[1] = vec3(0.2, 1.0, 0.2);
@@ -104,7 +106,7 @@ void main()
arrayY[3] = vec3(0.8, 0.8, 0.8);
color.rgb = pow(color.rgb * vec3(0.8, 0.8, 0.8), vec3(1.8, 1.8, 1.8)) + vec3(0.16, 0.16, 0.16);
int colorX = int(mod(vTexCoord.s * SourceSize.x * 4.0, 4.0));
int colorX = int(mod(original_coord.x * 4.0, 4.0));
if (colorX == 0) {
color.rgb *= arrayX[0];
} else if (colorX == 1) {
@@ -115,7 +117,7 @@ void main()
color.rgb *= arrayX[3];
}
int colorY = int(mod(vTexCoord.t * SourceSize.y * 4.0, 4.0));
int colorY = int(mod(original_coord.y * 4.0, 4.0));
if (colorY == 0) {
color.rgb *= arrayY[0];
} else if (colorY == 1) {
+4 -2
View File
@@ -79,6 +79,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -92,6 +93,7 @@ COMPAT_VARYING vec4 TEX0;
void main()
{
vec4 color = COMPAT_TEXTURE(Source, vTexCoord);
vec2 original_coord = vTexCoord * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
vec3 arrayX[4];
arrayX[0] = vec3(1.0, 0.2, 0.2);
arrayX[1] = vec3(0.2, 1.0, 0.2);
@@ -103,8 +105,8 @@ void main()
arrayY[2] = vec3(1.0, 1.0, 1.0);
arrayY[3] = vec3(0.9, 0.9, 0.9);
color.rgb = pow(color.rgb, vec3(1.6, 1.6, 1.6));
color.rgb *= arrayX[int(mod(vTexCoord.s * SourceSize.x * 4.0, 4.0))];
color.rgb *= arrayY[int(mod(vTexCoord.t * SourceSize.y * 4.0, 4.0))];
color.rgb *= arrayX[int(mod(original_coord.x * 4.0, 4.0))];
color.rgb *= arrayY[int(mod(original_coord.y * 4.0, 4.0))];
color.a = 0.8;
FragColor = color;
}
+7 -1
View File
@@ -93,6 +93,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -114,8 +115,13 @@ void main()
// Reading the texel
vec3 E = pow(COMPAT_TEXTURE(Source, vTexCoord).xyz, vec3(2.4));
vec2 fp = fract(vTexCoord*SourceSize.xy);
vec2 fp = fract(vTexCoord * SourceSize.xy);
vec2 ps = InputSize.xy * outsize.zw;
if (any(notEqual(InputSize, OrigInputSize)))
{
fp = fract(vTexCoord * TextureSize.xy / InputSize.xy * OrigInputSize.xy);
ps = OrigInputSize.xy * outsize.zw;
}
vec2 f = clamp(clamp(fp + 0.5*ps, 0.0, 1.0) - RETRO_PIXEL_SIZE, vec2(0.0), ps)/ps;
+13 -10
View File
@@ -98,6 +98,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
@@ -120,25 +121,27 @@ uniform COMPAT_PRECISION float SCANLINE_DEPTH;
void main()
{
vec2 pos = fract(vTexCoord * SourceSize.xy);
vec2 sub_pos = fract(vTexCoord * SourceSize.xy * 6.0);
vec2 original_texel = InputSize.xy / (TextureSize.xy * OrigInputSize.xy);
vec2 original_coord = vTexCoord / original_texel;
vec2 pos = fract(original_coord);
vec2 sub_pos = fract(original_coord * 6.0);
vec4 center = COMPAT_TEXTURE(Source, vTexCoord);
vec4 left = COMPAT_TEXTURE(Source, vTexCoord - vec2(1.0 / SourceSize.x, 0.0));
vec4 right = COMPAT_TEXTURE(Source, vTexCoord + vec2(1.0 / SourceSize.x, 0.0));
vec4 left = COMPAT_TEXTURE(Source, vTexCoord - vec2(original_texel.x, 0.0));
vec4 right = COMPAT_TEXTURE(Source, vTexCoord + vec2(original_texel.x, 0.0));
if (pos.y < 1.0 / 6.0) {
center = mix(center, COMPAT_TEXTURE(Source, vTexCoord + vec2(0.0, -1.0 / SourceSize.y)), 0.5 - sub_pos.y / 2.0);
left = mix(left, COMPAT_TEXTURE(Source, vTexCoord + vec2(-1.0 / SourceSize.x, -1.0 / SourceSize.y)), 0.5 - sub_pos.y / 2.0);
right = mix(right, COMPAT_TEXTURE(Source, vTexCoord + vec2( 1.0 / SourceSize.x, -1.0 / SourceSize.y)), 0.5 - sub_pos.y / 2.0);
center = mix(center, COMPAT_TEXTURE(Source, vTexCoord + vec2(0.0, -original_texel.y)), 0.5 - sub_pos.y / 2.0);
left = mix(left, COMPAT_TEXTURE(Source, vTexCoord + vec2(-original_texel.x, -original_texel.y)), 0.5 - sub_pos.y / 2.0);
right = mix(right, COMPAT_TEXTURE(Source, vTexCoord + vec2( original_texel.x, -original_texel.y)), 0.5 - sub_pos.y / 2.0);
center *= sub_pos.y * SCANLINE_DEPTH + (1.0 - SCANLINE_DEPTH);
left *= sub_pos.y * SCANLINE_DEPTH + (1.0 - SCANLINE_DEPTH);
right *= sub_pos.y * SCANLINE_DEPTH + (1.0 - SCANLINE_DEPTH);
}
else if (pos.y > 5.0 / 6.0) {
center = mix(center, COMPAT_TEXTURE(Source, vTexCoord + vec2(0, 1.0 / SourceSize.y)), sub_pos.y / 2.0);
left = mix(left, COMPAT_TEXTURE(Source, vTexCoord + vec2(-1.0 / SourceSize.x, 1.0 / SourceSize.y)), sub_pos.y / 2.0);
right = mix(right, COMPAT_TEXTURE(Source, vTexCoord + vec2( 1.0 / SourceSize.x, 1.0 / SourceSize.y)), sub_pos.y / 2.0);
center = mix(center, COMPAT_TEXTURE(Source, vTexCoord + vec2(0.0, original_texel.y)), sub_pos.y / 2.0);
left = mix(left, COMPAT_TEXTURE(Source, vTexCoord + vec2(-original_texel.x, original_texel.y)), sub_pos.y / 2.0);
right = mix(right, COMPAT_TEXTURE(Source, vTexCoord + vec2( original_texel.x, original_texel.y)), sub_pos.y / 2.0);
center *= (1.0 - sub_pos.y) * SCANLINE_DEPTH + (1.0 - SCANLINE_DEPTH);
left *= (1.0 - sub_pos.y) * SCANLINE_DEPTH + (1.0 - SCANLINE_DEPTH);
right *= (1.0 - sub_pos.y) * SCANLINE_DEPTH + (1.0 - SCANLINE_DEPTH);
@@ -83,6 +83,21 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform sampler2D Texture;
uniform sampler2D PrevTexture;
uniform sampler2D Prev1Texture;
@@ -108,14 +123,16 @@ uniform COMPAT_PRECISION float response_time;
#endif
// Frame sampling definitions
#define active_coord (vTexCoord * TextureSize.xy / InputSize.xy)
#define history_coord(input_size, texture_size) (all(equal(InputSize, OrigInputSize)) ? vTexCoord : active_coord * input_size / texture_size)
#define curr_rgb COMPAT_TEXTURE(Source, vTexCoord).rgb
#define prev0_rgb COMPAT_TEXTURE(PrevTexture, vTexCoord).rgb
#define prev1_rgb COMPAT_TEXTURE(Prev1Texture, vTexCoord).rgb
#define prev2_rgb COMPAT_TEXTURE(Prev2Texture, vTexCoord).rgb
#define prev3_rgb COMPAT_TEXTURE(Prev3Texture, vTexCoord).rgb
#define prev4_rgb COMPAT_TEXTURE(Prev4Texture, vTexCoord).rgb
#define prev5_rgb COMPAT_TEXTURE(Prev5Texture, vTexCoord).rgb
#define prev6_rgb COMPAT_TEXTURE(Prev6Texture, vTexCoord).rgb
#define prev0_rgb COMPAT_TEXTURE(PrevTexture, history_coord(PrevInputSize.xy, PrevTextureSize.xy)).rgb
#define prev1_rgb COMPAT_TEXTURE(Prev1Texture, history_coord(Prev1InputSize.xy, Prev1TextureSize.xy)).rgb
#define prev2_rgb COMPAT_TEXTURE(Prev2Texture, history_coord(Prev2InputSize.xy, Prev2TextureSize.xy)).rgb
#define prev3_rgb COMPAT_TEXTURE(Prev3Texture, history_coord(Prev3InputSize.xy, Prev3TextureSize.xy)).rgb
#define prev4_rgb COMPAT_TEXTURE(Prev4Texture, history_coord(Prev4InputSize.xy, Prev4TextureSize.xy)).rgb
#define prev5_rgb COMPAT_TEXTURE(Prev5Texture, history_coord(Prev5InputSize.xy, Prev5TextureSize.xy)).rgb
#define prev6_rgb COMPAT_TEXTURE(Prev6Texture, history_coord(Prev6InputSize.xy, Prev6TextureSize.xy)).rgb
// Fragment Shader
@@ -145,6 +145,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -205,11 +206,13 @@ const COMPAT_PRECISION float INV_DISPLAY_GAMMA = 1.0 / 2.2;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...) and apply colour correction
colour.rgb = pow(colour.rgb, vec3(TARGET_GAMMA + 1.0 + DARKEN_COLOUR));
@@ -145,6 +145,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -205,11 +206,13 @@ const COMPAT_PRECISION float INV_DISPLAY_GAMMA = 1.0 / 2.2;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...) and apply colour correction
colour.rgb = pow(colour.rgb, vec3(TARGET_GAMMA + 1.0 + DARKEN_COLOUR));
@@ -145,6 +145,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -205,11 +206,13 @@ const COMPAT_PRECISION float INV_DISPLAY_GAMMA = 1.0 / 2.2;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...) and apply colour correction
colour.rgb = pow(colour.rgb, vec3(TARGET_GAMMA - 0.5 + DARKEN_COLOUR));
@@ -145,6 +145,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -205,11 +206,13 @@ const COMPAT_PRECISION float INV_DISPLAY_GAMMA = 1.0 / 2.2;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...) and apply colour correction
colour.rgb = pow(colour.rgb, vec3(TARGET_GAMMA - 0.5 + DARKEN_COLOUR));
@@ -139,6 +139,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -185,11 +186,13 @@ const COMPAT_PRECISION float INV_BG_TEXTURE_SIZE = 1.0 / BG_TEXTURE_SIZE;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...)
colour.rgb = pow(colour.rgb, vec3(1.0 + DARKEN_COLOUR));
@@ -139,6 +139,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -185,11 +186,13 @@ const COMPAT_PRECISION float INV_BG_TEXTURE_SIZE = 1.0 / BG_TEXTURE_SIZE;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...)
colour.rgb = pow(colour.rgb, vec3(1.0 + DARKEN_COLOUR));
@@ -144,6 +144,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -202,11 +203,13 @@ const COMPAT_PRECISION float INV_DISPLAY_GAMMA = 1.0 / 2.2;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...) and apply colour correction
colour.rgb = pow(colour.rgb, vec3(TARGET_GAMMA + 1.0 + DARKEN_COLOUR));
@@ -144,6 +144,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -202,11 +203,13 @@ const COMPAT_PRECISION float INV_DISPLAY_GAMMA = 1.0 / 2.2;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...) and apply colour correction
colour.rgb = pow(colour.rgb, vec3(TARGET_GAMMA - 0.5 + DARKEN_COLOUR));
@@ -141,6 +141,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
uniform sampler2D BACKGROUND;
COMPAT_VARYING COMPAT_PRECISION vec4 TEX0;
@@ -185,11 +186,13 @@ const COMPAT_PRECISION float INV_BG_TEXTURE_SIZE = 1.0 / BG_TEXTURE_SIZE;
void main()
{
// Get current texture coordinate
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 imgPixelCoord = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 imgCenterCoord = floor(imgPixelCoord.xy) + vec2(0.5, 0.5);
COMPAT_PRECISION vec2 sourcePixelCoord = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourcePixelCoord.xy) + vec2(0.5, 0.5);
// Get colour of current pixel
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * imgCenterCoord.xy).rgb;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, InvTextureSize.xy * sourceCenterCoord.xy).rgb;
// Darken colours (if required...)
colour.rgb = pow(colour.rgb, vec3(1.0 + DARKEN_COLOUR));
+5 -2
View File
@@ -116,6 +116,7 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
varying COMPAT_PRECISION vec2 invSize;
@@ -136,8 +137,10 @@ uniform COMPAT_PRECISION float GBAGAMMA;
void main()
{
COMPAT_PRECISION vec2 texcoordInPixels = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 texcoordInPixels = TEX0.xy * TextureSize.xy / InputSize.xy * OrigInputSize.xy;
COMPAT_PRECISION vec2 centerCoord = floor(texcoordInPixels.xy)+vec2(0.5,0.5);
COMPAT_PRECISION vec2 sourceCoordInPixels = TEX0.xy * TextureSize.xy;
COMPAT_PRECISION vec2 sourceCenterCoord = floor(sourceCoordInPixels.xy)+vec2(0.5,0.5);
COMPAT_PRECISION vec2 distFromCenter = abs(centerCoord - texcoordInPixels);
COMPAT_PRECISION float Y = max(distFromCenter.x,(distFromCenter.y));
@@ -149,7 +152,7 @@ void main()
COMPAT_PRECISION float LineWeight = YY - 2.7*YYY;
LineWeight = 1.0 - BORDERMULT*LineWeight;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, invSize*centerCoord).rgb*LineWeight;
COMPAT_PRECISION vec3 colour = COMPAT_TEXTURE(Texture, invSize*sourceCenterCoord).rgb*LineWeight;
//#if defined(GBAGAMMA)
// //colour.rgb = pow(colour.rgb, vec3(1.35));
+24 -7
View File
@@ -83,6 +83,21 @@ uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 PrevInputSize;
uniform COMPAT_PRECISION vec2 Prev1InputSize;
uniform COMPAT_PRECISION vec2 Prev2InputSize;
uniform COMPAT_PRECISION vec2 Prev3InputSize;
uniform COMPAT_PRECISION vec2 Prev4InputSize;
uniform COMPAT_PRECISION vec2 Prev5InputSize;
uniform COMPAT_PRECISION vec2 Prev6InputSize;
uniform COMPAT_PRECISION vec2 PrevTextureSize;
uniform COMPAT_PRECISION vec2 Prev1TextureSize;
uniform COMPAT_PRECISION vec2 Prev2TextureSize;
uniform COMPAT_PRECISION vec2 Prev3TextureSize;
uniform COMPAT_PRECISION vec2 Prev4TextureSize;
uniform COMPAT_PRECISION vec2 Prev5TextureSize;
uniform COMPAT_PRECISION vec2 Prev6TextureSize;
uniform sampler2D Texture;
uniform sampler2D PrevTexture;
uniform sampler2D Prev1Texture;
@@ -108,14 +123,16 @@ uniform COMPAT_PRECISION float response_time;
#endif
// Frame sampling definitions
#define active_coord (vTexCoord * TextureSize.xy / InputSize.xy)
#define history_coord(input_size, texture_size) (all(equal(InputSize, OrigInputSize)) ? vTexCoord : active_coord * input_size / texture_size)
#define curr_rgb COMPAT_TEXTURE(Source, vTexCoord).rgb
#define prev0_rgb COMPAT_TEXTURE(PrevTexture, vTexCoord).rgb
#define prev1_rgb COMPAT_TEXTURE(Prev1Texture, vTexCoord).rgb
#define prev2_rgb COMPAT_TEXTURE(Prev2Texture, vTexCoord).rgb
#define prev3_rgb COMPAT_TEXTURE(Prev3Texture, vTexCoord).rgb
#define prev4_rgb COMPAT_TEXTURE(Prev4Texture, vTexCoord).rgb
#define prev5_rgb COMPAT_TEXTURE(Prev5Texture, vTexCoord).rgb
#define prev6_rgb COMPAT_TEXTURE(Prev6Texture, vTexCoord).rgb
#define prev0_rgb COMPAT_TEXTURE(PrevTexture, history_coord(PrevInputSize.xy, PrevTextureSize.xy)).rgb
#define prev1_rgb COMPAT_TEXTURE(Prev1Texture, history_coord(Prev1InputSize.xy, Prev1TextureSize.xy)).rgb
#define prev2_rgb COMPAT_TEXTURE(Prev2Texture, history_coord(Prev2InputSize.xy, Prev2TextureSize.xy)).rgb
#define prev3_rgb COMPAT_TEXTURE(Prev3Texture, history_coord(Prev3InputSize.xy, Prev3TextureSize.xy)).rgb
#define prev4_rgb COMPAT_TEXTURE(Prev4Texture, history_coord(Prev4InputSize.xy, Prev4TextureSize.xy)).rgb
#define prev5_rgb COMPAT_TEXTURE(Prev5Texture, history_coord(Prev5InputSize.xy, Prev5TextureSize.xy)).rgb
#define prev6_rgb COMPAT_TEXTURE(Prev6Texture, history_coord(Prev6InputSize.xy, Prev6TextureSize.xy)).rgb
// Fragment Shader