date: 2003-11-20 00:00:00 tutorial name: Modeling for VRML & Real Time with Softimage : 69 author: Anthony Rossano
software: Avid Softimage 3D Extreme version: 3.x region:
introduction next step

Modeling for VRML & Real Time with Softimage
(1) What is VRML?

VRML (Virtual Reality Markup Language) is a text based transport language designed to describe three dimensional geometry in a manner that is very similar to the way that HTML describes text and image layout. Like HTML, it is also intended to facilitate delivery of this geometry across the internet. Like HTML, a browser on the Client side of the internet connection reads the file and converts it into imagery. Unlike HTML, the VRML imagery that the browser creates is completely dynamic, and changes depending on your point of view in the scene.

VRML is also completely programmable, and in fact is a functional subset of the Open Inventor programming language developed by Silicon Graphics for visual programming.
These days there are many 3D packages that can convert their geometry into VRML, and Softimage is as good as any and better than most. Softimage has an export filter that can convert either single models or entire scenes to VRML. These files can be viewed in many different VRML browsers, and seem to work well in the Cosmo Player from SGI, and the TGS plugin for Microsoft Explorer.

To convert a model in Softimage to VRML, simply select that model and in the Model module choose the SAVE-->VRML command. In the save dialog box, choose "Save Selected Models" and be sure to specify a valid path and name to save the file to. Click the "OK" button, and the effect will write out a text file with the name you specified, and any texture maps you have on the model will be converted to JPEG files and saved out as well.

To save an entire scene, do the same but uncheck the box marked "Save Selected Models" . Softimage will write out not only the geometry but the lights in the scene, the camera position, and a transform node based on the camera angle in Softimage. Tip: Reset the camera in Softimage before you run the export for more consistent results.

WhatÕs different about modeling for VRML?

The most important task in creating a VRML space is the modeling. Good modeling will make your space interesting to wander around in, visually rich and with responsive visual feedback. Bad modeling wonÕt just look lousy, it can increase download times to the point where users wonÕt bother to check out your space, and can cause those that do to have a jerky, slow moving experience.

VRML is largely polygon based. That means that a VRML file describes physical objects by recording a series of points that define flat, two dimensional polygons. (picture of polygons) Complex objects are made up of many such polygons bound together, sharing edges with one another. These complex objects are sometimes called "indexed face sets", because "face" is a term for a filled in polygon.

Each face has a number of vertices (sing. Vertex) and edges that connect the vertices. Each face also has a "Normal" which helps describe the orientation of the face. Normals are often conceptualized as short line segments ("Vectors" ) extending perpendicularly from one side of the face.

Each face has color information for each vertex, and that color information is described as Red, Green and Blue values.
Each face can also have texture binding information that tells the browser how to map texture maps onto the face.

Polycount, Polycount, PolyCount

Since each face can have so much associated information, increasing the number of faces in a VRML model can increase the amount of data needed to describe it. It is therefore of critical importance to good VRML modeling that you use no more polygons to make an object than absolutely necessary.

For example, a sphere in Softimage with 12 latitude and 12 longitude subdivisions exported as VRML requires 859 lines of text to describe it. The size of the file is 26 kilobytes, way too much for a simple sphere. VRML does have generic primitive shapes that you may use to save file size and download time, but when you create your own custom geometry, large indexed face sets are a fact of life.

The number of faces in the scene also affects how long the computer takes to draw the screen when a user moves through the environment, so keeping the poly count low is also a critical performance issue. In real time playback systems like computer games, military simulators and the like, the computer needs to keep up a frame rate of typically 30 to 60 frames per second drawn to the screen, a challenge for even the beefiest computer systems. You can increase performance on your users browsers by keeping the polygon count in your scenes below 2000 polygons.

To reduce the polycount in your models quickly and easily, use the Softimage command EFFECT-->Cleanup in the model module. Cleanup analyzes the angle between polygons, and eliminated neighboring polygons if that angle falls under a threshold you can set. For example, if a boxy shape has a lot of polygons in it, you can set the cleanup angle to 5 degrees, and run the effect. Any two polygons that share an edge and meet at less than 5 degrees will be merged into a single, planar polygon, greatly reducing the polycount of your model.

