Public Types | Public Member Functions | Static Public Member Functions

IDxSceneManager Class Reference

Search for all occurrences

Detailed Description

A system to manage the current state of the Dx Scene and render passes.

This will provide support for RTT scene based effects, as well as handling matrix conversions.

#include <RTMax.h>

Inheritance diagram for IDxSceneManager:
Inheritance graph
[legend]

List of all members.

Public Types

enum   DXEffectType { kPreEffect, kPostEffect, kEnvEffect }
 

Describes the effect in use.

More...
enum   DXPassType { kStandard, kEnvironment, kEnvironmentLast }
 

Describes what the current pass is doing, standard rendering to the viewport, or for example creating textures for use later in the render process.

More...

Public Member Functions

virtual  ~IDxSceneManager ()
  Destructor.
virtual void  StoreSceneEffect (Mtl *dxMtl, DXEffectType effectType=kPostEffect, int numberOfPasses=0)=0
  Add a scene effect to the database.
virtual void  StoreSceneEffect (Tab< Mtl * > &dxMtl)=0
  Add a scene effect to the database.
virtual int  GetNumberOfSceneEffects (DXEffectType effectType=kPostEffect)=0
  Number of Scene effects active.
virtual Mtl GetSceneEffect (int index, DXEffectType effectType=kPostEffect)=0
  Get the scene effect.
virtual void  ResetSceneEffects ()=0
  flush out the effects, and reset all Render Targets
virtual void  RemoveSceneEffect (int index, DXEffectType effectType=kPostEffect)=0
  Remove specified Effect.
virtual void  StartScene (GraphicsWindow *gw)=0
  Called at the beginning of the Scene Traversal - All effects PreRenders are called here.
virtual void  EndScene (GraphicsWindow *gw)=0
  Called at the end of traversal.
virtual LPDIRECT3DBASETEXTURE9  GetSceneRenderTarget (bool env=false, MCHAR *paramName=NULL)=0
  Get access to the scene Render Target. This will change depending on how many effects are loaded.
virtual void  SetSceneRenderTarget (LPDIRECT3DBASETEXTURE9 texture, MCHAR *paramName)=0
  Set the environment texture for use by an object based effect. The paramName needs to be consistant.
virtual void  EnableDebugMode (bool onOff, MCHAR *outputPath, MCHAR *namePrefix)=0
  Special Debugging mode - textures will be saved for each pass/combiner - USE WITH CAUTION !!
virtual void  EnableSceneTraversal (bool state, IValidateNodeCallback *proc)=0
  Turn on the traversal system.
virtual IDxSceneTransformManager GetTransformManager ()=0
  access to the Transform manager
virtual void  SceneInitialize (GraphicsWindow *gw)=0
  A one time per scene initialisation that must be called first before the scene is rendered.
virtual int  GetNumberOfPasses ()=0
  The number of passes required to render the scene based on the effects loaded.
virtual int  GetCurrentPassNumber ()=0
  The value of the current pass.
virtual IDxSceneManager::DXPassType  GetActivePassType ()=0
  Provides access to the type of pass being rendered.
virtual bool  IsSceneEffectValid ()=0
  Specifies whether the current scene effects are valid or not.

Static Public Member Functions

static DllExport IDxSceneManager GetIDxSceneManager ()
  Access to the singleton.

Member Enumeration Documentation

Describes the effect in use.

Enumerator:
kPreEffect 

Pre Effect - drawn behind the geometry.

kPostEffect 

Post Effect - drawn on top as a screen quad.

kEnvEffect 

Environment effect, used to create shadow buffers etc.

enum DXPassType

Describes what the current pass is doing, standard rendering to the viewport, or for example creating textures for use later in the render process.

Enumerator:
kStandard 

General scene rendering.

kEnvironment 

Texture generation.

kEnvironmentLast 

Final environment render call in current environment pass.


Constructor & Destructor Documentation

virtual ~IDxSceneManager ( ) [inline, virtual]

Destructor.

{;}

Member Function Documentation

virtual void StoreSceneEffect ( Mtl dxMtl,
DXEffectType  effectType = kPostEffect,
int  numberOfPasses = 0 
) [pure virtual]

Add a scene effect to the database.

Parameters:
*dxMtl A pointer to a DirectX Shader Material
effectType Describes what type of effect is being stored
numberOfPasses How many passes are required. This is only really useful for environment effects
virtual void StoreSceneEffect ( Tab< Mtl * > &  dxMtl ) [pure virtual]

Add a scene effect to the database.

