summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authoralex-2b17x4 <3957610+CptPotato@users.noreply.github.com>2018-07-11 15:59:14 +0200
committeralex-2b17x4 <3957610+CptPotato@users.noreply.github.com>2018-07-11 15:59:14 +0200
commit7fe75bb43ba6dcf2e2b8d3e8626e8a99e42c2b77 (patch)
treef1ffb93c47bd888fc7a8d641bf09680c98109fd5 /drivers/gles3/shaders
parenta184126e8b2a74b47137b47001c1d11a092ccdaa (diff)
added 'whitepoint' to ACES tonemapping
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r--drivers/gles3/shaders/tonemap.glsl9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl
index a75871f08e..ceb37d703a 100644
--- a/drivers/gles3/shaders/tonemap.glsl
+++ b/drivers/gles3/shaders/tonemap.glsl
@@ -161,13 +161,14 @@ vec3 tonemap_filmic(vec3 color,float white) {
}
-vec3 tonemap_aces(vec3 color) {
+vec3 tonemap_aces(vec3 color, float white) {
float a = 2.51f;
float b = 0.03f;
float c = 2.43f;
float d = 0.59f;
float e = 0.14f;
- return color = clamp((color*(a*color+b))/(color*(c*color+d)+e),vec3(0.0),vec3(1.0));
+ color = (color * (a * color + b)) / (color * (c * color + d) + e);
+ return clamp(color / vec3((white * (a * white + b)) / (white * (c * white + d) + e)), vec3(0.0), vec3(1.0));
}
vec3 tonemap_reindhart(vec3 color,float white) {
@@ -250,10 +251,10 @@ void main() {
#ifdef USE_ACES_TONEMAPPER
- color.rgb = tonemap_aces(color.rgb);
+ color.rgb = tonemap_aces(color.rgb,white);
# if defined(USING_GLOW)
- glow = tonemap_aces(glow);
+ glow = tonemap_aces(glow,white);
# endif
#endif