Light tree: orientation cone of a reverse-sided light points the wrong way

Open Beginner friendly
#332 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Start with LightTreeCone(const Light*) in lib/rendering/pbr/light/LightTreeUtil.h and inspect how it derives the cone axis for reverse-sided lights. Reproduce with the issue’s eight DiskLights, spread 0.5 and adaptive versus uniform light sampling; done means the reverse-sided ratio no longer shows the reported 4% loss while regular-sided and wider-spread cases remain unaffected.

Written by the indexing model from the issue text.

Description

Summary. With adaptive light sampling, reverse-sided lights with a spread below 1 are under-selected: the image is about 4% too dark, and BSDF samples do not compensate. Version 2026.29.1, scalar mode.

Reproduce. Eight DiskLights (radius 0.2, spread 0.5) facing down onto a diffuse floor, max_depth 1, light samples only. Ratio of light_sampling_mode adaptive to uniform:

lights adaptive / uniform
sidedness reverse 0.9558
the same lights with regular sidedness (rotated instead) 0.9998
reverse, with bsdf_samples on too 0.9559

With spread 0.8 or 1 there is no loss.

Cause. LightTreeCone(const Light*) (lib/rendering/pbr/light/LightTreeUtil.h) takes the cone axis from light->getDirection(0), the local +z, for every light. A light with sidedness reverse emits toward -z, so with a spread below 1 the tree's orientation bound excludes directions the light does emit into, and the importance of the light is underestimated.

Fix (untested). Use -getDirection() as the cone axis for reverse-sided lights (two-sided lights already set mTwoSided).

Dominant language
CMake
Stars
4.7k
Forks
321
Avg merge
13m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenMoonRay/openmoonray

All issues in OpenMoonRay/openmoonray

Similar issues

More Computer Graphics issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.