SetSkybox
This function can be used to set add a skybox to a camera. The sky will be drawn everywhere and appear behind all rendered objects.
Syntax
- SetSkybox(Asset asset)
- bool SetSkybox(string path)
Parameters
- asset: the material or texture to use for the skybox.
- path: the path to the material or texture to load.
Returns
The second function overload will return true if the asset is loaded, otherwise false is returned.
Example
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
--Set skybox
skybox = Texture:Load("Materials/Sky/skybox_texture.tex")
camera:SetSkybox(skybox)
while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end
Time:Update()
world:Update()
world:Render()
context:Sync()
end