News for hackers. Stuff that matters.
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by realusername on Friday August 29, 2014 @03:54PM (#8244228)
I don't want to spoil their great "innovation patent" but Three.js has implemented this years ago (http://threejs.org/docs/#Reference/Renderers/CanvasRenderer).
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by mbrubeck on Friday August 29, 2014 @05:33PM (#8244616)
Does that reconstruct quads as the Zynga post described? From the source code, it seems to just draw the triangles individually:

https://github.com/mrdoob/three.js/blob/1769fbfc6c994b51a54c...

I also don't see any heuristic processing of shaders as described for ZyGL.

Re:Zynga’s first foray into WebGL, and how it runs on IE10 by razh on Friday August 29, 2014 @06:01PM (#8244707)
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by mbrubeck on Friday August 29, 2014 @06:06PM (#8244724)
Even before that change, I don't see any code that automatically reconstructs construct quads from pairs of triangles. But maybe I'm missing something?
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by lunixbochs on Friday August 29, 2014 @11:19PM (#8245518)
(I've been working on OpenGL platform translation for years)

Reconstructing quads from pairs of triangles is just about doable in a one-liner. The harder part in my opinion is applying texture mapping to the resulting triangle, but it's not unreasonably difficult.

    // this depends on your winding
    triangles = [1, 2, 4, 2, 3, 4]
    quads = []
    for i in xrange(len(triangles), 6):
        t = triangles[i:i+6]
        quads += [t[0], t[1], t[4], t[2]]
The only things I think are interesting here are their heuristics on shaders to apply color maps, and the fact they shipped a game with it.
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by razh on Friday August 29, 2014 @06:24PM (#8244779)
No, you're right, there's no quad reconstruction. I imagine you could have just used quads in both the WebGL and Canvas renderers to achieve a similar effect.
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by robterrell on Friday August 29, 2014 @07:04PM (#8244927)
I don't know what exactly is being patented. As I read it, the novel part is this:

So, what about that arbitrary shader code? In practice, the shaders used in 2D games tend to be fairly simple. ZyGL applies a series of heuristics to the shader code to try to infer its intent. It then uses these heuristics to map the draw calls through to some approximations of common shader code that we wrote in JavaScript.

I'm not aware of any prior art that is (a) a polyfill for WebGL using canvas that also (b) reconstructs triangle strips into canvas quads and (c) attempts to mimic shader effects by scanning the shader code for common techniques.

Re:Zynga’s first foray into WebGL, and how it runs on IE10 by lunixbochs on Friday August 29, 2014 @11:10PM (#8245490)
This is the first time someone's announced a patent for a space I'm in. I have no idea what implications this has for me, but I may have some prior art on "software rasterization of OpenGL code that only uses it for 2D", including quad recovery.
Re:Zynga’s first foray into WebGL, and how it runs on IE10 by nacs on Friday August 29, 2014 @06:20PM (#8244764)
Pixi.js ( http://www.pixijs.com ) supports WebGL with an automatic canvas fallback as well (and is also used as the renderer by Javascript game frameworks like Phaser.io and Panda.js).