RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.01k stars 182 forks source link

GeometryLight reduces effect of HDRILight #552

Open mnaehrig opened 1 year ago

mnaehrig commented 1 year ago

Following image was rendered via pathtracing. It contains just a single HDRI light and simple geometries with Principled materials: hdri_only

If we add a geometry light (small sphere with Luminous material), the overall brightness is significantly reduced: hdri_and_geometry_light

We found out that this issue was introduced with commit cbf9d26. So it can't be reproduced with OSPRay 2.7.1 and earlier. A possible fix is to change computation of selectionPDF in VirtualLight.ispc from:

const uniform float selectionPDF = rcp((uniform float)pathContext.numLights - w->pathtracerData.numGeoLights);

to:

const uniform float selectionPDF = rcp((uniform float)pathContext.numLights);

But currently I'm not sure if this change has unexpected side effects.