IRTShaderNode Class Reference

IRTShaderNode Class Referenceabstract

#include <IRTShaderNode.h>

Class Description

A Hardware shader node for use with compiled shader trees.

IRTShaderNode is an interface to a node that has its visual representation handled by an internal shade tree generated by a compiler technology such as AMD's Ashli or Mental Images Mental Mill technology. The interface wraps many of the draw calls, shader and state management, including cache creation for these complex shaders. It would typically be used with in a Material, but for 3ds max 2008, it was extended to support background nodes. Internally the system implements the IRenderMesh interfaces. A developer can create a unique node by using methods of IRTShaderManager, in particular AddShaderNode. This interface does not remove the need to implement IDX9VertexShader interfaces, but simply allows passing control of certain methods to the IRTShaderNode interfaces. Currently only the Standard Material and the Architectural Material participate in these shade trees.
NB - This system is only valid for DirectX Viewports - it will not be active on openGL or Heidi.

+ Inheritance diagram for IRTShaderNode:

Public Member Functions

virtual bool SetRenderObjects (INode *node, Mesh *mesh)=0
 Assign the current active mesh and node data to the shading sub system. More...
 
virtual bool SetRenderObjects (INode *node, MNMesh *mnmesh)=0
 Assign the current active MNMesh and node data to the shading sub system. More...
 
virtual bool DrawObjects ()=0
 Request the rendering of the assigned shade tree. More...
 
virtual void RegisterGraphicsWindow (LPVOID gfxWindow)=0
 The underlying system requires access to key viewport interfaces. More...
 

Additional Inherited Members

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

Member Function Documentation

virtual bool SetRenderObjects ( INode node,
Mesh mesh 
)
pure virtual

Assign the current active mesh and node data to the shading sub system.

This would be implemented in IDX9VertexShader::Initialize(..)

Parameters
[in]nodeThe node to render
[in]meshThe mesh to render
Returns
TRUE if the data was successfully allocated. FALSE would indicate an internal failure.
virtual bool SetRenderObjects ( INode node,
MNMesh mnmesh 
)
pure virtual

Assign the current active MNMesh and node data to the shading sub system.

This would be implemented in IDX9VertexShader::Initialize(..)

Parameters
[in]nodeThe node to render
[in]mnmeshThe mesh to render
Returns
TRUE if the data was successfully allocated. FALSE would indicate an internal failure.
virtual bool DrawObjects ( )
pure virtual

Request the rendering of the assigned shade tree.

The calling code has no control over what is rendered it simple initiates the draw call. This would typically be called in response to the IDX9VertexShader::DrawMeshStrips(). The return code can be passed directly back to DrawMeshStrips. FALSE would indicate that the object(s) was not drawn.

Returns
TRUE if the objects are rendered, false if an error was raised. Returning false to DrawMeshStrips would allow the GFX layer to continue to render the objects - returning TRUE would indicated that no further processing is required.
virtual void RegisterGraphicsWindow ( LPVOID  gfxWindow)
pure virtual

The underlying system requires access to key viewport interfaces.

This method allows the shader node to assign the current window interface. It is passed as a LPVOID so as to assist working with DirectX9 and DirectX10 interfaces. The underlying system knows which sub system is running, but can't access the viewport directly. To assign a DirectX9 window simply cast an ID3D9GraphicsWindow obtained from IDX9VertexShader::ConfirmDevice. For DirectX10 ID3D10GraphicsWindow would be used instead.

Parameters
[in]gfxWindowA pointer to the current active hardware viewport