CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
OdGiShadowParameters Class Reference

#include <GiLightTraits.h>

Public Types

enum  ShadowType { kShadowsRayTraced = 0 , kShadowMaps , kAreaSampled }
 
enum  ExtendedLightShape {
  kLinear = 0 , kRectangle , kDisk , kCylinder ,
  kSphere
}
 

Public Member Functions

 OdGiShadowParameters ()
 
 OdGiShadowParameters (const OdGiShadowParameters &parms)
 
OdGiShadowParametersoperator= (const OdGiShadowParameters &parms)
 
bool operator== (const OdGiShadowParameters &parms) const
 
bool operator!= (const OdGiShadowParameters &parms) const
 
void setShadowsOn (bool on)
 
bool shadowsOn () const
 
void setShadowType (ShadowType typ)
 
ShadowType shadowType () const
 
bool setShadowMapSize (OdUInt16 sz)
 
OdUInt16 shadowMapSize () const
 
bool setShadowMapSoftness (OdUInt8 soft)
 
OdUInt8 shadowMapSoftness () const
 
bool setShadowSamples (OdUInt16 nSamples)
 
OdUInt16 shadowSamples () const
 
void setShapeVisibility (bool bVisibility)
 
bool shapeVisibility () const
 
void setExtendedLightShape (ExtendedLightShape lightShape)
 
ExtendedLightShape extendedLightShape () const
 
bool setExtendedLightLength (double dLength)
 
double extendedLightLength () const
 
bool setExtendedLightWidth (double dWidth)
 
double extendedLightWidth () const
 
bool setExtendedLightRadius (double dRadius)
 
double extendedLightRadius () const
 
void save (OdGsFiler *pFiler) const
 
void load (OdGsFiler *pFiler)
 

Detailed Description

Corresponding C++ library: TD_Gi <group OdGi_Classes>

See also
<link gi_shadows_rendering, Shadows Visualization>

Definition at line 149 of file GiLightTraits.h.

Member Enumeration Documentation

◆ ExtendedLightShape

Represents shapes of the extended light sources.

Enumerator
kLinear 

Linear light source.

kRectangle 

Rectangular-shaped light source.

kDisk 

Disk-shaped light source.

kCylinder 

Cylinder-shaped light source.

kSphere 

Sphere-shaped light source.

Definition at line 224 of file GiLightTraits.h.

◆ ShadowType

Represents methods that are used to compute shadows.

Enumerator
kShadowsRayTraced 

Ray-traced shadows.

kShadowMaps 

Shadow maps.

kAreaSampled 

The area-sampled shadow algorithm shows the effect of extended light sources.

Definition at line 211 of file GiLightTraits.h.

Constructor & Destructor Documentation

◆ OdGiShadowParameters() [1/2]

OdGiShadowParameters::OdGiShadowParameters ( )
inline

Default constructor for the OdGiShadowParameters class. Initializes the following data members:

Data member Value Description m_bShadowsOn true Flag that shows if shadows are enabled m_shadowMapSoftness 1 The number of pixels at the shadow edge that are diffused. m_bShapeVisible false Flag that shows if the light shape is visible in the rendering. m_shadowType OdGiShadowParameters::kShadowsRayTraced Method which is used to compute shadows cast from the light source. m_shadowMapSize 256 Shadow map size in pixels. m_shadowSamples 16 The number of shadow rays to shoot for the light. m_lightShape OdGiShadowParameters::kSphere The shape of the extended light source. m_lightLength 0.0 The length of the extended light source. m_lightWidth 0.0 The width of the extended light source. m_lightRadius 0.0 Radius of the extended light source.

Definition at line 495 of file GiLightTraits.h.

◆ OdGiShadowParameters() [2/2]

OdGiShadowParameters::OdGiShadowParameters ( const OdGiShadowParameters parms)
inline

Copy constructor for the OdGiShadowParameters class.

Parameters
parms[in] Shadow parameters to be copied.

Definition at line 509 of file GiLightTraits.h.

Member Function Documentation

◆ extendedLightLength()

double OdGiShadowParameters::extendedLightLength ( ) const
inline

