Pmndrs Post Processing: Tone Mapping guidance

This is a question concerning the usage of the pmndrs postprocessing library. Ive sent my questions on their github forum and im still waiting for a reply, but i thought id try my luck here:

At the moment I am learning how to use tonemappingeffect. But i have some questions that i hope the community can help me with:

1- I understand that ToneMappingEffect should be the last pass I add to my composer. What are the recommendations when I have a selectivebloom pass which happens before in my pipeline. At the moment i had a red object blooming, but the tonemapping turns it into a light red/orange color. I remember this was easily solved in threejs’s default tonemapping by simply setting the material parameter “tonemapped” to “false”. I have done the same here but nothing has changed. Is there a special way to add exceptions to the tonemapping in this library?

2- The default tonemapping in three js was more straight forward. For example, it was enough to select the tonemapping mode to “ACESFilmic” and I would get a good result. But in this library, the tonemappingeffect has extra parameters such as blendFunction/resolution/whitepoint/middleGrey/minLuminance/avgLuminance/adaptationRate. Can someone guide me through how i should set these parameters in order to get the “ACESFilmic” tonemapping that threejs usually does?

1 Like

About (1), the diagrams in this post might be helpful. “OutputPass” refers to the three.js effect composer, not the pmndrs postprocessing library, but if you replace that with pmndrs’ ToneMappingPass, the diagram looks the same.

i had a red object blooming, but the tonemapping turns it into a light red/orange color.

This is expected. Tone-mapping desaturates colors (especially those with RGB values >1, but also values within [0–1]) as it forms an image from scene lighting information. If you can, I think the best approach is usually to allow the desaturation to happen, adjusting original colors, exposure, and perhaps tone mapping to create the final image you want. Consider the images below.

Without tone mapping:

With tone mapping:

The lightsabers desaturate to white with tone mapping, and as the (less bright) areas around them keep more of a saturated red color in the image, this is how bloom and tone mapping are usually intended to work together. I don’t meant to say you can’t choose something different… but just want to be clear about why it works this way. :slight_smile:

I do feel that ACES shifts the hue more than you might want, though, this is a bit of a known problem. We’re working on providing better options than ACES Filmic, like AgX tone mapping from Blender 4.0, see the discussion here:

Can someone guide me through how i should set these parameters in order to get the “ACESFilmic” tonemapping that threejs usually does?

I’m afraid I don’t know about these, perhaps someone else can weigh in. Personally I don’t think they’re hugely important. Contrast and exposure are the more common knobs to adjust.

1 Like

Thank You @donmccurdy for your helpful reply! I learned that the de-saturation effect is, as you’ve said, desired. Im trying to find other ways to get the overall effect that i am looking for. The only open point for me now is how to apply exceptions for tonemapping. Through trial and error, it seems to me that setting “tonemapped” as either false or true on the materials of different meshes has no effect on pmndrs’ tonemapping. Im curious if anyone knows of any other way to do this

The tonemapped parameter only works when rendering directly to the screen. When using post processing it is ignored.

1 Like

Yes, this used to work once but it was a breaking change in threejs. Like @LR17 said, toneMapping=false is out of order once you render to a webglrendertarget and i don’t think there is a solution or replacement. You can still use HDR workflow for bloom, as in you don’t use selectivebloom but just the regular one and push colors on materials you want to bloom over the threshold you defined, but specifically picking which materials receive tonemapping is deprecated in three. The regular ToneMappingPass in the end will apply ACIS to the whole screen.

1 Like