Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve lightight source light values documentation #9809

Closed
nicopap opened this issue Sep 14, 2023 · 3 comments · Fixed by #11551
Closed

Improve lightight source light values documentation #9809

nicopap opened this issue Sep 14, 2023 · 3 comments · Fixed by #11551
Labels
A-Rendering Drawing game state to the screen C-Docs An addition or correction to our documentation C-Feature A new feature, making something new possible
Milestone

Comments

@nicopap
Copy link
Contributor

nicopap commented Sep 14, 2023

Problem

PointLight has an intensity field, while DirectionalLight has illuminance field.

Solution

either use intensity or illuminance but not both (I personally am in favor of intensity because it's easier to spell)

@nicopap nicopap added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Sep 14, 2023
@nicopap nicopap added this to the 0.12 milestone Sep 14, 2023
@mockersf
Copy link
Member

mockersf commented Sep 14, 2023

It is willingly that they don't have the same name: illuminance of DirectionalLight is in lux, while intensity of PointLight / SpotLight is in lumens

While lumens measure the amount of light emitted by a source, luxes determine the same amount of light, but are projected onto a surface

illuminance is the amount of light a surface will receive, or be illuminated by the directional light, while intensity is the intensity of a spotlight / point light

@nicopap
Copy link
Contributor Author

nicopap commented Sep 14, 2023

Oohh I see. So for a summary:

  • lumens is property of light emitter.
  • luxes is property of lighted surface.

1lx = 1 lm/m²

Since point light/spot lights fall-off with distance, the amount of lumens is constant, but the luxes can change depending on how distant the lighted surface is.

Since the DirectionalLight lights every surface the same way, the field we set is in lux and express illuminance of the surface being lighted.

The difference between the units lumen and lux is that the lux takes into account the area over which the luminous flux is spread. A flux of 1,000 lumens, concentrated into an area of one square metre, lights up that square metre with an illuminance of 1,000 lux. The same 1,000 lumens, spread out over ten square metres, produces a dimmer illuminance of only 100 lux. Mathematically, 1 lx = 1 lm/m².

Well, it's just a documentation issue then.

@nicopap nicopap added C-Docs An addition or correction to our documentation and removed C-Bug An unexpected or incorrect behavior labels Sep 14, 2023
@nicopap nicopap changed the title PointLight and DirectionalLight have inconsistent field naming Improve lightight source light values documentation Sep 14, 2023
@nicopap nicopap added the C-Feature A new feature, making something new possible label Sep 14, 2023
@mockersf
Copy link
Member

mockersf commented Sep 14, 2023

it has been slightly improved very recently by moving a doc comment from the default impl on the field to the field itself in #9724 so that at least both mention their unit now

@JMS55 JMS55 modified the milestones: 0.12, 0.13 Oct 24, 2023
github-merge-queue bot pushed a commit that referenced this issue Jan 27, 2024
#11551)

# Objective

- Fix #9809

## Solution

- Describe the difference between lumens and luxes, and why some
lightsources use one and some the other.
tjamaan pushed a commit to tjamaan/bevy that referenced this issue Feb 6, 2024
bevyengine#11551)

# Objective

- Fix bevyengine#9809

## Solution

- Describe the difference between lumens and luxes, and why some
lightsources use one and some the other.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Docs An addition or correction to our documentation C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants