xeolabs/scenejs — Issue #151: Default to mediump precision in shaders
Author: xeolabs
Created: 2011-12-01 23:33:50+00:00
State: open

From Giles:

WebGL is increasingly being supported on mobile devices. Firefox on my Android phone (a Samsung Galaxy S II) quite happily displays all of my tutorials, and many other WebGL sites as well. But not all mobile devices are equal; some quite popular ones apparently don’t support highp precision in fragment shaders.

The WebGL spec says that all implementations must support at least mediump, so it looks like that’s the most sensible precision to use as a default for most WebGL sites. I’ve changed the lessons here so that they use it. I also took the opportunity to get rid of some compatibility cruft that dated from the early days of WebGL: the #ifdef GL_ES that surrounded the precision qualifiers.