-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
RoomEnvironment: Set emissiveIntensity instead #31348
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
Conversation
When thinking about this: I understand at first glance
Since there are no lights in the scene I would wonder why the original developer has chosen |
On the other hand all of this is somewhat subjective. If no other developer object, I'm okay with merging the PR as it is. |
TBH, I would not characterize this as "somewhat subjective".
It is improper to set it to a value greater than 1. For self-illuminating materials, we have We could add those two properties to Instead, |
Maybe the number of this PR so the discussion can easily be found? |
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I'd prefer to avoid this. Probably >98% of users choose MeshBasicMaterial because they want an unlit or shadeless material; that MeshBasicMaterial happens to also support AO and lightmaps is (IMHO) a conceptual inconsistency kept for backward-compatibility and performance. Perhaps preferably it would be split in two, or lighting could be disabled on lit material types, but I wouldn't add more shading behaviors to MeshBasicMaterial as things are now. Regardless, the changes look good to me. It would also be OK to use MeshBasicMaterial, but to include an inline comment stating that we intend an emissive model but are emulating the effect with MeshBasicMaterial 'for performance reasons'. |
material.color
represents the diffuse reflectance of the material. It is a dimensionless quantity in [ 0, 1It does not make sense to set
material.color
to a value outside that range.This is particularly true when mapping between sRGB and linear-sRGB color space, as the transfer function is only defined on [ 0, 1 ].
Instead, set the
emissive
property ofMeshLambertMaterial
, and assign the desired intensity tomaterial.emissiveIntensity
.emissive
is dimensionless;emissiveIntensity
represents luminance.By luck, as used in
RoomEnvironment
, the result is the same, but the current implementation is improper.