Function _IrrSetNodeMaterialType

au3Irr2

au3Irr2 Function Reference

_IrrSetNodeMaterialType

Set the way that materials are applied to a scene node

#Include <au3Irrlicht2.au3>
_IrrSetNodeMaterialType($h_Node, $i_Type)

 

Parameters

$h_Node Handle of a scene node
$i_Type Material property to apply to the scene node (see table in remarks)

 

Return Value

success: True
failure: False

 

Remarks

Valid material properties:
$IRR_EMT_SOLID Standard solid rendering uses one texture
$IRR_EMT_SOLID_2_LAYER 2 blended textures using vertex alpha value
$IRR_EMT_LIGHTMAP 2 textures: 0=color 1=lighting level and ignores vertex lighting
$IRR_EMT_LIGHTMAP_ADD ... as above but adds levels instead of modulating between them
$IRR_EMT_LIGHTMAP_M2 ... as above but color levels are multiplied by 2 for brightening
$IRR_EMT_LIGHTMAP_M4 ... as above but color leels are multiplied by 4 for brightening
$IRR_EMT_LIGHTMAP_LIGHTING 2 textures: 0=color 1=lighting level but supports dynamic lighting
$IRR_EMT_LIGHTMAP_LIGHTING_M2 ... as above but color levels are multiplied by 2 for brightening
$IRR_EMT_LIGHTMAP_LIGHTING_M4 ... as above but color levels are multiplied by 4 for brightening
$IRR_EMT_DETAIL_MAP 2 blended textures: the first is a color map the second at a different scale adds and subtracts from the color to add detail
$IRR_EMT_SPHERE_MAP makes the material appear reflective
$IRR_EMT_REFLECTION_2_LAYER a reflective material blended with a color texture
$IRR_EMT_TRANSPARENT_ADD_COLOR a transparency effect that simply adds a color texture to the background. the darker the color the more transparent it is.
$IRR_EMT_TRANSPARENT_ALPHA_CHANNEL a transparency effect that uses the color textures alpha as a transparency level
$IRR_EMT_TRANSPARENT_ALPHA_CHANNEL_REF a transparency effect that uses the color textures alpha, the pixel is only drawn if the alpha is > 127. this is a fast effect that does not blur edges and is ideal for leaves & grass etc.
$IRR_EMT_TRANSPARENT_VERTEX_ALPHA a transparency effect that uses the vertex alpha value
$IRR_EMT_TRANSPARENT_REFLECTION_2_LAYER a transparent & reflecting effect. the first texture is a reflection map, the second a color map. transparency is from vertex alpha
$IRR_EMT_NORMAL_MAP_SOLID A solid normal map renderer. First texture is color, second is normal map. Only use nodes added with IrrAddStaticMeshForNormalMappingToScene. Only supports nearest two lights. Requires vertex and pixel shaders 1.1
$IRR_EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR ... as above only with a transparency effect that simply adds the color to the background. the darker the color the more transparent it is.
$IRR_EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA ... as above only with a transparency effect that uses the vertex alpha value
$IRR_EMT_PARALLAX_MAP_SOLID similar to the solid normal map but more realistic providing virtual displacement of the surface. Uses the alpha channel of the normal map for height field displacement. Requires vertex shader 1.1 and pixel shader 1.4.
$IRR_EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR ... as above only with a transparency effect that simply adds the color to the background. the darker the color the more transparent it is.
$IRR_EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA ... as above only with a transparency effect that uses the vertex alpha value

 

Related

_IrrSetNodeMaterialTexture, _IrrSetNodeMaterialFlag

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

local $nodeCamera = _IrrAddCamera(2,2,2, 0,0,0 )
local $nodeCube = _IrrAddCubeSceneNode(2) ; _IrrAddMeshToScene( $mesh )
_IrrSetNodeMaterialTexture( $nodeCube, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0 )

_IrrSetNodeMaterialFlag( $nodeCube, $IRR_EMF_LIGHTING, $IRR_OFF )
_IrrSetNodeMaterialType($nodeCube, $IRR_EMT_SPHERE_MAP)

_IrrAddRotationAnimator($nodeCube, 0.1, 0.1, 0.1)

WHILE _IrrRunning()
    _IrrBeginScene(50, 50, 50)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()