3ds Max C++ API Reference
IDxSceneManager Class Referenceabstract

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

#include <RTMax.h>

+ Inheritance diagram for IDxSceneManager:

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

Static Public Member Functions

static DllExport IDxSceneManagerGetIDxSceneManager ()
 Access to the singleton. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

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.

Member Enumeration Documentation

◆ DXEffectType

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.

843  {
844  kPreEffect,
845  kPostEffect,
846  kEnvEffect
847  };
@ kEnvEffect
Environment effect, used to create shadow buffers etc.
Definition: RTMax.h:846
@ kPreEffect
Pre Effect – drawn behind the geometry.
Definition: RTMax.h:844
@ kPostEffect
Post Effect – drawn on top as a screen quad.
Definition: RTMax.h:845

◆ DXPassType

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.

852  {
853  kStandard,
854  kEnvironment,
856  };
@ kEnvironment
Texture generation.
Definition: RTMax.h:854
@ kStandard
General scene rendering.
Definition: RTMax.h:853
@ kEnvironmentLast
Final environment render call in current environment pass.
Definition: RTMax.h:855

Constructor & Destructor Documentation

◆ ~IDxSceneManager()

virtual ~IDxSceneManager ( )
inlinevirtual

Destructor.

859 {;}

Member Function Documentation

◆ StoreSceneEffect() [1/2]

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

Add a scene effect to the database.

Parameters
*dxMtlA pointer to a DirectX Shader Material
effectTypeDescribes what type of effect is being stored
numberOfPassesHow many passes are required. This is only really useful for environment effects

◆ StoreSceneEffect() [2/2]

virtual void StoreSceneEffect ( Tab< Mtl * > &  dxMtl)
pure virtual

Add a scene effect to the database.

Parameters
&dxMtlA 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.

◆ GetNumberOfSceneEffects()

virtual int GetNumberOfSceneEffects ( DXEffectType  effectType = kPostEffect)
pure virtual

Number of Scene effects active.

Parameters
effectTypeThe type of effect to query
Returns
The number of scene effects

◆ GetSceneEffect()

virtual Mtl* GetSceneEffect ( int  index,
DXEffectType  effectType = kPostEffect 
)
pure virtual

Get the scene effect.

Parameters
indexThe index of the material to access
effectTypeThe type of effect to query
Returns
The material at the index

◆ ResetSceneEffects()

virtual void ResetSceneEffects ( )
pure virtual

flush out the effects, and reset all Render Targets

◆ RemoveSceneEffect()

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

Remove specified Effect.

Parameters
indexThe index of the effect to remove
effectTypeThe type of effect

◆ StartScene()

virtual void StartScene ( GraphicsWindow gw)
pure virtual

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

Parameters
*gwThe current viewport being rendered

◆ EndScene()

virtual void EndScene ( GraphicsWindow gw)
pure virtual

Called at the end of traversal.

The main effects Render method is called here.

Parameters
*gwThe current viewport being rendered

◆ GetSceneRenderTarget()

virtual LPDIRECT3DBASETEXTURE9 GetSceneRenderTarget ( bool  env = false,
const 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
envDefines whether the requested Render Target is the result of an environmental effect
*paramNameThe name of the Render Target to access
Returns
The render target

◆ SetSceneRenderTarget()

virtual void SetSceneRenderTarget ( LPDIRECT3DBASETEXTURE9  texture,
const MCHAR paramName 
)
pure virtual

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

Parameters
textureThe Render Target to store
*paramNameThe name to be used to store the render target. This will be used in GetSceneRenderTarget

◆ EnableDebugMode()

virtual void EnableDebugMode ( bool  onOff,
const MCHAR outputPath,
const 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
onOffTurn debug on/off
*outputPathA pointer to a string containing the path, ending with "\"
*namePrefixA pointer to a string containing a name prefix

◆ EnableSceneTraversal()

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
statea boolean used to turn the traversal on/off
*procA callback used to validate and sort nodes

◆ GetTransformManager()

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

◆ SceneInitialize()

virtual void SceneInitialize ( GraphicsWindow gw)
pure virtual

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

Parameters
*gwThe viewport being rendered

◆ GetNumberOfPasses()

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

◆ GetCurrentPassNumber()

virtual int GetCurrentPassNumber ( )
pure virtual

The value of the current pass.

Returns
The current pass number

◆ GetActivePassType()

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

◆ IsSceneEffectValid()

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

◆ GetIDxSceneManager()

static DllExport IDxSceneManager* GetIDxSceneManager ( )
static

Access to the singleton.