Materials count.

Every single vertex of every single polygon has a color assigned to it. Although this often seems like a waste of file size, it is a part of the VRML specification. You can take advantage of this to add interesting color schemes to your space.
Each polygon can have several color attributes: diffuse color, ambient color and specular color.
Diffuse color is the color you will see when you shine light on the object. Ambient color is the color an object will have when there is no direct illumination on it, and the specular color is the color of the specular highlight, the shiny dot that simulates a reflection from the light source. The intensity of the specular highlight can also be adjusted, and low specular rolloff values can create interesting changes in apparent lighting as you move throughout a space in VRML.

A great deal of visual detail can be added to a space by coloring specific polygons on an object differently. This is called a "local Material" in Softimage. To do it, add a global material to the object first, then select a group of polygons (try using the "g" key and pointing to polygons with your mouse cursor). With the group of polygons you want selected, go to the Materials Module and choose POLYGON-->New Material.
Choose the color values you want, and preview your work in the shaded perspective view.
Remember: Materials donÕt add any file size, download time or render time, so use them as much as you can to enhance your space.

Textures are expensive.

A great way to add detail to a scene without modeling it is to use a texture map. Texture maps are an image that you prepare in an image editor like Photoshop, then stick on to polygons like a decal sticker. The texture map stays on the polygon, and can add a great deal of life to the user experience. Some of the earliest and best uses of VRML were in virtual museums and art galleries. Unfortunately, scaling and stretching the texture to fit the polygon and the userÕs angle to it is computationaly expensive. Tests show that textured polygons require up to 10 times more computer time to draw than untextured polygons. Some computers have special hardware designed to speed the display of textured polygons.
VRML browsers typically have a few options for the display of textures. They can show textures all the time and run slowly, the can use only shading while the user is in motion and display textures only when the user comes to rest, and they can turn textures off entirely.
The moral of the story is to use textures sparingly in VRML, and let your users determine what level of performance they are willing to trade off against greater detail in the environment.

Tesselation = Frustration

Most real time rendering engines and VRML browsers prefer to draw only polygons with three vertices, called triangles. Before a VRML browser can draw your geometry to the screen it has to examine each of your polygons, and if they have more than three edges it has to subdivide that polygon into several smaller triangles. That process is called tesselation. The accuracy of the tesselation process determines how good your geometry looks on screen, and how rapidly the rendering engine can display it. Sometimes the tesselation process divides up your geometry in ways that donÕt work well, or look poor. Sometimes the display will seem to flicker, as if the tesselation process canÕt make up itÕs mind about how to draw a certain polygon. Sometimes it will connect edges to fill in holes in your geometry. In these cases you will need to tessellate your geometry manually by adding edges between vertices where you do want them.

In Softimage, the Effect-->Convert command will reduce polygons to triangles. Unfortunately, having polygons with three sides instead of four or more sides means that there will be more polygons, each with itÕs own normal, material attributes and texture bindings, increasing file size and download time.
If you want Softimage to go the other way, converting triangles to fewer polygons with more sides, use the Effect -->Cleanup command.

ItÕs a Square, Square world

Because polygons are so important in VRML, and because good real time modeling means keeping the polygon count low, certain types of shapes work better than others. Objects with straight edges typically require fewer polygons than objects with rounded edges. Architecturally austere spaces tend to look better than cluttered, confining spaces. Spaces with a lot of emptiness, created by high walls and ceilings, are easy to create and look good. Spaces with changes of level, for instance sunken floors, mezzanines, staircases and balconies, look good.

Organic shapes are very difficult. People, for instance, require many more polygons than chairs and tables. Rounded shapes are also difficult to bring off convincingly, because the low numbers of polygons necessary result in faceted, broken lines.


RATE THIS TUTORIAL 1 .2..3..4..5
COMMENT ON THIS TUTORIAL   comment