Using Vue d'Esprit to make cube maps - Senscape/Dagon GitHub Wiki

<TITLE>CREATING CUBIC PANORAMAS FOR DAGON WITH VUE D'ESPRIT</TITLE>

This tutorial deals directly with setting up renders for use as nodes in Dagon, using Vue d'Esprit (I use Vue 9.0 Infinite). Your goal is to make a cubic panorama in six images - four sides plus a top and bottom - for each node in your scene. The basic principles used may apply to other programs such as Bryce and Blender. This is my way of working, not necessarily the only or best way, and I present it as such.


SCENE:
Build the 3D environment that you intend to use as the scene for your game. You can build directly in Vue or you can import a whole scene from another compatible program. Any program that can export a scene as 3DS or OBJ will work, but Vue has several import options depending upon the version that you use. You can check out the e-on website for more information on the available versions of Vue d'Esprit and the various import options.

Creation of the scene is not the focus of this tutorial, but there are a few things to keep on mind when building them. I'd suggest making at least a rough map, including all of your areas. This is to maintain consistency when moving from one scene to the next. I use the orthogonal top view as a guide for N/E/S/W (Dagon's 1,2,3,4) in every scene. Regardless of which direction you think of as "forward" when building your scene, north is always north in each environment. This makes it easier to prevent your player from moving out of one scene and facing an unintended direction in the next. Also, unless you intend a time change, the direction of the sunlight should be consistent. I also make a large rendering of the top view of each scene and print it out. On this rendering, I mark and number the location of each node in pencil or pen. This very helpful when it comes to adding the directional links in Dagon's LUA room files.

Be aware that the 45o FOV and 18mm lens setting as seen in Vue, makes objects appear to be progressively smaller and farther away as they near the center of the image. This is corrected when the cubic panorama is played back in Dagon. (I suspect this is a simple matter of the corners of the cube being farther away from the player's viewpoint than the center of each cube side.) So, items near the center of your image that appear to be far away in Vue, will actually appear to be much nearer when viewed in Dagon. Space will seem to be compressed. I always rely on the top orthogonal view and my "scale human" for judging the proper spacing of items in the scene and not the Camera View. You can change the perspective setting in Dagon, but I find that this causes distortion of the panorama.


SUN AND LIGHTS:
Select your sun and uncheck Point at camera so that your sunlight does not move with the camera. In the Atmosphere editor, uncheck flares for the sun and all other lights in the Effects tab. If left on, these will create seams in your cubic panorama. In general, avoid making your scene too dark. Agustin has suggested that, we try to avoid pure black (RGB 0,0,0) in the final renders, making 90% black (RGB 10,10,10) our darkest color. RENDER SETTINGS:
In the Render window, set the Aspect Ratio of your renders to Square (aspect ratio of 1:1). For size, I use Other 2048 x 2048, pixel units, and 72 DPI, but any factor of two, such as 512 x 512, 1024 x 1024, etc. can be used. Also in the render window, I choose Render to Screen with saving of the renders to disk every 15 minutes. You can save as TGAs, 24-bit PNGs or JPGs. I save in TGA format as it is said to be the fastest in DAGON. Plus, I save the alpha mask and z-depth images in case they are needed later.

You'll be converting these six images to a single TEX file later, so be sure to give a unique name to each of your nodes and to number them according to Dagon's conventions, using three zeros before the number for each side. [N = 1, E = 2, S = 3, W = 4, U = 5, and D = 6] Dagon expects files like this - nodename0001.tga, nodename0002.tga, etc., through nodename0006.tga. For instance, the cube sides for node #1 in a garden might be Garden1_0001.tga, Garden1_0002.tga, Garden1_0003.tga, Garden1_0004.tga, Garden1_0005.tga, and Garden1_0006.tga. Node #2 in the same scene would be Garden2_0001.tga, Garden2_0002.tga, Garden2_0003.tga, and so on. (I add _a to my alpha masks and _z to the depth maps, but don't yet know the conventions for these on Dagon.)


CAMERA:
Position your camera at whatever point in the scene that you plan to use as the viewpoint of your first node. I make a separate camera for each node in my scene and name and number it accordingly. Place the camera at the eye level of a human standing in your scene. If the camera is too low, when your player looks down he'll appear to be walking on his knees and when too high, he'll appear to be floating. [I use a simple elongated box that is textured in a black and white check pattern for my scale human and use "him" to set the height of my camera as the height of my ground changes.] To get the correct panoramic view per side, set the camera aperture (focal) to 18mm or 45o in the Aspects tab for your camera. The camera must be perfectly horizontal (pitch is set to 90o in the Numerics tab for the camera) when rendering the sides of the cube or else you'll get a distorted panorama. Make sure nothing is linked to your camera in the Animation tab. In the World Editor, double click your camera to bring up its properties window and check to make sure that you do not have auto-exposure enabled, which will create seams. [Natural film response seems to be okay though, at least I've never had a problem with it.] You have postwork options in this window, but I have never used them to see if they cause seams or not.

