From 95b2678c735bea91fc860011c0fb9036016f33cf Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 12 Feb 2015 15:49:22 +0300 Subject: [PATCH] 0025822: Visualization, TKOpenGl - front material should be used instead of back material within distinguish mode turned off add test case v3d/glsl/distinguish_off --- src/OpenGl/OpenGl_ShaderManager.cxx | 4 ++- tests/v3d/glsl/distinguish_off | 38 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/v3d/glsl/distinguish_off diff --git a/src/OpenGl/OpenGl_ShaderManager.cxx b/src/OpenGl/OpenGl_ShaderManager.cxx index 14fc5923d7..e00d2e4e23 100644 --- a/src/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/OpenGl/OpenGl_ShaderManager.cxx @@ -843,7 +843,9 @@ static void PushAspectFace (const Handle(OpenGl_Context)& theCtx, continue; } - aParams.Init (anIndex == 0 ? theAspect->IntFront() : theAspect->IntBack()); + aParams.Init (anIndex == 0 || theAspect->DistinguishingMode() != TOn + ? theAspect->IntFront() + : theAspect->IntBack()); theProgram->SetUniform (theCtx, aLoc, OpenGl_Material::NbOfVec4(), aParams.Packed()); } diff --git a/tests/v3d/glsl/distinguish_off b/tests/v3d/glsl/distinguish_off new file mode 100644 index 0000000000..b8aa39aeff --- /dev/null +++ b/tests/v3d/glsl/distinguish_off @@ -0,0 +1,38 @@ +puts "========" +puts "0025822: Visualization, TKOpenGl - front material should be used instead of back material within distinguish mode turned off" +puts "========" + +pload MODELING OCAF XDE +box b 10 10 10 +vclear +vclose all +catch { Close D } +NewDocument D MDTV-XCAF +XAddShape D b +XSetColor D b 0 0 1 +explode b f +XSetColor D b_1 1 0 0 + +XShow D +vviewparams -proj 1 0.1 0.1 +vfit +vsetdispmode 1 + +catch { vclipplane delete pln } +vclipplane create pln +vclipplane set pln view Driver1/Document_D/View1 +vclipplane change pln equation -1 0 0 5 + +# FFP on, pixel is RED3, which is expected +vcaps -ffp 1 +set aColorFfp [vreadpixel 200 200 rgb name] +if { "$aColorFfp" != "RED3" } { + puts "Error: RED3 color is expected at the back side (FFP)" +} + +# GLSL on, pixel should has the same color RED3, but actual color is KHAKI1 +vcaps -ffp 0 +set aColorGlsl [vreadpixel 200 200 rgb name] +if { "$aColorGlsl" != "RED3" } { + puts "Error: RED3 color is expected at the back side (GLSL)" +} -- 2.20.1