mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0024437: Efficient HLR visualization based on OpenGL and GLSL
correction of HLR in perspective mode
This commit is contained in:
@@ -3456,7 +3456,10 @@ void OpenGl_Context::PushOrthoScale (const Handle(OpenGl_Workspace)& theWorkspac
|
||||
{
|
||||
if (!myActiveProgram.IsNull() && !theWorkspace.IsNull())
|
||||
{
|
||||
Standard_ShortReal aScale = (Standard_ShortReal)theWorkspace->View()->Camera()->Scale();
|
||||
Handle(Graphic3d_Camera) aCamera = theWorkspace->View()->Camera();
|
||||
Standard_ShortReal aScale = 0.0;
|
||||
if( aCamera->IsOrthographic() )
|
||||
aScale = (Standard_ShortReal)aCamera->Scale();
|
||||
myActiveProgram->SetUniform(this, myActiveProgram->GetStateLocation(OpenGl_OCCT_ORTHO_SCALE), aScale);
|
||||
}
|
||||
}
|
||||
|
@@ -1635,16 +1635,17 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramUnlit (Handle(OpenGl_Sha
|
||||
EOL" {"
|
||||
EOL" if (occIsSilhouettePass > 0.1)"
|
||||
EOL" {"
|
||||
EOL" vec4 pos = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * vertex;"
|
||||
EOL" delta = occNormal.xyz * aShift * pos.w;"
|
||||
EOL" vec4 proj_vertex = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * vertex;"
|
||||
EOL" delta = occNormal.xyz * aShift/2 * proj_vertex.w;"
|
||||
EOL" }"
|
||||
EOL" }"
|
||||
EOL" "
|
||||
EOL" vertex += vec4(delta, 0.0);"
|
||||
EOL" vertex[3] = 1.0;"
|
||||
;
|
||||
|
||||
aSrcVertEndMain +=
|
||||
EOL"gl_Position += vec4(pdelta.xy, 0.0, 0.0);"
|
||||
EOL"gl_Position += vec4(2*pdelta.xy, 0.0, 0.0);"
|
||||
;
|
||||
|
||||
aSrcFragExtraOut +=
|
||||
|
Reference in New Issue
Block a user