Skip to content

Add configurable stage light intensity - #391

Merged
cdata merged 2 commits into
masterfrom
stage-light-intensity
Mar 1, 2019
Merged

cdata merged 2 commits into
masterfrom
stage-light-intensity

Conversation

@cdata

@cdata cdata commented Feb 28, 2019 •

Copy link
Copy Markdown
Contributor

This change proposes adding a stage-light-intensity attribute/property for configuring the intensity of Three.js ambient/directional lights in the scene.

  • Intensity in this context is a scalar that is applied to the base intensity of the ambient and directional lights separately
    • Rationale here is that the base intensity for each of these lights is different, and also based on the current role (see below)
  • Stage lights now also have a "primary" and "secondary" role, for non-PMREM and PMREM rendering respectively
    • The rationale here is that when PMREM is activated, the stage lights should be de-emphasized (they become "secondary" lighting)
    • This is an implementation detail, not directly configurable by the <model-element> user
  • 0.0 intensity turns off the stage lights; 1.0 is the current defaults as we know them; there is no upper bound

stage-light-intensity oscillating from 0.0 to 6.0

PMREM on PMREM off
lights-osc-pmrem 2019-02-27 18_26_45 lights-osc-no-pmrem 2019-02-27 18_31_44
stage-light-intensity="1.0" Toggling PMREM on and off
lights-pmrem-no-pmrem

@cdata
cdata requested review from jsantell, mrdoob and smalls February 28, 2019 02:37
@cdata
cdata marked this pull request as ready for review February 28, 2019 02:38

@jsantell jsantell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Quick comment on the primary/secondary 'baseline' for the lights: while I think these settings make sense to balance the overall illumination with PMREM, it seems a bit strange in the scenario where devs have control over the intensity of specifically non-environmental lighting (e.g. a dimly lit environment map, stage lights change drastically when toggling on PMREM). This is a whole can of worms of course that can be kicked down the road a bit. Everything else looks solid 👍

textureUtils = new TextureUtils(renderer);
// NOTE(cdata): We need to lower the samples here or else tests that use
// PMREM have a tendency to time out on iOS Simulator
textureUtils = new TextureUtils(renderer, {pmremSamples: 4});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unfortunate, but no benefit of higher samples here anyway

@cdata

cdata commented Mar 1, 2019

Copy link
Copy Markdown
Contributor Author

This is a whole can of worms of course that can be kicked down the road a bit. Everything else looks solid

Filed #396

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.

2 participants