}
// Set background colors (only gradient background supported)
- if (myBgGradientArray != NULL)
+ if (myBgGradientArray != NULL
+ && myBgGradientArray->IsDefined())
{
theProgram->SetUniform (theGlContext,
myUniformLocations[theProgramId][OpenGl_RT_uBackColorTop], myBgGradientArray->GradientColor (0));
theProgram->SetUniform (theGlContext,
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,
myUniformLocations[theProgramId][OpenGl_RT_uSphereMapForBack], theCView.RenderParams.UseEnvironmentMapBackground ? 1 : 0);
--- /dev/null
+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)."
+}