Live data from Hacker News

Zynga’s first foray into WebGL, and how it runs on IE10

code.zynga.com

31–34 of 34 posts

Re: Zynga’s first foray into WebGL, and how it runs on IE10

#32

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 ).

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 a…

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

#33
post #23

Earlier quoted context omitted.

three.js removed support for quads to reduce renderer complexity. https://github.com/mrdoob/three.js/blob/master/src/core/Face... https://github.com/mrdoob/three.js/blob/88092284cbe07723fe2b... And the relevant issue: https://github.com/mrdoob/three.js/issues/3663

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?

(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

#34
post #2

Ugh: 'we developed a patent-pending solution called “ZyGL”.' While there are a bunch of people working to make stuff performant on browsers, Zynga comes in from behind and starts patenting barely-novel stuff on top of it.

Hopefully they will be able to extend and extinguish as well, so that the so called "open web" (that is actually pretty much closed to different languages and technologies, unless you are willing to use crap-trans-pilation crutch like Emscripten) or at least WebGL will die as it should. All the best to Zynga!

Unfortunately, a successful patent here could block my non-web work in this area :(
Post reply on HN