Fixes to lights. Oops.
This commit is contained in:
parent
ce2a9f8d85
commit
ffd6af3142
|
@ -120,10 +120,10 @@ int main(int argc, char* argv[]) {
|
||||||
"Use KHR_materials_unlit extension to request an unlit shader.")
|
"Use KHR_materials_unlit extension to request an unlit shader.")
|
||||||
->group("Materials");
|
->group("Materials");
|
||||||
|
|
||||||
app.add_flag(
|
app.add_flag_function(
|
||||||
"--khr-lights-punctual",
|
"--no-khr-lights-punctual",
|
||||||
gltfOptions.useKHRLightsPunctual,
|
[&](size_t count) { gltfOptions.useKHRLightsPunctual = (count == 0); },
|
||||||
"Use KHR_lights_punctual extension to request an unlit shader.");
|
"Don't use KHR_lights_punctual extension to export FBX lights.");
|
||||||
|
|
||||||
app.add_flag(
|
app.add_flag(
|
||||||
"--user-properties",
|
"--user-properties",
|
||||||
|
|
|
@ -729,14 +729,14 @@ ModelData* Raw2Gltf(
|
||||||
light.innerConeAngle,
|
light.innerConeAngle,
|
||||||
light.outerConeAngle));
|
light.outerConeAngle));
|
||||||
}
|
}
|
||||||
}
|
for (int i = 0; i < raw.GetNodeCount(); i++) {
|
||||||
for (int i = 0; i < raw.GetNodeCount(); i++) {
|
const RawNode& node = raw.GetNode(i);
|
||||||
const RawNode& node = raw.GetNode(i);
|
const auto nodeData = gltf->nodes.ptrs[i];
|
||||||
const auto nodeData = gltf->nodes.ptrs[i];
|
|
||||||
|
|
||||||
if (node.lightIx >= 0) {
|
if (node.lightIx >= 0) {
|
||||||
// we lean on the fact that in this simple case, raw and gltf indexing are aligned
|
// we lean on the fact that in this simple case, raw and gltf indexing are aligned
|
||||||
nodeData->SetLight(node.lightIx);
|
nodeData->SetLight(node.lightIx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue