HPS::PostProcessEffectsControl Class Reference

#include <hps.h>

Inheritance diagram for HPS::PostProcessEffectsControl:
HPS::Control HPS::Object

Public Member Functions

HPS::Type ObjectType () const
 
PostProcessEffectsControloperator= (PostProcessEffectsControl &&in_that)
 
PostProcessEffectsControloperator= (PostProcessEffectsControl const &in_that)
 
 PostProcessEffectsControl (WindowKey &in_seg)
 
 PostProcessEffectsControl (PostProcessEffectsControl const &in_that)
 
 PostProcessEffectsControl (PostProcessEffectsControl &&in_that)
 
PostProcessEffectsControlSetAmbientOcclusion (bool in_state, float in_strength=1.0f, PostProcessEffects::AmbientOcclusion::Quality in_quality=PostProcessEffects::AmbientOcclusion::Quality::Fastest, float in_radius=1.0f, float in_sharpness=32.0f)
 
PostProcessEffectsControlSetAmbientOcclusion (float in_strength, PostProcessEffects::AmbientOcclusion::Quality in_quality=PostProcessEffects::AmbientOcclusion::Quality::Fastest, float in_radius=1.0f, float in_sharpness=32.0f)
 
PostProcessEffectsControlSetBloom (bool in_state, float in_strength=1.0f, unsigned int in_blur=5, PostProcessEffects::Bloom::Shape in_shape=PostProcessEffects::Bloom::Shape::Radial)
 
PostProcessEffectsControlSetBloom (float in_strength, unsigned int in_blur, PostProcessEffects::Bloom::Shape in_shape)
 
PostProcessEffectsControlSetDepthOfField (bool in_state, float in_strength=1.0f, float in_near_distance=Float::NegativeInfinity, float in_far_distance=Float::Infinity)
 
PostProcessEffectsControlSetDepthOfField (float in_strength, float in_near_distance, float in_far_distance)
 
PostProcessEffectsControlSetEyeDomeLighting (bool in_state, float in_exponent=50.0f, float in_tolerance=1.0f, float in_strength=1.0f)
 
PostProcessEffectsControlSetEyeDomeLighting (float in_exponent, float in_tolerance, float in_strength)
 
PostProcessEffectsControlSetSilhouetteEdges (bool in_state, float in_tolerance=1.0f, bool in_heavy_exterior=false)
 
PostProcessEffectsControlSetSilhouetteEdges (float in_tolerance, bool in_heavy_exterior)
 
PostProcessEffectsControlSetWorldScale (float in_scale)
 
bool ShowAmbientOcclusion (bool &out_state, float &out_strength, PostProcessEffects::AmbientOcclusion::Quality &out_quality, float &out_radius, float &out_sharpness) const
 
bool ShowBloom (bool &out_state, float &out_strength, unsigned int &out_blur, PostProcessEffects::Bloom::Shape &out_shape) const
 
bool ShowDepthOfField (bool &out_state, float &out_strength, float &out_near_distance, float &out_far_distance) const
 
bool ShowEyeDomeLighting (bool &out_state, float &out_exponent, float &out_tolerance, float &out_strength) const
 
bool ShowSilhouetteEdges (bool &out_state, float &out_tolerance, bool &out_heavy_exterior) const
 
bool ShowWorldScale (float &out_scale) const
 
virtual HPS::Type Type () const
 
PostProcessEffectsControlUnsetAmbientOcclusion ()
 
PostProcessEffectsControlUnsetBloom ()
 
PostProcessEffectsControlUnsetDepthOfField ()
 
PostProcessEffectsControlUnsetEverything ()
 
PostProcessEffectsControlUnsetEyeDomeLighting ()
 
PostProcessEffectsControlUnsetSilhouetteEdges ()
 
PostProcessEffectsControlUnsetWorldScale ()
 
 ~PostProcessEffectsControl ()
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
 Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::PostProcessEffectsControl
 
- Static Public Attributes inherited from HPS::Control
static const HPS::Type staticType = HPS::Type::Control
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 
- Protected Member Functions inherited from HPS::Control
 Control (Control &&in_that)
 
