ITextureDisplay Class Reference

This reference page is linked to from the following overview topics: Porting Simple Material and Texture Map Plug-ins to Nitrous.



Detailed Description

This interface enables material and texture map plugins to display textures in the new viewport display system in 3ds Max 2012.

Developers override the ITextureDisplay::SetupTextures() method to assign a texture resource to the ISimpleMaterial managed by the material or texture map plug-in.

In general materials have a more complicated requirement for texture display. An example would be diffuse and opacity display with different mapping channels. Texture plugins on the other hand tend to be more simplistic. However, there are examples of a more complex setup as can be seen with the mix or composite maps. To support these complex setups a plugin must implement ITextureDisplay, otherwise during translation GetActiveTexHandle() will be called.

The texture resource is represented by the TexHandle class and can be created using TexHandleMaker::CreateHandle(). The TexHandle instance lifetime is managed by the plugin. If the texture data managed by a plug-in (e.g. texture related parameters) becomes invalid then the plug-in must deleted the TexHandle and to call ISimpleMaterial::ClearTextures(). It is possible to clear a single texture resource by calling SetTexture() with NULL and the appropriate map usage.

Note:
See Stdmtl2.cpp for an example implementation of SetupTextures()
See also:
ISimpleMaterial

#include <ITextureDisplay.h>

Inheritance diagram for ITextureDisplay:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual Interface_ID  GetID ()
  Get the unique ID for this interface.
virtual void  SetupTextures (TimeValue t, DisplayTextureHelper &updater)=0
  Allows for setting up the textures of a ISimpleMaterial.

Member Function Documentation

virtual Interface_ID GetID ( ) [inline, virtual]

Get the unique ID for this interface.

By default it will return ITEXTURE_DISPLAY_INTERFACE_ID

Reimplemented from BaseInterface.

{ return ITEXTURE_DISPLAY_INTERFACE_ID; }
virtual void SetupTextures ( TimeValue  t,
DisplayTextureHelper updater 
) [pure virtual]

Allows for setting up the textures of a ISimpleMaterial.

The automatic translation of material and texture map plug-ins can be complemented by implementing this method to setup the texture maps of a material or texture map plug-in by calling ISimpleMaterial::SetTexture(). This method can also override in its implementation the automatic translation of all material parameters (diffuse color, etc). Texture map plug-ins should only setup their textures with ISimpleMaterial::SetTexture as they are displayed without lighting or other surface details. Texture maps assigned to a ISimpleMaterial will be used by both the viewport and the hardware renderer. This method is called by 3ds Max when the parameters of a material or texture map change.

Parameters:
t The time at which the textures need to be setup
updater the helper object that needs to be used to update the display representation of the textures

ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay
ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay ITextureDisplay