Fixes to lights. Oops.

This commit is contained in:
Par Winzell 2019-01-25 15:14:37 -08:00
parent ce2a9f8d85
commit ffd6af3142
2 changed files with 11 additions and 11 deletions

View File

@ -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",

View File

@ -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);
}
} }
} }
} }