4 ms·
Definitely not. The performance is pathetic, the feature set is pretty basic. WebGL is where compiled 3d apps/games were, like, 20 years ago. Yes, I know it wi
by hastur 15y ago
Definitely not. The performance is pathetic, the feature set is pretty basic.
WebGL is where compiled 3d apps/games were, like, 20 years ago. Yes, I know it will improve, but so will compiled products. The sheer fact that WebGL is interpreted and is a poor-man's subset of OpenGL, puts it at permanent disadvantage.
Of course, you could have some trick allowing for compiled graphics code to be run within the browser, analogous to the Chrome Native Client, and with all the DirectX/OpenGL features. But that's no longer WebGL, that's just a smart trick to run old-school code within the confines of a browser environment. You might just as well write a stand-alone app.
- irrlichthn 15y ago20 years ago? That was the time of Wolfenstein 3D. :) Much more thant that is possible with WebGL... Take a look at some of those demos available. (example: http://www.ambiera.com/copperlicht/demos.html http://www.ambiera.com/copperlicht/demos.html) You can always workaround that performance problem. No need to program some CPU cylcle swallowing AI for now.
- hastur 15y agoWell, maybe 20 years was too far of a shot. But I assume you're associated with the Irrlicht game engine, so I assume that when you write "is WebGL the future?", you don't mean "will it be useful at all?" or "will some silly casual games be possible in WebGL?", but whether it will be a legitimate gaming platform, capable of competing with desktop gaming (which is where Irrlicht competence lays, afaik). And to that I say firmly: no. I like the demos you've linked to (and I've seen them before), no doubt they're quite impressive, considering the constraints of the browser environment. But when I put them in context of what one could run on a computer natively, these demos remind me of Quake I. Sorry.
- hastur 15y agoAnd BTW, I really hate to put you down like this. I have dreams of my own of one day writing an MMO game, that would mostly be handled by a server and the client would run in a browser. Perhaps the clue is not BF3-level graphics, but something "decent" on the graphical side and a really cool world and mechanics within the game. I'm just a little frustrated at how inefficient all this web stuff still is. Imagine even your own demos - rather simple graphics by native standards - but with much larger world and many more characters. It would grind to a halt even on a mid-range PC, not to mention an iPad or a cheap laptop. Still, I really wish that you create a plug-and-play graphics engine for web game developers, that would allow people like me to fulfill their fantasies. :) Wish you all the best!
- nextparadigms 15y agoI think Native Client is pretty impressive if you want to make a browser-game. Bastion looks pretty good: https://chrome.google.com/webstore/detail/oohphhdkahjlioohbalmicpokoefkgid https://chrome.google.com/webstore/detail/oohphhdkahjlioohba...
- kevingadd 15y agoWebGL is interpreted? What do you mean? Modern JavaScript runtimes are DEFINITELY not interpreted, and the idea of an interpreted graphics API or GPU is nonsense.
- hastur 15y agoLOL, what is JavaScript then, if not interpreted? I'm not going to get into a semantic argument, perhaps to you Java is not interpreted either, but to me anything that doesn't compile to a binary directly executable on the CPU is substandard in terms of performance. And I'm sorry to surprise you, but in 3d graphics we're still starved for processor cycles, otherwise we'd have ray-traced, globally illuminated games with huge environments to play with.
- fridek 15y agoIt's JIT compiled and WebGL shaders are compiled as well. It is a native code executable on CPU, read how Crankshaft in V8 works. It's true that JS is at the moment N times slower than C++ (N in range 1 to 10). It's not true that you need to use JS that much to have great graphics. Everything you pointed out is done on GPU afaik. And if you wait a year or so, JIT + type inference will make JS basically as fast as C++.
- hastur 15y agoWell, I'm not that familiar with the internals of JS engines, perhaps some browsers are capable of partial compilation. On the other hand, this is a dynamic language (as in: data types and other pieces of code can change in run-time), with limited features, like data structures (wanna benchmark linked lists or kd-trees in C++ vs JS? I doubt N=10 is skeptic enough). I'm not sure if I write path-finding or collision detection or line-triangle intersection with their respective data structures in JS, it will turn out anywhere in the ballpark of real compiled code. (And this is pretty elementary stuff in 3d games.)
- fridek 15y ago
- gacek 15y agoWebGL is not a poor-man's subset of OpenGL, its the same subset that is supported by most mobile devices (OpenGL ES2.0). What are you missing? Quads? 3D textures? NURBS? And yes, we know that JS is interpreted and that it's no use for building anything more than a clock on your webpage, right?
- hastur 15y agoCould you write (graphically) Battlefield 3 in WebGL, assuming you'd be able to compile it to run efficiently? As for your second question, JS is very useful, I love JS, I write 90% of my code in JS. But we're talking sophisticated 3d apps here, not whether it's useful at all.
- fridek 15y agoYes you can. Have you seen Team Fortress 2 in WebGL? http://www.youtube.com/watch?v=DQrC5YLKFUY http://www.youtube.com/watch?v=DQrC5YLKFUY http://www.youtube.com/watch?v=Lmvj6-CFbbA http://www.youtube.com/watch?v=Lmvj6-CFbbA JS is not very pleasant to code with, so writing an actual game logic could be a bit painful, but so is development for PS3 and it's done somehow. It's not a question of performance, rather about workflow and structures provided by language.
- ehsanu1 15y agoJS has gotchas and some really bad parts, but if you know the language well and know what you're doing, I think it's quite pleasant actually for many problems. Have you done much programming with JS, and if so, what was so unpleasant about it? Though, I think I've heard pretty much all the complaints against JavaScript, many of which are addressed by using something like CoffeeScript.
- fridek 15y agoI'm using Google Closure to get rid of the bad parts, but still it's not very good. I did some testing with game AI, graphics and so on - JS is far from perfect for such things. Maybe it's a lack of tools, maybe of some features I was used to in C++ or maybe it's that all the books and tutorials are targeted for C++. It doesn't really matter, browser games are the future and no matter how complicated it's going to be, somebody will be good enough to write them. We already passed "demo era" and some games are really good, like https://chrome.google.com/webstore/detail/bhoaojooagiaaiidlnfhkkafjpbbnnno https://chrome.google.com/webstore/detail/bhoaojooagiaaiidln...
- exDM69 15y ago>> WebGL is where compiled 3d apps/games were, like, 20 years ago. 20 years is a bit of exaggeration. Doom 1 was released 20 years ago. Feature-wise WebGL/GLES2 matches a desktop GPU circa 2004 or so. Doom 3-ish feature set. Performance wise it's a bit behind, but this varies so much from device to device that it makes no sense to take this into a discussion when we're talking about API standards and their features.