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?
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.
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.
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.
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
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.