gbc-color: Add darken screen parameter

This commit is contained in:
Monroe88 2018-02-10 15:08:38 -06:00
parent b248b77cf0
commit 9afc9923f7

View file

@ -10,6 +10,11 @@
License: Public domain
*/
layout(push_constant) uniform Push
{
float darken_screen;
} params;
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
@ -18,6 +23,8 @@ layout(std140, set = 0, binding = 0) uniform UBO
vec4 SourceSize;
} global;
#pragma parameter darken_screen "Darken Screen" 0.0 -0.25 2.0 0.05
#define target_gamma 2.2
#define display_gamma 2.2
#define blr 0.0
@ -33,7 +40,6 @@ layout(std140, set = 0, binding = 0) uniform UBO
#define br 0.0
#define bg 0.275000
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
@ -52,7 +58,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source;
void main()
{
vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma)).rgba;
vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma + params.darken_screen)).rgba;
// red green blue alpha ; alpha does nothing for our purposes
mat4 color = mat4(r, rg, rb, 0.0, //red