Retrieves the length of the extended light source.

Returns
the length of the extended light source as a value of the double type.

Definition at line 652 of file GiLightTraits.h.

◆ extendedLightRadius()

double OdGiShadowParameters::extendedLightRadius ( ) const
inline

Retrieves the radius of the extended light source.

Returns
radius for the extended light source as the value of the double type.

Definition at line 674 of file GiLightTraits.h.

◆ extendedLightShape()

OdGiShadowParameters::ExtendedLightShape OdGiShadowParameters::extendedLightShape ( ) const
inline

Retrieves the shape of the extended light source.

Returns
the shape of the extended light source as a value from the ExtendedLightShape enumeration.

Definition at line 641 of file GiLightTraits.h.

◆ extendedLightWidth()

double OdGiShadowParameters::extendedLightWidth ( ) const
inline

Retrieves the width of the extended light source.

Returns
the width of the extended light source as a value of the double type.

Definition at line 663 of file GiLightTraits.h.

◆ load()

void OdGiShadowParameters::load ( OdGsFiler pFiler)
inline

Loads the shadow parameters from the specified filer.

Parameters
pFiler[in] Pointer to a filer to load parameters from.

Definition at line 469 of file GiLightTraits.h.

◆ operator!=()

bool OdGiShadowParameters::operator!= ( const OdGiShadowParameters parms) const
inline

Inequality operator for the OdGiShadowParameters class.

Parameters
parms[in] Parameters to be compared.
Returns
true if these shadow parameters are bot equal to the passed shadow parameters, false otherwise.

Definition at line 552 of file GiLightTraits.h.

◆ operator=()

OdGiShadowParameters & OdGiShadowParameters::operator= ( const OdGiShadowParameters parms)
inline

Assignment operator for the OdGiShadowParameters class.

Parameters
parms[in] Shadow parameters to be assigned.
Returns
reference to shadow parameters.

Definition at line 523 of file GiLightTraits.h.

◆ operator==()

bool OdGiShadowParameters::operator== ( const OdGiShadowParameters parms) const
inline

Equality operator for the OdGiShadowParameters class.

Parameters
parms[in] Parameters to be compared.
Returns
true if these shadow parameters are equal to the passed shadow parameters, false otherwise.

Definition at line 538 of file GiLightTraits.h.

◆ save()

void OdGiShadowParameters::save ( OdGsFiler pFiler) const
inline

Saves the shadow parameters to the specified filer.

Parameters
pFiler[in] Pointer to a filer to save parameters to.

Definition at line 452 of file GiLightTraits.h.

◆ setExtendedLightLength()

bool OdGiShadowParameters::setExtendedLightLength ( double  dLength)
inline

Specifies the length of the extended light source.

Parameters
dLength[in] Length for the extended light source.
Remarks
This method is useful only if shadow type is kAreaSampled and the shape of the extended light source is kLinear, kRectangle or kCylinder.

Definition at line 646 of file GiLightTraits.h.

◆ setExtendedLightRadius()

bool OdGiShadowParameters::setExtendedLightRadius ( double  dRadius)
inline

Specifies the radius of the extended light source.

Parameters
dRadius[in] Radius for the extended light source.
Returns
true.
Remarks
This method is useful only if shadow type is kAreaSampled and the shape of the extended light source is kDisk, kCylinder or kSphere.

Definition at line 668 of file GiLightTraits.h.

◆ setExtendedLightShape()

void OdGiShadowParameters::setExtendedLightShape ( OdGiShadowParameters::ExtendedLightShape  lightShape)
inline

Specifies the shape of the extended light source.

Parameters
lightShape[in] Light shape for the extended light source.
Remarks
This method is useful only if shadow type is kAreaSampled.

Definition at line 636 of file GiLightTraits.h.

◆ setExtendedLightWidth()

bool OdGiShadowParameters::setExtendedLightWidth ( double  dWidth)
inline

Specifies the width of the extended light source.

Parameters
dWidth[in] Width for the extended light source.
Remarks
This method is useful only if shadow type is kAreaSampled and the shape of the extended light source is kLinear, kRectangle or kCylinder.

