-
Notifications
You must be signed in to change notification settings - Fork 186
GLSL Gotchas
mattdesl edited this page Sep 13, 2013
·
11 revisions
Here are some gotchas to be aware of when working with GLSL on various platforms.
- Array declaration is broken on Snow Leopard (1)
- Specify precision where possible. Low precision is useful for colors (0.0 - 1.0). More info here.
- Be mindful of
step()
as it may create branching (although it really shouldn't). Benchmark withsmoothstep()
to see if performance improves. - 'For' loops may cause problems on certain Android devices (1)
- On WebGL, you don't need
#ifdef GL_ES
as it will always return true - Many more optimizations listed here