This might overflow. There's a better way to double the texture coordinates - just double the factors in the rescale array in ShaderManager.cpp .