Files
OpenSpace/data/assets/examples/renderable/renderablemodel/model.asset
Malin E 01483ef982 Add support for model vertex colors (#3346)
* Add model vertex color support

* Fix an issue with the Tiangong model not loading properly and set a correct bounding sphere size for it

* Update caching for models

* Update previous model examples to the new format

* And add a new example to test the new vertex colors support

* Apply suggestions from code review

Co-authored-by: Alexander Bock <alexander.bock@liu.se>

* Add a model example with lighting

* Improve the basic example and add a separate example for vertex colors

* Add visual test for vertex colors (#3348)

* Update the readme file for the visual tests

* Add asset instruction to the visual testing readme

* Add visual test for RenderableModel with vertex colors

* Apply suggestions from code review

Co-authored-by: Alexander Bock <alexander.bock@liu.se>

* Update test when asset changed name

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>

* Update Ghoul

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>
2024-07-17 15:56:06 +02:00

44 lines
1.1 KiB
Lua

-- Basic
-- This example loads a model.
-- Load the example model from OpenSpace servers
-- If you want to use your own model, this block of code can be safely deleted
local model = asset.resource({
Name = "Animated Box",
Type = "HttpSynchronization",
Identifier = "animated_box",
Version = 1
})
local Node = {
Identifier = "RenderableModel_Example",
Renderable = {
Type = "RenderableModel",
GeometryFile = model .. "BoxAnimated.glb",
-- Use the line below insted of the one above if you want to use your own model
--GeometryFile = "C:/path/to/model.fbx",
},
GUI = {
Name = "RenderableModel - Basic",
Path = "/Examples"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
-- Model credit
--[[
Author = Cesium, https://cesium.com/
URL = https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/BoxAnimated
License =
Creative Commons Attribution 4.0 International License,
https://creativecommons.org/licenses/by/4.0/
]]