In my cube engine im using ambient occlusion to make things look better. In general it doesnt look that bad but there are some issues im not happy with. First ill show you 2 pictures. In Fig1 you can see a shader that for each vertex renders blue if the vertex is not occluded at all or red if there is at least a bit of occlusion (independent of how much). In fig. 2 you can see a regular render:
As you can see in Fig1 in general it looks good, but for example in the highlighted areas you can see that there are "lines" that look wrong. These lines are even worse if you look at figure 2.
I never really implemented this before so im a bit clueless where those errors come from? Is there anything i can do to prevent this?