Jump to content
  • Advertisement
Sign in to follow this  
ic0de

blend mode for ssao

This topic is 2516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
I did try it just ssao and it looked right.

but its ok because I fixed it now with: GL_DST_COLOR, GL_ZERO

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!