SetAmbientLight

This function sets a world's ambient light level. This is the minimum light level a surface will be rendered with when no other lights are present.

Syntax

Parameters

Example

function App:Start()
--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

--Create a directional light with an orange tint
local light = DirectionalLight:Create()
light:SetRotation(35,45,0)
light:SetColor(1.5,1.3,0.6)

--Set the ambient light level to dark blue
world:SetAmbientLight(0.08,0.08,0.18)

--Create a model
model = Model:Box()

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

model:Turn(0,Time:GetSpeed(),0)

Time:Update()
world:Update()
world:Render()
context:Sync(false)

end