Skip to content

Conversation

@AdaRoseCannon
Copy link
Contributor

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:

  • exposure and toneMapping to renderer system
  • toneMapped to flat shader

TODO: Docs

@AdaRoseCannon
Copy link
Contributor Author

Preview of change

See how the colours are more muted and less graphic generally. ALso noticed how one of the torus-knots has toneMapped:false so that it has it's original pure colour.

maxCanvasWidth: {default: 1920},
maxCanvasHeight: {default: 1920},
physicallyCorrectLights: {default: false},
exposure: {default: 1, if: {type: ['ACESFilmic', 'Linear', 'Reinhard', 'Cineon']}},
Copy link
Member

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);

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

@dmarcos dmarcos Mar 21, 2022

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']}},
Copy link
Contributor Author

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;
Copy link
Member

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?

Copy link
Contributor Author

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.

maxCanvasHeight: {default: 1920},
physicallyCorrectLights: {default: false},
exposure: {default: 1, if: {type: ['ACESFilmic', 'Linear', 'Reinhard', 'Cineon']}},
toneMapping: {default: 'No', oneOf: ['No', 'ACESFilmic', 'Linear', 'Reinhard', 'Cineon']},
Copy link
Member

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']},
Copy link
Contributor Author

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.

@dmarcos
Copy link
Member

dmarcos commented Mar 21, 2022

This is awesome. Thank you!

@dmarcos dmarcos merged commit 6326321 into aframevr:master Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants