]> OCCT Git - occt-copy.git/commitdiff
eventual correction of the outline shader
authorasl <asl@opencascade.com>
Wed, 13 Jun 2018 04:51:20 +0000 (07:51 +0300)
committerasl <asl@opencascade.com>
Wed, 13 Jun 2018 04:51:20 +0000 (07:51 +0300)
src/OpenGl/OpenGl_PrimitiveArray.cxx
src/OpenGl/OpenGl_ShaderManager.cxx

index f6937deeaf3d2bdf8589044119c0a4955174c928..8804b51bcc4d659b6809a622bcfbbfb7fd88d598 100644 (file)
@@ -828,7 +828,7 @@ void OpenGl_PrimitiveArray::Render (const Handle(OpenGl_Workspace)& theWorkspace
           theWorkspace->View()->Window()->Size(aViewWidth, aViewHeight);
           Standard_Integer aMin = aViewWidth < aViewHeight ? aViewWidth : aViewHeight;
 
-          Standard_ShortReal anEdgeWidth = 2*(Standard_ShortReal)anAspectFace->Aspect()->EdgeWidth() / (Standard_ShortReal)aMin;
+          Standard_ShortReal anEdgeWidth = (Standard_ShortReal)anAspectFace->Aspect()->EdgeWidth() / (Standard_ShortReal)aMin;
           aCtx->SetSilhouetteThickness(anEdgeWidth);
 
           aCtx->SetIsSilhouettePass(Standard_True);
index d5c29a6a5285c3213a3de98dac54f3bf6f0cf461..5be378ae362d774c3ba3d4420a478dff04b6eddf 100644 (file)
@@ -1616,10 +1616,10 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramUnlit (Handle(OpenGl_Sha
       EOL"  vec3 pdelta = vec3(0.0, 0.0, 0.0);"
       EOL"  vec4 proj_normal = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * vec4(occNormal, 0.0);"
       EOL""
-      EOL"  float aShift = occSilhouetteThickness / 2.0;"
+      EOL"  float aShift = occSilhouetteThickness;"// / 2.0;"
       EOL"  if (occOrthoScale > 0.0)"
       EOL"  {"
-      EOL"    if (abs(proj_normal[2]) < 0.1)"
+      EOL"    if (abs(proj_normal[2]) < 0.25)"
       EOL"    {"
       EOL"      float k = 1.0;"
       EOL"      if (occIsSilhouettePass < 0.1)"