Removed from PathtraceBase.fs redundant gamma correction applied to texture.
if (aBSDF.Kd.w >= 0.f)
{
vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriIndex), 0.f, 1.f);
-
- vec4 aTrsfRow1 = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));
- vec4 aTrsfRow2 = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));
-
+ vec4 aTrsfRow1 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));
+ vec4 aTrsfRow2 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));
aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),
dot (aTrsfRow2, aTexCoord));
- vec4 aTexColor = textureLod (
- sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.f);
-
- aBSDF.Kd.rgb *= (aTexColor.rgb * aTexColor.rgb) * aTexColor.w; // de-gamma correction (for gamma = 2)
-
+ vec4 aTexColor = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.f);
+ aBSDF.Kd.rgb *= aTexColor.rgb * aTexColor.w;
if (aTexColor.w != 1.0f)
{
// mix transparency BTDF with texture alpha-channel
" if (aBSDF.Kd.w >= 0.f)\n"
" {\n"
" vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriIndex), 0.f, 1.f);\n"
- "\n"
- " vec4 aTrsfRow1 = texelFetch (\n"
- " uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));\n"
- " vec4 aTrsfRow2 = texelFetch (\n"
- " uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));\n"
- "\n"
+ " vec4 aTrsfRow1 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));\n"
+ " vec4 aTrsfRow2 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));\n"
" aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),\n"
" dot (aTrsfRow2, aTexCoord));\n"
"\n"
- " vec4 aTexColor = textureLod (\n"
- " sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.f);\n"
- "\n"
- " aBSDF.Kd.rgb *= (aTexColor.rgb * aTexColor.rgb) * aTexColor.w; // de-gamma correction (for gamma = 2)\n"
- "\n"
+ " vec4 aTexColor = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.f);\n"
+ " aBSDF.Kd.rgb *= aTexColor.rgb * aTexColor.w;\n"
" if (aTexColor.w != 1.0f)\n"
" {\n"
" // mix transparency BTDF with texture alpha-channel\n"
--- /dev/null
+puts "============"
+puts "0031135: Visualization, TKOpenGl - texture sRGB -> linear conversion is applied twice by Path Tracer"
+puts "============"
+puts ""
+
+source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
+
+vtexture ball 11 -scale 0.1 0.1
+vsetmaterial ball plaster
+vbsdf ball -coatFresnel Constant 0.0
+
+vfps 100
+vdump $imagedir/${casename}_zoom.png