ViewPortFilter Class Reference

This reference page is linked to from the following overview topics: Layers and Viewport Filters, Viewports, Viewport Filters.



Detailed Description

ViewPortFilters are post-processes that are applied to the rendered scene before display.

Mudbox first renders the meshes in the scene, then goes through its list of ViewPortFilters. Any filters with visibility turned on are applied to the resulting image, yielding the new image that is displayed. This base class ViewPortFilter does nothing; you must derive new filters from it.

Examples:

SampleViewportFilter/SampleViewportFilter.cpp, SampleViewportFilter/SampleViewportFilter.h, TextureSwapperViewportFilter/TextureSwapperViewportFilter.cpp, and TextureSwapperViewportFilter/TextureSwapperViewportFilter.h.

Definition at line 73 of file viewport.h.

#include <viewport.h>

Inheritance diagram for ViewPortFilter:
Inheritance graph
[legend]

List of all members.

Public Types

enum   {
  eNone = 0, eColor = 1, eHDR = 2, eDepth24 = 4,
  eNormal16 = 16, ePosition32 = 32, eNormalDepth16 = 128, eLinearDepth = 512,
  eFaceNormal = 1024
}
typedef int  RequirementValue
  The RequirementValue typedef is used to tell Mudbox what information needs to be.

Public Member Functions

virtual QString  StringID (const ClassDesc *pClass=0) const
  Returns the string id of the viewport filter. It's the same to string id of its class.
virtual QString  DisplayName (void) const
  Returns the display name of the viewport filter. It's the same to display name of its class.
virtual void  Initialize (void)
  This is called after construction to initialize internal variables.
virtual RequirementValue  Requirement (void) const
  Returns a value that indicates what information is required by the ViewPortFilter.
virtual void  Process (ViewPortState &sState)
  Process the Mudbox view through the ViewPortFilter.
virtual float  Transparency (void) const
  This method is not used in ViewPortFilters.
virtual void  SetTransparency (float fTransparency)
  This method is not used in ViewPortFilters.
virtual Layer Children (void) const
  This method is not used in ViewPortFilters.
virtual Layer Next (void) const
  This method is not used in ViewPortFilters.
virtual Layer Prev (void) const
  This method is not used in ViewPortFilters.
virtual class LayerContainer Container (void) const
  This method is not used in ViewPortFilters.
void  SetVisible (bool bVisible)
  Turns the ViewPortFilter on and off.
virtual void  LockCalibration (bool bLock)
  This method locks any calibration the ViewPortFilter does.
bool  CalibrationLocked (void)
  Returns true if the ViewPortFilter calibration is locked.

Public Attributes

class ViewPort m_pViewPort
  A pointer to the Viewport containing this ViewPortFilter.

Protected Attributes

bool  m_bCalibrationLocked

Member Typedef Documentation

typedef int RequirementValue

The RequirementValue typedef is used to tell Mudbox what information needs to be.

calculated at render time so that this ViewPortFilter can work properly. The elements in this list can be combined with a bitwise or (|) operator. This is used in the Requirements method.

Definition at line 91 of file viewport.h.


Member Enumeration Documentation


Member Function Documentation

virtual QString StringID ( const ClassDesc pClass = 0 ) const [virtual]

Returns the string id of the viewport filter. It's the same to string id of its class.

Reimplemented from Node.

virtual QString DisplayName ( void  ) const [virtual]

Returns the display name of the viewport filter. It's the same to display name of its class.

Reimplemented from Node.

virtual void Initialize ( void  ) [virtual]

This is called after construction to initialize internal variables.

Reimplemented from Node.

virtual RequirementValue Requirement ( void  ) const [virtual]

Returns a value that indicates what information is required by the ViewPortFilter.

When you create your own ViewPortFilter, you must override this method. Mudbox only calculates things like depth maps or normal maps when requested, so you must figure out what information is needed as input to your viewport filter, and have this function return the appropriate flags.

virtual void Process ( ViewPortState sState ) [virtual]

Process the Mudbox view through the ViewPortFilter.

This method does the actual work of filtering the viewport. Derived ViewPortFilters must override it. It takes the information provided in the ViewPortState that is passed in, and puts the resulting (filtered) image in the m_pColor texture of that object. This method must be overridden by derived classes.

Parameters:
[in,out] sState The textures used by this filter, and the result
virtual float Transparency ( void  ) const [virtual]

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual void SetTransparency ( float  fTransparency ) [virtual]

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual Layer* Children ( void  ) const [virtual]

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual Layer* Next ( void  ) const [virtual]

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual Layer* Prev ( void  ) const [virtual]

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual class LayerContainer* Container ( void  ) const [virtual]

This method is not used in ViewPortFilters.

Reimplemented from Layer.

void SetVisible ( bool  bVisible ) [virtual]

Turns the ViewPortFilter on and off.

Parameters:
[in] bVisible Set this true to make the filter visible, and false to hide it.

Reimplemented from TreeNode.

virtual void LockCalibration ( bool  bLock ) [virtual]

This method locks any calibration the ViewPortFilter does.

Some kinds of ViewPortFilters do a calibration step as part of the process. For example, all the values produced may be normalized to the range of values currently displayed. This can be a problem when you need to generate multiple images where the calibration must be the same (say, to make a large tiled image, or an animation). Locking calibration tells the ViewPortFilter to leave its calibration values at the current level, rather than recalculating per-frame. Derived ViewPortFilters probably do not need to override this method, but they should pay attention to the flag. If you do need to override the method, ensure the derived method calls the base method so that the flag will be set properly.

Parameters:
[in] bLock Set this true to lock calibration, and false to unlock it
bool CalibrationLocked ( void  )

Returns true if the ViewPortFilter calibration is locked.


Member Data Documentation

A pointer to the Viewport containing this ViewPortFilter.

Definition at line 271 of file viewport.h.

bool m_bCalibrationLocked [protected]

Definition at line 277 of file viewport.h.


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

ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter
ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter ViewPortFilter