Optimus now changes texture based on distance.

The Resource manager is created with just enough memory to keep the model and two textures which forces the resource manager to release resources when we change between the three textures.

The resource manager had a deadlock which has been fixed so it can now release unused resources.