Hey, im using post processing to improve realism in my scene. This works more or less. The main problem is that dark colors have a weird behavior when SSAA is enabled. Here a before/after demo. Left is with renderPass, GammaCorrection & FXAA, right is with SSAA, GammaCorrection & SAO. See the black suit or the brown pants in the bottom right corner. Or this jsFiddle
i am terribly sorry to hijack this topic with a small question, but this looks stunning for something that’s presented on the web. could you recommend any resources that go into baking? the ones that i have seen don’t seem to yield results like that, not even close. yours looks actually real.
I’m not sure why adding or removing SSAA would cause any color issues like you’re showing but I notice that you’re setting the renderer outputEncoding to sRGBEncoding and also adding a gamma correction pass. You should just be doing one or the other:
this._renderer.outputEncoding = THREE.sRGBEncoding
// ...
this.gammaCorrection = new ShaderPass(GammaCorrectionShader)
I do not use baking at all, because every part of the scene is dynamically positioned. I have multiple lights that I tried to configure to have a very soft shadow. Also using the SAO to generate a Ambient Occlusion effect works quite well, but it costs a lot of performance. For that reason I have two render states: While moving Im rendering without SAO and on mouse up I render with SAO, so the user has no lag when orbiting. Its not the most elegant way, but the only one I see right now.
I forgot to mention that I only use one at a time. In code the passes were disabled, but that wasnt clear enough sry. I changed the description.
Left picture is with renderPass, gammaCorrection & FXAA, the right picture is with SSAA, SAO & GammaCorrection, in that order. I change betweent the two onMouseMove/onMouseUp.
I tested it and didnt see any effect
Deleting the this._renderer.outputEncoding = THREE.sRGBEncoding did not work as well. I also removed it from the textures. texture['encoding'] = THREE.sRGBEncoding makes no difference.
I also removed the unrelated passes from the chain.
Here is a jsFiddle which shows the problem. OnMouseUp the Shark gets way darker and has less gradient. Also see the cube reflection from the spotlight. The gradient is also getting smaller
@looeee I tried the SSAO before but it didnt look good at all. I will look into the SMAA, thanks
Lowering SSAA.sampleLevel to 1 enhanced greatly the color problem, while keeping AA. Adding a background color to the scene stopped the background color changing problem. See here : https://jsfiddle.net/oj8914ph/
So when increasing the sampleLevel of SSAA, it seems like its loosing contrast.
Is this even a desired behavior of SSAA? Why would it change colors? Isnt it for antialiasing only?
@drcmda The question of @new is not about SSAO. So need to plug projects here.
Any chances to provide a live example that shows what you are doing? Color related issue with SSAA have been fixed in recent versions of three.js. You should also not use GammaCorrectionShader anymore but OutputPass which does tone mapping and color space conversion in one go.
My problem is that you use literally any opportunity in this forum to plug projects instead of answering the questions of users. This is considered as off-topic for sure…