Controloperator= (Control &&in_that)
 

Detailed Description

The HPS::PostProcessEffectsControl class is a smart pointer that is tied to a database object. This object is effective only for the shader-based driver interfaces such as DirectX and OpenGL2. Ambient occlusion, bloom, silhouette edges, and depth of field are all enabled through this control. Default values for the various fields of HPS::PostProcessEffectsControl can be found here.

Constructor & Destructor Documentation

◆ PostProcessEffectsControl() [1/3]

HPS::PostProcessEffectsControl::PostProcessEffectsControl ( WindowKey in_seg)
explicit

Initializes a control tied to the window segment in_seg.

◆ PostProcessEffectsControl() [2/3]

HPS::PostProcessEffectsControl::PostProcessEffectsControl ( PostProcessEffectsControl const &  in_that)

Initializes a control tied to the same object as in_that.

◆ PostProcessEffectsControl() [3/3]

HPS::PostProcessEffectsControl::PostProcessEffectsControl ( PostProcessEffectsControl &&  in_that)

The move constructor creates a PostProcessEffectsControl by transferring the underlying impl of the rvalue reference to this PostProcessEffectsControl thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a PostProcessEffectsControl to take the impl from.

◆ ~PostProcessEffectsControl()

HPS::PostProcessEffectsControl::~PostProcessEffectsControl ( )

Releases a reference to the database object this control is tied to.

Member Function Documentation

◆ ObjectType()

HPS::Type HPS::PostProcessEffectsControl::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::Control.

