During the last month, I didn’t have much time to work on Ascent, mainly because of an awesome three week vacation in Italy. But there’s one tiny update I made that I find pretty important: moving from particles as scene “background” to a skybox.
Although the change is minimal regarding LOC, it has major impact on the game itself: it looks more awesome. And as we know, looking awesome is a key factor to gain people’s interest in something. Say, you build a new car – no matter how brilliant the technical details are, if it doesn’t look awesome it won’t attract people. And the Ascent project depends on input from the community – it’s a hobby project, and I can’t work on it full time. Also, I simply lack many skills needed to make this project something people enjoy. Another benefit is that it makes it easier to not get lost, in a space environment you need reference points to know your way around.
But, enough of this, let’s get into the code! This is the new function added to the scene utils:
As you can see, nothing spectacular going on here, the process is pretty straight-forward. Three.js offers everything you need to create a skybox (a skybox is just a large cube mesh with textures on each side that blend into each other). There’s
THREE.ImageUtils.loadTextureCube() that will get the six images, and there’s a shader in the shader library that you can use. Really easy!
However, I noticed a huge performance impact – I used a large skybox for RavenJS, which was built using GLGE and didn’t seem to get a performance penalty there. I still have to find out what can be done about that. Also, the images need to be accounted for when determining when loading is finished. Right now, the loading screen disappears before all images are loaded, as it is only waiting for the models to be there.
You can check out the Ascent source code here: https://github.com/jensarps/Ascent
Directly try it out in your browser: https://jensarps.github.com/Ascent/