The vast majority of what you think are modern 2D games are not 2D. They are rendered in a 3D environment with a fixed camera perspective using 3D textured polygons (again, not sprites); not because it's easier to do it that way but because it's much, much faster. The rest of them use non-hardware accelerated java or non-hardware accelerated flash. Which use sprites. Which use the CPU.
So, because hardware-accelerated 2D games use some GPU tricks that involve them being rendered in the same manner as 3D graphics, that makes them suddenly 3D? All it is is a different architecture for doing exactly the same thing. Because a shader and a textured quad get involved, suddenly it's 3D?
WebGL is not the only hardware acceleration tech making its way into browsers, canvas is also getting hardware acceleration. IE9 and chrome both use hardware accelerated canvas, from what I understand.
What exactly is the point you're trying to make? You started out arguing that hardware accelerated javascript does not exist. I don't see anybody trying to make the argument that it does.
It seems that javascript is one of the things that is fully output with software only. If there was hardware acceleration then it would be blazing fast.
This comment was probably not talking about hardware-accelerating javascript, it was talking about the output that javascript controls: when the script says "draw this image here," does the CPU set each pixel or does the GPU?
I misread the original comment by tgc1. But then ZorbaTHut came in with implications that more than just <canvas>, <video> and CSS is accelerated. I really should just stop replying to him.
There are also other commenters that chrome's hardware acceleration is responsible for differences in drawing speed for the Christmas tree and I was mixing up posts. That's really what made me lose it in the first place.
So what exactly is the difference between a 2D game and a game "rendered in a 3D environment with a fixed camera perspective using 3D textured polygons"?
If it looks like a duck and quacks like a duck, it's a duck. I'd call that a 2D game.
At this point, I suspect you're just being deliberately dense, but to help other redditors who might be confused:
It's a 3D game if it uses 3D rendering APIs such as Direct3D (a part of DirectX) or OpenGL and the accelerated 3D rendering pathways in the GPU for its rendering engine.
Real 2D games usually are stuff like solitaire and Linux games that use GTK and QT.
A game's "3dness" or "2dness" doesn't depend on the rendering pathways involved. By that definition, no game on any modern console system can be 2d, since they literally don't have those layers.
Are you implying that an implementation of GTK or QT that used 3d hardware - like, say, Compiz on Linux, which GTK and QT can render under - magically turns 2d games into 3d games? What about the OSX Quartz Compositor? Is that a "3d window manager" because it uses 3d hardware? Is Windows 7 a 3d operating system?
This definition is useless to the point of inanity. The only possible reasonable definition of "2d" vs "3d" is whether the game makes use of effects and gameplay techniques that are generally considered 3d. Super Meat Boy is a 2d game because it uses 2d graphics techniques to provide a 2d game experience. The fact that it uses 3d hardware for special effects and rendering is irrelevant.
Are you seriously going to claim that this is a 3d game?
Agreed. The definition proposed by ascendant512 shows a profound misunderstanding of the difference between what something is and how it was made. His definition is like saying "it isn't bread because you didn't make it with a bread-maker."
The difference between 2D and 3D is in the perspective and how the depth dimension is used. In 2D the perspective is orthogonal and the depth is used as a way of ordering drawing without having to do it yourself (lazyness!). In 3D the perspective is, well, perspective and the depth is used (equally with the other two dimensions) to reshape objects based on distance and angle.
So much of javascript is un-accelerate-able that just fringe uses like this aren't really worth the effort of splitting up the parts of it that could be.
For something like this, <canvas> or even CSS would work much better, they're designed for handling images and for moving them around. And guess what? They are already hardware accelerated.
Javascript is just not designed to be used for this.
0
u/ascendant512 Dec 21 '10
The vast majority of what you think are modern 2D games are not 2D. They are rendered in a 3D environment with a fixed camera perspective using 3D textured polygons (again, not sprites); not because it's easier to do it that way but because it's much, much faster. The rest of them use non-hardware accelerated java or non-hardware accelerated flash. Which use sprites. Which use the CPU.
You are wrong, go away.