Closed ButzYung closed 1 year ago
I was torn about how to implement this - as a simple "multiply" operation would make the AO color look weird, if not wrong, on colored surfaces. For instance - a blue tinted AO would not appear on a red surface. There's probably a better algorithm out there for this...
Switched to multiply blending for now, as you are right that it looks better.
My understanding is that AO is about darkening, but this isn't always the case in your new AO color implementation.
gl_FragColor = vec4( mix(sceneTexel.rgb, color, 1.0 - finalAo), sceneTexel.a);
If
color
is black (default), everything is fine. However, imagine the scenario whencolor
is brighter than thesceneTexel
. The AO color would actually lighten up the pixel. Shouldn't the AO color be a "multiply" operation, something like this?gl_FragColor = vec4( sceneTexel.rgb * mix(color, vec3(1.0), finalAo), sceneTexel.a);