Re: [webgl-dev-list] Solid wireframe in WebGL

1,290 views
Skip to first unread message

Daniel Koch

unread,
Jan 22, 2013, 6:32:55 PM1/22/13
to webgl-d...@googlegroups.com

On 2013-01-22, at 10:43 AM, Alberto La Rocca wrote:

On Monday, January 21, 2013 10:02:57 AM UTC+1, Florian Bösch wrote:
WebGL does not have a lines drawing mode. However you can use standard derivatives and a specially prepared vertex attribute to draw a solid wireframe, see my blog post about it on: http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/


Thank you, great article! I had considered the idea of discarding fragments too far from the edge of a triangle but not using fwidth to make line width constant.

I can see fwidth simply computes abs(dFdx(x) + dFdy(x))
How standard are dFdx and dFdy? Can one use them in case fwidth is not available?

dFdx, dFdy and fwidth all come from the same extension - OES_standard_derivatives, so you won't find one without the others.

As for popularity -- see http://webglstats.com

Daniel
Reply all
Reply to author
Forward
0 new messages