Procedural Night Sky

Nov 7, 2016·
Ben Ahlbrand
Ben Ahlbrand
· 1 min read
Image credit: Unsplash

I generated a procedural night sky w/transparent quads w/a radial fall off in my c++ rendering framework.

The algorithm is pretty simple and goes something like:

// the trick is to sample an interesting distribution ;)
pts = sampleRange(xMagnitude, yMagnitude, zMagnitude, numStars)
render(pts)
captureSkybox()

// typical main loop here
while (true) {
    drawSkybox()
    drawScene()
    ...
}