Skip to content

Pluggable Tone Mapping Operators (their own class that injects GLSL) #26661

@bhouston

Description

@bhouston

Description

Since we introduced tone mapping, we have usually done it via a set of enums which triggered fixed function tone map operators in the core Three.js code.

As tone mapping matures there are more and more tone mapping operators. This hard coding of our "preferred tone mapping" methods is getting a bit cumbersome.

Solution

Instead, why don't we refactor the tone mapping operators to be their own classes. And you can then allow others to define their own tone mappers how ever they want. In the end, the tone map operator just gives a chunk of GLSL code that can be inserted into a shader.

We can still keep the old hard coded interface, we can just add one more type called "Pluggable" or "custom" and then you can plug in your own. the underlying code behind the hard coded enums can still use the new pluggable system as well, thus avoiding duplicated code.

Alternatives

The alternative is just to add more hard coded tone mappers, but at some point that stops scaling well.

Additional context

I was suggesting this as we look to add AgX to Three.js.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions