## Solid angle of a pixelWritten by Paul BourkeJuly 2017
In the following the question of how much solid angle a pixel representing a projection of a 3D scene covers will be presented. Applications for this include computing the total solid angle an object in a scene covers, for example, for lighting calculations. While what follows can be extended to any projection space, for simplicity here we will consider 90 degree by 90 degree perspective projections such as generated from cube maps. Consider one face of the cube centered at the origin as shown below. Each pixel of which may be in one or another state and the aim is to find the solid angle of all pixels in a particular state. This involves counting up the solid angle of each pixel in that state. If the aim is to find the solid angle overall then this can be applied to each of the 6 cube faces.
One pixel on this face of the cube is shown highlighted above, the corners
labeled as shown. Consider vectors from the origin to c _{0} + Ø_{1} + Ø_{2} - π
Where the angles
Ø
Computing the tangents at each c XYZ CalcTangent(XYZ p0,XYZ p1) { XYZ p,r,t; p = VectorSub(p1,p0); r = CrossProduct(p0,p); t = CrossProduct(r,p0); Normalise(&t); return(t); } There are a few simple test cases for a coded implementation. If the cube face is entirely contained in the object whose solid angle is to be measured then the solid angle should be 4π/6. Consider a disk of radius R one unit from the origin. The solid angle should be 2π(1-cos(θ)) where θ is atan(R).
For a bounded longitude and latitude rectangle the solid angle is
given by (sin(φ |