Definition at line 657 of file GiLightTraits.h.

◆ setShadowMapSize()

bool OdGiShadowParameters::setShadowMapSize ( OdUInt16  sz)
inline

Specifies a shadow map size.

Parameters
sz[in] Shadow map size.
Remarks
Valid values are 64, 128, 256, 512, 1024, 2048, and 4096. Smaller values provide softer and smudged shadows, while greater values provide sharper shadows, therefore they require more resources to be calculated.

Definition at line 586 of file GiLightTraits.h.

◆ setShadowMapSoftness()

bool OdGiShadowParameters::setShadowMapSoftness ( OdUInt8  soft)
inline

Specifies a shadow map softness.

Parameters
soft[in] Shadow map softness value.
Remarks
The passed parameter represents the number of pixels at the shadow edge that are diffused. This method is useful only if shadow type if kShadowMaps.

Definition at line 604 of file GiLightTraits.h.

◆ setShadowSamples()

bool OdGiShadowParameters::setShadowSamples ( OdUInt16  nSamples)
inline

Specifies a number of shadow rays to use for the light.

Parameters
nSamples[in] The number of shadow rays to use for the light.
Returns
true.
Remarks
The number of samples controls the softness of sampled shadows. This method is useful only if shadow type if kAreaSampled.

Definition at line 615 of file GiLightTraits.h.

◆ setShadowsOn()

void OdGiShadowParameters::setShadowsOn ( bool  on)
inline

Specifies whether shadows are casted from the light.

Parameters
on[in] Flag that specifies whether to enable shadows .

Definition at line 566 of file GiLightTraits.h.

◆ setShadowType()

void OdGiShadowParameters::setShadowType ( ShadowType  typ)
inline

Specifies type of the shadows.

Parameters
typ[in] Shadow type.

Definition at line 576 of file GiLightTraits.h.

◆ setShapeVisibility()

void OdGiShadowParameters::setShapeVisibility ( bool  bVisibility)
inline

Specifies whether light shape should be visible in the rendering.

Parameters
bVisibility[in] Flag that specifies whether light shape should be visible.

Definition at line 626 of file GiLightTraits.h.

◆ shadowMapSize()

OdUInt16 OdGiShadowParameters::shadowMapSize ( ) const
inline

Retrieves a shadow map size.

Returns
shadow map size as OdUInt16 value.
Remarks
Returned values can be 64, 128, 256, 512, 1024, 2048, and 4096. Smaller values represent softer and smudged shadows, while greater values represent sharper shadows.

Definition at line 599 of file GiLightTraits.h.

◆ shadowMapSoftness()

OdUInt8 OdGiShadowParameters::shadowMapSoftness ( ) const
inline

Retrieves a shadow map softness.

Returns
the number of pixels at the shadow edge that are diffused.

Definition at line 610 of file GiLightTraits.h.

◆ shadowSamples()

OdUInt16 OdGiShadowParameters::shadowSamples ( ) const
inline

Retrieves a number of shadow rays to use for the light.

Returns
the number of shadow rays for the light as OdUInt16 value.
Remarks
The number of samples controls the softness of sampled shadows. This method is useful only if shadow type if kAreaSampled.

Definition at line 621 of file GiLightTraits.h.

◆ shadowsOn()

bool OdGiShadowParameters::shadowsOn ( ) const
inline

Checks whether shadows are casted from the light.

Returns
true if shadows are enabled, false otherwise.

Definition at line 571 of file GiLightTraits.h.

◆ shadowType()

OdGiShadowParameters::ShadowType OdGiShadowParameters::shadowType ( ) const
inline

Retrieves a type a the shadow.

Returns
a value from the ShadowType enumeration that represents one of the shadow types.

Definition at line 581 of file GiLightTraits.h.

◆ shapeVisibility()

bool OdGiShadowParameters::shapeVisibility ( ) const
inline

Checks whether light shape is visible in the rendering.

Returns
true if light source is visible in the rendering, false otherwise.

Definition at line 631 of file GiLightTraits.h.


The documentation for this class was generated from the following file: