Hi all,
I’m currently trying to develop my own 3D Viewer for GLTF files.
I’d like to include the following functionality: I want to extract custom properties from the model like for example light settings or camera positions that I can use to create a DirectionalLight instance. I found online that this can be done with extensions:
# myModel.gltf
"extensionsUsed": [
"KHR_lights_punctual"
],
"extensions": {
"KHR_lights_punctual": {
"lights": [
{
"type": "directional",
"intensity": 1
}
]
}
}
In addition, it should be possible to load custom values for such settings by using a configuration file (e.g. in JSON format), for example when I want to change the light’s intensity:
# config.json
"gltfExtensions": {
"KHR_lights_punctual": {
"lights": [
{
"type": "directional",
"intensity": 10
}
]
}
}
So I’m looking for a way to override or disable any given extensions in the original GLTF once I load custom values. Is this possible at all? And if so are there any best practices? I’ve already tried to include them into the userData
node, but this didn’t seem to work.
Thank you so much for any help!