For my final project I created a fancy renderer for an n-body simulator I wrote a few years ago. The two main features this project showcases are the shadows cast by the planets, and the bloom lighting effect present around bright objects.
The "Shadows" in this project are merely an object with transparency that is drawn into the world behind each gravity object except for the sun. They are scaled based on the object that they are attached to, and I do some vector math so that they always point directly away from the sun, and so that they are always perpendicular to the camera.
The bloom effect (the way bright lights cause light to spread beyond the border of the object) is achieved by first rendering the entire scene onto a texture, then drawing that texture onto the screen with a special shader that adds the bloom lighting effect. I could not figure out how to enable true HDR (high dynamic range) (HDR allows colors with values over 1.0) for this texture, so I use a hacky workaround. The color of everything sent to the texture is divided by 2, and the final rendering stage that applies the bloom multiplies all colors by 2, and spreads out any color greater than 0.5 (or so, some funny math is involved to make it look a little smoother).
The only library I used for this project is LWJGL, which provides a barebones wrapper for OpenGL and some user input / display setup code.
© 2015, by Jono Chadwell. All rights reserved. | Template by TEMPLATED.