Load

This function loads a material from a material (*.mat) file.

Syntax

Parameters

Returns

Returns the loaded material. If the material cannot be loaded, NULL is returned.

Example

window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
directionallight = DirectionalLight:Create()
directionallight:SetRotation(45,35,0)

--Load a material
local material = Material:Load("Materials/Grass/grass01.mat")

--Create a model
local model = Model:Sphere()
model:SetMaterial(material)
model:SetPosition(0,0,3)


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

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