-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[usdLux] normalized lights divide by surfaceArea expressed in meters^2 #3587
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
base: dev
Are you sure you want to change the base?
[usdLux] normalized lights divide by surfaceArea expressed in meters^2 #3587
Conversation
This allows normalized lights to compose correctly into stages with a different metersPerUnit setting, at a backwards-compatibility cost of a change in luminance of normalized lights before this, in layers with metersPerUnit != 1
581b73f
to
facd5eb
Compare
Filed as internal issue #USD-10863 (This is an automated message. See here for more information.) |
/AzurePipelines run |
I'm pretty certain everybody wants option 1. The light does not change when the meters per unit changes, even if you are working with "real world light units". Yes the total amount of light emitted will increase by the square of the scale, but the distance of that light from any objects will also increase by the scale and thus drop off by the square of the scale. |
Hi @spitzak, could you explain a bit more what you'r suggesting here? You seem to be saying that option 1 preserves brightness when a normalized light is scaled, which is not the case. |
/AzurePipelines run |
2 similar comments
/AzurePipelines run |
/AzurePipelines run |
Description of Change(s)
This allows normalized lights to compose correctly into stages with a different metersPerUnit setting, at a backwards-compatibility cost of a change in luminance of normalized lights before this, in layers with metersPerUnit != 1
(See below for a full discussion.)
Link to proposal (if applicable)
PixarAnimationStudios/OpenUSD-proposals#77
Checklist
I have created this PR based on the dev branch
I have followed the coding conventions
I have added unit tests that exercise this functionality (Reference:
testing guidelines)
I have verified that all unit tests pass with the proposed changes
I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)
Intro + Background
Neither the current UsdLux implementation, or the current version of the UsdLux clarifications and changes in this OpenUSD proposal (md) (pdf), explicitly specify how the behavior of
LightAPI.inputs:normalize
relates to linear stage units (metersPerUnit
), and what happens when the linear stage units change (ie, by being composed into another stage with differentmetersPerUnit
). We wish to further update the UsdLux clarification to address this gap.Terms
lsu = linear stage unit(s)
metersPerUnit
- ie,metersPerUnit=.01
implies "the lsu is cm"nit
cd/m^2
)Common usage of the normalize attribute
In theory, you might desire to have normalized lights and non-normalized lights behave differently when composed into a scene with different units... but I struggled to come up with a credible common scenario for that.
Most commonly, normalize is used to allow lighting artists to adjust the size of a light without affecting it's overall illumination output on the surrounding scene. ie, you might want to make shadows softer without dramatically altering the overall light level of the scene. It's used as a way to alter the way you sculpt the light while designing it - not as a way to mark it as a fundamentally different type of light, that should behave in a fundamentally different way from other lights, when placed into a new setting, or when automated, non-artistic operations are done on it.
As transforms associated with changes in scene scale are "non-artistic" (and ideally, automated) changes, it follows that artists will generally want normalized and non-normalized lights to behave similarly in this situation. That is, if they have two lights that appear identical in two_lights.usd, except one is normalized and one isn't, they will want the two lights to stay identical to each other when placed into a new scene.
Assumptions and Observations
Assumption 1: Light dimensions must be in lsu
If this were not the case, then a layer with both lights + geometry would not retain the same relative size when composed into a scene with a different
metersPerUnit
- which is unlikely to be the wanted behavior.Assumption 2: For non-normalized lights,
inputs:intensity
represents luminance innits
This document is intended as a further exploration to the proposed UsdLux clarifications and changes from this OpenUSD proposal (md) (pdf), and that proposal assumes (non-normalized)
inputs:intensity
is in a fixed units,nits
.Observation 1: Direct light sampling for non-normalized, non-ies lights are generally not affected by
metersPerUnit
For non-normalized lights, we've assumed
inputs:intensity
is always a measure of base luminance innits
. Because measurement of luminance is unaffected by distance, it is thus unaffected by a scale change. Most other UsdLux light properties are modifiers to the luminance, whose formulas do not depend on any values which are in scene units. (One possible exception are lights with attached ies files, whose measurements are defined to be luminous intensity values expressed in candela. However, we defer discussion of unit interaction with ies files for another disucssion.) Therefore, direct light sampling for non-normalized, non-ies lights are unaffected by scale changes.By "direct light sampling", I mean the sampling of a light for a ray known to intersect the light. The light dimensions are in lsu, so a
metersPerUnit
change can/will affect their size and position in the scene, and therefore can affect whether a given ray will intersect it, or the exact sampling pattern used. But, once it's known a ray intersects a non-normalized, non-ies light, themetersPerUnit
setting is unimportant.Therefore, other than ensuring the size scale of a non-normalized light is as desired, they will generally not present any special problems when undergoing unit changes.
Normalized Area Light Option 1: Normalized lights divide by scene-relative surface area
Summary of behavior
sizeFactor
for normalized area lights (whereluminance = inputs:intensity / sizeFactor
)is in scene-relative units of
lsu^2
metersPerUnit
into account
When rendering the composed stage, renderers need to:
metersPerUnit
settingWhen composing lighting scenes with different
metersPerUnit
, artists / end users need to:metersPerUnit
inputs:intensity
is in lsu-relative units, and so remains unchangednits
) of the light changesand the light will try to automatically adjust it's luminance without knowledge of the scene
scale causing the brightness of the light to be incorrect relative to the intended size of the
asset
Backwards compatibility behavior
Normalized Area Light Option 2: Normalized lights divide by fixed-unit surface area (meters^2)
Summary of behavior
sizeFactor
for normalized area lights (whereluminance = inputs:intensity / sizeFactor
)is in fixed units of
meters^2
When rendering the composed stage, renderers need to:
metersPerUnit
^2metersPerUnit
^2, we would get an area in units of m^2metersPerUnit
metersPerUnit
, we would get a length in units of mmetersPerUnit
When composing lighting scenes with different
metersPerUnit
, artists / end users need to:metersPerUnit
metersPerUnit
, at render time (see above)Backwards compatibility behavior
metersPerUnit=1
, will be significantly brighter or darker in "old" vs "new" UsdLuxnewLuminance = oldLuminance / metersPerUnit^2
metersPerUnit=.01
), normalized lights in "new" usdLux will have 10,000x higher luminance than with "old" UsdLuxSummary and Analysis
Summary of differences
Here's a summary of differences, with my subjective rating of which option has the superior behavior in each area:
metersPerUnit
Analysis
Big win for Option 2 (Normalized Fixed Units): no manual overrides on lights to preserve correct real-world units
Big win for Option 1 (Normalized Scene-relative units): better backwards compatibility of normalized light intensity for "most" scenes
metersPerUnit=1
), the brightness of normalized lights under Option 2 will change by orders of magnitudemetersPerUnit=1
), it is assumed that "many" / "most" scenes will have their normalized lights change significantly under Option 2Minor win for Option 1 (Normalized Scene-relative units): renderers need no additional unit-aware changes
Conclusion
We have a choice between backwards compatibility (Option 1) vs better / more correct behavior going forward (Option 2)
The UsdLux clarification project is about providing better behavior going forward, at the cost of some backward compatibility, so overall we feel Option 2 is the better choice long-term.