pmndrs/postprocessing

Documentation: effect ordering

hybridherbst opened this issue · 2 comments

Description of the bug

I think some effects are missing both in the docs and in the internal ordering.
https://github.com/pmndrs/postprocessing/wiki/Effect-Merging#effect-execution-order

Specifically, BrightnessContrastEffect and HueSaturationEffect don't seem to be sorted automatically – they can end up in the wrong position (e.g. before ToneMappingEffect) but I think should always be after tone mapping.

Also, PixelationEffect is not in the list, but should probably be sorted last.

Expected behavior

All effects provided by the library are sorted automatically, or the docs mention which effects need to be sorted manually (and thus more care taken when to add them in the chain).

Library versions used

  • Post Processing: [6.34.3]

Specifically, BrightnessContrastEffect and HueSaturationEffect don't seem to be sorted automatically – they can end up in the wrong position (e.g. before ToneMappingEffect) but I think should always be after tone mapping.

I've not included automatic sorting in v7 so far because it can be hit and miss, especially with custom effects. I think it's better to leave this to the user after all. However, the documentation/manual will still include a section on this topic with a recommended sort order.

In v6 sorting is based on EffectAttribute which boils down to depth buffer usage and whether an effects blurs the input buffer. This is obviously an incomplete solution. A better implementation could rely on explicit Effect.sortOrder values that effects define themselves, but I'm not sure if such a feature would be worth maintaining.

Closing this since this information will be included in the manual for v7.

I've also added PixelationEffect to the Wiki post.