Illuminated lines is a new method for using a dynamic texture map on 3D polylines to represent field streamlines for the purpose of visualizing continuous fluid dynamics fields. The method combines stream lines and particle animation into one hybrid technique, and employs texture display on lines to represent full 3D lighting, motion and 3D flow structure in one view. The technique exploits texture graphics systems in common use for games, and achieves high graphics efficiency during animation. In AVS/Express, Illuminated lines is implemented using a custom OpenGL render method. Thus the technique is only available when using the OpenGL renderer.
There is a new macro, illuminated_lines, with the full name DV_OGL.illuminated_lines. It is used much like other DV high-level modules, but a few important differences. Its input must a poly-line cell-set (unstructured) field such as produced by the MODS.streamline macro. This means that streamline must not be run in "ribbons" mode, because then it puts out quad cells that illuminated_lines cannot use. There is no literal dependency between and streamline, although in practice, almost all real applications using illuminated_lines will also have a streamline ahead of illuminated_lines. DV_OGL.illuminated_lines has no field output, only a renderable GDobject output.
A link to illuminated_lines has been added to the Mappers library on the Network Editor Main page. Click here for more details.
The illuminated lines package contains 3 low-level modules and a special polyline field that contains the custom render method. However, these modules have almost no use outside the high-level illuminated_lines macro. All of the below modules are in the DV_OGL library:
Some of the properties in illuminated_lines are:
Changing Line Color
The base line color is defined in the DataObject. This can be changed using
the object editor menus. In case node data is present in the input mesh, coloring
takes place using node data values and the DataObject's data map. Control over
amount of color blended with the illumination model is selectable by the Color
Blend slider. The Smooth Shading toggle provides a way to interpolate the node
values between adjacent nodes, resulting in smooth color shading of individual
polyline segments.
Shading Model
The illuminated lines module uses a full Phong shading model. Ambient light is added as a background constant to all shades. Diffuse illumination is computed by the cosine of the angle between the synthetic surface normal of the line and the light source. Specular shading takes into account the relationships of both the light source angle and the viewer angle differences from the surface normal vector. The shininess is varied from broad to tight highlight shape using a power of the cosine of the angle, as in classical Phong shading models. A further refinement is the Phong modifier term, which also applies an exponent term to the diffuse shading angle term. The resulting shade function is encoded into a 2D texture map. The default texture map size is 64 x 64 pixels, but can be changed in the module's parameter block. As these values work in most circumstances, no user interface is provided. Because the texture map is used to encode shading, this can be considered a piece-wise linear approximation to the full analytical bi-directional reflectance function (BDRF), with the piece-wise segments representing approximately 3 degrees of shading angle. The texture UV coordinate lookup then performs bi-linear interpolation from the texture within each angular segment.
Halo
To further enhance spatial perception of field lines a Halo model is utilized. This is a synthetic artistic presentation effect and has no basis in physical representation. The Halo mimics hand sketched drawings when a line breaks as it passes underneath a line that should be on top. When the lines and their halos are rendered, each halo obstructs the view of any line passing behind them. Simple implementations of line halo effect against a black background are made by rendering black, thicker lines first, then the true lines on top, in a depth sorted order. The problem of this simplistic approach is that the surrounding halos are solid black and will not work if the background is any other color. The algorithm implemented in the Illuminated Lines module uses a special invisible halo technique, where the background may show through the halo space around the illuminated lines. With this technique an influence mask surrounds each line, so that the depth ordering of lines becomes more visually pronounced. The width of the halo can be controlled for best visual effect. A halo width of zero disables this effect.
Line Transparency
The results are quite spectacular, but only work well on machines with hardware acceleration support for texture mapping. The shaded field lines provide dramatically more visual cues to the structure of the field as compared to conventional solid lines. In addition, line transparency shading allows greater insight to the field structure in the interior of the field. Transparency results can be misleading since polyline rendering is not performed in a depth sorted order. To minimize rendering artifacts, a Depth Mask toggle is provided. Active Depth Mask can also provide better results when antialiasing has been selected. The artifacts are normally only present at some line crossings and are normally hardly visible.
Animation Effects
This module has been equipped with simple animation effects, including the polyline width and transparency modulation along the line. It is not possible to change the width within a single segment of a polyline, thus both effects work per segment basis - this is the unit of measure of the animation effect. The line region that an effect is defined over is made out of two parts - the first is the active part followed by filling (spacing) which delimits the active zones. Both zone's lengths are user settable by means of sliders (Length and Spacing). The active zone of an effect can be of type 'stair' or 'dash'. For the dash effect the active zone makes the polyline segments that it modifies either of width one or totally transparent (depending on selected modulation). Following spacing segments are left with original parameters. The stair effect has three modes: up, down or up&down that define stair steps with linearly increasing, decreasing or both 'steps'. This way an illusion of a moving pulse of increasing transparency or width is achieved. Because the effects are applied per polyline segment, their rendering has to be done as segments instead of per polyline. This of course introduces a performance penalty compared to display speed without animation effects. The animation effect is computed using simple euclidean distance along the line, and does not reference any local velocity field information that may be available. If flow velocity animation is required, use the "advector" module. The animation effects can be usefully applied to create visualizations even without creating an animation.
Data Types
This module requires the input mesh to contain one Polyline cell set. Any
other type of cell set will be rejected, and any additional cell sets will be
ignored. Any scalar node data may be present, or none for purely geometric display.
Any special id node data (color, rgb, etc.) and any cell data is ignored.
Renderer Context
The implementation of the project is done by creating a custom render method that connects to the Graphics Display kit in AVS/Express. Any time the viewer refreshes or does a new scene update, it calls this custom method to perform the object draw. This method then contains the appropriate OpenGL calls to implement the illuminated line technique. If this module is used with another renderer, such as the software renderer or the "OutputImage" module, lines will be drawn in the default mode with illuminated line features turned off.