Hacker News new | past | comments | ask | show | jobs | submit login

OpenGL certainly is a 3D library, but WebGL is based on OpenGL ES (the ES part being important here) and basically just provides facilities to transfer data to/from the GPU and run vertex and pixel shaders.

It is completely up to the user whether the position data for the triangles is given in 2D coordinates from the start or in 3D coordinates and then transformed to 2D coordinates in the vertex shader.

The fact that it makes it fast to do the math for 3D, does not make it a 3D API.




my issue is more with the specific criteria the author uses being invalid. there is no special 2d functionality, e.g. aspect ratio correction or rotations. there is special 3d functionality, and contrary to the authors claim, you can just throw 3d data down the pipe and have it work. you just have a fixed, non-aspect-ratio-corrected view, the same as you get when you naively throw 2d data down the pipeline.

also, please don't confuse OpenGL circa 1999 with modern OpenGL. the features removed in ES were considered bad practice 10-15 years ago... i do disagree with removing default shaders (our beautiful flexibility is now relegated to mere boilerplate) but i'm sure the OpenGL ARB had a good reason behind that choice (reducing driver responsibility, reducing points of failure etc.).

also, what is never up to the user is the perspective divide. if a naive user is not aware of this particular, very 3D specific gem, of the hardware/API then he will end up with subtle bugs and maybe even struggle to fix them due to the incomplete knowledge...

its got nothing to do with performance.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: