Using Blender to make cube maps - Senscape/Dagon GitHub Wiki
Blender is a popular open-source and free 3D modeling and animation program with professional results. We must assume here that the reader is already familiar with using Blender.
Setup the Blender Render Panel
- Enter a resolution in the Render Panel and ensure the aspect ratio is set equal. (100:100)
Setup a camera
-
For Blender, the 'ground' will typically default +Z axis for up and +Y axis for 'north'. This is a safe assumption unless your model is strange or you need an atypical (tilted) view. The following settings are for this normal view orientation.
-
Set the camera's 'Lens' to 'perspective' and Field of View to 90 degrees exactly.
-
Put the camera's location at the center of wherever the viewpoint will be in the modeling environment.
-
There are six images for each cube face.
The camera rotation values that correspond to each cube face are: (x,y,z values in degrees)
North: 90,0,0 East: 90,0,-90 South: 90,0,-180 West: 90,0,90 Up: 180,0,0 Down: 0,0,0
-
Set the camera to each rotation and render the image, then save each image, using a 4-digit suffix to indicate which face has been rendered. image0001 = N, image0002 = E, etc in the same order as describe above. These image files can be imported into the game code directly, or compressed into a special .tex file using the provided KSconvert tool. This .tex file has extra compression for smaller size and faster loading. It also conveniently combines all the cube face images into one file for simpler file management. However, it is 'lossy' compression and your images will lose some detail. The types of images you are creating will determine whether this is important or not.
-
A more automated alternative is to use the animation feature of Blender. In the Render panel of Blender, set the output path to the desired folder and file-name, but append a '####' into the file-name, ie 'filename####.ext'. This will cause the animation frame number to be added into the file-name. (ie file-name of "image_####.png" will generate image_0001.png, image_0002.png, etc.)
You must also animate the camera correctly. In frame 1, key the camera to rotation-only using the North settings, frame 2, the East settings, etc.
Set the animation curve for the camera to 'constant' interpolation. (Graph Editor->Keys->Interpolation Mode..)
Set the animation range in the Render Panel from 1 to 6.
Then just click 'animate' and all six cube faces will be rendered while you sleep and be automatically ready for direct import to the game. (or packing using the ksconvert tool)
-
Just in...A Blender Addon for making cube-maps: Make Dagon Nodes