nestoras
Joking aside, it didn't start as a fully-fledged UI. Some scrolling text strings to show a message log first, the ability to move them out of the way later, then implementing a proper window container for them, then introducing the concept of a 'widget', then getting really excited and thinking about a layout system to be able to present multiple widgets per window... that's the way it usually goes :) The GUI turned out a lot more demanding than the terrain engine itself, both in development time as well as rendering load.
In the end, it's all about learning!
The scaling in frame rate has to do with the amount of terrain patches that have to be displayed. You can see the same scaling by changing the frustum viewing angle (i.e. without resizing the browser window).
Thank you! :)
Q: OK, why not put them a bit lower than that, with some variety between peaks?
A: I already have. If you take a closer look, you will notice that there is another layer of flat surfaces, lower than the top.
Q: I'm not convinced. Why only two layers of 'flatness', one at the top, another a bit lower?
A: In the end, it's all about the dynamic range that you have to work with. When using a single byte, there are only 255 distinct height values. The key point is to understand that these values must not differ by much (i.e. they cannot be scaled by large values), since this will affect the appearance of the rest of the terrain (think very, very sharp, unnatural triangles everywhere). On the other hand, the scale factor must be large enough to allow for distinct terrain 'features', avoiding the appearance of a deflated terrain. Two layers of flatness, safely away from each other, was the best compromise.
Q: I'm still not convinced. Just vary the top layer by a small amount between peaks.
A: Using a small value wouldn't make much of a difference. If the amount was large enough, the distinction between the two 'flatness' layers would be lost and the terrain would lose that specific character that it currently has.
Going to two bytes per elevation (and thus be able to use a small scale factor) would allow me to keep the style intact (of some specific geological procedure that has formed the terrain), while varying the peaks and keep the rest of the terrain smooth.
I hope this made some sense. However you're right, it is noticeable! I just didn't think it detracts that much from the overall feel, while it still has advantages, so I went with it.
Doing the lighting and shadow generation in real-time (during tile initialization) is a very interesting problem! The great advantage is the bandwidth reduction and the ability to move the sun of course. A Web Worker can (probably should) be used for that purpose. The problem is that in order to correctly light a tile, you need access to its adjacent tiles as well (since peaks near the border on their side may be casting shadows on our tile).
All in all, very interesting and certainly doable!
For learning, you can try game development sites, graphics programming books, online Geomipmapping tutorials (for terrain stuff), forum discussions when facing problems... However, the most important thing is general programming experience, I guess.
I remember though that Learning WebGL (http://learningwebgl.com/blog/) was very useful when I began learning things specifically for the web!
1. As the demo stands, it doesn't really need a 3D engine. Including one (any one) wouldn't help with anything, except for maybe skipping some (miniscule) setup code. Surprising, but true. Things definitely change as soon as you wish to render a flying ship though.
2. Learning has been the main reason for this demo. There's no better way to learn than to take apart or build something from scratch. In fact, I've built a 3D engine as well during this time (not used in this demo at all), along with a 3D model viewer and an application I hope to turn into a start-up some day. If I've been developing a 3D game (for example), with the express purpose of releasing it as soon as possible, I'd certainly use Three.js!
And last but not least:
3. When I decided to get into web development, about one and a half years ago, I didn't know about Three.js! :) (I found out quite soon though)
Can't say for sure, because I didn't make it all in one go. The first time I opened the browser with the intent of developing for the web was a year and a half ago. During that time, I've built some other things as well (a 3D graphics engine, a CAD-like 3D model viewer to test the engine with and an application I'd like to turn into a start-up someday :)).
If I had to guess, I'd say that the terrain took me 3 to 4 months, the GUI a bit more than that, plus two more for really polishing the demo. Hard to say though, since everything was done in parallel, with even a few dead periods in-between.
A motocross would be slightly more difficult :)
http://www.anadelta.com/index-en.php?s=exported
You may recognize the sky :)
Thanks for the kind words!
The result is used for modulating the intensity of both the lens flares layer and the glare layer.
Nice article!
http://www.youtube.com/watch?v=zVSSxwXkPjE
This game was simply a masterpiece, in every way. For a 12 year old, it was an unbelievable experience. The graphics were amazing, the animation free-flowing and beautiful, the stage where the drama was unfolding an almost infinite, dark world and the music so much unlike anything else that my trusty Amstrad's little speaker has ever sounded. The whole game had an eerie atmosphere, like a dream. Even the gameplay had original elements: your dragon did not seem to have hit points or an energy bar. Instead, the faster its heart was beating, the closer it was to death. Yet, you never knew exactly how close. Just like real life, that was the point. Being Greek, even the name had an impressive, majestic quality to me: Thanatos (the dragon's name) means Death.
Thanatos managed to create a completely immersive experience (at least to a 12 year old) through graphics, animation, sound, story, atmosphere and gameplay elements.
I take extreme pride in my work and I am always aware of the clock ticking. Every. Second. A wise and accomplished person once said to me that in the end nothing remains but personal relationships. Take good care my friend, lest you lose in the process much more important things in life that you are now enjoying.