Parameters:
&dxMtl A table of effects. This would be used to copy a complete block over. This is useful when setting multi effects, or the ordering has changed.
virtual int GetNumberOfSceneEffects ( DXEffectType  effectType = kPostEffect ) [pure virtual]

Number of Scene effects active.

Parameters:
effectType The type of effect to query
Returns:
The number of scene effects
virtual Mtl* GetSceneEffect ( int  index,
DXEffectType  effectType = kPostEffect 
) [pure virtual]

Get the scene effect.

Parameters:
index The index of the material to access
effectType The type of effect to query
Returns:
The material at the index
virtual void ResetSceneEffects ( ) [pure virtual]

flush out the effects, and reset all Render Targets

virtual void RemoveSceneEffect ( int  index,
DXEffectType  effectType = kPostEffect 
) [pure virtual]

Remove specified Effect.

Parameters:
index The index of the effect to remove
effectType The type of effect
virtual void StartScene ( GraphicsWindow gw ) [pure virtual]

Called at the beginning of the Scene Traversal - All effects PreRenders are called here.

Parameters:
*gw The current viewport being rendered
virtual void EndScene ( GraphicsWindow gw ) [pure virtual]

Called at the end of traversal.

The main effects Render method is called here.

Parameters:
*gw The current viewport being rendered
virtual LPDIRECT3DBASETEXTURE9 GetSceneRenderTarget ( bool  env = false,
MCHAR *  paramName = NULL 
) [pure virtual]

Get access to the scene Render Target. This will change depending on how many effects are loaded.

This is used to access any rendertargets that are either the result of a full render, or can be stored by the parsers. Only Environmental effects can store render targets, and they can then be looked up by name

Parameters:
env Defines whether the requested Render Target is the result of an environmental effect
*paramName The name of the Render Target to access
Returns:
The render target
virtual void SetSceneRenderTarget ( LPDIRECT3DBASETEXTURE9  texture,
MCHAR *  paramName 
) [pure virtual]

Set the environment texture for use by an object based effect. The paramName needs to be consistant.

Parameters:
texture The Render Target to store
*paramName The name to be used to store the render target. This will be used in GetSceneRenderTarget
virtual void EnableDebugMode ( bool  onOff,
MCHAR *  outputPath,
MCHAR *  namePrefix 
) [pure virtual]

Special Debugging mode - textures will be saved for each pass/combiner - USE WITH CAUTION !!

The various passes will be saved as DDS file to the specified location - they will be titled XXX_Pre_pass and XXX_post_pass - the final rendered pass is not saved, as this is available in the viewport. The XX is the name prefix supplied

Parameters:
onOff Turn debug on/off
*outputPath A pointer to a string containing the path, ending with "\"
*namePrefix A pointer to a string containing a name prefix
virtual void EnableSceneTraversal ( bool  state,
IValidateNodeCallback proc 
) [pure virtual]

Turn on the traversal system.

When activated the developer can control what is rendered to the viewport

See also:
IValidateNodeCallback
Parameters:
state a boolean used to turn the traversal on/off
*proc A callback used to validate and sort nodes
virtual IDxSceneTransformManager* GetTransformManager ( ) [pure virtual]

access to the Transform manager

This provides scene level access to the various DX transforms. When rendering scene based effects these transforms should be used It is safe when drawing object level effect to still use this, but only for PROJECTION and VIEW. World should be obtained from the regular methods.

See also:
IDsSceneTransformManager
Returns:
A pointer to IDxSceneTransformManager
virtual void SceneInitialize ( GraphicsWindow gw ) [pure virtual]

A one time per scene initialisation that must be called first before the scene is rendered.

Parameters:
*gw The viewport being rendered
virtual int GetNumberOfPasses ( ) [pure virtual]

The number of passes required to render the scene based on the effects loaded.

Returns:
the total number of passes
virtual int GetCurrentPassNumber ( ) [pure virtual]

The value of the current pass.

Returns:
The current pass number
virtual IDxSceneManager::DXPassType GetActivePassType ( ) [pure virtual]

Provides access to the type of pass being rendered.

This allows developers to pre process or switch techniques based on whether environmental effects are being calculated or actual scene drawing is taking place

Returns:
The active pass
virtual bool IsSceneEffectValid ( ) [pure virtual]

Specifies whether the current scene effects are valid or not.

The system will check the validity channel of the post effects to determine whether a full scene update is required. This is mainly for effects that require a TIME semantic, which denotes that it constantly runs and updates the scene.

Returns:
True if the effects are valid and require no scene update
static DllExport IDxSceneManager* GetIDxSceneManager ( ) [static]

Access to the singleton.


IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager
IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager IDxSceneManager