Function _IrrAddFadeOutParticleAffector

au3Irr2

au3Irr2 Function Reference

_IrrAddFadeOutParticleAffector

Adds a fade out affector to a particle system gradually fading particles out so they are invisible when they are deleted.

#Include <au3Irrlicht2.au3>
_IrrAddFadeOutParticleAffector($h_ParticleSystem, $i_FadeFactor, $i_Red, $i_Green, $i_Blue)

 

Parameters

$h_ParticleSystem Handle of the particle system the created affector is attached to.
$i_FadeFactor Milliseconds the fade out effect will take place.
$i_Red, $i_Green, $i_Blue Values of the colour the particles are faded to (0-255)

 

Return Value

success: Handle of the created affector.
failure: false

 

Remarks

The fade out affector fades the particles out as they come to the end of their lifespan and stops them 'popping' out of existance. This creates a convincing effect for fire and smoke in particular.

 

Related

_IrrAddParticleSystemToScene, _IrrSetParticleAffectorEnable, _IrrRemoveAffectors

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

; add particle system with default emitter to the irrlicht scene manager
local $particleSystem = _IrrAddParticleSystemToScene($IRR_DEFAULT_EMITTER)
local $ParticleTexture = _IrrGetTexture( "./media/ParticleGrey.bmp" )

; setup this affector for a simple flashing-out effect
_IrrAddFadeOutParticleAffector( $particleSystem, 250, 255, 255, 0)

_IrrSetNodeMaterialTexture( $particleSystem, $ParticleTexture, 0 )
_IrrSetNodeMaterialFlag( $particleSystem, $IRR_EMF_LIGHTING, $IRR_OFF )
_IrrSetNodeMaterialType ( $particleSystem, $IRR_EMT_TRANSPARENT_ADD_COLOR )

local $nodeCamera = _IrrAddCamera( 80,0,0, 20,40,0 )

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

_IrrStop()