From: kgv Date: Wed, 14 Jun 2017 10:56:34 +0000 (+0300) Subject: 0028794: Regenerate .pxx file for Shaders/Display.fs resource X-Git-Tag: V7_2_0_beta~79 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=6c060ff2c468e847bb45413d98e2de2d6b7332e8 0028794: Regenerate .pxx file for Shaders/Display.fs resource --- diff --git a/src/Shaders/Shaders_Display_fs.pxx b/src/Shaders/Shaders_Display_fs.pxx index 80e1cba1c8..043f72b256 100644 --- a/src/Shaders/Shaders_Display_fs.pxx +++ b/src/Shaders/Shaders_Display_fs.pxx @@ -29,6 +29,16 @@ static const char Shaders_Display_fs[] = "//! Is debug mode enabled for importance screen sampling.\n" "uniform int uDebugAdaptive;\n" "\n" + "//! Exposure value for tone mapping.\n" + "uniform float uExposure;\n" + "\n" + "#ifdef TONE_MAPPING_FILMIC\n" + "\n" + "//! White point value for filmic tone mapping.\n" + "uniform float uWhitePoint;\n" + "\n" + "#endif // TONE_MAPPING\n" + "\n" "//! Output pixel color.\n" "out vec4 OutColor;\n" "\n" @@ -39,6 +49,18 @@ static const char Shaders_Display_fs[] = "#define SCALE_FACTOR 1.0e6f\n" "\n" "// =======================================================================\n" + "// function : ToneMappingFilmic\n" + "// purpose :\n" + "// =======================================================================\n" + "vec4 ToneMappingFilmic(vec4 theColor, float theWhitePoint)\n" + "{\n" + " vec4 aPackColor = vec4 (theColor.rgb, theWhitePoint);\n" + " vec4 aFilmicCurve = 1.425f * aPackColor + vec4 (0.05f);\n" + " vec4 aResultColor = (aPackColor * aFilmicCurve + vec4 (0.004f)) / (aPackColor * (aFilmicCurve + vec4 (0.55f)) + vec4 (0.0491f)) - vec4 (0.0821f);\n" + " return vec4 (aResultColor.rgb / aResultColor.www, 1.0);\n" + "}\n" + "\n" + "// =======================================================================\n" "// function : main\n" "// purpose :\n" "// =======================================================================\n" @@ -115,12 +137,18 @@ static const char Shaders_Display_fs[] = "\n" "#ifdef PATH_TRACING\n" "\n" - " // apply gamma correction (we use gamma = 2)\n" - " OutColor = vec4 (sqrt (aColor.rgb), 0.f);\n" + " aColor *= pow (2, uExposure);\n" + "\n" + "#ifdef TONE_MAPPING_FILMIC\n" + " aColor = ToneMappingFilmic (aColor, uWhitePoint);\n" + "#endif // TONE_MAPPING\n" + "\n" + " // apply gamma correction (we use gamma = 2)\n" + " OutColor = vec4 (sqrt (aColor.rgb), 0.f);\n" "\n" "#else // not PATH_TRACING\n" "\n" - " OutColor = aColor;\n" + " OutColor = aColor;\n" "\n" "#endif\n" "}\n";