Import materials from files

This commit is contained in:
Dane Johnson
2021-01-22 18:44:43 -06:00
parent 1ee5ed3e88
commit 1d97f6d855
22 changed files with 4427 additions and 44 deletions

View File

@@ -4,7 +4,7 @@
function couch.TexturedMesh(meshfile, ...)
local mesh = couch.Mesh.FromFile(meshfile)
for i, texturefile in ipairs({...}) do
local material = couch.Material()
local material = mesh:GetMaterial(i - 1)
material.usesTex = true
material.tex = couch.Texture.FromFile(texturefile)
mesh:SetMaterial(i - 1, material)