-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Reintroduce light intensity scale factor removed in THREE r165 after WebGLRenderer.useLegacyLights deprecation (fix #5556, #5546) #5577
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ module.exports.Component = registerComponent('light', { | |
color: {type: 'color', if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot']}}, | ||
envMap: {default: '', if: {type: ['probe']}}, | ||
groundColor: {type: 'color', if: {type: ['hemisphere']}}, | ||
decay: {default: 1, if: {type: ['point', 'spot']}}, | ||
decay: {default: 2, if: {type: ['point', 'spot']}}, | ||
distance: {default: 0.0, min: 0, if: {type: ['point', 'spot']}}, | ||
intensity: {default: 1.0, min: 0, if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe']}}, | ||
penumbra: {default: 0, min: 0, max: 1, if: {type: ['spot']}}, | ||
|
@@ -281,7 +281,11 @@ module.exports.Component = registerComponent('light', { | |
var distance = data.distance; | ||
var groundColor = new THREE.Color(data.groundColor); | ||
groundColor = groundColor.getHex(); | ||
var intensity = data.intensity; | ||
// WebGLRenderer.useLegacyLights has been removed in THREE r165 | ||
// Lights intensity had an implicit scaleFactor of PI now removed. | ||
// It's reintroduced here since it's easier to think about integers vs multiples of PI. | ||
var intensityScaleFactor = Math.PI; | ||
var intensity = data.intensity * intensityScaleFactor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It shouldn't change the intensity for scene that used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand the comment. Without the factor scene is dark. What should we do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have aframe experiences with renderer="physicallyCorrectLights:true" and light intensity that was carefully set, those scenes are not dark, we don't want the intensity to change for those. |
||
var type = data.type; | ||
var target = data.target; | ||
var light = null; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change decay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is @mrxz suggestion in #5546 (comment)