Live data from Hacker News

WebGL Terrain Flyover Demo

zephyrosanemos.com

51–60 of 121 posts

Re: WebGL Terrain Flyover Demo

#51

Amazing. How long did this project take you?

Thank you!

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.

Re: WebGL Terrain Flyover Demo

#53
FYI, directly working with WebGL code is painful just because of the amount of basic infrastructure that has to be built before anything can be done. I strongly suggest using an existing framework like three.js as a starting point and going from there. Three.js is complete enough that a basic scene can be created quickly and extensible enough that complex scenes and shading can be created by extending it with custom objects.

For example, I was working on creating a WebGL setup for playing around with the Oculus Rift and used three.js to create http://sxp.me/rift/. It's mostly three.js code, but I added a custom camera object which handles the offscreen rendering and distortion required for the Rift. It was much faster and easier than starting from scratch which was what I originally did before giving up.

Re: WebGL Terrain Flyover Demo

#55
post #6

Looks nice but runs at awfully slow 4-5 fps on my Ubuntu 64bit system. Is Radeon HD 4200 to weak for WebGL or is there something you need to configure?

Runs well on my machine (32-bit Ubuntu, NVidia drivers, Firefox). You shouldn't need to configure anything for it to be fast in general (if it's blacklisted, it won't run at all), but non-NVidia drivers on Linux can be slower in some cases. Do other WebGL demos run ok for you?

Re: WebGL Terrain Flyover Demo

#56
post #53

FYI, directly working with WebGL code is painful just because of the amount of basic infrastructure that has to be built before anything can be done. I strongly suggest using an existing framework like three.js as a starting point and going from there. Three.js is complete enough that a basic scene can be created quickly and extensible enough that complex scenes and shading can be created by extending it with custom…

I agree! Three.js is excellent and already a de facto standard for developing in 3D. However, some points:

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)

Re: WebGL Terrain Flyover Demo

#57

Chrome Beta for Android gets 3fps. Firefox Beta for Android crashes. Just FYI. edit: 60.1 FPS at 2560x1440 on my desktop (KDE/KWin/Chrome Dev)

Thank you! Quite frankly, I'm surprised the demo even runs (I don't have a smartphone currently). On what device did you test it?

Re: WebGL Terrain Flyover Demo

#58

Chrome Beta for Android gets 3fps. Firefox Beta for Android crashes. Just FYI. edit: 60.1 FPS at 2560x1440 on my desktop (KDE/KWin/Chrome Dev)

Thank you! Quite frankly, I'm surprised the demo even runs (I don't have a smartphone currently). On what device did you test it?

Galaxy Nexus CDMA CM10.1

Re: WebGL Terrain Flyover Demo

#60
post #6

Looks nice but runs at awfully slow 4-5 fps on my Ubuntu 64bit system. Is Radeon HD 4200 to weak for WebGL or is there something you need to configure?

Gentoo 64-bit here, Radeon HD 4350 and managed to get 20-30 fps depending. (git versions of Mesa, libdrm, xf86-video-ati, and a recent kernel, all of which are probably required to get best HW rendering, unfortunately).
Post reply on HN