Whether cameraExposure&cameraContrast work on one material or all materials?

Class PBRMaterial has cameraExposure&cameraContrast.
As explained, these two parameters only apply to the specified material.


But when I call these two parameters, it looks like it affects the full screen . Is there anything that needs extra attention?
PG:https://playground.babylonjs.com/#19JGPR#395

By default, the materials use the image processing configuration of the scene. You should create your own instance of ImageProcessingConfiguration for your material if you want the change to only affect the material:

1 Like

Thank you very much for your answer. It was very helpful.

But I had other problems.
When I enable cameraExposure and cameraContrast in post-processing ,then I enable my own instance of ImageProcessingConfiguration for my material, Even if the parameters are the same, the two have different effects.
I wonder when I enable my own instance of ImageProcessingConfiguration for my material,is it still affected by this post-processing?

Also,the effect will change even if the parameter is set to the initial state of 1.0 when I enable post-processing.I wonder if this is correct . In my understanding, when I turn on post-processing, in the initial state, the effect should be the same as before, only after modifying the parameters, the effect will change accordingly.

PG:https://playground.babylonjs.com/#19JGPR#404

When I enable my own instance of ImageProcessingConfiguration for my material,then I enable cameraExposure and cameraContrast in post-processing ,the overall effect will be a little whiter than before.

And no matter how to modify the two parameters of the post-processing, the effect will not change again, you can refer to the hdrSkybox in PG.

The properties of the image processing post process are named exposure and contrast, not cameraExposure / cameraContrast.

Also, if you use a post process, it will be applied at the end on the whole image, so it will add up to any image processing post process you would have enabled on specific materials. For this reason, when you use the image processing post process, you should not setup any image processing on materials.

The properties of the image processing post process are named exposure and contrast , not cameraExposure / cameraContrast .

You’re right. But the case for exposure in the document is wrong.

image

Also, if you use a post process, it will be applied at the end on the whole image, so it will add up to any image processing post process you would have enabled on specific materials.

I understand what you said.There are certain objects in the scene that want to make them appear especially bright.Therefore, I want to modify its exposure and contrast through the material first, and then overlay the exposure and contrast of post-processing. However, it seems that when the two effects are turned on at the same time, even if the exposure and contrast of post-processing are both 1.0, the final effect will be whiter than the expected effect, and I think the overlay effect is not right.
Or the two effects just don’t work together.

You’re right, this PR will fix it:

Indeed. You can’t apply two image processing configurations, because there’s a conversion to gamma space which is performed during this process: some operations are done before the conversion (exposure, vignette, tone mapping) and some others are done after (contrast, color grading, color curves, dither).

The two effects are not meant to work together, it is either global as a post process or per material.

You could use nme or a pluginMaterail to create your own custom way as it is too edge case to be standardized.

I see. Thank you very much for your help.

1 Like