gltf_viewer should not crash when there is no IBL.

This commit is contained in:
Philip Rideout
2019-06-28 15:40:02 -07:00
parent 26cbef7452
commit 3fdecfdefa

View File

@@ -207,7 +207,10 @@ int main(int argc, char** argv) {
// Add the renderables to the scene.
app.viewer->setAsset(app.asset, app.names, !app.actualSize);
app.viewer->setIndirectLight(FilamentApp::get().getIBL()->getIndirectLight());
auto ibl = FilamentApp::get().getIBL();
if (ibl) {
app.viewer->setIndirectLight(ibl->getIndirectLight());
}
};
auto setup = [&](Engine* engine, View* view, Scene* scene) {