Is there any way to achieve Ambient Occlusion through shaderMaterial

i want to strengthen the Three-dimensional of some mesh in scene,i know the example of SAO and SSAO, but it is not suit for me.Does it exist some fragment shader code that can achieve the effect of
Ambient Occlusion?

You can try to adapt the code from the aomap_fragment.glsl and aomap_pars_fragment.glsl shader chunks which is used in certain build-in materials. But this is only useful if you use an ambient occlusion maps.

Techniques like SAO are based on post-processing and calculated AO in a dynamic way. If the current implementation does not fulfill your requirements, you have to search for a different code.

thanks for your replay,achieve the effect with AO map is not what i want. i search the fragment shader code for a long time, but it seems not exist.

For good reasons. If you think about how AO works, you need post-processing (or ray-casting) in order to implement a dynamic approach.