mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0032567: Coding Rules - rename Graphic3d_TypeOfShadingModel values to include full enumeration name
This commit is contained in:
parent
e2421df543
commit
13b36bb14f
@ -1468,8 +1468,8 @@ The following items are required to determine the three colors of reflection:
|
|||||||
* Coefficient of ambient reflection;
|
* Coefficient of ambient reflection;
|
||||||
* Coefficient of specular reflection.
|
* Coefficient of specular reflection.
|
||||||
|
|
||||||
Common material properties are used within Gouraud and Phong shading models (Graphic3d_TOSM_FACET, Graphic3d_TOSM_VERTEX and Graphic3d_TOSM_FRAGMENT).
|
Common material properties are used within Phong shading model (Graphic3d_TypeOfShadingModel_Phong, Graphic3d_TypeOfShadingModel_PhongFacet and Graphic3d_TypeOfShadingModel_Gouraud).
|
||||||
Within PBR shading model (Graphic3d_TOSM_PBR and Graphic3d_TOSM_PBR_FACET), material properties are defined by the following *Graphic3d_PBRMaterial* properties (Graphic3d_MaterialAspect::PBRMaterial()):
|
Within PBR shading model (Graphic3d_TypeOfShadingModel_Pbr and Graphic3d_TypeOfShadingModel_PbrFacet), material properties are defined by the following *Graphic3d_PBRMaterial* properties (Graphic3d_MaterialAspect::PBRMaterial()):
|
||||||
* Albedo (main color);
|
* Albedo (main color);
|
||||||
* Metallic factor;
|
* Metallic factor;
|
||||||
* Roughness factor;
|
* Roughness factor;
|
||||||
|
@ -307,7 +307,7 @@ bool WasmOcctView::initViewer()
|
|||||||
|
|
||||||
Handle(V3d_Viewer) aViewer = new V3d_Viewer (aDriver);
|
Handle(V3d_Viewer) aViewer = new V3d_Viewer (aDriver);
|
||||||
aViewer->SetComputedMode (false);
|
aViewer->SetComputedMode (false);
|
||||||
aViewer->SetDefaultShadingModel (Graphic3d_TOSM_FRAGMENT);
|
aViewer->SetDefaultShadingModel (Graphic3d_TypeOfShadingModel_Phong);
|
||||||
aViewer->SetDefaultLights();
|
aViewer->SetDefaultLights();
|
||||||
aViewer->SetLightOn();
|
aViewer->SetLightOn();
|
||||||
for (V3d_ListOfLight::Iterator aLightIter (aViewer->ActiveLights()); aLightIter.More(); aLightIter.Next())
|
for (V3d_ListOfLight::Iterator aLightIter (aViewer->ActiveLights()); aLightIter.More(); aLightIter.Next())
|
||||||
|
@ -133,7 +133,7 @@ AIS_ColorScale::AIS_ColorScale()
|
|||||||
{
|
{
|
||||||
SetDisplayMode (0);
|
SetDisplayMode (0);
|
||||||
myDrawer->SetupOwnShadingAspect();
|
myDrawer->SetupOwnShadingAspect();
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Opaque);
|
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Opaque);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (Quantity_NOC_WHITE);
|
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (Quantity_NOC_WHITE);
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ AIS_LightSource::AIS_LightSource (const Handle(Graphic3d_CLight)& theLight)
|
|||||||
aMat.SetColor (aColor);
|
aMat.SetColor (aColor);
|
||||||
myDrawer->SetArrowAspect (new Prs3d_ArrowAspect());
|
myDrawer->SetArrowAspect (new Prs3d_ArrowAspect());
|
||||||
myDrawer->ArrowAspect()->SetColor (aColor);
|
myDrawer->ArrowAspect()->SetColor (aColor);
|
||||||
myDrawer->ArrowAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myDrawer->ArrowAspect()->Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myDrawer->ArrowAspect()->Aspect()->ChangeFrontMaterial() = aMat;
|
myDrawer->ArrowAspect()->Aspect()->ChangeFrontMaterial() = aMat;
|
||||||
myDrawer->ArrowAspect()->Aspect()->SetMarkerType (Aspect_TOM_EMPTY);
|
myDrawer->ArrowAspect()->Aspect()->SetMarkerType (Aspect_TOM_EMPTY);
|
||||||
myDrawer->ArrowAspect()->Aspect()->SetMarkerScale (2.0f);
|
myDrawer->ArrowAspect()->Aspect()->SetMarkerScale (2.0f);
|
||||||
@ -211,7 +211,7 @@ AIS_LightSource::AIS_LightSource (const Handle(Graphic3d_CLight)& theLight)
|
|||||||
myDrawer->ShadingAspect()->SetColor (aColor);
|
myDrawer->ShadingAspect()->SetColor (aColor);
|
||||||
myDrawer->ShadingAspect()->SetMaterial (aMat);
|
myDrawer->ShadingAspect()->SetMaterial (aMat);
|
||||||
myDrawer->ShadingAspect()->SetTransparency (0.5f);
|
myDrawer->ShadingAspect()->SetTransparency (0.5f);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
|
|
||||||
myDrawer->SetTextAspect (new Prs3d_TextAspect());
|
myDrawer->SetTextAspect (new Prs3d_TextAspect());
|
||||||
myDrawer->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_SHADOW);
|
myDrawer->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_SHADOW);
|
||||||
|
@ -56,7 +56,7 @@ AIS_MediaPlayer::AIS_MediaPlayer()
|
|||||||
|
|
||||||
Graphic3d_MaterialAspect aMat;
|
Graphic3d_MaterialAspect aMat;
|
||||||
myFrameAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_WHITE, Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0f, aMat, aMat);
|
myFrameAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_WHITE, Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0f, aMat, aMat);
|
||||||
myFrameAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myFrameAspect->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myFrameAspect->SetTextureMapOn (true);
|
myFrameAspect->SetTextureMapOn (true);
|
||||||
myFrameAspect->SetTextureSet (myFramePair);
|
myFrameAspect->SetTextureSet (myFramePair);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ AIS_RubberBand::AIS_RubberBand()
|
|||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
|
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
|
||||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
|
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||||
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
||||||
@ -66,7 +66,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
|
|||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
|
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
|
||||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
|
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||||
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
||||||
@ -92,7 +92,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
|
|||||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
||||||
myDrawer->ShadingAspect()->SetColor (theFillColor);
|
myDrawer->ShadingAspect()->SetColor (theFillColor);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|
||||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||||
myDrawer->ShadingAspect()->SetTransparency (theTransparency);
|
myDrawer->ShadingAspect()->SetTransparency (theTransparency);
|
||||||
|
@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d()
|
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d()
|
||||||
{
|
{
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||||
myLineType = Aspect_TOL_SOLID;
|
myLineType = Aspect_TOL_SOLID;
|
||||||
myLineWidth = 1.0f;
|
myLineWidth = 1.0f;
|
||||||
@ -37,7 +37,7 @@ Graphic3d_AspectLine3d::Graphic3d_AspectLine3d (const Quantity_Color& theColor,
|
|||||||
Aspect_TypeOfLine theType,
|
Aspect_TypeOfLine theType,
|
||||||
Standard_Real theWidth)
|
Standard_Real theWidth)
|
||||||
{
|
{
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myInteriorColor.SetRGB (theColor);
|
myInteriorColor.SetRGB (theColor);
|
||||||
SetLineType (theType);
|
SetLineType (theType);
|
||||||
SetLineWidth ((float)theWidth);
|
SetLineWidth ((float)theWidth);
|
||||||
|
@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
|
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
|
||||||
{
|
{
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||||
myMarkerType = Aspect_TOM_X;
|
myMarkerType = Aspect_TOM_X;
|
||||||
myMarkerScale = 1.0f;
|
myMarkerScale = 1.0f;
|
||||||
@ -37,7 +37,7 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker th
|
|||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Real theScale)
|
const Standard_Real theScale)
|
||||||
{
|
{
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myInteriorColor.SetRGB (theColor);
|
myInteriorColor.SetRGB (theColor);
|
||||||
myMarkerType = theType;
|
myMarkerType = theType;
|
||||||
SetMarkerScale ((float )theScale);
|
SetMarkerScale ((float )theScale);
|
||||||
@ -52,7 +52,7 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theCo
|
|||||||
const Standard_Integer theHeight,
|
const Standard_Integer theHeight,
|
||||||
const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
|
const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
|
||||||
{
|
{
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myMarkerImage = new Graphic3d_MarkerImage(theTextureBitMap, theWidth, theHeight);
|
myMarkerImage = new Graphic3d_MarkerImage(theTextureBitMap, theWidth, theHeight);
|
||||||
myInteriorColor.SetRGB (theColor),
|
myInteriorColor.SetRGB (theColor),
|
||||||
myMarkerType = Aspect_TOM_USERDEFINED;
|
myMarkerType = Aspect_TOM_USERDEFINED;
|
||||||
@ -65,7 +65,7 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theCo
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Handle(Image_PixMap)& theTextureImage)
|
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Handle(Image_PixMap)& theTextureImage)
|
||||||
{
|
{
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myMarkerImage = new Graphic3d_MarkerImage (theTextureImage);
|
myMarkerImage = new Graphic3d_MarkerImage (theTextureImage);
|
||||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||||
myMarkerType = Aspect_TOM_USERDEFINED;
|
myMarkerType = Aspect_TOM_USERDEFINED;
|
||||||
|
@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Graphic3d_Aspects)
|
|||||||
Graphic3d_AspectText3d::Graphic3d_AspectText3d()
|
Graphic3d_AspectText3d::Graphic3d_AspectText3d()
|
||||||
{
|
{
|
||||||
SetAlphaMode (Graphic3d_AlphaMode_MaskBlend, 0.285f);
|
SetAlphaMode (Graphic3d_AlphaMode_MaskBlend, 0.285f);
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||||
myEdgeColor.SetRGB (Quantity_NOC_WHITE);
|
myEdgeColor.SetRGB (Quantity_NOC_WHITE);
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
|
|||||||
Aspect_TypeOfDisplayText theDisplayType)
|
Aspect_TypeOfDisplayText theDisplayType)
|
||||||
{
|
{
|
||||||
SetAlphaMode (Graphic3d_AlphaMode_MaskBlend, 0.285f);
|
SetAlphaMode (Graphic3d_AlphaMode_MaskBlend, 0.285f);
|
||||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
myTextStyle = theStyle;
|
myTextStyle = theStyle;
|
||||||
myTextDisplayType = theDisplayType;
|
myTextDisplayType = theDisplayType;
|
||||||
myInteriorColor.SetRGB (theColor);
|
myInteriorColor.SetRGB (theColor);
|
||||||
|
@ -25,7 +25,7 @@ Graphic3d_Aspects::Graphic3d_Aspects()
|
|||||||
myBackInteriorColor (Quantity_NOC_CYAN1),
|
myBackInteriorColor (Quantity_NOC_CYAN1),
|
||||||
myEdgeColor (Quantity_NOC_WHITE),
|
myEdgeColor (Quantity_NOC_WHITE),
|
||||||
myInteriorStyle (Aspect_IS_SOLID),
|
myInteriorStyle (Aspect_IS_SOLID),
|
||||||
myShadingModel (Graphic3d_TOSM_DEFAULT),
|
myShadingModel (Graphic3d_TypeOfShadingModel_DEFAULT),
|
||||||
myFaceCulling (Graphic3d_TypeOfBackfacingModel_Auto),
|
myFaceCulling (Graphic3d_TypeOfBackfacingModel_Auto),
|
||||||
myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
|
myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
|
||||||
myAlphaCutoff (0.5f),
|
myAlphaCutoff (0.5f),
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
//! Modifies the interior type used for rendering
|
//! Modifies the interior type used for rendering
|
||||||
void SetInteriorStyle (const Aspect_InteriorStyle theStyle) { myInteriorStyle = theStyle; }
|
void SetInteriorStyle (const Aspect_InteriorStyle theStyle) { myInteriorStyle = theStyle; }
|
||||||
|
|
||||||
//! Returns shading model; Graphic3d_TOSM_DEFAULT by default.
|
//! Returns shading model; Graphic3d_TypeOfShadingModel_DEFAULT by default.
|
||||||
//! Graphic3d_TOSM_DEFAULT means that Shading Model set as default for entire Viewer will be used.
|
//! Graphic3d_TOSM_DEFAULT means that Shading Model set as default for entire Viewer will be used.
|
||||||
Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
|
Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
|
||||||
|
|
||||||
|
@ -1092,7 +1092,7 @@ void Graphic3d_CView::CopySettings (const Handle(Graphic3d_CView)& theOther)
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
void Graphic3d_CView::SetShadingModel (Graphic3d_TypeOfShadingModel theModel)
|
void Graphic3d_CView::SetShadingModel (Graphic3d_TypeOfShadingModel theModel)
|
||||||
{
|
{
|
||||||
if (theModel == Graphic3d_TOSM_DEFAULT)
|
if (theModel == Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||||
{
|
{
|
||||||
throw Standard_ProgramError ("Graphic3d_CView::SetShadingModel() - attempt to set invalid Shading Model!");
|
throw Standard_ProgramError ("Graphic3d_CView::SetShadingModel() - attempt to set invalid Shading Model!");
|
||||||
}
|
}
|
||||||
|
@ -99,11 +99,11 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Returns default Shading Model of the view; Graphic3d_TOSM_FRAGMENT by default.
|
//! Returns default Shading Model of the view; Graphic3d_TypeOfShadingModel_Phong by default.
|
||||||
Graphic3d_TypeOfShadingModel ShadingModel() const { return myRenderParams.ShadingModel; }
|
Graphic3d_TypeOfShadingModel ShadingModel() const { return myRenderParams.ShadingModel; }
|
||||||
|
|
||||||
//! Sets default Shading Model of the view.
|
//! Sets default Shading Model of the view.
|
||||||
//! Will throw an exception on attempt to set Graphic3d_TOSM_DEFAULT.
|
//! Will throw an exception on attempt to set Graphic3d_TypeOfShadingModel_DEFAULT.
|
||||||
Standard_EXPORT void SetShadingModel (Graphic3d_TypeOfShadingModel theModel);
|
Standard_EXPORT void SetShadingModel (Graphic3d_TypeOfShadingModel theModel);
|
||||||
|
|
||||||
//! Return backfacing model used for the view; Graphic3d_TypeOfBackfacingModel_Auto by default,
|
//! Return backfacing model used for the view; Graphic3d_TypeOfBackfacingModel_Auto by default,
|
||||||
|
@ -96,7 +96,7 @@ public:
|
|||||||
//! Creates default rendering parameters.
|
//! Creates default rendering parameters.
|
||||||
Graphic3d_RenderingParams()
|
Graphic3d_RenderingParams()
|
||||||
: Method (Graphic3d_RM_RASTERIZATION),
|
: Method (Graphic3d_RM_RASTERIZATION),
|
||||||
ShadingModel (Graphic3d_TOSM_FRAGMENT),
|
ShadingModel (Graphic3d_TypeOfShadingModel_Phong),
|
||||||
TransparencyMethod (Graphic3d_RTM_BLEND_UNORDERED),
|
TransparencyMethod (Graphic3d_RTM_BLEND_UNORDERED),
|
||||||
Resolution (THE_DEFAULT_RESOLUTION),
|
Resolution (THE_DEFAULT_RESOLUTION),
|
||||||
FontHinting (Font_Hinting_Off),
|
FontHinting (Font_Hinting_Off),
|
||||||
@ -189,7 +189,7 @@ public:
|
|||||||
public: //! @name general parameters
|
public: //! @name general parameters
|
||||||
|
|
||||||
Graphic3d_RenderingMode Method; //!< specifies rendering mode, Graphic3d_RM_RASTERIZATION by default
|
Graphic3d_RenderingMode Method; //!< specifies rendering mode, Graphic3d_RM_RASTERIZATION by default
|
||||||
Graphic3d_TypeOfShadingModel ShadingModel; //!< specified default shading model, Graphic3d_TOSM_FRAGMENT by default
|
Graphic3d_TypeOfShadingModel ShadingModel; //!< specified default shading model, Graphic3d_TypeOfShadingModel_Phong by default
|
||||||
Graphic3d_RenderTransparentMethod TransparencyMethod; //!< specifies rendering method for transparent graphics
|
Graphic3d_RenderTransparentMethod TransparencyMethod; //!< specifies rendering method for transparent graphics
|
||||||
unsigned int Resolution; //!< Pixels density (PPI), defines scaling factor for parameters like text size
|
unsigned int Resolution; //!< Pixels density (PPI), defines scaling factor for parameters like text size
|
||||||
//! (when defined in screen-space units rather than in 3D) to be properly displayed
|
//! (when defined in screen-space units rather than in 3D) to be properly displayed
|
||||||
|
@ -33,7 +33,7 @@ enum Graphic3d_TypeOfLimit
|
|||||||
Graphic3d_TypeOfLimit_HasSRGB, //!< indicates whether sRGB rendering is supported
|
Graphic3d_TypeOfLimit_HasSRGB, //!< indicates whether sRGB rendering is supported
|
||||||
Graphic3d_TypeOfLimit_HasBlendedOit, //!< indicates whether necessary GL extensions for Weighted, Blended OIT available (without MSAA).
|
Graphic3d_TypeOfLimit_HasBlendedOit, //!< indicates whether necessary GL extensions for Weighted, Blended OIT available (without MSAA).
|
||||||
Graphic3d_TypeOfLimit_HasBlendedOitMsaa, //!< indicates whether necessary GL extensions for Weighted, Blended OIT available (with MSAA).
|
Graphic3d_TypeOfLimit_HasBlendedOitMsaa, //!< indicates whether necessary GL extensions for Weighted, Blended OIT available (with MSAA).
|
||||||
Graphic3d_TypeOfLimit_HasFlatShading, //!< indicates whether Flat shading (Graphic3d_TOSM_FACET) is supported
|
Graphic3d_TypeOfLimit_HasFlatShading, //!< indicates whether Flat shading (Graphic3d_TypeOfShadingModel_PhongFacet) is supported
|
||||||
Graphic3d_TypeOfLimit_HasMeshEdges, //!< indicates whether advanced mesh edges presentation is supported
|
Graphic3d_TypeOfLimit_HasMeshEdges, //!< indicates whether advanced mesh edges presentation is supported
|
||||||
Graphic3d_TypeOfLimit_IsWorkaroundFBO, //!< indicates whether workaround for Intel driver problem with empty FBO for images with big width is applied.
|
Graphic3d_TypeOfLimit_IsWorkaroundFBO, //!< indicates whether workaround for Intel driver problem with empty FBO for images with big width is applied.
|
||||||
Graphic3d_TypeOfLimit_NB //!< number of elements in this enumeration
|
Graphic3d_TypeOfLimit_NB //!< number of elements in this enumeration
|
||||||
|
@ -21,38 +21,44 @@
|
|||||||
enum Graphic3d_TypeOfShadingModel
|
enum Graphic3d_TypeOfShadingModel
|
||||||
{
|
{
|
||||||
//! Use Shading Model, specified as default for entire Viewer.
|
//! Use Shading Model, specified as default for entire Viewer.
|
||||||
Graphic3d_TOSM_DEFAULT = -1,
|
Graphic3d_TypeOfShadingModel_DEFAULT = -1,
|
||||||
|
|
||||||
//! Unlit Shading (or shadeless), lighting is ignored and facet is fully filled by its material color.
|
//! Unlit Shading (or shadeless), lighting is ignored and facet is fully filled by its material color.
|
||||||
//! This model is useful for artificial/auxiliary objects, not intended to be lit,
|
//! This model is useful for artificial/auxiliary objects, not intended to be lit,
|
||||||
//! or for objects with pre-calculated lighting information (e.g. captured by camera).
|
//! or for objects with pre-calculated lighting information (e.g. captured by camera).
|
||||||
Graphic3d_TOSM_UNLIT = 0,
|
Graphic3d_TypeOfShadingModel_Unlit = 0,
|
||||||
|
|
||||||
//! Flat Shading, calculated per-facet basing on facet normal.
|
//! Flat Shading for Phong material model, calculated using triangle normal.
|
||||||
//! This model is useful for mesh element analysis.
|
//! Could be useful for mesh element analysis.
|
||||||
//! Note that unlike Graphic3d_TOSM_VERTEX/Graphic3d_TOSM_FRAGMENT,
|
//! This shading model does NOT require normals to be defined within vertex attributes.
|
||||||
//! this shading model does NOT require normals to be defined within vertex attributes.
|
Graphic3d_TypeOfShadingModel_PhongFacet,
|
||||||
Graphic3d_TOSM_FACET,
|
|
||||||
|
|
||||||
//! Gouraud Shading, calculated per-vertex basing on nodal normal, and then color is interpolated across fragments.
|
//! Gouraud shading uses the same material definition as Phong reflection model,
|
||||||
//! This shading model was default within Fixed-Function Pipeline of old OpenGL (and Direct3d);
|
//! but emulates an obsolete per-vertex calculations with result color interpolated across fragments,
|
||||||
//! still can be used as alternative to Graphic3d_TOSM_FRAGMENT for better performance on low-poly (and middle-poly) models
|
//! as implemented by T&L hardware blocks on old graphics hardware.
|
||||||
//! (per-fragment shading is more optimal for considerably high-poly models, since expensive shading is not computed for discarded fragments).
|
//! This shading model requires normals to be defined within vertex attributes.
|
||||||
//! Shading model requires normals to be defined within vertex attributes.
|
Graphic3d_TypeOfShadingModel_Gouraud,
|
||||||
Graphic3d_TOSM_VERTEX,
|
|
||||||
|
|
||||||
//! Phong Shading, calculated per-fragment basing on nodal normal, so that normal is interpolated across fragments.
|
//! Phong reflection model, an empirical model defined by Diffuse/Ambient/Specular/Shininess components.
|
||||||
//! This is a main shading model nowadays, providing the best image quality.
|
//! Lighting is calculated per-fragment basing on nodal normal (normal is interpolated across fragments of triangle).
|
||||||
//! Shading model requires normals to be defined within vertex attributes.
|
//! This shading model requires normals to be defined within vertex attributes.
|
||||||
Graphic3d_TOSM_FRAGMENT,
|
Graphic3d_TypeOfShadingModel_Phong,
|
||||||
|
|
||||||
//! Metallic-roughness physically based (PBR) illumination system.
|
//! Metallic-roughness physically based (PBR) illumination system.
|
||||||
Graphic3d_TOSM_PBR,
|
Graphic3d_TypeOfShadingModel_Pbr,
|
||||||
|
|
||||||
//! Same as Graphic3d_TOSM_PBR but using flat per-triangle normal.
|
//! Same as Graphic3d_TypeOfShadingModel_Pbr but using flat per-triangle normal.
|
||||||
Graphic3d_TOSM_PBR_FACET,
|
Graphic3d_TypeOfShadingModel_PbrFacet,
|
||||||
|
|
||||||
// obsolete aliases
|
// obsolete aliases
|
||||||
|
Graphic3d_TOSM_DEFAULT = Graphic3d_TypeOfShadingModel_DEFAULT,
|
||||||
|
Graphic3d_TOSM_UNLIT = Graphic3d_TypeOfShadingModel_Unlit,
|
||||||
|
Graphic3d_TOSM_FACET = Graphic3d_TypeOfShadingModel_PhongFacet,
|
||||||
|
Graphic3d_TOSM_VERTEX = Graphic3d_TypeOfShadingModel_Gouraud,
|
||||||
|
Graphic3d_TOSM_FRAGMENT = Graphic3d_TypeOfShadingModel_Phong,
|
||||||
|
Graphic3d_TOSM_PBR = Graphic3d_TypeOfShadingModel_Pbr,
|
||||||
|
Graphic3d_TOSM_PBR_FACET = Graphic3d_TypeOfShadingModel_PbrFacet,
|
||||||
|
//
|
||||||
Graphic3d_TOSM_NONE = Graphic3d_TOSM_UNLIT,
|
Graphic3d_TOSM_NONE = Graphic3d_TOSM_UNLIT,
|
||||||
V3d_COLOR = Graphic3d_TOSM_NONE,
|
V3d_COLOR = Graphic3d_TOSM_NONE,
|
||||||
V3d_FLAT = Graphic3d_TOSM_FACET,
|
V3d_FLAT = Graphic3d_TOSM_FACET,
|
||||||
@ -63,7 +69,7 @@ enum Graphic3d_TypeOfShadingModel
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
//! Auxiliary value defining the overall number of values in enumeration Graphic3d_TypeOfShadingModel
|
//! Auxiliary value defining the overall number of values in enumeration Graphic3d_TypeOfShadingModel
|
||||||
Graphic3d_TypeOfShadingModel_NB = Graphic3d_TOSM_PBR_FACET + 1
|
Graphic3d_TypeOfShadingModel_NB = Graphic3d_TypeOfShadingModel_PbrFacet + 1
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _Graphic3d_TypeOfShadingModel_HeaderFile
|
#endif // _Graphic3d_TypeOfShadingModel_HeaderFile
|
||||||
|
@ -43,7 +43,7 @@ namespace
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
OpenGl_Aspects::OpenGl_Aspects()
|
OpenGl_Aspects::OpenGl_Aspects()
|
||||||
: myAspect (new Graphic3d_Aspects()),
|
: myAspect (new Graphic3d_Aspects()),
|
||||||
myShadingModel (Graphic3d_TOSM_UNLIT)
|
myShadingModel (Graphic3d_TypeOfShadingModel_Unlit)
|
||||||
{
|
{
|
||||||
myAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
myAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||||
myAspect->SetInteriorColor (Quantity_NOC_WHITE);
|
myAspect->SetInteriorColor (Quantity_NOC_WHITE);
|
||||||
@ -59,7 +59,7 @@ OpenGl_Aspects::OpenGl_Aspects()
|
|||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
OpenGl_Aspects::OpenGl_Aspects (const Handle(Graphic3d_Aspects)& theAspect)
|
OpenGl_Aspects::OpenGl_Aspects (const Handle(Graphic3d_Aspects)& theAspect)
|
||||||
: myShadingModel (Graphic3d_TOSM_DEFAULT)
|
: myShadingModel (Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||||
{
|
{
|
||||||
SetAspect (theAspect);
|
SetAspect (theAspect);
|
||||||
}
|
}
|
||||||
@ -73,13 +73,13 @@ void OpenGl_Aspects::SetAspect (const Handle(Graphic3d_Aspects)& theAspect)
|
|||||||
myAspect = theAspect;
|
myAspect = theAspect;
|
||||||
|
|
||||||
const Graphic3d_MaterialAspect& aMat = theAspect->FrontMaterial();
|
const Graphic3d_MaterialAspect& aMat = theAspect->FrontMaterial();
|
||||||
myShadingModel = theAspect->ShadingModel() != Graphic3d_TOSM_UNLIT
|
myShadingModel = theAspect->ShadingModel() != Graphic3d_TypeOfShadingModel_Unlit
|
||||||
&& (aMat.ReflectionMode (Graphic3d_TOR_AMBIENT)
|
&& (aMat.ReflectionMode (Graphic3d_TOR_AMBIENT)
|
||||||
|| aMat.ReflectionMode (Graphic3d_TOR_DIFFUSE)
|
|| aMat.ReflectionMode (Graphic3d_TOR_DIFFUSE)
|
||||||
|| aMat.ReflectionMode (Graphic3d_TOR_SPECULAR)
|
|| aMat.ReflectionMode (Graphic3d_TOR_SPECULAR)
|
||||||
|| aMat.ReflectionMode (Graphic3d_TOR_EMISSION))
|
|| aMat.ReflectionMode (Graphic3d_TOR_EMISSION))
|
||||||
? theAspect->ShadingModel()
|
? theAspect->ShadingModel()
|
||||||
: Graphic3d_TOSM_UNLIT;
|
: Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
|
|
||||||
// invalidate resources
|
// invalidate resources
|
||||||
myResTextureSet.UpdateRediness (myAspect);
|
myResTextureSet.UpdateRediness (myAspect);
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
|
Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
|
||||||
|
|
||||||
//! Set if lighting should be disabled or not.
|
//! Set if lighting should be disabled or not.
|
||||||
void SetNoLighting() { myShadingModel = Graphic3d_TOSM_UNLIT; }
|
void SetNoLighting() { myShadingModel = Graphic3d_TypeOfShadingModel_Unlit; }
|
||||||
|
|
||||||
//! Returns textures map.
|
//! Returns textures map.
|
||||||
const Handle(OpenGl_TextureSet)& TextureSet (const Handle(OpenGl_Context)& theCtx,
|
const Handle(OpenGl_TextureSet)& TextureSet (const Handle(OpenGl_Context)& theCtx,
|
||||||
|
@ -2419,7 +2419,7 @@ void OpenGl_Context::SetShadingMaterial (const OpenGl_Aspects* theAspect,
|
|||||||
anAlphaCutoff = 0.285f;
|
anAlphaCutoff = 0.285f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (theAspect->ShadingModel() == Graphic3d_TOSM_UNLIT)
|
if (theAspect->ShadingModel() == Graphic3d_TypeOfShadingModel_Unlit)
|
||||||
{
|
{
|
||||||
if (anAlphaCutoff == aMatState.AlphaCutoff())
|
if (anAlphaCutoff == aMatState.AlphaCutoff())
|
||||||
{
|
{
|
||||||
@ -2725,8 +2725,8 @@ void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel)
|
|||||||
#if !defined(GL_ES_VERSION_2_0)
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
if (core11ffp != NULL)
|
if (core11ffp != NULL)
|
||||||
{
|
{
|
||||||
const Standard_Integer aModel = theModel == Graphic3d_TOSM_FACET
|
const Standard_Integer aModel = theModel == Graphic3d_TypeOfShadingModel_PhongFacet
|
||||||
|| theModel == Graphic3d_TOSM_PBR_FACET ? GL_FLAT : GL_SMOOTH;
|
|| theModel == Graphic3d_TypeOfShadingModel_PbrFacet ? GL_FLAT : GL_SMOOTH;
|
||||||
if (myShadeModel == aModel)
|
if (myShadeModel == aModel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -1051,7 +1051,7 @@ public: //! @name extensions
|
|||||||
Standard_Boolean hasFboSRGB; //!< sRGB FBO render targets (desktop OpenGL 2.1, OpenGL ES 3.0)
|
Standard_Boolean hasFboSRGB; //!< sRGB FBO render targets (desktop OpenGL 2.1, OpenGL ES 3.0)
|
||||||
Standard_Boolean hasSRGBControl; //!< sRGB write control (any desktop OpenGL, OpenGL ES + GL_EXT_sRGB_write_control extension)
|
Standard_Boolean hasSRGBControl; //!< sRGB write control (any desktop OpenGL, OpenGL ES + GL_EXT_sRGB_write_control extension)
|
||||||
Standard_Boolean hasFboRenderMipmap; //!< FBO render target could be non-zero mipmap level of texture
|
Standard_Boolean hasFboRenderMipmap; //!< FBO render target could be non-zero mipmap level of texture
|
||||||
OpenGl_FeatureFlag hasFlatShading; //!< Complex flag indicating support of Flat shading (Graphic3d_TOSM_FACET) (always available on desktop; on OpenGL ES - since 3.0 or as extension GL_OES_standard_derivatives)
|
OpenGl_FeatureFlag hasFlatShading; //!< Complex flag indicating support of Flat shading (Graphic3d_TypeOfShadingModel_Phong) (always available on desktop; on OpenGL ES - since 3.0 or as extension GL_OES_standard_derivatives)
|
||||||
OpenGl_FeatureFlag hasGlslBitwiseOps; //!< GLSL supports bitwise operations; OpenGL 3.0 / OpenGL ES 3.0 (GLSL 130 / GLSL ES 300) or OpenGL 2.1 + GL_EXT_gpu_shader4
|
OpenGl_FeatureFlag hasGlslBitwiseOps; //!< GLSL supports bitwise operations; OpenGL 3.0 / OpenGL ES 3.0 (GLSL 130 / GLSL ES 300) or OpenGL 2.1 + GL_EXT_gpu_shader4
|
||||||
OpenGl_FeatureFlag hasDrawBuffers; //!< Complex flag indicating support of multiple draw buffers (desktop OpenGL 2.0, OpenGL ES 3.0, GL_ARB_draw_buffers, GL_EXT_draw_buffers)
|
OpenGl_FeatureFlag hasDrawBuffers; //!< Complex flag indicating support of multiple draw buffers (desktop OpenGL 2.0, OpenGL ES 3.0, GL_ARB_draw_buffers, GL_EXT_draw_buffers)
|
||||||
OpenGl_FeatureFlag hasFloatBuffer; //!< Complex flag indicating support of float color buffer format (desktop OpenGL 3.0, GL_ARB_color_buffer_float, GL_EXT_color_buffer_float)
|
OpenGl_FeatureFlag hasFloatBuffer; //!< Complex flag indicating support of float color buffer format (desktop OpenGL 3.0, GL_ARB_color_buffer_float, GL_EXT_color_buffer_float)
|
||||||
|
@ -413,7 +413,7 @@ void OpenGl_FrameStatsPrs::Render (const Handle(OpenGl_Workspace)& theWorkspace)
|
|||||||
}
|
}
|
||||||
aCtx->ApplyModelViewMatrix();
|
aCtx->ApplyModelViewMatrix();
|
||||||
|
|
||||||
aCtx->ShaderManager()->BindFaceProgram (Handle(OpenGl_TextureSet)(), Graphic3d_TOSM_UNLIT,
|
aCtx->ShaderManager()->BindFaceProgram (Handle(OpenGl_TextureSet)(), Graphic3d_TypeOfShadingModel_Unlit,
|
||||||
Graphic3d_AlphaMode_Blend, true, false,
|
Graphic3d_AlphaMode_Blend, true, false,
|
||||||
Handle(OpenGl_ShaderProgram)());
|
Handle(OpenGl_ShaderProgram)());
|
||||||
aCtx->SetColor4fv (OpenGl_Vec4 (1.0f, 1.0f, 1.0f, 1.0f));
|
aCtx->SetColor4fv (OpenGl_Vec4 (1.0f, 1.0f, 1.0f, 1.0f));
|
||||||
|
@ -510,7 +510,7 @@ void OpenGl_PrimitiveArray::drawEdges (const Handle(OpenGl_Workspace)& theWorksp
|
|||||||
if (aGlContext->core20fwd != NULL)
|
if (aGlContext->core20fwd != NULL)
|
||||||
{
|
{
|
||||||
aGlContext->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), anAspect->Aspect()->EdgeLineType(),
|
aGlContext->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), anAspect->Aspect()->EdgeLineType(),
|
||||||
Graphic3d_TOSM_UNLIT, Graphic3d_AlphaMode_Opaque, Standard_False,
|
Graphic3d_TypeOfShadingModel_Unlit, Graphic3d_AlphaMode_Opaque, Standard_False,
|
||||||
anAspect->ShaderProgramRes (aGlContext));
|
anAspect->ShaderProgramRes (aGlContext));
|
||||||
}
|
}
|
||||||
aGlContext->SetSampleAlphaToCoverage (aGlContext->ShaderManager()->MaterialState().HasAlphaCutoff());
|
aGlContext->SetSampleAlphaToCoverage (aGlContext->ShaderManager()->MaterialState().HasAlphaCutoff());
|
||||||
@ -935,7 +935,7 @@ void OpenGl_PrimitiveArray::Render (const Handle(OpenGl_Workspace)& theWorkspace
|
|||||||
updateVBO (aCtx);
|
updateVBO (aCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_TypeOfShadingModel aShadingModel = Graphic3d_TOSM_UNLIT;
|
Graphic3d_TypeOfShadingModel aShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
anAspectFace = theWorkspace->ApplyAspects (false); // do not bind textures before binding the program
|
anAspectFace = theWorkspace->ApplyAspects (false); // do not bind textures before binding the program
|
||||||
const Handle(OpenGl_TextureSet)& aTextureSet = theWorkspace->TextureSet();
|
const Handle(OpenGl_TextureSet)& aTextureSet = theWorkspace->TextureSet();
|
||||||
const bool toEnableEnvMap = !aTextureSet.IsNull()
|
const bool toEnableEnvMap = !aTextureSet.IsNull()
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Handle(OpenGl_SetOfPrograms) myPrograms[Graphic3d_TypeOfShadingModel_NB - 1]; //!< programs array, excluding Graphic3d_TOSM_UNLIT
|
Handle(OpenGl_SetOfPrograms) myPrograms[Graphic3d_TypeOfShadingModel_NB - 1]; //!< programs array, excluding Graphic3d_TypeOfShadingModel_Unlit
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NCollection_DataMap<TCollection_AsciiString, Handle(OpenGl_SetOfShaderPrograms)> OpenGl_MapOfShaderPrograms;
|
typedef NCollection_DataMap<TCollection_AsciiString, Handle(OpenGl_SetOfShaderPrograms)> OpenGl_MapOfShaderPrograms;
|
||||||
|
@ -128,7 +128,7 @@ OpenGl_ShaderManager::OpenGl_ShaderManager (OpenGl_Context* theContext)
|
|||||||
: Graphic3d_ShaderManager (Aspect_GraphicsLibrary_OpenGL),
|
: Graphic3d_ShaderManager (Aspect_GraphicsLibrary_OpenGL),
|
||||||
#endif
|
#endif
|
||||||
myFfpProgram (new OpenGl_ShaderProgramFFP()),
|
myFfpProgram (new OpenGl_ShaderProgramFFP()),
|
||||||
myShadingModel (Graphic3d_TOSM_VERTEX),
|
myShadingModel (Graphic3d_TypeOfShadingModel_Gouraud),
|
||||||
myUnlitPrograms (new OpenGl_SetOfPrograms()),
|
myUnlitPrograms (new OpenGl_SetOfPrograms()),
|
||||||
myContext (theContext),
|
myContext (theContext),
|
||||||
myHasLocalOrigin (Standard_False)
|
myHasLocalOrigin (Standard_False)
|
||||||
@ -318,7 +318,7 @@ void OpenGl_ShaderManager::UpdateLightSourceState()
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
void OpenGl_ShaderManager::SetShadingModel (const Graphic3d_TypeOfShadingModel theModel)
|
void OpenGl_ShaderManager::SetShadingModel (const Graphic3d_TypeOfShadingModel theModel)
|
||||||
{
|
{
|
||||||
if (theModel == Graphic3d_TOSM_DEFAULT)
|
if (theModel == Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||||
{
|
{
|
||||||
throw Standard_ProgramError ("OpenGl_ShaderManager::SetShadingModel() - attempt to set invalid Shading Model!");
|
throw Standard_ProgramError ("OpenGl_ShaderManager::SetShadingModel() - attempt to set invalid Shading Model!");
|
||||||
}
|
}
|
||||||
@ -1055,7 +1055,7 @@ void OpenGl_ShaderManager::PushState (const Handle(OpenGl_ShaderProgram)& thePro
|
|||||||
{
|
{
|
||||||
// manage FFP lighting
|
// manage FFP lighting
|
||||||
myContext->SetShadeModel (theShadingModel);
|
myContext->SetShadeModel (theShadingModel);
|
||||||
if (theShadingModel == Graphic3d_TOSM_UNLIT)
|
if (theShadingModel == Graphic3d_TypeOfShadingModel_Unlit)
|
||||||
{
|
{
|
||||||
myContext->core11fwd->glDisable (GL_LIGHTING);
|
myContext->core11fwd->glDisable (GL_LIGHTING);
|
||||||
}
|
}
|
||||||
@ -1078,7 +1078,7 @@ Standard_Boolean OpenGl_ShaderManager::BindFontProgram (const Handle(OpenGl_Shad
|
|||||||
if (!theCustomProgram.IsNull()
|
if (!theCustomProgram.IsNull()
|
||||||
|| myContext->caps->ffpEnable)
|
|| myContext->caps->ffpEnable)
|
||||||
{
|
{
|
||||||
return bindProgramWithState (theCustomProgram, Graphic3d_TOSM_UNLIT);
|
return bindProgramWithState (theCustomProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myFontProgram.IsNull())
|
if (myFontProgram.IsNull())
|
||||||
@ -1092,7 +1092,7 @@ Standard_Boolean OpenGl_ShaderManager::BindFontProgram (const Handle(OpenGl_Shad
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bindProgramWithState (myFontProgram, Graphic3d_TOSM_UNLIT);
|
return bindProgramWithState (myFontProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -116,10 +116,10 @@ public:
|
|||||||
Standard_Boolean theEnableMeshEdges,
|
Standard_Boolean theEnableMeshEdges,
|
||||||
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
|
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
|
||||||
{
|
{
|
||||||
const Graphic3d_TypeOfShadingModel aShadeModelOnFace = theShadingModel != Graphic3d_TOSM_UNLIT
|
const Graphic3d_TypeOfShadingModel aShadeModelOnFace = theShadingModel != Graphic3d_TypeOfShadingModel_Unlit
|
||||||
&& (theTextures.IsNull() || theTextures->IsModulate())
|
&& (theTextures.IsNull() || theTextures->IsModulate())
|
||||||
? theShadingModel
|
? theShadingModel
|
||||||
: Graphic3d_TOSM_UNLIT;
|
: Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
if (!theCustomProgram.IsNull()
|
if (!theCustomProgram.IsNull()
|
||||||
|| myContext->caps->ffpEnable)
|
|| myContext->caps->ffpEnable)
|
||||||
{
|
{
|
||||||
@ -183,7 +183,7 @@ public:
|
|||||||
{
|
{
|
||||||
prepareStdProgramUnlit (aProgram, aBits, true);
|
prepareStdProgramUnlit (aProgram, aBits, true);
|
||||||
}
|
}
|
||||||
return bindProgramWithState (aProgram, Graphic3d_TOSM_UNLIT);
|
return bindProgramWithState (aProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Bind program for FBO blit operation.
|
//! Bind program for FBO blit operation.
|
||||||
@ -211,7 +211,7 @@ public:
|
|||||||
{
|
{
|
||||||
prepareStdProgramBoundBox();
|
prepareStdProgramBoundBox();
|
||||||
}
|
}
|
||||||
return bindProgramWithState (myBoundBoxProgram, Graphic3d_TOSM_UNLIT);
|
return bindProgramWithState (myBoundBoxProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns bounding box vertex buffer.
|
//! Returns bounding box vertex buffer.
|
||||||
@ -241,8 +241,8 @@ public:
|
|||||||
|
|
||||||
switch (theShadingModel)
|
switch (theShadingModel)
|
||||||
{
|
{
|
||||||
case Graphic3d_TOSM_PBR: return Graphic3d_TOSM_FRAGMENT;
|
case Graphic3d_TypeOfShadingModel_Pbr: return Graphic3d_TypeOfShadingModel_Phong;
|
||||||
case Graphic3d_TOSM_PBR_FACET: return Graphic3d_TOSM_FACET;
|
case Graphic3d_TypeOfShadingModel_PbrFacet: return Graphic3d_TypeOfShadingModel_PhongFacet;
|
||||||
default: return theShadingModel;
|
default: return theShadingModel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -454,7 +454,7 @@ public:
|
|||||||
|
|
||||||
//! Pushes current state of OCCT graphics parameters to specified program.
|
//! Pushes current state of OCCT graphics parameters to specified program.
|
||||||
Standard_EXPORT void PushState (const Handle(OpenGl_ShaderProgram)& theProgram,
|
Standard_EXPORT void PushState (const Handle(OpenGl_ShaderProgram)& theProgram,
|
||||||
Graphic3d_TypeOfShadingModel theShadingModel = Graphic3d_TOSM_UNLIT) const;
|
Graphic3d_TypeOfShadingModel theShadingModel = Graphic3d_TypeOfShadingModel_Unlit) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -478,24 +478,24 @@ public:
|
|||||||
{
|
{
|
||||||
if (!myContext->ColorMask())
|
if (!myContext->ColorMask())
|
||||||
{
|
{
|
||||||
return Graphic3d_TOSM_UNLIT;
|
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
}
|
}
|
||||||
Graphic3d_TypeOfShadingModel aModel = theCustomModel != Graphic3d_TOSM_DEFAULT ? theCustomModel : myShadingModel;
|
Graphic3d_TypeOfShadingModel aModel = theCustomModel != Graphic3d_TypeOfShadingModel_DEFAULT ? theCustomModel : myShadingModel;
|
||||||
switch (aModel)
|
switch (aModel)
|
||||||
{
|
{
|
||||||
case Graphic3d_TOSM_DEFAULT:
|
case Graphic3d_TypeOfShadingModel_DEFAULT:
|
||||||
case Graphic3d_TOSM_UNLIT:
|
case Graphic3d_TypeOfShadingModel_Unlit:
|
||||||
case Graphic3d_TOSM_FACET:
|
case Graphic3d_TypeOfShadingModel_PhongFacet:
|
||||||
return aModel;
|
return aModel;
|
||||||
case Graphic3d_TOSM_VERTEX:
|
case Graphic3d_TypeOfShadingModel_Gouraud:
|
||||||
case Graphic3d_TOSM_FRAGMENT:
|
case Graphic3d_TypeOfShadingModel_Phong:
|
||||||
return theHasNodalNormals ? aModel : Graphic3d_TOSM_FACET;
|
return theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_PhongFacet;
|
||||||
case Graphic3d_TOSM_PBR:
|
case Graphic3d_TypeOfShadingModel_Pbr:
|
||||||
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TOSM_PBR_FACET, IsPbrAllowed());
|
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_PbrFacet, IsPbrAllowed());
|
||||||
case Graphic3d_TOSM_PBR_FACET:
|
case Graphic3d_TypeOfShadingModel_PbrFacet:
|
||||||
return PBRShadingModelFallback (aModel, IsPbrAllowed());
|
return PBRShadingModelFallback (aModel, IsPbrAllowed());
|
||||||
}
|
}
|
||||||
return Graphic3d_TOSM_UNLIT;
|
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Choose Shading Model for line primitives.
|
//! Choose Shading Model for line primitives.
|
||||||
@ -506,24 +506,24 @@ public:
|
|||||||
{
|
{
|
||||||
if (!myContext->ColorMask())
|
if (!myContext->ColorMask())
|
||||||
{
|
{
|
||||||
return Graphic3d_TOSM_UNLIT;
|
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
}
|
}
|
||||||
Graphic3d_TypeOfShadingModel aModel = theCustomModel != Graphic3d_TOSM_DEFAULT ? theCustomModel : myShadingModel;
|
Graphic3d_TypeOfShadingModel aModel = theCustomModel != Graphic3d_TypeOfShadingModel_DEFAULT ? theCustomModel : myShadingModel;
|
||||||
switch (aModel)
|
switch (aModel)
|
||||||
{
|
{
|
||||||
case Graphic3d_TOSM_DEFAULT:
|
case Graphic3d_TypeOfShadingModel_DEFAULT:
|
||||||
case Graphic3d_TOSM_UNLIT:
|
case Graphic3d_TypeOfShadingModel_Unlit:
|
||||||
case Graphic3d_TOSM_FACET:
|
case Graphic3d_TypeOfShadingModel_PhongFacet:
|
||||||
return Graphic3d_TOSM_UNLIT;
|
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
case Graphic3d_TOSM_VERTEX:
|
case Graphic3d_TypeOfShadingModel_Gouraud:
|
||||||
case Graphic3d_TOSM_FRAGMENT:
|
case Graphic3d_TypeOfShadingModel_Phong:
|
||||||
return theHasNodalNormals ? aModel : Graphic3d_TOSM_UNLIT;
|
return theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
case Graphic3d_TOSM_PBR:
|
case Graphic3d_TypeOfShadingModel_Pbr:
|
||||||
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TOSM_UNLIT, IsPbrAllowed());
|
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_Unlit, IsPbrAllowed());
|
||||||
case Graphic3d_TOSM_PBR_FACET:
|
case Graphic3d_TypeOfShadingModel_PbrFacet:
|
||||||
return Graphic3d_TOSM_UNLIT;
|
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
}
|
}
|
||||||
return Graphic3d_TOSM_UNLIT;
|
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Choose Shading Model for Marker primitives.
|
//! Choose Shading Model for Marker primitives.
|
||||||
@ -632,7 +632,7 @@ protected:
|
|||||||
Handle(OpenGl_ShaderProgram)& getStdProgram (Graphic3d_TypeOfShadingModel theShadingModel,
|
Handle(OpenGl_ShaderProgram)& getStdProgram (Graphic3d_TypeOfShadingModel theShadingModel,
|
||||||
Standard_Integer theBits)
|
Standard_Integer theBits)
|
||||||
{
|
{
|
||||||
if (theShadingModel == Graphic3d_TOSM_UNLIT
|
if (theShadingModel == Graphic3d_TypeOfShadingModel_Unlit
|
||||||
|| (theBits & Graphic3d_ShaderFlags_HasTextures) == Graphic3d_ShaderFlags_TextureEnv)
|
|| (theBits & Graphic3d_ShaderFlags_HasTextures) == Graphic3d_ShaderFlags_TextureEnv)
|
||||||
{
|
{
|
||||||
// If environment map is enabled lighting calculations are
|
// If environment map is enabled lighting calculations are
|
||||||
@ -665,13 +665,13 @@ protected:
|
|||||||
{
|
{
|
||||||
switch (theShadingModel)
|
switch (theShadingModel)
|
||||||
{
|
{
|
||||||
case Graphic3d_TOSM_UNLIT: return prepareStdProgramUnlit (theProgram, theBits, false);
|
case Graphic3d_TypeOfShadingModel_Unlit: return prepareStdProgramUnlit (theProgram, theBits, false);
|
||||||
case Graphic3d_TOSM_FACET: return prepareStdProgramPhong (theProgram, theBits, true);
|
case Graphic3d_TypeOfShadingModel_PhongFacet: return prepareStdProgramPhong (theProgram, theBits, true);
|
||||||
case Graphic3d_TOSM_VERTEX: return prepareStdProgramGouraud(theProgram, theBits);
|
case Graphic3d_TypeOfShadingModel_Gouraud: return prepareStdProgramGouraud(theProgram, theBits);
|
||||||
case Graphic3d_TOSM_DEFAULT:
|
case Graphic3d_TypeOfShadingModel_DEFAULT:
|
||||||
case Graphic3d_TOSM_FRAGMENT: return prepareStdProgramPhong (theProgram, theBits, false);
|
case Graphic3d_TypeOfShadingModel_Phong: return prepareStdProgramPhong (theProgram, theBits, false);
|
||||||
case Graphic3d_TOSM_PBR: return prepareStdProgramPhong (theProgram, theBits, false, true);
|
case Graphic3d_TypeOfShadingModel_Pbr: return prepareStdProgramPhong (theProgram, theBits, false, true);
|
||||||
case Graphic3d_TOSM_PBR_FACET: return prepareStdProgramPhong (theProgram, theBits, true, true);
|
case Graphic3d_TypeOfShadingModel_PbrFacet: return prepareStdProgramPhong (theProgram, theBits, true, true);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -702,8 +702,8 @@ protected:
|
|||||||
Standard_EXPORT Standard_Boolean preparePBREnvBakingProgram (Standard_Integer theIndex);
|
Standard_EXPORT Standard_Boolean preparePBREnvBakingProgram (Standard_Integer theIndex);
|
||||||
|
|
||||||
//! Checks whether one of PBR shading models is set as default model.
|
//! Checks whether one of PBR shading models is set as default model.
|
||||||
Standard_Boolean IsPbrAllowed() const { return myShadingModel == Graphic3d_TOSM_PBR
|
Standard_Boolean IsPbrAllowed() const { return myShadingModel == Graphic3d_TypeOfShadingModel_Pbr
|
||||||
|| myShadingModel == Graphic3d_TOSM_PBR_FACET; }
|
|| myShadingModel == Graphic3d_TypeOfShadingModel_PbrFacet; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ void OpenGl_Structure::renderBoundingBox (const Handle(OpenGl_Workspace)& theWor
|
|||||||
OpenGl_Vec3 (aMin.x(), aMin.y(), aMax.z())
|
OpenGl_Vec3 (aMin.x(), aMin.y(), aMax.z())
|
||||||
};
|
};
|
||||||
|
|
||||||
aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID, Graphic3d_TOSM_UNLIT, Graphic3d_AlphaMode_Opaque, false, Handle(OpenGl_ShaderProgram)());
|
aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID, Graphic3d_TypeOfShadingModel_Unlit, Graphic3d_AlphaMode_Opaque, false, Handle(OpenGl_ShaderProgram)());
|
||||||
aCtx->SetColor4fv (theWorkspace->InteriorColor());
|
aCtx->SetColor4fv (theWorkspace->InteriorColor());
|
||||||
aCtx->core11fwd->glDisable (GL_LIGHTING);
|
aCtx->core11fwd->glDisable (GL_LIGHTING);
|
||||||
aCtx->core11ffp->glEnableClientState (GL_VERTEX_ARRAY);
|
aCtx->core11ffp->glEnableClientState (GL_VERTEX_ARRAY);
|
||||||
|
@ -640,7 +640,7 @@ void OpenGl_Text::drawRect (const Handle(OpenGl_Context)& theCtx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bind unlit program
|
// bind unlit program
|
||||||
theCtx->ShaderManager()->BindFaceProgram (Handle(OpenGl_TextureSet)(), Graphic3d_TOSM_UNLIT,
|
theCtx->ShaderManager()->BindFaceProgram (Handle(OpenGl_TextureSet)(), Graphic3d_TypeOfShadingModel_Unlit,
|
||||||
Graphic3d_AlphaMode_Opaque, Standard_False, Standard_False,
|
Graphic3d_AlphaMode_Opaque, Standard_False, Standard_False,
|
||||||
Handle(OpenGl_ShaderProgram)());
|
Handle(OpenGl_ShaderProgram)());
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ void OpenGl_View::SetBackgroundImage (const Handle(Graphic3d_TextureMap)& theTex
|
|||||||
Handle(Graphic3d_TextureSet) aTextureSet = new Graphic3d_TextureSet (theTextureMap);
|
Handle(Graphic3d_TextureSet) aTextureSet = new Graphic3d_TextureSet (theTextureMap);
|
||||||
anAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
anAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||||
anAspect->SetFaceCulling (Graphic3d_TypeOfBackfacingModel_DoubleSided);
|
anAspect->SetFaceCulling (Graphic3d_TypeOfBackfacingModel_DoubleSided);
|
||||||
anAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
anAspect->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
anAspect->SetTextureSet (aTextureSet);
|
anAspect->SetTextureSet (aTextureSet);
|
||||||
anAspect->SetTextureMapOn (true);
|
anAspect->SetTextureMapOn (true);
|
||||||
|
|
||||||
@ -1193,8 +1193,8 @@ bool OpenGl_View::prepareFrameBuffers (Graphic3d_Camera::Projection& theProj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// process PBR environment
|
// process PBR environment
|
||||||
if (myRenderParams.ShadingModel == Graphic3d_TOSM_PBR
|
if (myRenderParams.ShadingModel == Graphic3d_TypeOfShadingModel_Pbr
|
||||||
|| myRenderParams.ShadingModel == Graphic3d_TOSM_PBR_FACET)
|
|| myRenderParams.ShadingModel == Graphic3d_TypeOfShadingModel_PbrFacet)
|
||||||
{
|
{
|
||||||
if (!myPBREnvironment.IsNull()
|
if (!myPBREnvironment.IsNull()
|
||||||
&& myPBREnvironment->SizesAreDifferent (myRenderParams.PbrEnvPow2Size,
|
&& myPBREnvironment->SizesAreDifferent (myRenderParams.PbrEnvPow2Size,
|
||||||
@ -1424,7 +1424,7 @@ bool OpenGl_View::prepareFrameBuffers (Graphic3d_Camera::Projection& theProj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// allocate shadow maps
|
// allocate shadow maps
|
||||||
const Handle(Graphic3d_LightSet)& aLights = myRenderParams.ShadingModel == Graphic3d_TOSM_UNLIT ? myNoShadingLight : myLights;
|
const Handle(Graphic3d_LightSet)& aLights = myRenderParams.ShadingModel == Graphic3d_TypeOfShadingModel_Unlit ? myNoShadingLight : myLights;
|
||||||
if (!aLights.IsNull())
|
if (!aLights.IsNull())
|
||||||
{
|
{
|
||||||
aLights->UpdateRevision();
|
aLights->UpdateRevision();
|
||||||
@ -2094,7 +2094,7 @@ void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap)
|
|||||||
|
|
||||||
aCtx->ShaderManager()->UpdateMaterialState();
|
aCtx->ShaderManager()->UpdateMaterialState();
|
||||||
aCtx->ShaderManager()->UpdateModelWorldStateTo (OpenGl_Mat4());
|
aCtx->ShaderManager()->UpdateModelWorldStateTo (OpenGl_Mat4());
|
||||||
aCtx->ShaderManager()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
aCtx->ShaderManager()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
|
|
||||||
const Handle(OpenGl_FrameBuffer)& aShadowBuffer = theShadowMap->FrameBuffer();
|
const Handle(OpenGl_FrameBuffer)& aShadowBuffer = theShadowMap->FrameBuffer();
|
||||||
aShadowBuffer->BindBuffer (aCtx);
|
aShadowBuffer->BindBuffer (aCtx);
|
||||||
@ -2162,7 +2162,7 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
|
|||||||
myBVHSelector.CacheClipPtsProjections();
|
myBVHSelector.CacheClipPtsProjections();
|
||||||
|
|
||||||
const Handle(OpenGl_ShaderManager)& aManager = aContext->ShaderManager();
|
const Handle(OpenGl_ShaderManager)& aManager = aContext->ShaderManager();
|
||||||
const Handle(Graphic3d_LightSet)& aLights = myRenderParams.ShadingModel == Graphic3d_TOSM_UNLIT ? myNoShadingLight : myLights;
|
const Handle(Graphic3d_LightSet)& aLights = myRenderParams.ShadingModel == Graphic3d_TypeOfShadingModel_Unlit ? myNoShadingLight : myLights;
|
||||||
Standard_Size aLightsRevision = 0;
|
Standard_Size aLightsRevision = 0;
|
||||||
if (!aLights.IsNull())
|
if (!aLights.IsNull())
|
||||||
{
|
{
|
||||||
|
@ -2429,7 +2429,7 @@ Standard_Boolean OpenGl_View::updateRaytraceLightSources (const OpenGl_Mat4& the
|
|||||||
{
|
{
|
||||||
std::vector<Handle(Graphic3d_CLight)> aLightSources;
|
std::vector<Handle(Graphic3d_CLight)> aLightSources;
|
||||||
Graphic3d_Vec4 aNewAmbient (0.0f);
|
Graphic3d_Vec4 aNewAmbient (0.0f);
|
||||||
if (myRenderParams.ShadingModel != Graphic3d_TOSM_UNLIT
|
if (myRenderParams.ShadingModel != Graphic3d_TypeOfShadingModel_Unlit
|
||||||
&& !myLights.IsNull())
|
&& !myLights.IsNull())
|
||||||
{
|
{
|
||||||
aNewAmbient.SetValues (myLights->AmbientColor().rgb(), 0.0f);
|
aNewAmbient.SetValues (myLights->AmbientColor().rgb(), 0.0f);
|
||||||
|
@ -323,7 +323,7 @@ const OpenGl_Aspects* OpenGl_Workspace::ApplyAspects (bool theToBindTextures)
|
|||||||
{
|
{
|
||||||
// copy all values including line edge aspect
|
// copy all values including line edge aspect
|
||||||
*myAspectFaceHl.Aspect() = *myAspectsSet->Aspect();
|
*myAspectFaceHl.Aspect() = *myAspectsSet->Aspect();
|
||||||
myAspectFaceHl.Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
myAspectFaceHl.Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
myAspectFaceHl.Aspect()->SetInteriorColor (myView->BackgroundColor().GetRGB());
|
myAspectFaceHl.Aspect()->SetInteriorColor (myView->BackgroundColor().GetRGB());
|
||||||
myAspectFaceHl.Aspect()->SetDistinguish (false);
|
myAspectFaceHl.Aspect()->SetDistinguish (false);
|
||||||
myAspectFaceHl.SetNoLighting();
|
myAspectFaceHl.SetNoLighting();
|
||||||
@ -340,8 +340,8 @@ const OpenGl_Aspects* OpenGl_Workspace::ApplyAspects (bool theToBindTextures)
|
|||||||
myGlContext->BindTextures (aTextureSet, Handle(OpenGl_ShaderProgram)());
|
myGlContext->BindTextures (aTextureSet, Handle(OpenGl_ShaderProgram)());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((myView->ShadingModel() == Graphic3d_TOSM_PBR
|
if ((myView->ShadingModel() == Graphic3d_TypeOfShadingModel_Pbr
|
||||||
|| myView->ShadingModel() == Graphic3d_TOSM_PBR_FACET)
|
|| myView->ShadingModel() == Graphic3d_TypeOfShadingModel_PbrFacet)
|
||||||
&& !myView->myPBREnvironment.IsNull()
|
&& !myView->myPBREnvironment.IsNull()
|
||||||
&& myView->myPBREnvironment->IsNeededToBeBound())
|
&& myView->myPBREnvironment->IsNeededToBeBound())
|
||||||
{
|
{
|
||||||
|
@ -183,7 +183,7 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
|
|||||||
OpenGl_Vec4 aColor = theWorkspace->InteriorColor();
|
OpenGl_Vec4 aColor = theWorkspace->InteriorColor();
|
||||||
|
|
||||||
aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID,
|
aCtx->ShaderManager()->BindLineProgram (Handle(OpenGl_TextureSet)(), Aspect_TOL_SOLID,
|
||||||
Graphic3d_TOSM_UNLIT, Graphic3d_AlphaMode_Opaque, false,
|
Graphic3d_TypeOfShadingModel_Unlit, Graphic3d_AlphaMode_Opaque, false,
|
||||||
Handle(OpenGl_ShaderProgram)());
|
Handle(OpenGl_ShaderProgram)());
|
||||||
aCtx->SetColor4fv (aColor);
|
aCtx->SetColor4fv (aColor);
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentat
|
|||||||
Handle(Graphic3d_AspectFillArea3d) aShadingStyle = new Graphic3d_AspectFillArea3d();
|
Handle(Graphic3d_AspectFillArea3d) aShadingStyle = new Graphic3d_AspectFillArea3d();
|
||||||
aShadingStyle->SetInteriorStyle (Aspect_IS_SOLID);
|
aShadingStyle->SetInteriorStyle (Aspect_IS_SOLID);
|
||||||
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
||||||
aShadingStyle->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
aShadingStyle->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
aShadingStyle->SetPolygonOffset (aPolOffset);
|
aShadingStyle->SetPolygonOffset (aPolOffset);
|
||||||
|
|
||||||
aGroup->SetPrimitivesAspect (aShadingStyle);
|
aGroup->SetPrimitivesAspect (aShadingStyle);
|
||||||
|
@ -506,7 +506,7 @@ static Standard_Integer OCC30182 (Draw_Interpretor& , Standard_Integer theNbArgs
|
|||||||
aPrs->SetDisplayMode (AIS_Shaded);
|
aPrs->SetDisplayMode (AIS_Shaded);
|
||||||
aPrs->Attributes()->SetupOwnShadingAspect();
|
aPrs->Attributes()->SetupOwnShadingAspect();
|
||||||
const Handle(Graphic3d_AspectFillArea3d)& anAspect = aPrs->Attributes()->ShadingAspect()->Aspect();
|
const Handle(Graphic3d_AspectFillArea3d)& anAspect = aPrs->Attributes()->ShadingAspect()->Aspect();
|
||||||
anAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
anAspect->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||||
anAspect->SetTextureMapOn (true);
|
anAspect->SetTextureMapOn (true);
|
||||||
anAspect->SetTextureMap (new Graphic3d_Texture2Dmanual (anImage));
|
anAspect->SetTextureMap (new Graphic3d_Texture2Dmanual (anImage));
|
||||||
if (anImage->IsTopDown())
|
if (anImage->IsTopDown())
|
||||||
|
@ -688,7 +688,7 @@ public:
|
|||||||
//! the visual axis measured from the Y axis of the screen.
|
//! the visual axis measured from the Y axis of the screen.
|
||||||
Standard_EXPORT Standard_Real Twist() const;
|
Standard_EXPORT Standard_Real Twist() const;
|
||||||
|
|
||||||
//! Returns the current shading model; Graphic3d_TOSM_FRAGMENT by default.
|
//! Returns the current shading model; Graphic3d_TypeOfShadingModel_Phong by default.
|
||||||
Standard_EXPORT Graphic3d_TypeOfShadingModel ShadingModel() const;
|
Standard_EXPORT Graphic3d_TypeOfShadingModel ShadingModel() const;
|
||||||
|
|
||||||
//! Defines the shading model for the visualization.
|
//! Defines the shading model for the visualization.
|
||||||
|
@ -153,7 +153,7 @@ public:
|
|||||||
//! Gives the default visualization mode.
|
//! Gives the default visualization mode.
|
||||||
void SetDefaultVisualization (const V3d_TypeOfVisualization theType) { myVisualization = theType; }
|
void SetDefaultVisualization (const V3d_TypeOfVisualization theType) { myVisualization = theType; }
|
||||||
|
|
||||||
//! Returns the default type of Shading; Graphic3d_TOSM_FRAGMENT by default.
|
//! Returns the default type of Shading; Graphic3d_TypeOfShadingModel_Phong by default.
|
||||||
Graphic3d_TypeOfShadingModel DefaultShadingModel() const { return myDefaultRenderingParams.ShadingModel; }
|
Graphic3d_TypeOfShadingModel DefaultShadingModel() const { return myDefaultRenderingParams.ShadingModel; }
|
||||||
|
|
||||||
//! Gives the default type of SHADING.
|
//! Gives the default type of SHADING.
|
||||||
|
@ -340,43 +340,43 @@ Standard_Boolean ViewerTest::ParseShadingModel (Standard_CString th
|
|||||||
|| aTypeStr == "color"
|
|| aTypeStr == "color"
|
||||||
|| aTypeStr == "none")
|
|| aTypeStr == "none")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_UNLIT;
|
theModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||||
}
|
}
|
||||||
else if (aTypeStr == "flat"
|
else if (aTypeStr == "flat"
|
||||||
|| aTypeStr == "facet")
|
|| aTypeStr == "facet")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_FACET;
|
theModel = Graphic3d_TypeOfShadingModel_PhongFacet;
|
||||||
}
|
}
|
||||||
else if (aTypeStr == "gouraud"
|
else if (aTypeStr == "gouraud"
|
||||||
|| aTypeStr == "vertex"
|
|| aTypeStr == "vertex"
|
||||||
|| aTypeStr == "vert")
|
|| aTypeStr == "vert")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_VERTEX;
|
theModel = Graphic3d_TypeOfShadingModel_Gouraud;
|
||||||
}
|
}
|
||||||
else if (aTypeStr == "phong"
|
else if (aTypeStr == "phong"
|
||||||
|| aTypeStr == "fragment"
|
|| aTypeStr == "fragment"
|
||||||
|| aTypeStr == "frag"
|
|| aTypeStr == "frag"
|
||||||
|| aTypeStr == "pixel")
|
|| aTypeStr == "pixel")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_FRAGMENT;
|
theModel = Graphic3d_TypeOfShadingModel_Phong;
|
||||||
}
|
}
|
||||||
else if (aTypeStr == "pbr")
|
else if (aTypeStr == "pbr")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_PBR;
|
theModel = Graphic3d_TypeOfShadingModel_Pbr;
|
||||||
}
|
}
|
||||||
else if (aTypeStr == "pbr_facet")
|
else if (aTypeStr == "pbr_facet")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_PBR_FACET;
|
theModel = Graphic3d_TypeOfShadingModel_PbrFacet;
|
||||||
}
|
}
|
||||||
else if (aTypeStr == "default"
|
else if (aTypeStr == "default"
|
||||||
|| aTypeStr == "def")
|
|| aTypeStr == "def")
|
||||||
{
|
{
|
||||||
theModel = Graphic3d_TOSM_DEFAULT;
|
theModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||||
}
|
}
|
||||||
else if (aTypeStr.IsIntegerValue())
|
else if (aTypeStr.IsIntegerValue())
|
||||||
{
|
{
|
||||||
const int aTypeInt = aTypeStr.IntegerValue();
|
const int aTypeInt = aTypeStr.IntegerValue();
|
||||||
if (aTypeInt <= Graphic3d_TOSM_DEFAULT || aTypeInt >= Graphic3d_TypeOfShadingModel_NB)
|
if (aTypeInt <= Graphic3d_TypeOfShadingModel_DEFAULT || aTypeInt >= Graphic3d_TypeOfShadingModel_NB)
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -1815,7 +1815,7 @@ struct ViewerTest_AspectsChangeSet
|
|||||||
ToSetHatch (0),
|
ToSetHatch (0),
|
||||||
StdHatchStyle (-1),
|
StdHatchStyle (-1),
|
||||||
ToSetShadingModel (0),
|
ToSetShadingModel (0),
|
||||||
ShadingModel (Graphic3d_TOSM_DEFAULT),
|
ShadingModel (Graphic3d_TypeOfShadingModel_DEFAULT),
|
||||||
ToSetInterior (0),
|
ToSetInterior (0),
|
||||||
InteriorStyle (Aspect_IS_SOLID),
|
InteriorStyle (Aspect_IS_SOLID),
|
||||||
ToSetDrawSilhouette (0),
|
ToSetDrawSilhouette (0),
|
||||||
@ -1909,7 +1909,7 @@ struct ViewerTest_AspectsChangeSet
|
|||||||
isOk = Standard_False;
|
isOk = Standard_False;
|
||||||
}
|
}
|
||||||
if (ToSetShadingModel == 1
|
if (ToSetShadingModel == 1
|
||||||
&& (ShadingModel < Graphic3d_TOSM_DEFAULT || ShadingModel > Graphic3d_TOSM_PBR_FACET))
|
&& (ShadingModel < Graphic3d_TypeOfShadingModel_DEFAULT || ShadingModel > Graphic3d_TypeOfShadingModel_PbrFacet))
|
||||||
{
|
{
|
||||||
Message::SendFail() << "Error: unknown shading model " << ShadingModelName << ".";
|
Message::SendFail() << "Error: unknown shading model " << ShadingModelName << ".";
|
||||||
isOk = Standard_False;
|
isOk = Standard_False;
|
||||||
@ -3114,7 +3114,7 @@ static Standard_Integer VAspects (Draw_Interpretor& theDI,
|
|||||||
else if (anArg == "-unsetshadingmodel")
|
else if (anArg == "-unsetshadingmodel")
|
||||||
{
|
{
|
||||||
aChangeSet->ToSetShadingModel = -1;
|
aChangeSet->ToSetShadingModel = -1;
|
||||||
aChangeSet->ShadingModel = Graphic3d_TOSM_DEFAULT;
|
aChangeSet->ShadingModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||||
}
|
}
|
||||||
else if (anArg == "-setinterior"
|
else if (anArg == "-setinterior"
|
||||||
|| anArg == "-setinteriorstyle"
|
|| anArg == "-setinteriorstyle"
|
||||||
@ -3243,7 +3243,7 @@ static Standard_Integer VAspects (Draw_Interpretor& theDI,
|
|||||||
aChangeSet->StdHatchStyle = -1;
|
aChangeSet->StdHatchStyle = -1;
|
||||||
aChangeSet->PathToHatchPattern.Clear();
|
aChangeSet->PathToHatchPattern.Clear();
|
||||||
aChangeSet->ToSetShadingModel = -1;
|
aChangeSet->ToSetShadingModel = -1;
|
||||||
aChangeSet->ShadingModel = Graphic3d_TOSM_DEFAULT;
|
aChangeSet->ShadingModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||||
aChangeSet->ToSetInterior = -1;
|
aChangeSet->ToSetInterior = -1;
|
||||||
aChangeSet->InteriorStyle = Aspect_IS_SOLID;
|
aChangeSet->InteriorStyle = Aspect_IS_SOLID;
|
||||||
aChangeSet->ToSetDrawSilhouette = -1;
|
aChangeSet->ToSetDrawSilhouette = -1;
|
||||||
|
@ -11333,13 +11333,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
|||||||
theDI << "shadingModel: ";
|
theDI << "shadingModel: ";
|
||||||
switch (aView->ShadingModel())
|
switch (aView->ShadingModel())
|
||||||
{
|
{
|
||||||
case Graphic3d_TOSM_DEFAULT: theDI << "default"; break;
|
case Graphic3d_TypeOfShadingModel_DEFAULT: theDI << "default"; break;
|
||||||
case Graphic3d_TOSM_UNLIT: theDI << "unlit"; break;
|
case Graphic3d_TypeOfShadingModel_Unlit: theDI << "unlit"; break;
|
||||||
case Graphic3d_TOSM_FACET: theDI << "flat"; break;
|
case Graphic3d_TypeOfShadingModel_PhongFacet: theDI << "flat"; break;
|
||||||
case Graphic3d_TOSM_VERTEX: theDI << "gouraud"; break;
|
case Graphic3d_TypeOfShadingModel_Gouraud: theDI << "gouraud"; break;
|
||||||
case Graphic3d_TOSM_FRAGMENT: theDI << "phong"; break;
|
case Graphic3d_TypeOfShadingModel_Phong: theDI << "phong"; break;
|
||||||
case Graphic3d_TOSM_PBR: theDI << "pbr"; break;
|
case Graphic3d_TypeOfShadingModel_Pbr: theDI << "pbr"; break;
|
||||||
case Graphic3d_TOSM_PBR_FACET: theDI << "pbr_facet"; break;
|
case Graphic3d_TypeOfShadingModel_PbrFacet: theDI << "pbr_facet"; break;
|
||||||
}
|
}
|
||||||
theDI << "\n";
|
theDI << "\n";
|
||||||
{
|
{
|
||||||
@ -12130,13 +12130,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
|||||||
{
|
{
|
||||||
switch (aView->ShadingModel())
|
switch (aView->ShadingModel())
|
||||||
{
|
{
|
||||||
case Graphic3d_TOSM_DEFAULT: theDI << "default"; break;
|
case Graphic3d_TypeOfShadingModel_DEFAULT: theDI << "default"; break;
|
||||||
case Graphic3d_TOSM_UNLIT: theDI << "unlit "; break;
|
case Graphic3d_TypeOfShadingModel_Unlit: theDI << "unlit "; break;
|
||||||
case Graphic3d_TOSM_FACET: theDI << "flat "; break;
|
case Graphic3d_TypeOfShadingModel_PhongFacet: theDI << "flat "; break;
|
||||||
case Graphic3d_TOSM_VERTEX: theDI << "gouraud "; break;
|
case Graphic3d_TypeOfShadingModel_Gouraud: theDI << "gouraud "; break;
|
||||||
case Graphic3d_TOSM_FRAGMENT: theDI << "phong "; break;
|
case Graphic3d_TypeOfShadingModel_Phong: theDI << "phong "; break;
|
||||||
case Graphic3d_TOSM_PBR: theDI << "pbr"; break;
|
case Graphic3d_TypeOfShadingModel_Pbr: theDI << "pbr"; break;
|
||||||
case Graphic3d_TOSM_PBR_FACET: theDI << "pbr_facet"; break;
|
case Graphic3d_TypeOfShadingModel_PbrFacet: theDI << "pbr_facet"; break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -12146,9 +12146,9 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
|||||||
Message::SendFail() << "Syntax error at argument '" << anArg << "'";
|
Message::SendFail() << "Syntax error at argument '" << anArg << "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_TypeOfShadingModel aModel = Graphic3d_TOSM_DEFAULT;
|
Graphic3d_TypeOfShadingModel aModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||||
if (ViewerTest::ParseShadingModel (theArgVec[anArgIter], aModel)
|
if (ViewerTest::ParseShadingModel (theArgVec[anArgIter], aModel)
|
||||||
&& aModel != Graphic3d_TOSM_DEFAULT)
|
&& aModel != Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||||
{
|
{
|
||||||
aView->SetShadingModel (aModel);
|
aView->SetShadingModel (aModel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user