Interface: dxshadermanager

?

Interface: dxshadermanager

Methods:

getViewportManager material

Returns the viewport manager’s ViewportManagerCustAttrib object for the specified material.

IsVisible()

Returns true if the manager is visible.

SetVisible show

This method can be used to turn the manager on and off. It will not have an effect if the user is runnig in DirectX mode.

addViewportManager material

Adds a new viewport manager to the specified material and returns the ViewportManagerCustAttrib object providing an interface to access its effects.

?

?

For Example:

-- Create a new standard material

newmat = StandardMaterial()

-- Get the viewport manager from the material

manager = DXShaderManager.getViewportManager newmat

-- If there is no manager, assign a new oneif(manager==null) then manager = DXShaderManager.addViewportManager newmat

-- Get the active viewport effect

effect = manager.getactiveviewporteffect()

?

-- If there is no active effect, create a new one.

if(effect == null)then

effect = manager.setviewporteffect 1

-- 1 in our case is the lightmap, 0 sets it to "none"

-- Set the LightMap file names

effect.lightmap_filename = GetDir(#image) + "\\testlightmap.bmp"

effect.diffuse_filename = GetDir(#image) + "\\testdiffuse.bmp"

?

-- set the mapping channel to use

effect.lightmap_mapping = 1

effect.diffuse_mapping = 1

-- Search for the effect based on name?

-- Get the total number of effects:num = manager.getNumViewportEffects()

-- Step through all effects and check for name. If found,

-- then activate it.for i = 1 to num do

( if(manager.getViewportEffectName(i) == "LightMap") then effect = manager.setviewporteffect i

)

?

See also

CubeMap : ReferenceTarget

LightMap : ReferenceTarget

Membrane_Shader : ReferenceTarget

Metal_Bump : ReferenceTarget