mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0031135: Visualization, TKOpenGl - texture sRGB -> linear conversion is applied twice by Path Tracer
Removed from PathtraceBase.fs redundant gamma correction applied to texture.
This commit is contained in:
parent
f979709590
commit
a1a9b24952
@ -831,20 +831,13 @@ vec4 PathTrace (in SRay theRay, in vec3 theInverse, in int theNbSamples)
|
||||
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
|
||||
|
@ -834,20 +834,13 @@ static const char Shaders_PathtraceBase_fs[] =
|
||||
" 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"
|
||||
|
13
tests/v3d/raytrace/sample_ball_wood
Normal file
13
tests/v3d/raytrace/sample_ball_wood
Normal file
@ -0,0 +1,13 @@
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user