diff --git a/projects/FBX/MayaCamera.cpp b/projects/FBX/MayaCamera.cpp index 8910fc3711..b7bc1bb428 100644 --- a/projects/FBX/MayaCamera.cpp +++ b/projects/FBX/MayaCamera.cpp @@ -256,7 +256,15 @@ struct LightNode : INode { auto exposure = get_input2("exposure"); auto intensity = get_input2("intensity"); - intensity *= pow(2.0, exposure); + + auto scaler = powf(2.0f, exposure); + + if (std::isnan(scaler) || std::isinf(scaler) || scaler < 0.0f) { + scaler = 1.0f; + printf("Light exposure = %f is invalid, fallback to 0.0 \n", exposure); + } + + intensity *= scaler; auto prim = std::make_shared(); auto &verts = prim->verts; @@ -301,6 +309,14 @@ struct LightNode : INode { auto &clr = prim->verts.add_attr("clr"); auto c = color * intensity; + + for (size_t i=0; i