This section is under re-development. It is not finished, and not fully functional. The current
development stage is pre-alpha and as such, not every feature is even implemented yet.
Skyboxes!
I was growing tired of the OpenGL scene looking so...lifeless. Just a floating terrain with a red background. It was time to make it begin to feel like a game engine.
I declined to rush off in search of tutorials - the first idea was to get a huge cube surrounding the 'world bounds', and texture them with a skybox texture. So I did, and, the results were what feels like a giant wall with a texture, statically in place where you could walk up to it, as if its some backdrop in a movie set: Not good. Tutorial time. After a read around, I learnt that the skybox is actually tiny, and just wraps around the 'camera'. When the camera moves, so does the skybox, giving the feeling that it is infinitely far away: So, as the camera is moved, it passes its XYZ position to the skybox class, which updates the position of the skybox. Depth testing is disabled before the skybox is drawn, then enabled straight after - if we didnt do this, then all we would see is the skybox, and everything else would be hidden, as in reality, the skybox is infront of (mostly) everything else in the scene. |