lovr.graphics.newModel
Creates a new Model from a file. The supported 3D file formats are OBJ and glTF.
model = lovr.graphics.newModel(filename)
Arguments
Name | Type | Description |
filename | string | The filename of the model to load.
|
Returns
Name | Type | Description |
model | Model | The new Model.
|
model = lovr.graphics.newModel(modelData)
Arguments
Name | Type | Description |
modelData | ModelData | The ModelData containing the data for the Model.
|
Returns
Name | Type | Description |
model | Model | The new Model.
|
Notes
Diffuse and emissive textures will be loaded in the sRGB encoding, all other textures will be loaded as linear.
Currently, the following features are not supported by the model importer:
- OBJ: Quads are not supported (only triangles).
- glTF: Sparse accessors are not supported.
- glTF: Morph targets are not supported.
- glTF: base64 images are not supported (base64 buffer data works though).
- glTF: Only the default scene is loaded.
- glTF: Currently, each skin in a Model can have up to 48 joints.
See also