SSAO on custom shaders? Please help =3

Hello~ =3

I’m just wondering how difficult it would be to make it so that SSAO works on 2 custom shaders I’m using in a project. Currently SSAO ignores the custom-shaded geometry completly

I’m not the greatest coder =/.

At the major risk of destroying any chance of credibility, and sounding like a noob… :stuck_out_tongue:

If someone could do it for me, or let me know how i would love them forever and be in their debt, otherwise I will have to try my hand at it when I get a chance =/

These are the two shaders I would love to make sexier with SSAO :smile:

http://www.kormyen.com/misc/Bump-Spec-Rim-Lightmap-Reflection-GODSHADER.shader
http://www.kormyen.com/misc/Bump-Spec-Rim-Lightmap.shader
Edit: Now attached to post

Thanks for reading, and thanks WAAAAY more if you can help xP T_T

222450–8061–$bump_spec_rim_lightmap_reflection_godshader_197.shader (3.26 KB)
222450–8062–$bump_spec_rim_lightmap_840.shader (2.8 KB)

Right now the reason your see no SSAO on objects using your custom shaders is they aren’t being rendered into the Normal/Depth buffer. In order for that to happen, you need to give them a RenderType (see here for more information).

You may need to create your own RenderType, as your normal/depth information looks to be pretty specific. If you need to do that grab the Builtin Shader package from the Unity site and add it to the Camera-DepthNormalTexture shader. You will have to edit the SSAO shader to use this instead of the automated output added in 2.6, and setup manual rendering of the DepthNormal information through script.

Thank you so much xD

I’ll have a look into it