oF + SSAO + DoF

Hi :slight_smile:

oF + SSAO + DoF sample project.

[attachment=0:3syu941k]SSAODoF.png[/attachment:3syu941k]

I think there is room to improve, but anyway just sample.
The GLSL code is not my original,
but I do not remember where I got…

Thanks
Akira

oFSSAODoF.zip

1 Like

awesome!
thanks for posting your code.

You are welcome!

very nice, thank you!

very nice.

i am trying to use only the DOF part in combination with a 3D model.
before trying to implement this DOF got nice smooth edges by using this line
window.setGlutDisplayString(“rgba double samples>=4 depth”);

but once i start using your DOF example the edges are not anti aliased.

do you have suggestions to getting smooth edges again and on how to remove the SSAO part. I don’t need SSAO and thought removing it would save me some cpu.

thanks.

i figured out how to get the example running and not have to included the ssao shader

  
  
depthFBO.beforeUpdate();  
		drawScene();  
		depthFBO.afterUpdate();  
		  
		colorFBO.beforeUpdate();  
		drawScene();  
		colorFBO.afterUpdate();	  
		  
		int ssaoTexSlot = 6;  
		colorFBO.beforeDraw(ssaoTexSlot);  
		int depthTexSlot = 5;  
		depthFBO.beforeDraw(depthTexSlot);  
		  
		  
		dofShader.begin();  
		dofShader.setUniform1i("bgl_RenderedTexture", ssaoTexSlot);  
		dofShader.setUniform1i("bgl_DepthTexture", depthTexSlot);  
		  
		dofShader.setUniform1f("focus", focus);  
		dofShader.setUniform1f("aspectratiox", aspectratiox);  
		dofShader.setUniform1f("aspectratioy", aspectratioy);  
		dofShader.setUniform1f("blurclamp", blurclamp);  
		dofShader.setUniform1f("bias", bias);  
		drawFullScreenQuad(ofGetWidth(), ofGetHeight());  
		dofShader.end();	  
		  
		colorFBO.afterDraw();  
		depthFBO.afterDraw();