Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> WebGL is cool, but [..] the kind of graphics performance a developer can get by writing straight OpenGL (taking advantage of sophisticated shader models on more recent devices) is astonishing

Why can't you get the same performance with WebGL shaders? Yes, WebGL GLSL adds some security checks, but apparently they only add about 5%. The article here seems to assume there is a huge difference - I'd be curious to know what that is based on.

Is it new shader models not present in WebGL GLSL? If so, specific examples would be appreciated.

edit: expand the question



In current implementations, the shaders running through WebGL are identical to those that are not (outside of ES vs desktop changes). However, there are a couple problems:

1) There's definite overhead on the API itself, e.g. the slow shader compilation times due to the verification, translation, etc. That'll get better over time, but it'll never match the desktop; I personally think a caching approach will be a big win here, but no one has done it yet.

2) You don't have geometry shaders, hardware tessellation, hardware instancing, and a number of other features you get on the desktop with modern hardware. You also don't get the ability to render to multiple targets at once (critical for performant deferred shading).

3) There's significant 'extension lag' as it isn't as simple as just implementing an extension on one chip and coding for that; it has to hit a certain level of penetration before it'll be ratified for inclusion in WebGL, then it has to be made safe and implemented.

Those are the core things holding WebGL performance back (IMO), excluding other browser bits that may get in the way, which aren't relevant to this discussion directly. A lot of this will go away over time, but I honestly have no idea how any of that will happen.

(Disclaimer: I work on graphics stuff for Mozilla, but don't work much on the WebGL side of things; mainly write demo code there)


I'm slightly amused by one Mozilla employee responding to a question posed by another Mozilla employee with a disclaimer that they work for Mozilla.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: