diff options
author | Andreas Grois <andi@grois.info> | 2018-03-22 23:23:30 +0100 |
---|---|---|
committer | Andreas Grois <andi@grois.info> | 2018-03-22 23:23:30 +0100 |
commit | 81863349bfc7fede772eac9b6fd8024f49380e42 (patch) | |
tree | b4cafd7a04db93591f44121750f1b92369b6eeb3 /BuddhaTest/Shaders/BuddhaFragment.glsl | |
parent | e45b39dc2ebb76bc079677b1d186b6a5109d1a5b (diff) |
Make preview use color scale and gamma
Diffstat (limited to 'BuddhaTest/Shaders/BuddhaFragment.glsl')
-rw-r--r-- | BuddhaTest/Shaders/BuddhaFragment.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/BuddhaTest/Shaders/BuddhaFragment.glsl b/BuddhaTest/Shaders/BuddhaFragment.glsl index 73cb53e..52a0354 100644 --- a/BuddhaTest/Shaders/BuddhaFragment.glsl +++ b/BuddhaTest/Shaders/BuddhaFragment.glsl @@ -15,6 +15,8 @@ layout(std430, binding=3) restrict readonly buffer brightnessData uniform uint width; uniform uint height; +uniform float gamma; +uniform float colorScale; uvec3 getColorAt(vec2 fragCoord) { @@ -27,6 +29,6 @@ uvec3 getColorAt(vec2 fragCoord) void main(){ uvec3 totalCount = getColorAt(uv); - vec3 scaled = vec3(totalCount)/max(float(brightness),1.0); + vec3 scaled = pow(min(vec3(1.0),colorScale*vec3(totalCount)/max(float(brightness),1.0)),vec3(gamma)); color = scaled; } |