1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026809: Visualization, TKOpenGl - handle point arrays with per-vertex color within built-in GLSL programs

Shader rendering of point sprites with per-vertex colors and shading have been fixed.

Material state was removed from OpenGl_ShaderManager.
Material properties now should be modified trough OpenGl_Context::SetShadingMaterial().
This commit is contained in:
duv
2016-04-17 12:43:08 +03:00
committed by bugmaster
parent b8f67cc236
commit 299e0ab98f
8 changed files with 226 additions and 373 deletions

View File

@@ -341,6 +341,19 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)&
}
}
// set uniform defaults
const GLint aLocSampler = GetStateLocation (OpenGl_OCCT_ACTIVE_SAMPLER);
const GLint aLocTexEnable = GetStateLocation (OpenGl_OCCT_TEXTURE_ENABLE);
if (aLocSampler != INVALID_LOCATION
|| aLocTexEnable != INVALID_LOCATION)
{
const Handle(OpenGl_ShaderProgram)& anOldProgram = theCtx->ActiveProgram();
theCtx->core20fwd->glUseProgram (myProgramID);
SetUniform (theCtx, aLocSampler, 0); // GL_TEXTURE0
SetUniform (theCtx, aLocTexEnable, 0); // Off
theCtx->core20fwd->glUseProgram (!anOldProgram.IsNull() ? anOldProgram->ProgramId() : OpenGl_ShaderProgram::NO_PROGRAM);
}
return Standard_True;
}