0

I am trying to achieve ambient occlusion in my game through Monogame's VertexPositionColorTexture. An image of the current ambient occlusion I have come up with is this, but it's not entirely complete: Screenshot

I am not using shaders to achieve this effect and have been struggling to find out how to make use of them with ambient occlusion. Is it wrong to use Color instead of normals? And should I be making use of normals instead of the color parameter? I know that the BasicEffect class is a shader but I am just curious.

Thanks all.

Nico Schertler
  • 32,049
  • 4
  • 39
  • 70

1 Answers1

0

I dont't know monogame, but if you want to do ambient occlusion, normally it works as a post effect. this way every pixel is garanteed to be rendered. because for each pixel, you need to look up in its vicinity, in multiple places in a circle around it (radius depends on depth). the rendering must have multiple buffers, not only color but also depth and normal. (that is why deferred rendering is appreciated) Then the occlusion factor comes from a sum of the samples estimated occlusionning, which is evaluated as how much "in front" of the current pixel it is. which is done by comparing world position against the center pixel supposed surface (extrapolated from its normal), and supposed infinitely planar around it.

v.oddou
  • 6,476
  • 3
  • 32
  • 63