Esc

Gltf_Lights

structextensionsince 0.36.1Source
  • macOS: Gltf_Lights works on macOS
  • Linux: Gltf_Lights works on Linux
  • Windows: Gltf_Lights works on Windows
  • Wasm: Gltf_Lights works on Wasm

Declaration

Gltf_Lights :: struct @json(rename_all=camelCase) {
    lights: [] Gltf_Light; @json(default,skip_serializing_if=empty)}

KHR_lights_punctual on the document: the list of lights that nodes refer to by index. Release it with free_json.

Example↗
#import "Extensions/Json";

asset, error := gltf_load("{\"asset\":{\"version\":\"2.0\"},\"extensionsUsed\":[\"KHR_lights_punctual\"],\"extensions\":{\"KHR_lights_punctual\":{\"lights\":[{\"type\":\"directional\"},{\"type\":\"point\"}]}}}");
assert(error.kind == .NONE);
defer gltf_free(*asset);
lights, found, _ := gltf_extension(*asset.document.extensions, "KHR_lights_punctual", Gltf_Lights);
assert(found && lights.lights.count == 2);
free_json(*lights);

See also