Skip to content

Commit 8d50d4b

Browse files
fix double sided emitters
1 parent 66bfe82 commit 8d50d4b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/nbl/ext/MitsubaLoader/CMitsubaLoader.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,11 +1403,6 @@ inline core::smart_refctd_ptr<asset::ICPUDescriptorSet> CMitsubaLoader::createDS
14031403
auto baseInstanceDataIt = meshMeta->m_instances.begin();
14041404
for (const auto& inst : meshMeta->m_instanceAuxData)
14051405
{
1406-
// @Crisspl IIRC lights in mitsuba have "sides"
1407-
// TODO: address the comment!
1408-
// i think it's just that backside of an area emitter does not emit, docs doesnt say anything about this
1409-
emissive = inst.frontEmitter.type==CElementEmitter::AREA ? inst.frontEmitter.area.radiance : core::vectorSIMDf(0.f);
1410-
14111406
nbl_glsl_ext_Mitsuba_Loader_instance_data_t instData;
14121407

14131408
instData.tform = baseInstanceDataIt->worldTform;
@@ -1429,6 +1424,7 @@ inline core::smart_refctd_ptr<asset::ICPUDescriptorSet> CMitsubaLoader::createDS
14291424
//ofile << "Debug print front BSDF with id = " << inst.bsdf_id << std::endl;
14301425
//_ctx.backend.debugPrint(ofile, streams, _compResult, &_ctx.backend_ctx);
14311426
#endif
1427+
const auto emissive = inst.frontEmitter.type==CElementEmitter::AREA ? inst.frontEmitter.area.radiance:core::vectorSIMDf(0.f);
14321428
instData.material.front = impl_backendToGLSLStream(emissive,streams);
14331429
}
14341430
streams_it = _compResult.streams.find(bsdf_back);
@@ -1442,6 +1438,7 @@ inline core::smart_refctd_ptr<asset::ICPUDescriptorSet> CMitsubaLoader::createDS
14421438
//ofile << "Debug print back BSDF with id = " << inst.bsdf_id << std::endl;
14431439
//_ctx.backend.debugPrint(ofile, streams, _compResult, &_ctx.backend_ctx);
14441440
#endif
1441+
const auto emissive = inst.backEmitter.type==CElementEmitter::AREA ? inst.backEmitter.area.radiance:core::vectorSIMDf(0.f);
14451442
instData.material.back = impl_backendToGLSLStream(emissive,streams);
14461443
}
14471444

0 commit comments

Comments
 (0)