proper use max texture units
Merge pull request #398 from xoppa/new3dapi

proper use max texture units