Oh, sure I don't mind giving up some hints...
For the sun size, I calculate it using (mainly) those three VB.Net lines :
DistanceFactor = GetVectorLength(SubVectors(GetNormalizedVector(mSunPosition), PlayerCamera.CamLookAt))
FlareSize = (Math.Max(0.25! - DistanceFactor, 0)) * 5
RelativeSize = ViewportSize * FlareSize + ViewportSize / 10
The first one gets a "distance factor", a number for some reason between -1.5 and 1.5, which represents how big is the angle between you and the sun. The cam LookAt vector can be obtained easily; it's the 3rd row of the camera's rotation matrix.
The second calculates a size based on that angle. I use Max so that the sun only "grows" when you look in a very tight angle (0.25 vector length).
The third takes the size and makes it compatible with all viewport sizes. I use "(Width + Height) / 2" for the ViewportSize var. The "+ ViewportSize / 10)" gives the standard size; when isn't all shiny and big.
The sprit is then drawn using additive blending, on the 3d-to-2d position of the sun object.
All the rays basically use this technique at different sizes, except for the rays which get rotated when the VectorLength changes...
