Port gridtexture to GLSL 1.3 and 1.0ES (untested)