diff --git a/zenovis/src/optx/RenderEngineOptx.cpp b/zenovis/src/optx/RenderEngineOptx.cpp index b6ba4c66c2..e6287db440 100644 --- a/zenovis/src/optx/RenderEngineOptx.cpp +++ b/zenovis/src/optx/RenderEngineOptx.cpp @@ -1152,6 +1152,15 @@ struct RenderEngineOptx : RenderEngine, zeno::disable_copy { } } } + // add light map + for(auto const &[_, ld]: xinxinoptix::get_lightdats()) { + if (ld.profileKey.size()) { + realNeedTexPaths.emplace_back(ld.profileKey); + } + if (ld.textureKey.size()) { + realNeedTexPaths.emplace_back(ld.textureKey); + } + } std::vector needToRemoveTexPaths; for(auto const &[tex, _]: OptixUtil::g_tex) { if (std::find(realNeedTexPaths.begin(), realNeedTexPaths.end(), tex) != realNeedTexPaths.end()) { diff --git a/zenovis/xinxinoptix/optixPathTracer.cpp b/zenovis/xinxinoptix/optixPathTracer.cpp index 4f4ba44181..41f83e5399 100644 --- a/zenovis/xinxinoptix/optixPathTracer.cpp +++ b/zenovis/xinxinoptix/optixPathTracer.cpp @@ -2099,6 +2099,11 @@ static std::map lightdats; static std::vector triangleLightCoords; static std::vector triangleLightNormals; + +std::map &get_lightdats() { + return lightdats; +} + void unload_light(){ lightdats.clear(); diff --git a/zenovis/xinxinoptix/xinxinoptixapi.h b/zenovis/xinxinoptix/xinxinoptixapi.h index 826145e270..fd40f09ebd 100644 --- a/zenovis/xinxinoptix/xinxinoptixapi.h +++ b/zenovis/xinxinoptix/xinxinoptixapi.h @@ -104,4 +104,5 @@ void using_hdr_sky(bool enable); void show_background(bool enable); // void optixUpdateUniforms(std::vector & inConstants); void optixUpdateUniforms(void *inConstants, std::size_t size); +std::map &get_lightdats(); }