judnich / Kosmos

A virtual 3D universe in your web browser.
BSD 2-Clause "Simplified" License
174 stars 33 forks source link

Feature: Atmosphere #2

Open fjcaetano opened 11 years ago

fjcaetano commented 11 years ago

Hi judnich,

First of all, congratulations. This is amazing and utterly beautiful. Great job! It reminds me of Kerbal Space Program which is one of the most beautiful games I've ever played.

That said, have you ever thought of adding atmospheres to some planets? I saw that there are rocky surfaces (like the first body that resembles the Moon) and some different surfaces (like the purple planet). I think it would be very interesting if there was atmospheres to some of those different kinds of dirt, because it's the atmospheric gas wich gives "color" to a space body.

It's just an idea, and I don't even know if you're still developing this, but what you think?

judnich commented 11 years ago

Thanks! I completely agree and in fact had originally planned to implement realistic atmospheric scattering. Unfortunately though since I rewrote it in HTML5 fairly close to my school's project deadline at the time, I didn't have enough time to implement atmospheres in the web version.

It's definitely on my todo list, so it mainly comes down to how I can allocate my spare time projects. For example, I plan for the next version of Kosmos to be written in cross-platform native C++ (for better performance and reliability) -- so although I could add atmospheres to the web version of Kosmos, it might take away some development time from other such projects.

fjcaetano commented 11 years ago

Nice to hear that you'll keep improving it.

I understand your decision of rewriting it in C++, but it's sad that it has to be so. I think it would be awesome if it could be completely web, without any downloads or installations.

Anyways, congrats once again for the project. I'll keep myself updated.

judnich commented 11 years ago

I agree it's kind of sad to move away from a web implementation, because web apps are so much more easily accessible than full native apps. If both approaches yielded equal quality results, I'd definitely prefer web.

For a variety of reasons though specific to the complexity of some of the 3D algorithms, it just isn't possible right now to make a web implementation whose visual quality matches a native implementation. It is definitely possible to make something, but if it's only 50% the visual quality I could otherwise get out of a machine with native, web becomes a rather difficult choice to justify (in this very specific case).

This quality difference is both because native code is much faster at memory manipulation and math (very important for some rendering algorithms dealing with large worlds), and because of the many compatibility issues I encountered with WebGL (which aside from being a huge hassle to work around, require work-arounds that further slow down performance significantly vs native OpenGL). Performance is important because more performance allows more visual details within a given frame time deadline.

In the future it's possible that WebGL and JavaScript will catch up -- likely, even. Combined with the existence of tools that can compile C++ to JavaScript makes an encouraging outlook. So at least it's safe to say that if in the future WebGL does catch up, I should be able to port whatever I have to web fairly straightforwardly.