blend mode for ssao

Started by
2 comments, last by Yours3!f 12 years, 2 months ago
hi,
I have a pixel shader that does SSAO(screen space ambient occlusion) that outputs its result as a gray-scale value now I need to blend it with my already rendered scene I am currently using two full screen quads and the blend mode GL_ONE, GL_ONE but I can barely see the effects of my shader Is there a different blend mode I should be using?
Advertisement
Well then it probably needs contrast. Did you check the ssao texture alone without blending?

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

I did try it just ssao and it looked right.

but its ok because I fixed it now with: GL_DST_COLOR, GL_ZERO
if you have them rendered as two textures, then you can easily mix them in GLSL, or you can put the SSAO generating shader into the lighting shader, so that you can mix the end result in one pass. then no need for the good ol' blending.
like:
uniform float alpha_val; //you can play with alpha settings
...
final_color.xyzw = raw_albedo * diffuse_light * vec4(ssao_output.xyz, alpha_val) + specular_light;

to add in glsl you can use many functions, or develop a custom algorithm that fits your scene, or give artist values to control.

This topic is closed to new replies.

Advertisement