Replaced flatTextureID calculation with bitshifting ops.