From 6c4bd1efa087b739b51afa20fd3f4937f62b5e40 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 19 May 2025 23:29:02 -0700 Subject: [PATCH] Res: Port more Pokefan531 color shaders (closes #3437) --- CHANGES | 1 + .../dslite-color.shader/dslite-color.fs | 20 +++++++++++ .../dslite-color.shader/dslite-color.vs | 34 +++++++++++++++++++ res/shaders/dslite-color.shader/manifest.ini | 19 +++++++++++ .../gb-micro-color.shader/gb-micro-color.fs | 20 +++++++++++ .../gb-micro-color.shader/gb-micro-color.vs | 34 +++++++++++++++++++ .../gb-micro-color.shader/manifest.ini | 19 +++++++++++ res/shaders/gba-color.shader/manifest.ini | 2 ++ res/shaders/gbc-color.shader/gbc-color.fs | 21 ++++++++++++ res/shaders/gbc-color.shader/gbc-color.vs | 34 +++++++++++++++++++ res/shaders/gbc-color.shader/manifest.ini | 26 ++++++++++++++ res/shaders/nds-color.shader/manifest.ini | 19 +++++++++++ res/shaders/nds-color.shader/nds-color.fs | 20 +++++++++++ res/shaders/nds-color.shader/nds-color.vs | 34 +++++++++++++++++++ res/shaders/nso-gba-color.shader/manifest.ini | 2 ++ res/shaders/nso-gbc-color.shader/manifest.ini | 26 ++++++++++++++ .../nso-gbc-color.shader/nso-gbc-color.fs | 19 +++++++++++ .../nso-gbc-color.shader/nso-gbc-color.vs | 34 +++++++++++++++++++ res/shaders/sp101-color.shader/manifest.ini | 19 +++++++++++ res/shaders/sp101-color.shader/sp101-color.fs | 20 +++++++++++ res/shaders/sp101-color.shader/sp101-color.vs | 34 +++++++++++++++++++ 21 files changed, 457 insertions(+) create mode 100644 res/shaders/dslite-color.shader/dslite-color.fs create mode 100644 res/shaders/dslite-color.shader/dslite-color.vs create mode 100644 res/shaders/dslite-color.shader/manifest.ini create mode 100644 res/shaders/gb-micro-color.shader/gb-micro-color.fs create mode 100644 res/shaders/gb-micro-color.shader/gb-micro-color.vs create mode 100644 res/shaders/gb-micro-color.shader/manifest.ini create mode 100644 res/shaders/gbc-color.shader/gbc-color.fs create mode 100644 res/shaders/gbc-color.shader/gbc-color.vs create mode 100644 res/shaders/gbc-color.shader/manifest.ini create mode 100644 res/shaders/nds-color.shader/manifest.ini create mode 100644 res/shaders/nds-color.shader/nds-color.fs create mode 100644 res/shaders/nds-color.shader/nds-color.vs create mode 100644 res/shaders/nso-gbc-color.shader/manifest.ini create mode 100644 res/shaders/nso-gbc-color.shader/nso-gbc-color.fs create mode 100644 res/shaders/nso-gbc-color.shader/nso-gbc-color.vs create mode 100644 res/shaders/sp101-color.shader/manifest.ini create mode 100644 res/shaders/sp101-color.shader/sp101-color.fs create mode 100644 res/shaders/sp101-color.shader/sp101-color.vs diff --git a/CHANGES b/CHANGES index c8cba4bb6..3a7b590f8 100644 --- a/CHANGES +++ b/CHANGES @@ -67,6 +67,7 @@ Misc: - Res: Port hq2x and OmniScale shaders from SameBoy - Res: Port NSO-gba-colors shader (closes mgba.io/i/2834) - Res: Update gba-colors shader (closes mgba.io/i/2976) + - Res: Port more Pokefan531 color shaders (closes mgba.io/i/3437) - Scripting: Add `callbacks:oneshot` for single-call callbacks 0.10.5: (2025-03-08) diff --git a/res/shaders/dslite-color.shader/dslite-color.fs b/res/shaders/dslite-color.shader/dslite-color.fs new file mode 100644 index 000000000..b6b00f7e6 --- /dev/null +++ b/res/shaders/dslite-color.shader/dslite-color.fs @@ -0,0 +1,20 @@ +// Shader that replicates the LCD Colorspace from a Nintendo DS Lite -- +varying vec2 texCoord; +varying mat4 profile; +uniform sampler2D tex; +uniform vec2 texSize; + +const float target_gamma = 2.2; +const float display_gamma = 2.2; + +void main() { + // bring out our stored luminance value + float lum = profile[3].w; + + // our adjustments need to happen in linear gamma + vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma)).rgba; + + screen = clamp(screen * lum, 0.0, 1.0); + screen = profile * screen; + gl_FragColor = pow(screen, vec4(1.0 / display_gamma)); +} diff --git a/res/shaders/dslite-color.shader/dslite-color.vs b/res/shaders/dslite-color.shader/dslite-color.vs new file mode 100644 index 000000000..21df96580 --- /dev/null +++ b/res/shaders/dslite-color.shader/dslite-color.vs @@ -0,0 +1,34 @@ +uniform int color_mode; +attribute vec4 position; +varying vec2 texCoord; +varying mat4 profile; + +const mat4 DSL_sRGB = mat4( + 0.93, 0.025, 0.008, 0.0, //red channel + 0.14, 0.90, -0.03, 0.0, //green channel + -0.07, 0.075, 1.022, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.935 //alpha channel +); + +const mat4 DSL_DCI = mat4( + 0.76, 0.055, 0.0225, 0.0, //red channel + 0.27, 0.875, 0.0225, 0.0, //green channel + -0.03, 0.07, 0.955, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.97 //alpha channel +); + +const mat4 DSL_Rec2020 = mat4( + 0.585, 0.09, 0.0225, 0.0, //red channel + 0.3725, 0.825, 0.035, 0.0, //green channel + 0.0425, 0.085, 0.9425, 0.0, //blue channel + 0.0, 0.0, 0.0, 1.0 //alpha channel +); + +void main() { + if (color_mode == 1) profile = DSL_sRGB; + else if (color_mode == 2) profile = DSL_DCI; + else if (color_mode == 3) profile = DSL_Rec2020; + + gl_Position = position; + texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5); +} diff --git a/res/shaders/dslite-color.shader/manifest.ini b/res/shaders/dslite-color.shader/manifest.ini new file mode 100644 index 000000000..a30df9a31 --- /dev/null +++ b/res/shaders/dslite-color.shader/manifest.ini @@ -0,0 +1,19 @@ +[shader] +name=Nintendo DS Lite Color +author=Pokefan531 and hunterk +description=Shader that replicates the LCD Colorspace from a Nintendo DS Lite. +passes=1 + +[pass.0] +fragmentShader=dslite-color.fs +vertexShader=dslite-color.vs +blend=1 +width=-1 +height=-1 + +[pass.0.uniform.color_mode] +type=int +default=1 +min=1 +max=3 +readableName=Color Profile (1=sRGB, 2=DCI, 3=Rec2020) diff --git a/res/shaders/gb-micro-color.shader/gb-micro-color.fs b/res/shaders/gb-micro-color.shader/gb-micro-color.fs new file mode 100644 index 000000000..9544f5438 --- /dev/null +++ b/res/shaders/gb-micro-color.shader/gb-micro-color.fs @@ -0,0 +1,20 @@ +// Shader that replicates the LCD Colorspace from a Gameboy Micro (OXY-001) -- +varying vec2 texCoord; +varying mat4 profile; +uniform sampler2D tex; +uniform vec2 texSize; + +const float target_gamma = 2.2; +const float display_gamma = 2.2; + +void main() { + // bring out our stored luminance value + float lum = profile[3].w; + + // our adjustments need to happen in linear gamma + vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma)).rgba; + + screen = clamp(screen * lum, 0.0, 1.0); + screen = profile * screen; + gl_FragColor = pow(screen, vec4(1.0 / display_gamma)); +} diff --git a/res/shaders/gb-micro-color.shader/gb-micro-color.vs b/res/shaders/gb-micro-color.shader/gb-micro-color.vs new file mode 100644 index 000000000..93cef2d9f --- /dev/null +++ b/res/shaders/gb-micro-color.shader/gb-micro-color.vs @@ -0,0 +1,34 @@ +uniform int color_mode; +attribute vec4 position; +varying vec2 texCoord; +varying mat4 profile; + +const mat4 GBM_sRGB = mat4( + 0.8025, 0.10, 0.1225, 0.0, //red channel + 0.31, 0.6875, 0.1125, 0.0, //green channel + -0.1125, 0.2125, 0.765, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.9 //alpha channel +); + +const mat4 GBM_DCI = mat4( + 0.6675, 0.125, 0.13, 0.0, //red channel + 0.3825, 0.675, 0.1475, 0.0, //green channel + -0.05, 0.20, 0.7225, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.96 //alpha channel +); + +const mat4 GBM_Rec2020 = mat4( + 0.525, 0.15, 0.13, 0.0, //red channel + 0.43, 0.65, 0.155, 0.0, //green channel + 0.045, 0.20, 0.715, 0.0, //blue channel + 0.0, 0.0, 0.0, 1.0 //alpha channel +); + +void main() { + if (color_mode == 1) profile = GBM_sRGB; + else if (color_mode == 2) profile = GBM_DCI; + else if (color_mode == 3) profile = GBM_Rec2020; + + gl_Position = position; + texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5); +} diff --git a/res/shaders/gb-micro-color.shader/manifest.ini b/res/shaders/gb-micro-color.shader/manifest.ini new file mode 100644 index 000000000..6d70a2a06 --- /dev/null +++ b/res/shaders/gb-micro-color.shader/manifest.ini @@ -0,0 +1,19 @@ +[shader] +name=GB Micro Color +author=Pokefan531 and hunterk +description=Shader that replicates the LCD Colorspace from a Gameboy Micro (OXY-001). +passes=1 + +[pass.0] +fragmentShader=gb-micro-color.fs +vertexShader=gb-micro-color.vs +blend=1 +width=-1 +height=-1 + +[pass.0.uniform.color_mode] +type=int +default=1 +min=1 +max=3 +readableName=Color Profile (1=sRGB, 2=DCI, 3=Rec2020) diff --git a/res/shaders/gba-color.shader/manifest.ini b/res/shaders/gba-color.shader/manifest.ini index ed16900cd..bdf0f2b45 100644 --- a/res/shaders/gba-color.shader/manifest.ini +++ b/res/shaders/gba-color.shader/manifest.ini @@ -14,6 +14,8 @@ height=-1 [pass.0.uniform.darken_screen] type=float default=0.5 +min=0 +max=1 readableName=Darken Screen [pass.0.uniform.color_mode] diff --git a/res/shaders/gbc-color.shader/gbc-color.fs b/res/shaders/gbc-color.shader/gbc-color.fs new file mode 100644 index 000000000..81b4f21af --- /dev/null +++ b/res/shaders/gbc-color.shader/gbc-color.fs @@ -0,0 +1,21 @@ +// Shader that replicates the LCD Colorspace from Gameboy Color -- +varying vec2 texCoord; +varying mat4 profile; +uniform sampler2D tex; +uniform vec2 texSize; + +uniform float lighten_screen; +const float target_gamma = 2.2; +const float display_gamma = 2.2; + +void main() { + // bring out our stored luminance value + float lum = profile[3].w; + + // our adjustments need to happen in linear gamma + vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma - lighten_screen)).rgba; + + screen = clamp(screen * lum, 0.0, 1.0); + screen = profile * screen; + gl_FragColor = pow(screen, vec4(1.0 / display_gamma)); +} diff --git a/res/shaders/gbc-color.shader/gbc-color.vs b/res/shaders/gbc-color.shader/gbc-color.vs new file mode 100644 index 000000000..5c7095b30 --- /dev/null +++ b/res/shaders/gbc-color.shader/gbc-color.vs @@ -0,0 +1,34 @@ +uniform int color_mode; +attribute vec4 position; +varying vec2 texCoord; +varying mat4 profile; + +const mat4 GBC_sRGB = mat4( + 0.905, 0.10, 0.1575, 0.0, //red channel + 0.195, 0.65, 0.1425, 0.0, //green channel + -0.10, 0.25, 0.70, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.91 //alpha channel +); + +const mat4 GBC_DCI = mat4( + 0.76, 0.125, 0.16, 0.0, //red channel + 0.27, 0.6375, 0.18, 0.0, //green channel + -0.03, 0.2375, 0.66, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.97 //alpha channel +); + +const mat4 GBC_Rec2020 = mat4( + 0.61, 0.155, 0.16, 0.0, //red channel + 0.345, 0.615, 0.1875, 0.0, //green channel + 0.045, 0.23, 0.6525, 0.0, //blue channel + 0.0, 0.0, 0.0, 1.0 //alpha channel +); + +void main() { + if (color_mode == 1) profile = GBC_sRGB; + else if (color_mode == 2) profile = GBC_DCI; + else if (color_mode == 3) profile = GBC_Rec2020; + + gl_Position = position; + texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5); +} diff --git a/res/shaders/gbc-color.shader/manifest.ini b/res/shaders/gbc-color.shader/manifest.ini new file mode 100644 index 000000000..308c11b4a --- /dev/null +++ b/res/shaders/gbc-color.shader/manifest.ini @@ -0,0 +1,26 @@ +[shader] +name=GBC Color +author=Pokefan531 and hunterk +description=Modifies the color output to simulate the GBA LCD characteristics. +passes=1 + +[pass.0] +fragmentShader=gbc-color.fs +vertexShader=gbc-color.vs +blend=1 +width=-1 +height=-1 + +[pass.0.uniform.lighten_screen] +type=float +default=1.0 +min=0 +max=1 +readableName=External Lighten Screen + +[pass.0.uniform.color_mode] +type=int +default=1 +min=1 +max=3 +readableName=Color Profile (1=sRGB, 2=DCI, 3=Rec2020) diff --git a/res/shaders/nds-color.shader/manifest.ini b/res/shaders/nds-color.shader/manifest.ini new file mode 100644 index 000000000..4ec444e06 --- /dev/null +++ b/res/shaders/nds-color.shader/manifest.ini @@ -0,0 +1,19 @@ +[shader] +name=Nintendo DS Color +author=Pokefan531 and hunterk +description=Shader that replicates the LCD Colorspace from a Nintendo DS Phat. +passes=1 + +[pass.0] +fragmentShader=nds-color.fs +vertexShader=nds-color.vs +blend=1 +width=-1 +height=-1 + +[pass.0.uniform.color_mode] +type=int +default=1 +min=1 +max=3 +readableName=Color Profile (1=sRGB, 2=DCI, 3=Rec2020) diff --git a/res/shaders/nds-color.shader/nds-color.fs b/res/shaders/nds-color.shader/nds-color.fs new file mode 100644 index 000000000..15ccefa0b --- /dev/null +++ b/res/shaders/nds-color.shader/nds-color.fs @@ -0,0 +1,20 @@ +// Shader that replicates the LCD Colorspace from a Nintendo DS Phat -- +varying vec2 texCoord; +varying mat4 profile; +uniform sampler2D tex; +uniform vec2 texSize; + +const float target_gamma = 2.2; +const float display_gamma = 2.2; + +void main() { + // bring out our stored luminance value + float lum = profile[3].w; + + // our adjustments need to happen in linear gamma + vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma)).rgba; + + screen = clamp(screen * lum, 0.0, 1.0); + screen = profile * screen; + gl_FragColor = pow(screen, vec4(1.0 / display_gamma)); +} diff --git a/res/shaders/nds-color.shader/nds-color.vs b/res/shaders/nds-color.shader/nds-color.vs new file mode 100644 index 000000000..711546424 --- /dev/null +++ b/res/shaders/nds-color.shader/nds-color.vs @@ -0,0 +1,34 @@ +uniform int color_mode; +attribute vec4 position; +varying vec2 texCoord; +varying mat4 profile; + +const mat4 NDS_sRGB = mat4( + 0.835, 0.10, 0.105, 0.0, //red channel + 0.27, 0.6375, 0.175, 0.0, //green channel + -0.105, 0.2625, 0.72, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.905 //alpha channel +); + +const mat4 NDS_DCI = mat4( + 0.70, 0.125, 0.12, 0.0, //red channel + 0.34, 0.625, 0.20, 0.0, //green channel + -0.04, 0.25, 0.68, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.96 //alpha channel +); + +const mat4 NDS_Rec2020 = mat4( + 0.555, 0.1475, 0.1175, 0.0, //red channel + 0.39, 0.6075, 0.2075, 0.0, //green channel + 0.055, 0.245, 0.675, 0.0, //blue channel + 0.0, 0.0, 0.0, 1.0 //alpha channel +); + +void main() { + if (color_mode == 1) profile = NDS_sRGB; + else if (color_mode == 2) profile = NDS_DCI; + else if (color_mode == 3) profile = NDS_Rec2020; + + gl_Position = position; + texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5); +} diff --git a/res/shaders/nso-gba-color.shader/manifest.ini b/res/shaders/nso-gba-color.shader/manifest.ini index 42faa25bd..c73d457f2 100644 --- a/res/shaders/nso-gba-color.shader/manifest.ini +++ b/res/shaders/nso-gba-color.shader/manifest.ini @@ -14,6 +14,8 @@ height=-1 [pass.0.uniform.darken_screen] type=float default=0.8 +min=0 +max=1 readableName=Darken Screen [pass.0.uniform.color_mode] diff --git a/res/shaders/nso-gbc-color.shader/manifest.ini b/res/shaders/nso-gbc-color.shader/manifest.ini new file mode 100644 index 000000000..60babb0db --- /dev/null +++ b/res/shaders/nso-gbc-color.shader/manifest.ini @@ -0,0 +1,26 @@ +[shader] +name=NSO GBC Color +author=Pokefan531 and hunterk +description=Shader that replicates the Nintendo Switch Online's GBC color filter. +passes=1 + +[pass.0] +fragmentShader=nso-gbc-color.fs +vertexShader=nso-gbc-color.vs +blend=1 +width=-1 +height=-1 + +[pass.0.uniform.lighten_screen] +type=float +default=0.0 +min=0 +max=1 +readableName=Lighten Screen + +[pass.0.uniform.color_mode] +type=int +default=1 +min=1 +max=3 +readableName=Color Profile (1=sRGB, 2=DCI, 3=Rec2020) diff --git a/res/shaders/nso-gbc-color.shader/nso-gbc-color.fs b/res/shaders/nso-gbc-color.shader/nso-gbc-color.fs new file mode 100644 index 000000000..d2d68769f --- /dev/null +++ b/res/shaders/nso-gbc-color.shader/nso-gbc-color.fs @@ -0,0 +1,19 @@ +// Shader that replicates the Nintendo Switch Online's GBC color filter -- +varying vec2 texCoord; +varying mat4 profile; +uniform sampler2D tex; +uniform vec2 texSize; + +uniform float lighten_screen; + +void main() { + // bring out our stored luminance value + float lum = profile[3].w; + + // our adjustments need to happen in linear gamma + vec4 screen = pow(texture2D(tex, texCoord), vec4(1.24, 0.8, 0.7, 1.0)).rgba; + + screen = clamp(screen * lum, 0.0, 1.0); + screen = profile * screen; + gl_FragColor = pow(screen, vec4(1.0)); +} diff --git a/res/shaders/nso-gbc-color.shader/nso-gbc-color.vs b/res/shaders/nso-gbc-color.shader/nso-gbc-color.vs new file mode 100644 index 000000000..bc01beb28 --- /dev/null +++ b/res/shaders/nso-gbc-color.shader/nso-gbc-color.vs @@ -0,0 +1,34 @@ +uniform int color_mode; +attribute vec4 position; +varying vec2 texCoord; +varying mat4 profile; + +const mat4 GBC_sRGB = mat4( + 0.84, 0.105, 0.15, 0.0, //red channel + 0.265, 0.67, 0.30, 0.0, //green channel + 0.0, 0.24, 0.525, 0.0, //blue channel + 0.175, 0.18, 0.18, 0.85 //alpha channel +); + +const mat4 GBC_DCI = mat4( + 0.84, 0.105, 0.15, 0.0, //red channel + 0.265, 0.67, 0.30, 0.0, //green channel + 0.0, 0.24, 0.525, 0.0, //blue channel + 0.175, 0.18, 0.18, 1.0 //alpha channel +); + +const mat4 GBC_Rec2020 = mat4( + 0.84, 0.105, 0.15, 0.0, //red channel + 0.265, 0.67, 0.30, 0.0, //green channel + 0.0, 0.24, 0.525, 0.0, //blue channel + 0.175, 0.18, 0.18, 1.0 //alpha channel +); + +void main() { + if (color_mode == 1) profile = GBC_sRGB; + else if (color_mode == 2) profile = GBC_DCI; + else if (color_mode == 3) profile = GBC_Rec2020; + + gl_Position = position; + texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5); +} diff --git a/res/shaders/sp101-color.shader/manifest.ini b/res/shaders/sp101-color.shader/manifest.ini new file mode 100644 index 000000000..b42599b1f --- /dev/null +++ b/res/shaders/sp101-color.shader/manifest.ini @@ -0,0 +1,19 @@ +[shader] +name=GBA SP 101 Color +author=Pokefan531 and hunterk +description=Shader that replicates the LCD Colorspace from a Gameboy SP 101 (backlit version). +passes=1 + +[pass.0] +fragmentShader=sp101-color.fs +vertexShader=sp101-color.vs +blend=1 +width=-1 +height=-1 + +[pass.0.uniform.color_mode] +type=int +default=1 +min=1 +max=3 +readableName=Color Profile (1=sRGB, 2=DCI, 3=Rec2020) diff --git a/res/shaders/sp101-color.shader/sp101-color.fs b/res/shaders/sp101-color.shader/sp101-color.fs new file mode 100644 index 000000000..7fb44d507 --- /dev/null +++ b/res/shaders/sp101-color.shader/sp101-color.fs @@ -0,0 +1,20 @@ +// Shader that replicates the LCD Colorspace from a Gameboy SP 101 (backlit version) -- +varying vec2 texCoord; +varying mat4 profile; +uniform sampler2D tex; +uniform vec2 texSize; + +const float target_gamma = 2.2; +const float display_gamma = 2.2; + +void main() { + // bring out our stored luminance value + float lum = profile[3].w; + + // our adjustments need to happen in linear gamma + vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma)).rgba; + + screen = clamp(screen * lum, 0.0, 1.0); + screen = profile * screen; + gl_FragColor = pow(screen, vec4(1.0 / display_gamma)); +} diff --git a/res/shaders/sp101-color.shader/sp101-color.vs b/res/shaders/sp101-color.shader/sp101-color.vs new file mode 100644 index 000000000..b78993a82 --- /dev/null +++ b/res/shaders/sp101-color.shader/sp101-color.vs @@ -0,0 +1,34 @@ +uniform int color_mode; +attribute vec4 position; +varying vec2 texCoord; +varying mat4 profile; + +const mat4 SP1_sRGB = mat4( + 0.96, 0.0325, 0.001, 0.0, //red channel + 0.11, 0.89, -0.03, 0.0, //green channel + -0.07, 0.0775, 1.029, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.935 //alpha channel +); + +const mat4 SP1_DCI = mat4( + 0.805, 0.0675, 0.017, 0.0, //red channel + 0.24, 0.86, 0.02, 0.0, //green channel + -0.045, 0.0725, 0.963, 0.0, //blue channel + 0.0, 0.0, 0.0, 0.955 //alpha channel +); + +const mat4 SP1_Rec2020 = mat4( + 0.625, 0.10, 0.015, 0.0, //red channel + 0.35, 0.82, 0.0325, 0.0, //green channel + 0.025, 0.08, 0.9525, 0.0, //blue channel + 0.0, 0.0, 0.0, 1.0 //alpha channel +); + +void main() { + if (color_mode == 1) profile = SP1_sRGB; + else if (color_mode == 2) profile = SP1_DCI; + else if (color_mode == 3) profile = SP1_Rec2020; + + gl_Position = position; + texCoord = (position.st + vec2(1.0, 1.0)) * vec2(0.5, 0.5); +}