// purpose : Creates new empty shader manager
// =======================================================================
OpenGl_ShaderManager::OpenGl_ShaderManager (OpenGl_Context* theContext)
-: myShadingModel (Visual3d_TOM_VERTEX),
+: myShadingModel (Graphic3d_TOSM_VERTEX),
myContext (theContext),
myLastView (NULL)
{
// =======================================================================
void OpenGl_ShaderManager::switchLightPrograms()
{
- TCollection_AsciiString aKey (myShadingModel == Visual3d_TOM_FRAGMENT ? "p_" : "g_");
+ TCollection_AsciiString aKey (myShadingModel == Graphic3d_TOSM_FRAGMENT ? "p_" : "g_");
const OpenGl_ListOfLight* aLights = myLightSourceState.LightSources();
if (aLights != NULL)
{
{
switch (aLightIter.Value().Type)
{
- case Visual3d_TOLS_AMBIENT:
+ case Graphic3d_TOLS_AMBIENT:
break; // skip ambient
- case Visual3d_TOLS_DIRECTIONAL:
+ case Graphic3d_TOLS_DIRECTIONAL:
aKey += "d";
break;
- case Visual3d_TOLS_POSITIONAL:
+ case Graphic3d_TOLS_POSITIONAL:
aKey += "p";
break;
- case Visual3d_TOLS_SPOT:
+ case Graphic3d_TOLS_SPOT:
aKey += "s";
break;
}
// function : SetShadingModel
// purpose :
// =======================================================================
-void OpenGl_ShaderManager::SetShadingModel (const Visual3d_TypeOfModel theModel)
+void OpenGl_ShaderManager::SetShadingModel (const Graphic3d_TypeOfShadingModel theModel)
{
myShadingModel = theModel;
switchLightPrograms();
for (OpenGl_ListOfLight::Iterator anIter (*myLightSourceState.LightSources()); anIter.More(); anIter.Next())
{
const OpenGl_Light& aLight = anIter.Value();
- if (aLight.Type == Visual3d_TOLS_AMBIENT)
+ if (aLight.Type == Graphic3d_TOLS_AMBIENT)
{
anAmbient += aLight.Color;
continue;
OpenGl_ShaderLightParameters& aLightParams = aLightParamsArray[aLightsNb];
aLightParams.Color = aLight.Color;
- aLightParams.Position = aLight.Type == Visual3d_TOLS_DIRECTIONAL
+ aLightParams.Position = aLight.Type == Graphic3d_TOLS_DIRECTIONAL
? -aLight.Direction
: aLight.Position;
- if (aLight.Type == Visual3d_TOLS_SPOT)
+ if (aLight.Type == Graphic3d_TOLS_SPOT)
{
aLightParams.Direction = aLight.Direction;
}
// function : UpdateSurfaceDetailStateTo
// purpose : Updates state of OCCT surface detail
// =======================================================================
-void OpenGl_ShaderManager::UpdateSurfaceDetailStateTo (const Visual3d_TypeOfSurfaceDetail theDetail)
+void OpenGl_ShaderManager::UpdateSurfaceDetailStateTo (const Graphic3d_TypeOfSurfaceDetail theDetail)
{
mySurfaceDetailState.Set (theDetail);
mySurfaceDetailState.Update();
// =======================================================================
TCollection_AsciiString OpenGl_ShaderManager::stdComputeLighting (const Standard_Boolean theHasVertColor)
{
- bool aLightsMap[Visual3d_TOLS_SPOT + 1] = { false, false, false, false };
+ bool aLightsMap[Graphic3d_TOLS_SPOT + 1] = { false, false, false, false };
TCollection_AsciiString aLightsFunc, aLightsLoop;
const OpenGl_ListOfLight* aLights = myLightSourceState.LightSources();
if (aLights != NULL)
{
switch (aLightIter.Value().Type)
{
- case Visual3d_TOLS_AMBIENT:
+ case Graphic3d_TOLS_AMBIENT:
--anIndex;
break; // skip ambient
- case Visual3d_TOLS_DIRECTIONAL:
+ case Graphic3d_TOLS_DIRECTIONAL:
aLightsLoop = aLightsLoop + EOL" directionalLight (" + anIndex + ", theNormal, theView, theIsFront);";
break;
- case Visual3d_TOLS_POSITIONAL:
+ case Graphic3d_TOLS_POSITIONAL:
aLightsLoop = aLightsLoop + EOL" pointLight (" + anIndex + ", theNormal, theView, aPoint, theIsFront);";
break;
- case Visual3d_TOLS_SPOT:
+ case Graphic3d_TOLS_SPOT:
aLightsLoop = aLightsLoop + EOL" spotLight (" + anIndex + ", theNormal, theView, aPoint, theIsFront);";
break;
}
aTypeBit = true;
switch (aLightIter.Value().Type)
{
- case Visual3d_TOLS_AMBIENT: break;
- case Visual3d_TOLS_DIRECTIONAL: aLightsFunc += THE_FUNC_directionalLight; break;
- case Visual3d_TOLS_POSITIONAL: aLightsFunc += THE_FUNC_pointLight; break;
- case Visual3d_TOLS_SPOT: aLightsFunc += THE_FUNC_spotLight; break;
+ case Graphic3d_TOLS_AMBIENT: break;
+ case Graphic3d_TOLS_DIRECTIONAL: aLightsFunc += THE_FUNC_directionalLight; break;
+ case Graphic3d_TOLS_POSITIONAL: aLightsFunc += THE_FUNC_pointLight; break;
+ case Graphic3d_TOLS_SPOT: aLightsFunc += THE_FUNC_spotLight; break;
}
}
}