welcome to linkAR technical documentation

next

previous

GENERATION OF CUBE MAPS IN 3DS MAX

INTRODUCTION

In this section we'll take a look at the process that we have to follow in order to generate a cube map from our scene, to later simulate reflections using the resulting images. This method is extensively used in games, as it provides a way to emulate reflections, without the high processing power that “real” dynamic reflections need, which is very convenient for mobile platforms.

The cube mapping is a 6 images set, each one corresponding to a cube's face, projected in a way in which if we insert a camera in the center of the cube and look around, it will look like if we are surrounded by the environment.

SETTING THE SCENE IN 3DS MAX

First of all, let's take a look at the scene we're going to use to generate our cube map. It has a floating island in the middle, surrounded by a sphere-like shape with mountains, sunset and sky 360º texture: Scene overlook Now we'll need a point from which we want to take the images, this would be the position where we'll place the reflective objects, or close to it. In this case, we know that we're going to add the objects over the floating island, so we'll create a camera, dummy or any object in that position: Creating a camera to define the view position to take the cube map images from Now, we create a new material. It won't be used, it's just for taking the needed images. Into this material, we'll add a Reflect/Refract map in any channel (diffuse for example). It would look something like this: Setting up the material for baking This type of map is there to simulate reflections and refractions. For doing it, it can use files previously rendered (the same as the Engine). Here we'll render them from the map itself. First we select the “From File” option, and then we pick the size we want for the images we'll generate: 512x512px is ok. Then we specify where to save the images, their name, and format. About the format, .jpeg will do it. For now, set any name, as we'll rename them later to fit in the Engine. Finally, click on “Pick an Object and Render Maps”, pick the Camera (or Object) you just created, and the images will be generated: Resulting images for the cube mapping Depending on your configuration, you may have the images oriented differently (specially top and bottom ones), so for the Engine to take them correctly you should be able to place them as they are in the image below. You may need to rotate some of the images to be able to place them in this distribution: Cube map images distribution After this, you should create a .cfg file for the reflection texture, including the name of your textures (by default it will look for the names in the distribution images above).

You can check materials documentation to see how to set up reflections in 3Ds Max.

next

previous