◆ operator=() [1/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::operator= ( PostProcessEffectsControl &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this PostProcessEffectsControl thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to a PostProcessEffectsControl to take the impl from.
Returns
A reference to this PostProcessEffectsControl.

◆ operator=() [2/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::operator= ( PostProcessEffectsControl const &  in_that)

Share the underlying smart-pointer of the PostProcessEffectsControl source.

Parameters
in_thatThe PostProcessEffectsControl source of the assignment.
Returns
A reference to this PostProcessEffectsControl.

◆ SetAmbientOcclusion() [1/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetAmbientOcclusion ( bool  in_state,
float  in_strength = 1.0f,
PostProcessEffects::AmbientOcclusion::Quality  in_quality = PostProcessEffects::AmbientOcclusion::Quality::Fastest,
float  in_radius = 1.0f,
float  in_sharpness = 32.0f 
)

Ambient occlusion is a general term for shading that varies when nearby objects (occluders) would prevent some portion of ambient light from reaching a surface. This applies a filter that looks for small valleys in the depth buffer results, and slightly darkens these areas.

Note
Ambient occlusion uses the depth buffer that is generated when we render opaque geometry to approximate ambient occlusion. Drawing of transparent geometry is always deferred until after all opaque geometry is drawn, and doesn't write any depth information to the depth buffer. Thus, transparent geometry will effectively not exist for ambient occlusion calculations, and will therefore be unaffected by them. This also means that if all geometry in a scene is transparent, ambient occlusion is effectively disabled.
Parameters
in_stateWhether ambient occlusion should be used.
in_strengthA multiplier on the default contribution of ambient occlusion in the regular lighting calculations. Higher values mean that ambient occlusion will make a stronger contribution.
in_qualityIndicates how much time should be spent improving the visual quality.
in_radiusA multiplier for the screen-space search radius.
in_sharpnessA value from 0.0f to 32.0f where lower values result in more blurred but softer edges and higher values will be blurred less with harder edges yet with more potential for banding. Higher values increase the search radius for occluding pixels, but may cause under-sampling artifacts.
Returns
A reference to this object.

◆ SetAmbientOcclusion() [2/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetAmbientOcclusion ( float  in_strength,
PostProcessEffects::AmbientOcclusion::Quality  in_quality = PostProcessEffects::AmbientOcclusion::Quality::Fastest,
float  in_radius = 1.0f,
float  in_sharpness = 32.0f 
)

Ambient occlusion is a general term for shading that varies when nearby objects (occluders) would prevent some portion of ambient light from reaching a surface. This applies a filter that looks for small valleys in the depth buffer results, and slightly darkens these areas. The state is implicitly on.

Note
Ambient occlusion uses the depth buffer that is generated when we render opaque geometry to approximate ambient occlusion. Drawing of transparent geometry is always deferred until after all opaque geometry is drawn, and doesn't write any depth information to the depth buffer. Thus, transparent geometry will effectively not exist for ambient occlusion calculations, and will therefore be unaffected by them. This also means that if all geometry in a scene is transparent, ambient occlusion is effectively disabled.
Parameters
in_strengthA multiplier on the default contribution of ambient occlusion in the regular lighting calculations. Higher values mean that ambient occlusion will make a stronger contribution.
in_qualityIndicates how much time should be spent improving the visual quality.
in_radiusA multiplier for the screen-space search radius.
in_sharpnessA value from 0.0f to 32.0f where lower values result in more blurred but softer edges and higher values will be blurred less with harder edges yet with more potential for banding. Higher values increase the search radius for occluding pixels, but may cause under-sampling artifacts.
Returns
A reference to this object.

◆ SetBloom() [1/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetBloom ( bool  in_state,
float  in_strength = 1.0f,
unsigned int  in_blur = 5,
PostProcessEffects::Bloom::Shape  in_shape = PostProcessEffects::Bloom::Shape::Radial 
)

Bloom causes bright objects to bleed into darker ones, simulating the imperfect focus inevitable with the human eye or any other type of lens.

Parameters
in_stateWhether bloom should be used.
in_strengthA multiplier on the default contribution of bloom. Higher values mean that bloom will make a stronger contribution. Valid range is [0,10].
in_blurThe number of blur passes to perform on the output. Higher values mean that bloom will affect a wider area and look smoother. Valid range is [1,8].
in_shapeThe shape of the bloom effect.
Returns
A reference to this object.

◆ SetBloom() [2/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetBloom ( float  in_strength,
unsigned int  in_blur,
PostProcessEffects::Bloom::Shape  in_shape 
)

Bloom causes bright objects to bleed into darker ones, simulating the imperfect focus inevitable with the human eye or any other type of lens. The state is implicitly on.

Parameters
in_strengthA multiplier on the default contribution of bloom. Higher values mean that bloom will make a stronger contribution. Valid range is [0,10].
in_blurThe number of blur passes to perform on the output. Higher values mean that bloom will affect a wider area and look smoother. Valid range is [1,8].
in_shapeThe shape of the bloom effect.
Returns
A reference to this object.

◆ SetDepthOfField() [1/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetDepthOfField ( bool  in_state,
float  in_strength = 1.0f,
float  in_near_distance = Float::NegativeInfinity,
float  in_far_distance = Float::Infinity 
)

Depth of Field is the distance between the nearest and farthest objects in a scene that appear sharp.

Parameters
in_stateWhether depth of field should be used.
in_strengthA multiplier on the default blur radius. Higher values mean more blurring.
in_near_distanceThe camera distance in front of which geometry will begin to appear out of focus.
in_far_distanceThe camera distance beyond which geometry will appear out of focus.
Returns
A reference to this object.

◆ SetDepthOfField() [2/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetDepthOfField ( float  in_strength,
float  in_near_distance,
float  in_far_distance 
)

Depth of Field is the distance between the nearest and farthest objects in a scene that appear sharp. The state is implicitly on.

Parameters
in_strengthA multiplier on the default blur radius. Higher values mean more blurring.
in_near_distanceThe camera distance in front of which geometry will begin to appear out of focus.
in_far_distanceThe camera distance beyond which geometry will appear out of focus.
Returns
A reference to this object.

◆ SetEyeDomeLighting() [1/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetEyeDomeLighting ( bool  in_state,
float  in_exponent = 50.0f,
float  in_tolerance = 1.0f,
float  in_strength = 1.0f 
)

Controls the shader-based eye-dome lighting effect.

Parameters
in_stateWhether eye-dome lighting should be used.
in_exponentAn exponent used to attenuate the per-pixel occlusion computed by the eye-dome lighting algorithm.
in_toleranceA multiplier on the threshold that the driver uses when comparing adjacent pixel depth values to detect occlusion. This allows the user to control the amount of occlusion added by neighboring pixels based on their relative depth difference.
in_strengthA multiplier on the calculated per-pixel occlusion value.
Returns
true if the setting is valid, false otherwise.

◆ SetEyeDomeLighting() [2/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetEyeDomeLighting ( float  in_exponent,
float  in_tolerance,
float  in_strength 
)

Controls the shader-based eye-dome lighting effect. The state is implicitly on.

Parameters
in_exponentAn exponent used to attenuate the per-pixel occlusion computed by the eye-dome lighting algorithm.
in_toleranceA multiplier on the threshold that the driver uses when comparing adjacent pixel depth values to detect occlusion. This allows the user to control the amount of occlusion added by neighboring pixels based on their relative depth difference.
in_strengthA multiplier on the calculated per-pixel occlusion value.
Returns
true if the setting is valid, false otherwise.

◆ SetSilhouetteEdges() [1/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetSilhouetteEdges ( bool  in_state,
float  in_tolerance = 1.0f,
bool  in_heavy_exterior = false 
)

Controls the shader-based fast drawing of silhouette edges.

Parameters
in_stateWhether silhouette edges should be used.
in_toleranceA multiplier on the threshold that the driver uses when comparing adjacent pixel depth values to detect silhouettes. This allows the user to control the trade-off between silhouettes appearing where they shouldn't, vs disappearing in places they should be.
in_heavy_exteriorThis option, when enabled, causes an extra thick border to be drawn at the boundary between geometry and the window background (as opposed to geometry on top of other geometry).
Returns
A reference to this object.

◆ SetSilhouetteEdges() [2/2]

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetSilhouetteEdges ( float  in_tolerance,
bool  in_heavy_exterior 
)

Controls the shader-based fast drawing of silhouette edges. The state is implicitly on.

Parameters
in_toleranceA multiplier on the threshold that the driver uses when comparing adjacent pixel depth values to detect silhouettes. This allows the user to control the trade-off between silhouettes appearing where they shouldn't, vs disappearing in places they should be.
in_heavy_exteriorThis option, when enabled, causes an extra thick border to be drawn at the boundary between geometry and the window background (as opposed to geometry on top of other geometry).
Returns
A reference to this object.

◆ SetWorldScale()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::SetWorldScale ( float  in_scale)

Sets a world scale value used by post process effects such as ambient occlusion. If not set, scale is computed based on scene bounding.

Parameters
in_scaleScale value used by post process effect.
Returns
A reference to this object.

◆ ShowAmbientOcclusion()

bool HPS::PostProcessEffectsControl::ShowAmbientOcclusion ( bool &  out_state,
float &  out_strength,
PostProcessEffects::AmbientOcclusion::Quality out_quality,
float &  out_radius,
float &  out_sharpness 
) const

Shows the ambient occlusion setting.

Parameters
out_stateWhether ambient occlusion should be used.
out_strengthA multiplier on the default contribution of ambient occlusion in the regular lighting calculations. Higher values mean that ambient occlusion will make a stronger contribution.
out_qualityIndicates how much time should be spent improving the visual quality.
out_radiusA multiplier for the screen-space search radius.
out_sharpnessA value indicating the sharpness of the ambient occlusion edges. Higher values increase the search radius for occluding pixels, but may cause under-sampling artifacts.
Returns
true if the setting is valid, false otherwise.

◆ ShowBloom()

bool HPS::PostProcessEffectsControl::ShowBloom ( bool &  out_state,
float &  out_strength,
unsigned int &  out_blur,
PostProcessEffects::Bloom::Shape out_shape 
) const

Shows the bloom setting.

Parameters
out_stateWhether bloom should be used.
out_strengthA multiplier on the default contribution of bloom. Higher values mean that bloom will make a stronger contribution.
out_blurThe number of blur passes to perform on the output. Higher values mean that bloom will affect a wider area and look smoother.
out_shapeThe shape of the bloom effect.
Returns
true if the setting is valid, false otherwise.

◆ ShowDepthOfField()

bool HPS::PostProcessEffectsControl::ShowDepthOfField ( bool &  out_state,
float &  out_strength,
float &  out_near_distance,
float &  out_far_distance 
) const

Shows the depth of field setting.

Parameters
out_stateWhether depth of field should be used.
out_strengthA multiplier on the default blur radius. Higher values mean more blurring.
out_near_distanceThe camera distance in front of which geometry will begin to appear out of focus.
out_far_distanceThe camera distance beyond which geometry will appear out of focus.
Returns
true if the setting is valid, false otherwise.

◆ ShowEyeDomeLighting()

bool HPS::PostProcessEffectsControl::ShowEyeDomeLighting ( bool &  out_state,
float &  out_exponent,
float &  out_tolerance,
float &  out_strength 
) const

Shows the eye-dome lighting setting.

Parameters
out_stateWhether eye-dome lighting should be used.
out_exponentAn exponent used to attenuate the per-pixel occlusion computed by the eye-dome lighting algorithm.
out_toleranceA multiplier on the threshold that the driver uses when comparing adjacent pixel depth values to detect occlusion. This allows the user to control the amount of occlusion added by neighboring pixels based on their relative depth difference.
out_strengthA multiplier on the calculated per-pixel occlusion value.
Returns
true if the setting is valid, false otherwise.

◆ ShowSilhouetteEdges()

bool HPS::PostProcessEffectsControl::ShowSilhouetteEdges ( bool &  out_state,
float &  out_tolerance,
bool &  out_heavy_exterior 
) const

Shows the silhouette edge setting.

Parameters
out_stateWhether silhouette edges should be used.
out_toleranceA multiplier on the threshold that the driver uses when comparing adjacent pixel depth values to detect silhouettes. This allows the user to control the trade-off between silhouettes appearing where they shouldn't, vs disappearing in places they should be.
out_heavy_exteriorThis option, when enabled, causes an extra thick border to be drawn at the boundary between geometry and the window background (as opposed to geometry on top of other geometry).
Returns
true if the setting is valid, false otherwise.

◆ ShowWorldScale()

bool HPS::PostProcessEffectsControl::ShowWorldScale ( float &  out_scale) const

Shows the world scale setting.

Parameters
out_scaleScale value used by post process effects.
Returns
true if the setting is valid, false otherwise.

◆ Type()

virtual HPS::Type HPS::PostProcessEffectsControl::Type ( ) const
inlinevirtual

This function returns the true type of the underlying object. This function is useful for finding the type of smart pointer objects that have been cast to more generic types.

Warning
This function must synchronize the database (by waiting for all pending database operations to complete) in order to know the type status of this object with certainty. Therefore this function can negatively impact performance. You should vigorously avoid using this function in high-traffic or peformance-critical areas of your code.
Returns
The true type of the object in question.

Reimplemented from HPS::Control.

◆ UnsetAmbientOcclusion()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetAmbientOcclusion ( )

Removes any ambient occlusion setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

◆ UnsetBloom()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetBloom ( )

Removes a bloom setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

◆ UnsetDepthOfField()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetDepthOfField ( )

Removes a depth of field setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

◆ UnsetEverything()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetEverything ( )

Removes all settings from this object. If the control is attached to a WindowKey this function restores the default settings of this control as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

◆ UnsetEyeDomeLighting()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetEyeDomeLighting ( )

Removes an eye-dome lighting setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

◆ UnsetSilhouetteEdges()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetSilhouetteEdges ( )

Removes a silhouette edge setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

◆ UnsetWorldScale()

PostProcessEffectsControl& HPS::PostProcessEffectsControl::UnsetWorldScale ( )

Removes any world scale setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by PostProcessEffectsKit::GetDefault().

Returns
A reference to this object.

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