Function _IrrSetAmbientLight

au3Irr2

au3Irr2 Function Reference

_IrrSetAmbientLight

Sets the ambient lighting level across entire scene.

#Include <au3Irrlicht2.au3>
_IrrSetAmbientLight($f_Red, $f_Green, $f_Blue)

 

Parameters

$i_Red, $i_Green, $i_Blue Colour values for ambient lighting.
Red/green/blue are fractional values from 0 to 1!

 

Return Value

Success: True
Failure: False

 

Remarks

Ambient light illuminates all surfaces in the scene uniformly. This is usually a low value to increase the overall lighting level.
It should never be greater than the brightness of the darkest area of your scene, it can however reduce the number of lights you need in the scene.

 

Related

_IrrAddLight, _IrrSetLightAmbientColor

 

Example


#include "au3Irrlicht2.au3"

_IrrStart( $IRR_EDT_OPENGL, 800, 600, $IRR_BITS_PER_PIXEL_32, _
        $IRR_WINDOWED, $IRR_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON )

local $nodeSphere = _IrrAddSphereSceneNode(4, 32)
_IrrSetNodeMaterialTexture( $nodeSphere, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0)

local $nodeLight = _IrrAddLight($IRR_NO_PARENT, 0,50,0, 0.9,0.9,0.9, 1000.0)
_IrrSetAmbientLight(8, 0, 0)
_IrrAddFlyCircleAnimator($nodeLight, 0, 0, 0, 500, 0.001)

local $nodeCamera = _IrrAddCamera(-5,5,-6, 0,0,0 )

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

_IrrStop()