- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Public Attributes | Protected Attributes

# ViewPortFilter Class Reference

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

Search for all occurrences

## 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 37 of file viewport.h.

`#include <viewport.h>`

Inheritance diagram for ViewPortFilter:
[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 calculated at render time so that this ViewPortFilter can work properly.
## 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

Search for all occurrences

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 46 of file viewport.h.

## Member Enumeration Documentation

anonymous enum

Search for all occurrences

Enumerator:

  eNone | Search for all occurrences
  eColor | Search for all occurrences
  eHDR | Search for all occurrences
  eDepth24 | Search for all occurrences
  eNormal16 | Search for all occurrences
  ePosition32 | Search for all occurrences
  eNormalDepth16 | Search for all occurrences
  eLinearDepth | Search for all occurrences
  eFaceNormal | Search for all occurrences

Definition at line 47 of file viewport.h.

        {
            eNone = 0,
            eColor = 1,
            eHDR = 2,
            eDepth24 = 4,
    //      ePosition16 = 8, // not implemented
            eNormal16 = 16,
            ePosition32 = 32,
    //      eNormal32 = 64, // not implemented
            eNormalDepth16 = 128,
    //      eNormalDepth32 = 256, // not implemented
            eLinearDepth = 512,
            eFaceNormal = 1024,
        };

## Member Function Documentation

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

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

This is called after construction to initialize internal variables.

Reimplemented from Node.

virtual RequirementValue Requirement | ( | void |  | ) | const `[virtual]`

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual void SetTransparency | ( | float | fTransparency | ) | `[virtual]`

Search for all occurrences

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual Layer* Children | ( | void |  | ) | const `[virtual]`

Search for all occurrences

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual Layer* Next | ( | void |  | ) | const `[virtual]`

Search for all occurrences

This method is not used in ViewPortFilters.

Reimplemented from Layer.

virtual Layer* Prev | ( | void |  | ) | const `[virtual]`

Search for all occurrences

This method is not used in ViewPortFilters.

Reimplemented from Layer.

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

Search for all occurrences

This method is not used in ViewPortFilters.

Reimplemented from Layer.

void SetVisible | ( | bool | bVisible | ) | `[virtual]`

Search for all occurrences

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]`

Search for all occurrences

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 |  | ) |

Search for all occurrences

Returns true if the ViewPortFilter calibration is locked.

## Member Data Documentation

class ViewPort* m_pViewPort

Search for all occurrences

A pointer to the Viewport containing this ViewPortFilter.

Definition at line 136 of file viewport.h.

bool m_bCalibrationLocked `[protected]`

Search for all occurrences

Definition at line 139 of file viewport.h.

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

- Mudbox/viewport.h

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