mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2025-02-17 07:27:43 +11:00
gbc-color: Add darken screen parameter
This commit is contained in:
parent
b248b77cf0
commit
9afc9923f7
1 changed files with 8 additions and 2 deletions
|
@ -10,6 +10,11 @@
|
||||||
License: Public domain
|
License: Public domain
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
layout(push_constant) uniform Push
|
||||||
|
{
|
||||||
|
float darken_screen;
|
||||||
|
} params;
|
||||||
|
|
||||||
layout(std140, set = 0, binding = 0) uniform UBO
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
{
|
{
|
||||||
mat4 MVP;
|
mat4 MVP;
|
||||||
|
@ -18,6 +23,8 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
} global;
|
} global;
|
||||||
|
|
||||||
|
#pragma parameter darken_screen "Darken Screen" 0.0 -0.25 2.0 0.05
|
||||||
|
|
||||||
#define target_gamma 2.2
|
#define target_gamma 2.2
|
||||||
#define display_gamma 2.2
|
#define display_gamma 2.2
|
||||||
#define blr 0.0
|
#define blr 0.0
|
||||||
|
@ -33,7 +40,6 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
#define br 0.0
|
#define br 0.0
|
||||||
#define bg 0.275000
|
#define bg 0.275000
|
||||||
|
|
||||||
|
|
||||||
#pragma stage vertex
|
#pragma stage vertex
|
||||||
layout(location = 0) in vec4 Position;
|
layout(location = 0) in vec4 Position;
|
||||||
layout(location = 1) in vec2 TexCoord;
|
layout(location = 1) in vec2 TexCoord;
|
||||||
|
@ -52,7 +58,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||||
|
|
||||||
void main()
|
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
|
// red green blue alpha ; alpha does nothing for our purposes
|
||||||
mat4 color = mat4(r, rg, rb, 0.0, //red
|
mat4 color = mat4(r, rg, rb, 0.0, //red
|
||||||
|
|
Loading…
Add table
Reference in a new issue