EnSight QuickTools Part IV: Skyboxes Print

One of the new QuickTools in EnSight 9.0 allows the user to generate "Skyboxes". 

Skyboxes 101

What is a skybox? The idea behind a skybox is that a carefully constructed texture, if mapped onto a cube appears like the sky and horizon from inside of the cube.  A picture is the best way to explain.  In the animation, you can see the skybox from both outside of the textured cube and from inside of the cube. When you place geometry inside of the cube, it appears to be inside of an environment.

How does it work?

In reality, the skybox is just a collection of 6 textures applied to the faces of a cube. Normally, these 6 textures are packed into a single texture made up of a 4x3 tiling of the face images. This specially formatted texture is called a "cubemap".  A cubemap looks like this:

One can often find such textures on the web or generate them with various tools. The key is to look for "cubemap" textures. The skybox tool uses the enve Python extension to extract out the individual tiles and places them into the texture buffers.

The second thing the skybox tool does is generate the geometry of a cube. This is done using 6 point parts and a new feature in EnSight 9.0 that allows point parts to be displayed as triangle meshes.  This is done as an advanced option. It takes every three points and creates a triangle element from them. This is done 6 times (once for each face/part) for 12 triangles total in the form of a cube. It is a simple operation then to use projection textures to map the textures onto the cube.

Once that is done, all the user need do is move the point of view inside the cube!

The Skybox QuickTool

To use the Skybox QuickTool, you need to take the following steps.  First, find a cubemap texture you want to use. It can be in any format EnSight understands (e.g. jpeg, png, bmp, etc), but it should be in the tiled scheme shown above. Second, you must load a dataset. The skybox creates point parts as children of the part selected when the tool is invoked, so a dataset with at least one selected model part must be loaded. Finally, the QuickTool places the skybox cube using the box tool. Before you run the Skybox QuickTool, you need to enable the box tool and place it around the geometry you want to enclose.  An example is illustrated here:

 

 

 

At this point, you can run the QuickTool itself from the user defined tools menu.

 

 

It begins with a little introductory information dialog that covers much of the information from this article. Once that is dismissed, you will be prompted to select a cubemap texture image.  After that, the process is automatic:

 

 

You only need to move the view inside the box for the full effect.

 

 

 

That's it!

Some closing thoughts

Skyboxes can add a great deal of realism to your animations and EnSight 9.0 makes them relatively easy to add to your visualizations. For best results, you should start with the highest resolution cubemap texture image you can find. In the example, the individual cube faces had 1024x1024 resolution. One should also stick to images that are powers of two in size to avoid scaling artifacts.  Finally, remember that the texture is on the faces of a cube.  At a distance, it tends to look more like a uniform horizon and it leaves more space inside the cube to place your viewpoint, so use the largest box that is practical. One other thing to plan for is the eye level in the cube, relative to the geometry you place in the cube and any horizon in the cubemap texture. Skyboxes look the best when the eye level is kept level. If the eye is looking up or down, the cube distortion becomes more visible.

Adding a skybox is a simple task and can add context and improve the visual appeal of your visualizations. 

 

 

 

valid xhtml? | valid CSS?

Joomla Templates by Joomlashack