Check shadowTextureCount for material generation

The count returned by the scene manager is now used instead of a
hardcoded value of 5.
Render far away pages using composite map.