I've added simple color based ambient occlusion to my game.
First it looked like this (from giawa.com):
The description: "Due to anisotropy, the ambient occlusion shading on the top left is inconsistent with the top right. We need to flip those quads so that they get rendered properly."
So according to that I had to flip some faces in order to fix the issue. I did and then it would look like this:
This is of course because of back face culling, culling the flipped faces.
When I disable culling, it looks like this:
Which is how it's supposed to look. But as you can imagine, that costs a lot of performance because culling is now disabled.
According to the article: http://www.giawa.com/author/giawa/page/10/ "This occurs due to differences in how the GPU linear interpolates across the edge of a triangle versus the body of a triangle. This is called anisotropy, and can be fixed by ‘flipping’ the quad. My final fix was to enable polygon culling, which meant I had to make sure to render my quads in a consistent winding. "
I've searched for this "polygon culling" but could not find anything about that.
I can't just switch between culling modes because all the vertexes are added to a vertex buffer when initializing a chunk. This is so I can render each chunk in one draw call.
I hope anyone knows a way to fix this, thanks in advance.