-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add exposure to AFrame #5029
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 exposure to AFrame #5029
Conversation
src/systems/renderer.js
Outdated
| maxCanvasWidth: {default: 1920}, | ||
| maxCanvasHeight: {default: 1920}, | ||
| physicallyCorrectLights: {default: false}, | ||
| exposure: {default: 1, if: {type: ['ACESFilmic', 'Linear', 'Reinhard', 'Cineon']}}, |
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.
Can name values with lowercase if not an acronym for consistency: linear, reinhard, cineon
Can capitalize first letter below:
string.charAt(0).toUpperCase() + string.slice(1);
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.
I think the default shouldn't be 1
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.
"1" is the THREE.js default of no change.
https://threejs.org/docs/#api/en/renderers/WebGLRenderer.toneMappingExposure
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.
Probably can replace 1 with something more user friendly and translate internally.
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.
Maybe no as toneMapping for consistency?
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.
Well it's a float it should be set to something like 0.5, or 1.1
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.
Like "intensity" on the light component
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.
Ah I see that the list is an if not a oneOf Misread. Sorry
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 should be:
toneMapping instead of type
exposure: {default: 1, if: {toneMapping: ['ACESFilmic', 'linear', 'reinhard', 'cineon']}},
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.
Thank you! Great spot!
| var data = this.data; | ||
| var sceneEl = this.el; | ||
| var renderer = sceneEl.renderer; | ||
| renderer.toneMappingExposure = data.exposure; |
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.
I have no experience with exposure or tone mapping so this might be dumb. Are there use cases for different values of tone mapping and exposure? Should we always match them automatically?
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.
The tone toneMapping option is a list of functions that act on the colour of each pixel according to the exposure value specified.
The different functions each have a slightly different aesthetic.
You control the exposure for when the user moves into a bright environment you lower it to make the dark areas darker and make the outside less blinding bright.
Usually it's just used to control the lighting on a global level to get the right feeling for the environment the developer is building.
src/systems/renderer.js
Outdated
| maxCanvasHeight: {default: 1920}, | ||
| physicallyCorrectLights: {default: false}, | ||
| exposure: {default: 1, if: {type: ['ACESFilmic', 'Linear', 'Reinhard', 'Cineon']}}, | ||
| toneMapping: {default: 'No', oneOf: ['No', 'ACESFilmic', 'Linear', 'Reinhard', 'Cineon']}, |
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.
We can do:
toneMapping: {default: 'no', oneOf: ['no', 'ACESFilmic', 'linear', 'reinhard', 'cineon']},
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.
Yeah I'll do that.
|
This is awesome. Thank you! |

Description:
This adds exposure to the renderer settings and allows flat materials to opt out of it so that they can still look like light emitting surfaces
Changes proposed:
TODO: Docs