Workaround GLSL function for using 3D textures in WebGL