mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0026404: Visualization, Ray Tracing - use solid background color when gradient color is disabled
Test-case for issue #26404
This commit is contained in:
parent
b285c9fed2
commit
67c12d8020
@ -2263,13 +2263,25 @@ Standard_Boolean OpenGl_View::setUniformState (const Graphic3d_CView& the
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set background colors (only gradient background supported)
|
// Set background colors (only gradient background supported)
|
||||||
if (myBgGradientArray != NULL)
|
if (myBgGradientArray != NULL
|
||||||
|
&& myBgGradientArray->IsDefined())
|
||||||
{
|
{
|
||||||
theProgram->SetUniform (theGlContext,
|
theProgram->SetUniform (theGlContext,
|
||||||
myUniformLocations[theProgramId][OpenGl_RT_uBackColorTop], myBgGradientArray->GradientColor (0));
|
myUniformLocations[theProgramId][OpenGl_RT_uBackColorTop], myBgGradientArray->GradientColor (0));
|
||||||
theProgram->SetUniform (theGlContext,
|
theProgram->SetUniform (theGlContext,
|
||||||
myUniformLocations[theProgramId][OpenGl_RT_uBackColorBot], myBgGradientArray->GradientColor (1));
|
myUniformLocations[theProgramId][OpenGl_RT_uBackColorBot], myBgGradientArray->GradientColor (1));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const OpenGl_Vec4 aBackColor (theCView.DefWindow.Background.r,
|
||||||
|
theCView.DefWindow.Background.g,
|
||||||
|
theCView.DefWindow.Background.b,
|
||||||
|
1.0f);
|
||||||
|
theProgram->SetUniform (theGlContext,
|
||||||
|
myUniformLocations[theProgramId][OpenGl_RT_uBackColorTop], aBackColor);
|
||||||
|
theProgram->SetUniform (theGlContext,
|
||||||
|
myUniformLocations[theProgramId][OpenGl_RT_uBackColorBot], aBackColor);
|
||||||
|
}
|
||||||
|
|
||||||
theProgram->SetUniform (theGlContext,
|
theProgram->SetUniform (theGlContext,
|
||||||
myUniformLocations[theProgramId][OpenGl_RT_uSphereMapForBack], theCView.RenderParams.UseEnvironmentMapBackground ? 1 : 0);
|
myUniformLocations[theProgramId][OpenGl_RT_uSphereMapForBack], theCView.RenderParams.UseEnvironmentMapBackground ? 1 : 0);
|
||||||
|
27
tests/bugs/vis/bug26404
Normal file
27
tests/bugs/vis/bug26404
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC26404"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
###########################################################################################
|
||||||
|
# Visualization, Ray Tracing - use solid background color when gradient color is disabled
|
||||||
|
###########################################################################################
|
||||||
|
|
||||||
|
box b 1 2 3
|
||||||
|
vinit View1
|
||||||
|
vclear
|
||||||
|
vaxo
|
||||||
|
vsetdispmode 1
|
||||||
|
vsetcolorbg 10 10 10
|
||||||
|
vdisplay b
|
||||||
|
vfit
|
||||||
|
vraytrace 1
|
||||||
|
set bug_info_1 [vreadpixel 50 50 rgb name]
|
||||||
|
if {$bug_info_1 != "GRAY8"} {
|
||||||
|
puts "ERROR: OCC26404 is reproduced. Background color is invalid (case #1)."
|
||||||
|
}
|
||||||
|
vsetgradientbg 255 0 0 0 0 255 1
|
||||||
|
vsetgradientbg 255 0 0 0 0 255 0
|
||||||
|
set bug_info_2 [vreadpixel 50 50 rgb name]
|
||||||
|
if {$bug_info_2 != "GRAY8"} {
|
||||||
|
puts "ERROR: OCC26404 is reproduced. Background color is invalid (case #2)."
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user