All About Cube maps - Senscape/Dagon GitHub Wiki
[top]
Each 'node' in Dagon represents a view in the game. The view can be either a single view (sometimes called a 'zoom'), or a full panorama the user can interactively pan around using the mouse.
A panoramic image (or set of images) assumes the viewer is at a particular location. Their view can be represented by a cube with the viewer in the center. Each face of the cube holds a particular image representing that direction.
Making cube-maps
First a scene is setup in some kind of modeling program. Unlike normal renders, a panoramic render requires a scene to be modeled in all directions as if it were a real place, not just a stage. Then the camera is rotated in six different directions and an image rendered for each direction. Those six images are then used by a panoramic player (Dagon in this instance but many VR players can use cube-maps) where the images are pasted together into one big panoramic backdrop and displayed in a way that allows the person to change what direction they are looking at.
The biggest 'gotcha' with cube-maps...seams!
What to do if you see seams within your panoramic player.
-
Be very careful applying post-render effects to individual cube-face images. Any process that affects an area and not just a single pixel (ie glare, glow, blur, DOF) will probably fail because at the border of the image the effect should spill over onto another cube-face. Note that an effect done on one image to create a special effect (ie adding glare to a lantern) is ok if the effect is contained away from any of the edges. Sometimes only testing will tell...
-
A perfect rule of thumb to know whether a post-render effect is safe: "Is it possible to apply the effect on exactly one pixel without affecting any other pixels?" If yes, you are good, use it without worries. Examples include changing color, gamma, saturation, brightness, speckle-noise. Just remember to apply the exact same process to all 6 images.
-
Certain kinds of 'global' lighting can cause seam problems. 'Global' lighting describes lighting methods in renderers that simulate the light bouncing around between objects, the sky, etc. It depends on the specific software and settings but sometimes the lighting calculations may depend on the direction of the camera, and since a cube-map has 6 different directions....
-
The use of bump-maps can cause issues in some software. Bump maps have less control than full Normal maps and may arbitrarily 'flip' the bump direction depending on the camera direction. If your cube face images have seams where a pattern in your image seems to invert along the seam, that is likely a bump-map problem.
Cube-map size
Because cube-faces are square, so must the render. Although many resolutions are supported in Dagon, it is generally safer to stick with image sizes that are a power of 2. Typical resolutions are:
-
1024 ..this will be adequate for lower image quality (a 'retro' look) but will run faster and be smaller for older computers.
-
2048 ..suitable for HD quality, although it may run slower on older machines and files are much bigger. This is the default choice for most.
-
4096 ..Super-high image quality, will load even slower and only an option if a 'power-gamer' mode is desired for players with powerful computers.
Scene layout tips for cube-maps
Working on a scene in a 3D editing package and seeing the rendered result in Dagon can sometimes contrast quite a bit. Typically, objects can appear closer and scenes smaller than expected. The is related to the Field Of View (FOV) that Dagon uses (default FOV setting is 55). As a result, much time can be wasted rearranging and re-rendering high-poly scenes so they appear as intended when viewed in Dagon.
Here are a few tips to help with scene layout:
- Roughly block out scenes using simple low-poly 3D shapes to represent various objects, doorways, rooms, etc.
- Don't use (or temporarily turn off) any processor-heavy render settings (subdivisions, anti-aliasing, reflections, transparency, etc.).
- Objects can now be re-arranged and cube-map images re-rendered very quickly to suit the desired Dagon FOV.
- Spaces between nodes may also need to be adjusted. It may even mean removing nodes altogether or adding additional ones.
- Once satisfied with how the simplified view looks when running in Dagon, replace the low-poly proxy shapes with high-poly versions and turn on the processor-intensive render settings again for the final renders.
In the long run, these few extra steps will save substantial time consuming re-rendering of high-poly graphics to get layouts 'just right'.
Another benefit of doing simplified versions of scenes is that the process can also be great for rapid prototyping your game. It will allow issues to be identified much sooner that are related to oversights with node navigation, puzzles, story plotting, etc. If you can identify these sooner (in simple form) than it means a lot less effort later in the development process when issues tend to be more hassle to rectify.