You'll probably want to rotate the camera a few times to check for composition and to determine where it's best to have each side of the cube "end". This way, you don't end up with half of a doorway or "gettable" item in one render and the other half in another. In the Orientation tab for the camera, set pitch to 90, yaw to 180, and roll to 0. This is "north" or Dagon's "1." From this point, rotate the camera by changing the yaw progressively from 180 to 90 to 0 to 270 to see the framing of your four cube sides. For Up, set the pitch to 0 and the yaw to 180. For Down, set the pitch and yaw both to 180. Roll is always at zero.

At this point, I make several test renders and then tweak lighting, textures, and item position as I see fit. This is also a good time to adjust your render settings to get more reasonable render times. When I have the camera as I'd like it, I write down the position of the camera in case I accidentally move it.


NOTE ON RENDERING "GETTABLES:
"Gettable" items, items to be picked-up or moved during game play, should be hidden from the renders for the cubic panoramas. To do this, right click the item in the World Editor and choose hide from render. To render the "patch" for use in Dagon. make the item visible again, then right click the screen and choose Select render area. Place your cursor where you want the upper left corner of your patch to begin, then click and drag the cursor to box just that small section of the image that contains your item (and its shadow and/or reflection, if that applies). The render will begin automatically. When it's done, save the image as a PNG, TGA, or JPG. (This smaller image can then be overlay-ed or "patched" onto the cube face in Dagon.)
RENDERING:
So, with your camera positioned, you rotate the camera to North and make the first render. When that is done, save the image (I've been saving as both TGA and PNG). Reset the camera rotation for the second/East side of the cubic render, render and save it, and so on until you have all of the six views that you need. These are the camera rotation settings for each of the sides of the cube. (I have my "Y" axis set to vertical and x = pitch, y = yaw, and z = roll.) -

North/Side One x = 90 y = 180 z = 0
East/Side Two x = 90 y = 90 z = 0
South/Side Three x = 90 y = 0 z = 0
West/Side Four x = 90 y = 270 z = 0
Up/Side Five x = 0 y = 180 z = 0
Down/Side Six x = 180 y = 180 z = 0

You can also set the Vue file up to render the cube images as a six frame animation. You can also make multiple copies of the finished VUE scene file, each with the active camera at a different node, and then batch render the scene files with Vue's batch rendering utility. Vue generates the frames of an animation as name_0000001.png. So, if you name each Vue scene according to its node, then in Dagon, add three zeros to the end of the name of the node (Garden1_000 for node 1), then you don't have to rename all of your images.


POSTWORK OPTIONS:
Some "postwork" can be done in Dagon with shaders. Blur/Noise, Fog (z-buffer), Nervous, and Depth-of-field are currently being developed. Shaders for retina response and underwater effects have also been proposed as have many others. However, you'll probably want to do some postwork on your images in an image editor, such as Adobe Photoshop, GIMP, or one of the Corel editors. I usually use Corel Photopaint X4 for postwork. I would strongly recommend that you work on copies if your original renderings. As long as the changes to the images are done consistently with the same settings used for each of the six sides of the cube filters, I have found that images altered with brightness, contrast, hue, gamma, intensity, and tone filters do not cause seams to appear when the node is viewed in Dagon.
The final step is to convert your cubmap images to TEX format for use in the Dagon engine. To do that, just follow the steps found at the following link. * Making bundled .tex files with KSConvert Utility

That's it! I hope this was helpful.
~Imari, 2-27-2012 edited 7-28-2012

⚠️ **GitHub.com Fallback** ⚠️