1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0028369: Visualization, Path Tracing - Expose radiance clamping setting in path tracing mode

New parameter was added in the vrenderparams command:
vrenderparams -maxrad <value>
This commit is contained in:
dbp
2017-01-18 14:24:13 +03:00
committed by apn
parent 7a59f4ce9f
commit b09447ed89
9 changed files with 129 additions and 40 deletions

View File

@@ -785,7 +785,7 @@ vec4 PathTrace (in SRay theRay, in vec3 theInverse)
vec4 aTexColor = textureLod (
sampler2D (uTextureSamplers[int (aMaterial.Kd.w)]), aTexCoord.st, 0.f);
aMaterial.Kd.rgb *= (aTexColor.rgb, aTexColor.rgb) * aTexColor.w; // de-gamma correction (for gamma = 2)
aMaterial.Kd.rgb *= (aTexColor.rgb * aTexColor.rgb) * aTexColor.w; // de-gamma correction (for gamma = 2)
if (aTexColor.w != 1.0f)
{

View File

@@ -13,9 +13,9 @@ uniform int uBlockedRngEnabled;
uniform sampler2D uAccumTexture;
#endif
//! Maximum radiance that can be added to the pixel. Decreases noise
//! level, but introduces some bias.
#define MAX_RADIANCE vec3 (50.f)
//! Maximum radiance that can be added to the pixel.
//! Decreases noise level, but introduces some bias.
uniform float uMaxRadiance = 50.f;
// =======================================================================
// function : main
@@ -64,7 +64,7 @@ void main (void)
aColor.rgb = ZERO;
}
aColor.rgb = min (aColor.rgb, MAX_RADIANCE);
aColor.rgb = min (aColor.rgb, vec3 (uMaxRadiance));
#ifdef ADAPTIVE_SAMPLING

View File

@@ -788,7 +788,7 @@ static const char Shaders_PathtraceBase_fs[] =
" vec4 aTexColor = textureLod (\n"
" sampler2D (uTextureSamplers[int (aMaterial.Kd.w)]), aTexCoord.st, 0.f);\n"
"\n"
" aMaterial.Kd.rgb *= (aTexColor.rgb, aTexColor.rgb) * aTexColor.w; // de-gamma correction (for gamma = 2)\n"
" aMaterial.Kd.rgb *= (aTexColor.rgb * aTexColor.rgb) * aTexColor.w; // de-gamma correction (for gamma = 2)\n"
"\n"
" if (aTexColor.w != 1.0f)\n"
" {\n"

View File

@@ -16,9 +16,9 @@ static const char Shaders_RaytraceRender_fs[] =
" uniform sampler2D uAccumTexture;\n"
"#endif\n"
"\n"
"//! Maximum radiance that can be added to the pixel. Decreases noise\n"
"//! level, but introduces some bias.\n"
"#define MAX_RADIANCE vec3 (50.f)\n"
"//! Maximum radiance that can be added to the pixel.\n"
"//! Decreases noise level, but introduces some bias.\n"
"uniform float uMaxRadiance = 50.f;\n"
"\n"
"// =======================================================================\n"
"// function : main\n"
@@ -67,7 +67,7 @@ static const char Shaders_RaytraceRender_fs[] =
" aColor.rgb = ZERO;\n"
" }\n"
"\n"
" aColor.rgb = min (aColor.rgb, MAX_RADIANCE);\n"
" aColor.rgb = min (aColor.rgb, vec3 (uMaxRadiance));\n"
"\n"
"#ifdef ADAPTIVE_SAMPLING\n"
"\n"