mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-02 17:46: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 specular reflection.
|
||||
|
||||
Common material properties are used within Gouraud and Phong shading models (Graphic3d_TOSM_FACET, Graphic3d_TOSM_VERTEX and Graphic3d_TOSM_FRAGMENT).
|
||||
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()):
|
||||
Common material properties are used within Phong shading model (Graphic3d_TypeOfShadingModel_Phong, Graphic3d_TypeOfShadingModel_PhongFacet and Graphic3d_TypeOfShadingModel_Gouraud).
|
||||
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);
|
||||
* Metallic factor;
|
||||
* Roughness factor;
|
||||
|
@ -307,7 +307,7 @@ bool WasmOcctView::initViewer()
|
||||
|
||||
Handle(V3d_Viewer) aViewer = new V3d_Viewer (aDriver);
|
||||
aViewer->SetComputedMode (false);
|
||||
aViewer->SetDefaultShadingModel (Graphic3d_TOSM_FRAGMENT);
|
||||
aViewer->SetDefaultShadingModel (Graphic3d_TypeOfShadingModel_Phong);
|
||||
aViewer->SetDefaultLights();
|
||||
aViewer->SetLightOn();
|
||||
for (V3d_ListOfLight::Iterator aLightIter (aViewer->ActiveLights()); aLightIter.More(); aLightIter.Next())
|
||||
|
@ -133,7 +133,7 @@ AIS_ColorScale::AIS_ColorScale()
|
||||
{
|
||||
SetDisplayMode (0);
|
||||
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()->SetInteriorColor (Quantity_NOC_WHITE);
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ AIS_LightSource::AIS_LightSource (const Handle(Graphic3d_CLight)& theLight)
|
||||
aMat.SetColor (aColor);
|
||||
myDrawer->SetArrowAspect (new Prs3d_ArrowAspect());
|
||||
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()->SetMarkerType (Aspect_TOM_EMPTY);
|
||||
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()->SetMaterial (aMat);
|
||||
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->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_SHADOW);
|
||||
|
@ -56,7 +56,7 @@ AIS_MediaPlayer::AIS_MediaPlayer()
|
||||
|
||||
Graphic3d_MaterialAspect 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->SetTextureSet (myFramePair);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ AIS_RubberBand::AIS_RubberBand()
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
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()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||
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->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
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()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
||||
@ -92,7 +92,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
|
||||
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()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||
myDrawer->ShadingAspect()->SetTransparency (theTransparency);
|
||||
|
@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
|
||||
// =======================================================================
|
||||
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d()
|
||||
{
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||
myLineType = Aspect_TOL_SOLID;
|
||||
myLineWidth = 1.0f;
|
||||
@ -37,7 +37,7 @@ Graphic3d_AspectLine3d::Graphic3d_AspectLine3d (const Quantity_Color& theColor,
|
||||
Aspect_TypeOfLine theType,
|
||||
Standard_Real theWidth)
|
||||
{
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myInteriorColor.SetRGB (theColor);
|
||||
SetLineType (theType);
|
||||
SetLineWidth ((float)theWidth);
|
||||
|
@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
|
||||
// =======================================================================
|
||||
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
|
||||
{
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||
myMarkerType = Aspect_TOM_X;
|
||||
myMarkerScale = 1.0f;
|
||||
@ -37,7 +37,7 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker th
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Real theScale)
|
||||
{
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myInteriorColor.SetRGB (theColor);
|
||||
myMarkerType = theType;
|
||||
SetMarkerScale ((float )theScale);
|
||||
@ -52,7 +52,7 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theCo
|
||||
const Standard_Integer theHeight,
|
||||
const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
|
||||
{
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myMarkerImage = new Graphic3d_MarkerImage(theTextureBitMap, theWidth, theHeight);
|
||||
myInteriorColor.SetRGB (theColor),
|
||||
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)
|
||||
{
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myMarkerImage = new Graphic3d_MarkerImage (theTextureImage);
|
||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||
myMarkerType = Aspect_TOM_USERDEFINED;
|
||||
|
@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Graphic3d_Aspects)
|
||||
Graphic3d_AspectText3d::Graphic3d_AspectText3d()
|
||||
{
|
||||
SetAlphaMode (Graphic3d_AlphaMode_MaskBlend, 0.285f);
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myInteriorColor.SetRGB (Quantity_NOC_YELLOW);
|
||||
myEdgeColor.SetRGB (Quantity_NOC_WHITE);
|
||||
}
|
||||
@ -41,7 +41,7 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
|
||||
Aspect_TypeOfDisplayText theDisplayType)
|
||||
{
|
||||
SetAlphaMode (Graphic3d_AlphaMode_MaskBlend, 0.285f);
|
||||
myShadingModel = Graphic3d_TOSM_UNLIT;
|
||||
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
myTextStyle = theStyle;
|
||||
myTextDisplayType = theDisplayType;
|
||||
myInteriorColor.SetRGB (theColor);
|
||||
|
@ -25,7 +25,7 @@ Graphic3d_Aspects::Graphic3d_Aspects()
|
||||
myBackInteriorColor (Quantity_NOC_CYAN1),
|
||||
myEdgeColor (Quantity_NOC_WHITE),
|
||||
myInteriorStyle (Aspect_IS_SOLID),
|
||||
myShadingModel (Graphic3d_TOSM_DEFAULT),
|
||||
myShadingModel (Graphic3d_TypeOfShadingModel_DEFAULT),
|
||||
myFaceCulling (Graphic3d_TypeOfBackfacingModel_Auto),
|
||||
myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
|
||||
myAlphaCutoff (0.5f),
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
//! Modifies the interior type used for rendering
|
||||
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_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)
|
||||
{
|
||||
if (theModel == Graphic3d_TOSM_DEFAULT)
|
||||
if (theModel == Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||
{
|
||||
throw Standard_ProgramError ("Graphic3d_CView::SetShadingModel() - attempt to set invalid Shading Model!");
|
||||
}
|
||||
|
@ -99,11 +99,11 @@ 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; }
|
||||
|
||||
//! 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);
|
||||
|
||||
//! Return backfacing model used for the view; Graphic3d_TypeOfBackfacingModel_Auto by default,
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
//! Creates default rendering parameters.
|
||||
Graphic3d_RenderingParams()
|
||||
: Method (Graphic3d_RM_RASTERIZATION),
|
||||
ShadingModel (Graphic3d_TOSM_FRAGMENT),
|
||||
ShadingModel (Graphic3d_TypeOfShadingModel_Phong),
|
||||
TransparencyMethod (Graphic3d_RTM_BLEND_UNORDERED),
|
||||
Resolution (THE_DEFAULT_RESOLUTION),
|
||||
FontHinting (Font_Hinting_Off),
|
||||
@ -189,7 +189,7 @@ public:
|
||||
public: //! @name general parameters
|
||||
|
||||
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
|
||||
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
|
||||
|
@ -33,7 +33,7 @@ enum Graphic3d_TypeOfLimit
|
||||
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_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_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
|
||||
|
@ -21,38 +21,44 @@
|
||||
enum Graphic3d_TypeOfShadingModel
|
||||
{
|
||||
//! 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.
|
||||
//! 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).
|
||||
Graphic3d_TOSM_UNLIT = 0,
|
||||
Graphic3d_TypeOfShadingModel_Unlit = 0,
|
||||
|
||||
//! Flat Shading, calculated per-facet basing on facet normal.
|
||||
//! This model is 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.
|
||||
Graphic3d_TOSM_FACET,
|
||||
//! Flat Shading for Phong material model, calculated using triangle normal.
|
||||
//! Could be useful for mesh element analysis.
|
||||
//! This shading model does NOT require normals to be defined within vertex attributes.
|
||||
Graphic3d_TypeOfShadingModel_PhongFacet,
|
||||
|
||||
//! Gouraud Shading, calculated per-vertex basing on nodal normal, and then color is interpolated across fragments.
|
||||
//! This shading model was default within Fixed-Function Pipeline of old OpenGL (and Direct3d);
|
||||
//! still can be used as alternative to Graphic3d_TOSM_FRAGMENT for better performance on low-poly (and middle-poly) models
|
||||
//! (per-fragment shading is more optimal for considerably high-poly models, since expensive shading is not computed for discarded fragments).
|
||||
//! Shading model requires normals to be defined within vertex attributes.
|
||||
Graphic3d_TOSM_VERTEX,
|
||||
//! Gouraud shading uses the same material definition as Phong reflection model,
|
||||
//! but emulates an obsolete per-vertex calculations with result color interpolated across fragments,
|
||||
//! as implemented by T&L hardware blocks on old graphics hardware.
|
||||
//! This shading model requires normals to be defined within vertex attributes.
|
||||
Graphic3d_TypeOfShadingModel_Gouraud,
|
||||
|
||||
//! Phong Shading, calculated per-fragment basing on nodal normal, so that normal is interpolated across fragments.
|
||||
//! This is a main shading model nowadays, providing the best image quality.
|
||||
//! Shading model requires normals to be defined within vertex attributes.
|
||||
Graphic3d_TOSM_FRAGMENT,
|
||||
//! Phong reflection model, an empirical model defined by Diffuse/Ambient/Specular/Shininess components.
|
||||
//! Lighting is calculated per-fragment basing on nodal normal (normal is interpolated across fragments of triangle).
|
||||
//! This shading model requires normals to be defined within vertex attributes.
|
||||
Graphic3d_TypeOfShadingModel_Phong,
|
||||
|
||||
//! Metallic-roughness physically based (PBR) illumination system.
|
||||
Graphic3d_TOSM_PBR,
|
||||
Graphic3d_TypeOfShadingModel_Pbr,
|
||||
|
||||
//! Same as Graphic3d_TOSM_PBR but using flat per-triangle normal.
|
||||
Graphic3d_TOSM_PBR_FACET,
|
||||
//! Same as Graphic3d_TypeOfShadingModel_Pbr but using flat per-triangle normal.
|
||||
Graphic3d_TypeOfShadingModel_PbrFacet,
|
||||
|
||||
// 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,
|
||||
V3d_COLOR = Graphic3d_TOSM_NONE,
|
||||
V3d_FLAT = Graphic3d_TOSM_FACET,
|
||||
@ -63,7 +69,7 @@ enum Graphic3d_TypeOfShadingModel
|
||||
enum
|
||||
{
|
||||
//! 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
|
||||
|
@ -43,7 +43,7 @@ namespace
|
||||
// =======================================================================
|
||||
OpenGl_Aspects::OpenGl_Aspects()
|
||||
: myAspect (new Graphic3d_Aspects()),
|
||||
myShadingModel (Graphic3d_TOSM_UNLIT)
|
||||
myShadingModel (Graphic3d_TypeOfShadingModel_Unlit)
|
||||
{
|
||||
myAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
myAspect->SetInteriorColor (Quantity_NOC_WHITE);
|
||||
@ -59,7 +59,7 @@ OpenGl_Aspects::OpenGl_Aspects()
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
OpenGl_Aspects::OpenGl_Aspects (const Handle(Graphic3d_Aspects)& theAspect)
|
||||
: myShadingModel (Graphic3d_TOSM_DEFAULT)
|
||||
: myShadingModel (Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||
{
|
||||
SetAspect (theAspect);
|
||||
}
|
||||
@ -73,13 +73,13 @@ void OpenGl_Aspects::SetAspect (const Handle(Graphic3d_Aspects)& theAspect)
|
||||
myAspect = theAspect;
|
||||
|
||||
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_DIFFUSE)
|
||||
|| aMat.ReflectionMode (Graphic3d_TOR_SPECULAR)
|
||||
|| aMat.ReflectionMode (Graphic3d_TOR_EMISSION))
|
||||
? theAspect->ShadingModel()
|
||||
: Graphic3d_TOSM_UNLIT;
|
||||
: Graphic3d_TypeOfShadingModel_Unlit;
|
||||
|
||||
// invalidate resources
|
||||
myResTextureSet.UpdateRediness (myAspect);
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
|
||||
|
||||
//! Set if lighting should be disabled or not.
|
||||
void SetNoLighting() { myShadingModel = Graphic3d_TOSM_UNLIT; }
|
||||
void SetNoLighting() { myShadingModel = Graphic3d_TypeOfShadingModel_Unlit; }
|
||||
|
||||
//! Returns textures map.
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (theAspect->ShadingModel() == Graphic3d_TOSM_UNLIT)
|
||||
if (theAspect->ShadingModel() == Graphic3d_TypeOfShadingModel_Unlit)
|
||||
{
|
||||
if (anAlphaCutoff == aMatState.AlphaCutoff())
|
||||
{
|
||||
@ -2725,8 +2725,8 @@ void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel)
|
||||
#if !defined(GL_ES_VERSION_2_0)
|
||||
if (core11ffp != NULL)
|
||||
{
|
||||
const Standard_Integer aModel = theModel == Graphic3d_TOSM_FACET
|
||||
|| theModel == Graphic3d_TOSM_PBR_FACET ? GL_FLAT : GL_SMOOTH;
|
||||
const Standard_Integer aModel = theModel == Graphic3d_TypeOfShadingModel_PhongFacet
|
||||
|| theModel == Graphic3d_TypeOfShadingModel_PbrFacet ? GL_FLAT : GL_SMOOTH;
|
||||
if (myShadeModel == aModel)
|
||||
{
|
||||
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 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
|
||||
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 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)
|
||||
|
@ -413,7 +413,7 @@ void OpenGl_FrameStatsPrs::Render (const Handle(OpenGl_Workspace)& theWorkspace)
|
||||
}
|
||||
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,
|
||||
Handle(OpenGl_ShaderProgram)());
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
aGlContext->SetSampleAlphaToCoverage (aGlContext->ShaderManager()->MaterialState().HasAlphaCutoff());
|
||||
@ -935,7 +935,7 @@ void OpenGl_PrimitiveArray::Render (const Handle(OpenGl_Workspace)& theWorkspace
|
||||
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
|
||||
const Handle(OpenGl_TextureSet)& aTextureSet = theWorkspace->TextureSet();
|
||||
const bool toEnableEnvMap = !aTextureSet.IsNull()
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -128,7 +128,7 @@ OpenGl_ShaderManager::OpenGl_ShaderManager (OpenGl_Context* theContext)
|
||||
: Graphic3d_ShaderManager (Aspect_GraphicsLibrary_OpenGL),
|
||||
#endif
|
||||
myFfpProgram (new OpenGl_ShaderProgramFFP()),
|
||||
myShadingModel (Graphic3d_TOSM_VERTEX),
|
||||
myShadingModel (Graphic3d_TypeOfShadingModel_Gouraud),
|
||||
myUnlitPrograms (new OpenGl_SetOfPrograms()),
|
||||
myContext (theContext),
|
||||
myHasLocalOrigin (Standard_False)
|
||||
@ -318,7 +318,7 @@ void OpenGl_ShaderManager::UpdateLightSourceState()
|
||||
// =======================================================================
|
||||
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!");
|
||||
}
|
||||
@ -1055,7 +1055,7 @@ void OpenGl_ShaderManager::PushState (const Handle(OpenGl_ShaderProgram)& thePro
|
||||
{
|
||||
// manage FFP lighting
|
||||
myContext->SetShadeModel (theShadingModel);
|
||||
if (theShadingModel == Graphic3d_TOSM_UNLIT)
|
||||
if (theShadingModel == Graphic3d_TypeOfShadingModel_Unlit)
|
||||
{
|
||||
myContext->core11fwd->glDisable (GL_LIGHTING);
|
||||
}
|
||||
@ -1078,7 +1078,7 @@ Standard_Boolean OpenGl_ShaderManager::BindFontProgram (const Handle(OpenGl_Shad
|
||||
if (!theCustomProgram.IsNull()
|
||||
|| myContext->caps->ffpEnable)
|
||||
{
|
||||
return bindProgramWithState (theCustomProgram, Graphic3d_TOSM_UNLIT);
|
||||
return bindProgramWithState (theCustomProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||
}
|
||||
|
||||
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,
|
||||
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())
|
||||
? theShadingModel
|
||||
: Graphic3d_TOSM_UNLIT;
|
||||
: Graphic3d_TypeOfShadingModel_Unlit;
|
||||
if (!theCustomProgram.IsNull()
|
||||
|| myContext->caps->ffpEnable)
|
||||
{
|
||||
@ -183,7 +183,7 @@ public:
|
||||
{
|
||||
prepareStdProgramUnlit (aProgram, aBits, true);
|
||||
}
|
||||
return bindProgramWithState (aProgram, Graphic3d_TOSM_UNLIT);
|
||||
return bindProgramWithState (aProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||
}
|
||||
|
||||
//! Bind program for FBO blit operation.
|
||||
@ -211,7 +211,7 @@ public:
|
||||
{
|
||||
prepareStdProgramBoundBox();
|
||||
}
|
||||
return bindProgramWithState (myBoundBoxProgram, Graphic3d_TOSM_UNLIT);
|
||||
return bindProgramWithState (myBoundBoxProgram, Graphic3d_TypeOfShadingModel_Unlit);
|
||||
}
|
||||
|
||||
//! Returns bounding box vertex buffer.
|
||||
@ -241,8 +241,8 @@ public:
|
||||
|
||||
switch (theShadingModel)
|
||||
{
|
||||
case Graphic3d_TOSM_PBR: return Graphic3d_TOSM_FRAGMENT;
|
||||
case Graphic3d_TOSM_PBR_FACET: return Graphic3d_TOSM_FACET;
|
||||
case Graphic3d_TypeOfShadingModel_Pbr: return Graphic3d_TypeOfShadingModel_Phong;
|
||||
case Graphic3d_TypeOfShadingModel_PbrFacet: return Graphic3d_TypeOfShadingModel_PhongFacet;
|
||||
default: return theShadingModel;
|
||||
}
|
||||
}
|
||||
@ -454,7 +454,7 @@ public:
|
||||
|
||||
//! Pushes current state of OCCT graphics parameters to specified program.
|
||||
Standard_EXPORT void PushState (const Handle(OpenGl_ShaderProgram)& theProgram,
|
||||
Graphic3d_TypeOfShadingModel theShadingModel = Graphic3d_TOSM_UNLIT) const;
|
||||
Graphic3d_TypeOfShadingModel theShadingModel = Graphic3d_TypeOfShadingModel_Unlit) const;
|
||||
|
||||
public:
|
||||
|
||||
@ -478,24 +478,24 @@ public:
|
||||
{
|
||||
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)
|
||||
{
|
||||
case Graphic3d_TOSM_DEFAULT:
|
||||
case Graphic3d_TOSM_UNLIT:
|
||||
case Graphic3d_TOSM_FACET:
|
||||
case Graphic3d_TypeOfShadingModel_DEFAULT:
|
||||
case Graphic3d_TypeOfShadingModel_Unlit:
|
||||
case Graphic3d_TypeOfShadingModel_PhongFacet:
|
||||
return aModel;
|
||||
case Graphic3d_TOSM_VERTEX:
|
||||
case Graphic3d_TOSM_FRAGMENT:
|
||||
return theHasNodalNormals ? aModel : Graphic3d_TOSM_FACET;
|
||||
case Graphic3d_TOSM_PBR:
|
||||
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TOSM_PBR_FACET, IsPbrAllowed());
|
||||
case Graphic3d_TOSM_PBR_FACET:
|
||||
case Graphic3d_TypeOfShadingModel_Gouraud:
|
||||
case Graphic3d_TypeOfShadingModel_Phong:
|
||||
return theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_PhongFacet;
|
||||
case Graphic3d_TypeOfShadingModel_Pbr:
|
||||
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_PbrFacet, IsPbrAllowed());
|
||||
case Graphic3d_TypeOfShadingModel_PbrFacet:
|
||||
return PBRShadingModelFallback (aModel, IsPbrAllowed());
|
||||
}
|
||||
return Graphic3d_TOSM_UNLIT;
|
||||
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||
}
|
||||
|
||||
//! Choose Shading Model for line primitives.
|
||||
@ -506,24 +506,24 @@ public:
|
||||
{
|
||||
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)
|
||||
{
|
||||
case Graphic3d_TOSM_DEFAULT:
|
||||
case Graphic3d_TOSM_UNLIT:
|
||||
case Graphic3d_TOSM_FACET:
|
||||
return Graphic3d_TOSM_UNLIT;
|
||||
case Graphic3d_TOSM_VERTEX:
|
||||
case Graphic3d_TOSM_FRAGMENT:
|
||||
return theHasNodalNormals ? aModel : Graphic3d_TOSM_UNLIT;
|
||||
case Graphic3d_TOSM_PBR:
|
||||
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TOSM_UNLIT, IsPbrAllowed());
|
||||
case Graphic3d_TOSM_PBR_FACET:
|
||||
return Graphic3d_TOSM_UNLIT;
|
||||
case Graphic3d_TypeOfShadingModel_DEFAULT:
|
||||
case Graphic3d_TypeOfShadingModel_Unlit:
|
||||
case Graphic3d_TypeOfShadingModel_PhongFacet:
|
||||
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||
case Graphic3d_TypeOfShadingModel_Gouraud:
|
||||
case Graphic3d_TypeOfShadingModel_Phong:
|
||||
return theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_Unlit;
|
||||
case Graphic3d_TypeOfShadingModel_Pbr:
|
||||
return PBRShadingModelFallback (theHasNodalNormals ? aModel : Graphic3d_TypeOfShadingModel_Unlit, IsPbrAllowed());
|
||||
case Graphic3d_TypeOfShadingModel_PbrFacet:
|
||||
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||
}
|
||||
return Graphic3d_TOSM_UNLIT;
|
||||
return Graphic3d_TypeOfShadingModel_Unlit;
|
||||
}
|
||||
|
||||
//! Choose Shading Model for Marker primitives.
|
||||
@ -632,7 +632,7 @@ protected:
|
||||
Handle(OpenGl_ShaderProgram)& getStdProgram (Graphic3d_TypeOfShadingModel theShadingModel,
|
||||
Standard_Integer theBits)
|
||||
{
|
||||
if (theShadingModel == Graphic3d_TOSM_UNLIT
|
||||
if (theShadingModel == Graphic3d_TypeOfShadingModel_Unlit
|
||||
|| (theBits & Graphic3d_ShaderFlags_HasTextures) == Graphic3d_ShaderFlags_TextureEnv)
|
||||
{
|
||||
// If environment map is enabled lighting calculations are
|
||||
@ -665,13 +665,13 @@ protected:
|
||||
{
|
||||
switch (theShadingModel)
|
||||
{
|
||||
case Graphic3d_TOSM_UNLIT: return prepareStdProgramUnlit (theProgram, theBits, false);
|
||||
case Graphic3d_TOSM_FACET: return prepareStdProgramPhong (theProgram, theBits, true);
|
||||
case Graphic3d_TOSM_VERTEX: return prepareStdProgramGouraud(theProgram, theBits);
|
||||
case Graphic3d_TOSM_DEFAULT:
|
||||
case Graphic3d_TOSM_FRAGMENT: return prepareStdProgramPhong (theProgram, theBits, false);
|
||||
case Graphic3d_TOSM_PBR: return prepareStdProgramPhong (theProgram, theBits, false, true);
|
||||
case Graphic3d_TOSM_PBR_FACET: return prepareStdProgramPhong (theProgram, theBits, true, true);
|
||||
case Graphic3d_TypeOfShadingModel_Unlit: return prepareStdProgramUnlit (theProgram, theBits, false);
|
||||
case Graphic3d_TypeOfShadingModel_PhongFacet: return prepareStdProgramPhong (theProgram, theBits, true);
|
||||
case Graphic3d_TypeOfShadingModel_Gouraud: return prepareStdProgramGouraud(theProgram, theBits);
|
||||
case Graphic3d_TypeOfShadingModel_DEFAULT:
|
||||
case Graphic3d_TypeOfShadingModel_Phong: return prepareStdProgramPhong (theProgram, theBits, false);
|
||||
case Graphic3d_TypeOfShadingModel_Pbr: return prepareStdProgramPhong (theProgram, theBits, false, true);
|
||||
case Graphic3d_TypeOfShadingModel_PbrFacet: return prepareStdProgramPhong (theProgram, theBits, true, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -702,8 +702,8 @@ protected:
|
||||
Standard_EXPORT Standard_Boolean preparePBREnvBakingProgram (Standard_Integer theIndex);
|
||||
|
||||
//! Checks whether one of PBR shading models is set as default model.
|
||||
Standard_Boolean IsPbrAllowed() const { return myShadingModel == Graphic3d_TOSM_PBR
|
||||
|| myShadingModel == Graphic3d_TOSM_PBR_FACET; }
|
||||
Standard_Boolean IsPbrAllowed() const { return myShadingModel == Graphic3d_TypeOfShadingModel_Pbr
|
||||
|| myShadingModel == Graphic3d_TypeOfShadingModel_PbrFacet; }
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -86,7 +86,7 @@ void OpenGl_Structure::renderBoundingBox (const Handle(OpenGl_Workspace)& theWor
|
||||
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->core11fwd->glDisable (GL_LIGHTING);
|
||||
aCtx->core11ffp->glEnableClientState (GL_VERTEX_ARRAY);
|
||||
|
@ -640,7 +640,7 @@ void OpenGl_Text::drawRect (const Handle(OpenGl_Context)& theCtx,
|
||||
}
|
||||
|
||||
// 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,
|
||||
Handle(OpenGl_ShaderProgram)());
|
||||
|
||||
|
@ -572,7 +572,7 @@ void OpenGl_View::SetBackgroundImage (const Handle(Graphic3d_TextureMap)& theTex
|
||||
Handle(Graphic3d_TextureSet) aTextureSet = new Graphic3d_TextureSet (theTextureMap);
|
||||
anAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
anAspect->SetFaceCulling (Graphic3d_TypeOfBackfacingModel_DoubleSided);
|
||||
anAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
anAspect->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||
anAspect->SetTextureSet (aTextureSet);
|
||||
anAspect->SetTextureMapOn (true);
|
||||
|
||||
@ -1193,8 +1193,8 @@ bool OpenGl_View::prepareFrameBuffers (Graphic3d_Camera::Projection& theProj)
|
||||
}
|
||||
|
||||
// process PBR environment
|
||||
if (myRenderParams.ShadingModel == Graphic3d_TOSM_PBR
|
||||
|| myRenderParams.ShadingModel == Graphic3d_TOSM_PBR_FACET)
|
||||
if (myRenderParams.ShadingModel == Graphic3d_TypeOfShadingModel_Pbr
|
||||
|| myRenderParams.ShadingModel == Graphic3d_TypeOfShadingModel_PbrFacet)
|
||||
{
|
||||
if (!myPBREnvironment.IsNull()
|
||||
&& myPBREnvironment->SizesAreDifferent (myRenderParams.PbrEnvPow2Size,
|
||||
@ -1424,7 +1424,7 @@ bool OpenGl_View::prepareFrameBuffers (Graphic3d_Camera::Projection& theProj)
|
||||
}
|
||||
|
||||
// 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())
|
||||
{
|
||||
aLights->UpdateRevision();
|
||||
@ -2094,7 +2094,7 @@ void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap)
|
||||
|
||||
aCtx->ShaderManager()->UpdateMaterialState();
|
||||
aCtx->ShaderManager()->UpdateModelWorldStateTo (OpenGl_Mat4());
|
||||
aCtx->ShaderManager()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
aCtx->ShaderManager()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||
|
||||
const Handle(OpenGl_FrameBuffer)& aShadowBuffer = theShadowMap->FrameBuffer();
|
||||
aShadowBuffer->BindBuffer (aCtx);
|
||||
@ -2162,7 +2162,7 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
|
||||
myBVHSelector.CacheClipPtsProjections();
|
||||
|
||||
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;
|
||||
if (!aLights.IsNull())
|
||||
{
|
||||
|
@ -2429,7 +2429,7 @@ Standard_Boolean OpenGl_View::updateRaytraceLightSources (const OpenGl_Mat4& the
|
||||
{
|
||||
std::vector<Handle(Graphic3d_CLight)> aLightSources;
|
||||
Graphic3d_Vec4 aNewAmbient (0.0f);
|
||||
if (myRenderParams.ShadingModel != Graphic3d_TOSM_UNLIT
|
||||
if (myRenderParams.ShadingModel != Graphic3d_TypeOfShadingModel_Unlit
|
||||
&& !myLights.IsNull())
|
||||
{
|
||||
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
|
||||
*myAspectFaceHl.Aspect() = *myAspectsSet->Aspect();
|
||||
myAspectFaceHl.Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
myAspectFaceHl.Aspect()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||
myAspectFaceHl.Aspect()->SetInteriorColor (myView->BackgroundColor().GetRGB());
|
||||
myAspectFaceHl.Aspect()->SetDistinguish (false);
|
||||
myAspectFaceHl.SetNoLighting();
|
||||
@ -340,8 +340,8 @@ const OpenGl_Aspects* OpenGl_Workspace::ApplyAspects (bool theToBindTextures)
|
||||
myGlContext->BindTextures (aTextureSet, Handle(OpenGl_ShaderProgram)());
|
||||
}
|
||||
|
||||
if ((myView->ShadingModel() == Graphic3d_TOSM_PBR
|
||||
|| myView->ShadingModel() == Graphic3d_TOSM_PBR_FACET)
|
||||
if ((myView->ShadingModel() == Graphic3d_TypeOfShadingModel_Pbr
|
||||
|| myView->ShadingModel() == Graphic3d_TypeOfShadingModel_PbrFacet)
|
||||
&& !myView->myPBREnvironment.IsNull()
|
||||
&& myView->myPBREnvironment->IsNeededToBeBound())
|
||||
{
|
||||
|
@ -183,7 +183,7 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
OpenGl_Vec4 aColor = theWorkspace->InteriorColor();
|
||||
|
||||
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)());
|
||||
aCtx->SetColor4fv (aColor);
|
||||
|
||||
|
@ -396,7 +396,7 @@ void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentat
|
||||
Handle(Graphic3d_AspectFillArea3d) aShadingStyle = new Graphic3d_AspectFillArea3d();
|
||||
aShadingStyle->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
||||
aShadingStyle->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
aShadingStyle->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||
aShadingStyle->SetPolygonOffset (aPolOffset);
|
||||
|
||||
aGroup->SetPrimitivesAspect (aShadingStyle);
|
||||
|
@ -506,7 +506,7 @@ static Standard_Integer OCC30182 (Draw_Interpretor& , Standard_Integer theNbArgs
|
||||
aPrs->SetDisplayMode (AIS_Shaded);
|
||||
aPrs->Attributes()->SetupOwnShadingAspect();
|
||||
const Handle(Graphic3d_AspectFillArea3d)& anAspect = aPrs->Attributes()->ShadingAspect()->Aspect();
|
||||
anAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
anAspect->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||
anAspect->SetTextureMapOn (true);
|
||||
anAspect->SetTextureMap (new Graphic3d_Texture2Dmanual (anImage));
|
||||
if (anImage->IsTopDown())
|
||||
|
@ -688,7 +688,7 @@ public:
|
||||
//! the visual axis measured from the Y axis of the screen.
|
||||
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;
|
||||
|
||||
//! Defines the shading model for the visualization.
|
||||
|
@ -153,7 +153,7 @@ public:
|
||||
//! Gives the default visualization mode.
|
||||
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; }
|
||||
|
||||
//! Gives the default type of SHADING.
|
||||
|
@ -340,43 +340,43 @@ Standard_Boolean ViewerTest::ParseShadingModel (Standard_CString th
|
||||
|| aTypeStr == "color"
|
||||
|| aTypeStr == "none")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_UNLIT;
|
||||
theModel = Graphic3d_TypeOfShadingModel_Unlit;
|
||||
}
|
||||
else if (aTypeStr == "flat"
|
||||
|| aTypeStr == "facet")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_FACET;
|
||||
theModel = Graphic3d_TypeOfShadingModel_PhongFacet;
|
||||
}
|
||||
else if (aTypeStr == "gouraud"
|
||||
|| aTypeStr == "vertex"
|
||||
|| aTypeStr == "vert")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_VERTEX;
|
||||
theModel = Graphic3d_TypeOfShadingModel_Gouraud;
|
||||
}
|
||||
else if (aTypeStr == "phong"
|
||||
|| aTypeStr == "fragment"
|
||||
|| aTypeStr == "frag"
|
||||
|| aTypeStr == "pixel")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_FRAGMENT;
|
||||
theModel = Graphic3d_TypeOfShadingModel_Phong;
|
||||
}
|
||||
else if (aTypeStr == "pbr")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_PBR;
|
||||
theModel = Graphic3d_TypeOfShadingModel_Pbr;
|
||||
}
|
||||
else if (aTypeStr == "pbr_facet")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_PBR_FACET;
|
||||
theModel = Graphic3d_TypeOfShadingModel_PbrFacet;
|
||||
}
|
||||
else if (aTypeStr == "default"
|
||||
|| aTypeStr == "def")
|
||||
{
|
||||
theModel = Graphic3d_TOSM_DEFAULT;
|
||||
theModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||
}
|
||||
else if (aTypeStr.IsIntegerValue())
|
||||
{
|
||||
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;
|
||||
}
|
||||
@ -1815,7 +1815,7 @@ struct ViewerTest_AspectsChangeSet
|
||||
ToSetHatch (0),
|
||||
StdHatchStyle (-1),
|
||||
ToSetShadingModel (0),
|
||||
ShadingModel (Graphic3d_TOSM_DEFAULT),
|
||||
ShadingModel (Graphic3d_TypeOfShadingModel_DEFAULT),
|
||||
ToSetInterior (0),
|
||||
InteriorStyle (Aspect_IS_SOLID),
|
||||
ToSetDrawSilhouette (0),
|
||||
@ -1909,7 +1909,7 @@ struct ViewerTest_AspectsChangeSet
|
||||
isOk = Standard_False;
|
||||
}
|
||||
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 << ".";
|
||||
isOk = Standard_False;
|
||||
@ -3114,7 +3114,7 @@ static Standard_Integer VAspects (Draw_Interpretor& theDI,
|
||||
else if (anArg == "-unsetshadingmodel")
|
||||
{
|
||||
aChangeSet->ToSetShadingModel = -1;
|
||||
aChangeSet->ShadingModel = Graphic3d_TOSM_DEFAULT;
|
||||
aChangeSet->ShadingModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||
}
|
||||
else if (anArg == "-setinterior"
|
||||
|| anArg == "-setinteriorstyle"
|
||||
@ -3243,7 +3243,7 @@ static Standard_Integer VAspects (Draw_Interpretor& theDI,
|
||||
aChangeSet->StdHatchStyle = -1;
|
||||
aChangeSet->PathToHatchPattern.Clear();
|
||||
aChangeSet->ToSetShadingModel = -1;
|
||||
aChangeSet->ShadingModel = Graphic3d_TOSM_DEFAULT;
|
||||
aChangeSet->ShadingModel = Graphic3d_TypeOfShadingModel_DEFAULT;
|
||||
aChangeSet->ToSetInterior = -1;
|
||||
aChangeSet->InteriorStyle = Aspect_IS_SOLID;
|
||||
aChangeSet->ToSetDrawSilhouette = -1;
|
||||
|
@ -11333,13 +11333,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
theDI << "shadingModel: ";
|
||||
switch (aView->ShadingModel())
|
||||
{
|
||||
case Graphic3d_TOSM_DEFAULT: theDI << "default"; break;
|
||||
case Graphic3d_TOSM_UNLIT: theDI << "unlit"; break;
|
||||
case Graphic3d_TOSM_FACET: theDI << "flat"; break;
|
||||
case Graphic3d_TOSM_VERTEX: theDI << "gouraud"; break;
|
||||
case Graphic3d_TOSM_FRAGMENT: theDI << "phong"; break;
|
||||
case Graphic3d_TOSM_PBR: theDI << "pbr"; break;
|
||||
case Graphic3d_TOSM_PBR_FACET: theDI << "pbr_facet"; break;
|
||||
case Graphic3d_TypeOfShadingModel_DEFAULT: theDI << "default"; break;
|
||||
case Graphic3d_TypeOfShadingModel_Unlit: theDI << "unlit"; break;
|
||||
case Graphic3d_TypeOfShadingModel_PhongFacet: theDI << "flat"; break;
|
||||
case Graphic3d_TypeOfShadingModel_Gouraud: theDI << "gouraud"; break;
|
||||
case Graphic3d_TypeOfShadingModel_Phong: theDI << "phong"; break;
|
||||
case Graphic3d_TypeOfShadingModel_Pbr: theDI << "pbr"; break;
|
||||
case Graphic3d_TypeOfShadingModel_PbrFacet: theDI << "pbr_facet"; break;
|
||||
}
|
||||
theDI << "\n";
|
||||
{
|
||||
@ -12130,13 +12130,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
switch (aView->ShadingModel())
|
||||
{
|
||||
case Graphic3d_TOSM_DEFAULT: theDI << "default"; break;
|
||||
case Graphic3d_TOSM_UNLIT: theDI << "unlit "; break;
|
||||
case Graphic3d_TOSM_FACET: theDI << "flat "; break;
|
||||
case Graphic3d_TOSM_VERTEX: theDI << "gouraud "; break;
|
||||
case Graphic3d_TOSM_FRAGMENT: theDI << "phong "; break;
|
||||
case Graphic3d_TOSM_PBR: theDI << "pbr"; break;
|
||||
case Graphic3d_TOSM_PBR_FACET: theDI << "pbr_facet"; break;
|
||||
case Graphic3d_TypeOfShadingModel_DEFAULT: theDI << "default"; break;
|
||||
case Graphic3d_TypeOfShadingModel_Unlit: theDI << "unlit "; break;
|
||||
case Graphic3d_TypeOfShadingModel_PhongFacet: theDI << "flat "; break;
|
||||
case Graphic3d_TypeOfShadingModel_Gouraud: theDI << "gouraud "; break;
|
||||
case Graphic3d_TypeOfShadingModel_Phong: theDI << "phong "; break;
|
||||
case Graphic3d_TypeOfShadingModel_Pbr: theDI << "pbr"; break;
|
||||
case Graphic3d_TypeOfShadingModel_PbrFacet: theDI << "pbr_facet"; break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -12146,9 +12146,9 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
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)
|
||||
&& aModel != Graphic3d_TOSM_DEFAULT)
|
||||
&& aModel != Graphic3d_TypeOfShadingModel_DEFAULT)
|
||||
{
|
||||
aView->SetShadingModel (aModel);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user