mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-18 03:20:33 -05:00
46 lines
1.2 KiB
Lua
46 lines
1.2 KiB
Lua
local assetHelper = asset.require("util/asset_helper")
|
|
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
|
|
local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
|
|
|
|
local model = asset.syncedResource({
|
|
Name = "Animated Box",
|
|
Type = "HttpSynchronization",
|
|
Identifier = "animated_box",
|
|
Version = 1
|
|
})
|
|
|
|
local model = {
|
|
Identifier = "modelshader",
|
|
Parent = transforms.EarthCenter.Identifier,
|
|
Transform = {
|
|
Translation = {
|
|
Type = "StaticTranslation",
|
|
Position = { 11E7, 0.0, 0.0 }
|
|
}
|
|
},
|
|
Renderable = {
|
|
Type = "RenderableModel",
|
|
GeometryFile = model .. "BoxAnimated.glb",
|
|
ModelScale = 3E7,
|
|
LightSources = {
|
|
{
|
|
Type = "SceneGraphLightSource",
|
|
Identifier = "Sun",
|
|
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
|
Intensity = 1.0
|
|
}
|
|
},
|
|
PerformShading = true,
|
|
DisableFaceCulling = true,
|
|
VertexShader = asset.localResource("model_vs.glsl"),
|
|
FragmentShader = asset.localResource("model_fs.glsl"),
|
|
},
|
|
GUI = {
|
|
Name = "Model Shader",
|
|
Path = "/Example",
|
|
Description = "Simple box model with a custom shader",
|
|
}
|
|
}
|
|
|
|
assetHelper.registerSceneGraphNodesAndExport(asset, { model })
|