Tuesday, November 20, 2012

Screen Space Ambient Occlusion

Implemented screen space ambient occlusion using 3 different techniques. Used the Sponza scene to display the effects.

Sponza Scene

  •  Regular Grid:
This used a regular grid with a fixed step size around the pixel in consideration. The grid points were then analzed in screen space and using the normals and the depth values of those points, ambient occlusion was calculated. There's regularity in the occlusion which comes out of this. Maybe blurring would have reduced that effect or even rotating the grid can reduce the regularity artifact.

Regular Grid AO

Regular Grid AO - Difference

  • Poisson Sphere:
In this case random points within a sphere were used to determine how much is the occlusion. The points were rotated by a random value for each pixel, to reduce artifacts.

Poisson Sphere (Rotated for randomness)

Poisson Sphere (Rotated for randomness) - Difference

  • World Space Poisson Sphere:
Similar to Screen space Poisson, but calculated in the world. A hemisphere is considered based on the normal of the point under consideration and then based on the distance of the points, those are then projected to the screen to find the occlusion. This is better than the other techniques.

AO using World space with Poisson Sphere

AO using World space with Poisson Sphere - Difference

GLSL Shaders

This project dealt with creating interesting shaders like shading the earth with bump mapping, clouds, day/night effects loaded from different textures.

Rotating Earth showing Bump mapping, specular highlights on the water, day and night and smooth blend between them, moving clouds and rim lighting

Earth with the Moon revolving around it

Pulsing effect through the vertex shader