cgvirus / Olive-Editor-Community-Effects

A community effort to populate effects for Olive-Editor
60 stars 7 forks source link

[OCIO] Example of breakage #17

Open sobotka opened 5 years ago

sobotka commented 5 years ago

https://github.com/cgvirus/Olive-Editor-Community-Effects/blob/94b4b1a97a8d0c5f528764c1bce3060f2ab5c264/bloom/bloom.frag#L42

sobotka commented 5 years ago

Citing this here for those interested in how scene referred processing works. Note the 1.0, which is a display referred hack here. Scene referred effects should:

  1. Not assume anything about the nature of the primaries. That is, beware of functions that have hard coded values in them that relate to colour.
  2. Not use display referred thinking. Anything with a magic number 1.0 for example, will break and / or not yield the desired output.
cgvirus commented 5 years ago

So what would be your suggestion for Olive implementation with a Scene Referred color space?

sobotka commented 5 years ago

Screen is essentially the probability formula, and as such, you would need to factor in “just what the hell is this doing or trying to do?”

That is, display referred formulas are hacks and kludges that work around the fact that they are nonlinear models emulating light transport systems. No nonlinear, display referred approach does this well, and as such, the kludges and hacks need to be peeled apart into intention for a more close-to-light-transport scene referred model.

A good example is exposure. In a scene referred model, it is simply multiplication. Display referred nonlinear? It’s a mess on any transfer function other than a pure log.

In this particular case, it would seem it is being used as some sort of guessed blending option? Actual blooms are additive light effects via lens optics or such. Glares, flares, etc. are simply adds. If you are encoding them using The One True Alpha Encoding, that would be something like [12.3, 12.0, 2.91, 0.0] in an RGBA triplet. Note the RGB values would be assumed scene referred radiometrically linear ratios of light, of arbitrary channel colours, depending on the reference space encoding.

Does that help?

cgvirus commented 5 years ago

thanks for the info. I will check them when the OCIO API is complete and merged