//! Bind program for filled primitives rendering
Standard_Boolean BindFaceProgram (const Handle(OpenGl_TextureSet)& theTextures,
const Graphic3d_TypeOfShadingModel theShadingModel,
+ const Graphic3d_AlphaMode theAlphaMode,
const Standard_Boolean theHasVertColor,
const Standard_Boolean theEnableEnvMap,
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
&& (theTextures.IsNull() || theTextures->IsModulate())
? theShadingModel
: Graphic3d_TOSM_UNLIT;
- const Standard_Integer aBits = getProgramBits (theTextures, theHasVertColor, theEnableEnvMap);
+ const Standard_Integer aBits = getProgramBits (theTextures, theAlphaMode, theHasVertColor, theEnableEnvMap);
Handle(OpenGl_ShaderProgram)& aProgram = getStdProgram (aShadeModelOnFace, aBits);
return bindProgramWithState (aProgram);
}
Standard_Boolean BindLineProgram (const Handle(OpenGl_TextureSet)& theTextures,
const Aspect_TypeOfLine theLineType,
const Graphic3d_TypeOfShadingModel theShadingModel,
+ const Graphic3d_AlphaMode theAlphaMode,
const Standard_Boolean theHasVertColor,
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
{
return bindProgramWithState (theCustomProgram);
}
- Standard_Integer aBits = getProgramBits (theTextures, theHasVertColor);
+ Standard_Integer aBits = getProgramBits (theTextures, theAlphaMode, theHasVertColor, false);
if (theLineType != Aspect_TOL_SOLID)
{
aBits |= OpenGl_PO_StippleLine;
//! Bind program for point rendering
Standard_Boolean BindMarkerProgram (const Handle(OpenGl_TextureSet)& theTextures,
const Graphic3d_TypeOfShadingModel theShadingModel,
+ const Graphic3d_AlphaMode theAlphaMode,
const Standard_Boolean theHasVertColor,
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
{
return bindProgramWithState (theCustomProgram);
}
- const Standard_Integer aBits = getProgramBits (theTextures, theHasVertColor) | OpenGl_PO_Point;
+ const Standard_Integer aBits = getProgramBits (theTextures, theAlphaMode, theHasVertColor, false) | OpenGl_PO_Point;
Handle(OpenGl_ShaderProgram)& aProgram = getStdProgram (theShadingModel, aBits);
return bindProgramWithState (aProgram);
}
//! Updates state of material.
void UpdateMaterialStateTo (const OpenGl_Material& theFrontMat,
const OpenGl_Material& theBackMat,
+ const float theAlphaCutoff,
const bool theToDistinguish,
const bool theToMapTexture)
{
- myMaterialState.Set (theFrontMat, theBackMat, theToDistinguish, theToMapTexture);
+ myMaterialState.Set (theFrontMat, theBackMat, theAlphaCutoff, theToDistinguish, theToMapTexture);
myMaterialState.Update();
}
//! Define program bits.
Standard_Integer getProgramBits (const Handle(OpenGl_TextureSet)& theTextures,
- const Standard_Boolean theHasVertColor,
- const Standard_Boolean theEnableEnvMap = Standard_False)
+ Graphic3d_AlphaMode theAlphaMode,
+ Standard_Boolean theHasVertColor,
+ Standard_Boolean theEnableEnvMap)
{
Standard_Integer aBits = 0;
+ if (theAlphaMode == Graphic3d_AlphaMode_Mask)
+ {
+ aBits |= OpenGl_PO_AlphaTest;
+ }
const Standard_Integer aNbPlanes = myContext->Clipping().NbClippingOrCappingOn();
if (aNbPlanes > 0)