Public Member Functions

IRTShaderNode Class Reference

Search for all occurrences

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

#include <IRTShaderNode.h>

Inheritance diagram for IRTShaderNode:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

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] node The node to render
[in] mesh The 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] node The node to render
[in] mnmesh The 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] gfxWindow A pointer to the current active hardware viewport

IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode
IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode IRTShaderNode