index textures starting at 0 again. cache some variables