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

add intensity to AmbientLight. #7621

Closed
wants to merge 4 commits into from

Conversation

bhouston
Copy link
Contributor

Implementation of improvement discussed here: #7620

@bhouston
Copy link
Contributor Author

@WestLangley this PR makes sense? I think it is pretty straightforward. I've done a first pass at adding the units to the docs as well, which I think we are in agreement except for directional light (which we can fix once we figure out the right answer.)

@@ -143,7 +143,7 @@

<h3>[property:Matrix4 matrixWorld]</h3>
<div>
The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.
The global transform of the object. If the Object3d has no parent, then it's identical to the local transform. World transforms are assumed to be specified in meters.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I would say that a matrix transform has units of meters.

@WestLangley
Copy link
Collaborator

this PR makes sense?

Yes.

Except the docs. I don't think I am quite as confident in what the units will be as you are -- but I guess we can always change the docs later...

Do we agree that color is a hue and can be considered as unit-less, and the units come from elsewhere? Or do you disagree with me on that hypothesis?

@bhouston
Copy link
Contributor Author

Do we agree that color is a hue and can be considered as unit-less, and the units come from elsewhere? Or do you disagree with me on that hypothesis?

I think that because our color is restricted to LDR, it can not represent unbounded colors required for lighting or emission, although it is great for relative spectral measures like absorption, and reflection. But the decomposition of a HDR light color into color and intensity is not well defined unlike the decomposition of a line into a unitless direction and length. The reason is that we do not use "normalized colors" of some type of unit intensity.

Because we do not use a normalized color, the decomposition of a HDR light color is arbitrary. Remember:

RGB( 0.1, 0.1, 0.1 ) * intensity( 10 ) === RBG( 1, 1, 1 ) * intensity( 1 )

Because these are equivalent in result, but their intensities different by an order of magnitude, it is hard to say with any accuracy that the units are in intensity.

We could explore normalizing our color when we go to use it (r+b+g must sum to 1 or something like that), but I'd prefer to find a precedent for this in another tool, and I worry about being confusing to users used to how other tools work.

@mrdoob
Copy link
Owner

mrdoob commented Nov 21, 2015

Ended up implementing it in a different way. Better to do another PR with the metric/lumens stuff.

I think I want to fix the shadows code first, then release r74 and then we can proceed with the lights changes.

@mrdoob mrdoob closed this Nov 21, 2015
@bhouston
Copy link
Contributor Author

Wohoo! Thanks for getting the AmbientLight intensity in. :)

@mrdoob
Copy link
Owner

mrdoob commented Nov 21, 2015

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants