Cubemap Generator

Author: Will Traxler

These two brief scripts will allow you to take the output from a camera and convert it into a cubemap which can be used to present reflections etc. The reflections are not realtime. This is based on reference examples provided by Unity.

The two scripts are used as follows:


 * Cubemapper.cs - Attaches to an empty gameobject. Responsible for generating the cubemap. Requires a camera which serves as the source for the cubemap and also an integer cubemap resolution (ie 128,256,512 etc).


 * CubemapperUtil.cs - Attaches to an object containing the material which will receive the cubemap. Takes a cubemapper object (see above) input which supplies the cubemap texture.  This arrangement is slightly complicated but allows the cubemap to be generated only once and shared to many objects.

CubemapperUtil also takes an array of keywords which are used to seek out materials containing these keywords, and submit the cubemap as input. For example, submit the shader keyword '_Cubemap' and any shader containing this keyword will have the cubemap set.