|
|
|
|
|
by azakai
5304 days ago
|
|
That can be true, but based on my experience in the game industry it isn't necessarily the case. Often a game will be GPU-bound, in which case the JS, Flash and NaCl versions will all have the same bottleneck, GPU shaders (in fact for this reason more and more is done in scripting languages in game engines these days). If that is the case, you might as well use JS, since it will run in many more places than Flash or NaCl. But again, there are situations where you are CPU bound, and in that case CPU speed does matter - you are very correct in those cases. Currently JS is indeed at a disadvantage compared to NaCl in that area, however, I believe that it will match it in time (through a combination of API additions like Intel's RiverTrail, and further improvements to JS engines like static analysis). The real question is then, will NaCl fix its problems (portability, adoption in browsers other than Chrome) before JS fixes its problem (speed). My bet is on JS. |
|
There is, to some extent; hardware acceleration for canvas. But I don't expect that to be at all comparable to native OpenGL for awhile yet. JS has certainly had some significant advances in speed over the last few years, but there's only so much optimization you can do. It's still running in a VM, so there will always be that overhead.
Another important thing to consider is that the native API will always have to exist before a Javascript abstraction can. Many triple-a titles will use brand new GPU features to sell the newest line of graphics cards. That won't work if they are making a browser game and the required interface to do those things doesn't exist yet. Javascript will always be chasing the tail of native.