Functions | |
| void | Set_Rendering_Options (const char *list) |
| void | QSet_Rendering_Options (const char *segment, const char *list) |
| void | UnSet_Rendering_Options (void) |
| void | UnSet_One_Rendering_Option (const char *which) |
| void | QUnSet_Rendering_Options (const char *segment) |
| void | QUnSet_One_Rendering_Option (const char *segment, const char *which) |
| void Set_Rendering_Options | ( | const char * | list | ) |
Allows you to control how carefully and accurately your scene is drawn, and to enable several special drawing effects.
| list | - A quoted string or a string variable containing a list of the desired settings. |
The list of "qualities" is passed to the system as an arbitrarily long formatted string containing one or more specifications, separated from each other by commas. Saying "option" or "no option" is the same as saying "option = on" or "option = off". You can use whichever style you please. Uppercase versus lowercase is not significant, nor are any leading or trailing blanks on any specification. Embedded blanks within the option name itself are significant.
Each individual Rendering Option inherits up and down the segment tree and is Set independently of all the other choices---you might find yourself calling Set_Rendering_Options() several times in a row, feeding in more choices each time. The new choices are merged with the old as they arrive. This avoids having to make the call just once with one long specification string. (Note that UnSet_Rendering_Options() removes all the information for the attribute for that segment---use UnSet_One_Rendering_Option() to discard just one of the options described below.)
The following choices for list are recognized:
All lines and edge geometry is anti-aliased.
All text geometry is anti-aliased.
The full scene is anti-aliased. This option is only allowed on drivers that were initialized with the anti-alias Driver_Option set.
Toggles anti-aliasing for all of the options above.
atmospheric attenuation = (z - yon) / (hither - yon)
final color = atmospheric attenuation * input color +
(1 - atmospheric attenuation) * background color
In general, the hither and yon planes should reflect the extent of the objects in camera - eye space (see Compute_Coordinates() and Compute_Circumsphere() for conversions to this coordinate system). The default is "no atmospheric attenuation". Note: The hither and yon planes of atmospheric attenuation have no effect on z-buffering. HOOPS does not currently provide user control of hither and yon planes for use by the z-buffer.
"attribute lock = color"
This would cause the inner segments' color settings not to have any effect on the rendering of the tree - to become "invisible" - unless or until an inner segment explicitly turns the lock back off within its scope. Locking mechanisms may be further refined by specifying discrete geometry types and multiple attributes, such as color and visibility. For example:
"attribute lock = (face pattern, color = (face, markers), visibility=(edge))"Attribute locks may also be placed on any of the color suboptions. For example, if the user wanted to lock the diffuse color settings, an attribute lock could be placed on the diffuse channel:
"attribute lock = (color = (faces = diffuse))"This would ensure that transparency or specular settings would not be overwritten on objects affected by the attribute lock. Attributes that are not inherited cannot be locked. These include "streaming mode", "metafile", "normal" and "window". Furthermore, the "attribute lock" property itself can't be locked. The default is "no attribute lock". See the Restrictions section for more information regarding attribute lock. NOTE: "no attribute lock" explicitly turns off locks, both on the specified segment, and any children. However, setting "no attribute lock" absolutely does not unset a previously established lock (although the visual effect will often be the same, depending on the data). To ensure that attribute locks are properly disabled, use UnSet_One_Rendering_Option("attribute lock").
Describes the hierarchical scope of the option's effectiveness. Ideally, this should be set to the lowest level below which geometry generally encloses complete volumes. The default value is "entity".
The distance below which line segments can be joined to form closed loops. If the distance is less than the tolerance value, the loop is closed. Cutting lines that cannot be merged into closed loops do not generate cut faces. The value is specified either as a world space distance (without a '%') or a percentage of camera field (with a '%'). The default is "10%".
A synonym for "display lists = geometry".
Places each individual shell/mesh into a single display list. All other possible geometry within a segment will be put into a geometry-specific, segment-level display list.
Places all geometry within a single segment into a single, geometry-specific display list. This means that the number of display lists within a single segment will be equal to the number of different types of geometry contained within that segment. Note that as far as display lists are concerned, shells, meshes and NURBS surfaces are considered a single type of geometry. Using this approach can result in better performance, due to better batching.
The upper boundary of the number of vertices that will be allowed in the tesselation of the curve, regardless of view settings. Default is 512, which is a large enough number that most curves will be limited by the other constraints.
The number of additional vertices will be allocated to the overall curve. A curve with exactly degree+1 control points will have "budget" number of vertices, whereas curves with more control points than that number will have "continued budget" additional vertices for every extra control point. For example, a cubic curve with 6 control points will have [budget] + 2*[continued budget] number of vertices. This option applies to NURBS curves only.
"view independent" means that HOOPS tesselates each curve with the number of vertices specified in "budget", in such a fashion that it honors the other "general curve" settings. "view dependent" allows tessalation of a NURBS curve as far as necessary, depending on the camera setting, in order to maintain a smooth curve. "view dependent" is more accurate, but "view independent" is computationally cheaper. Default is "view independent".
If the angle in degrees between adjacent faces of a Shell/Mesh is less than this value, then the corresponding edge is marked as a "hard" edge. The visibility of these edges can then be controlled by using Set_Visibility("edges=(hard=on/off)"). The default is "hard edge angle = 135".
Changes the order upon which the radii and colors are applied to points in a polycylinder. "invert polycylinders = on" is equivalent to "invert polycylinders = (radii = on, colors = on)" . The default is "no invert polycylinders".
color to be applied to the hidden lines and markers. Examples include "color = red" and "color = (R=1 G=0 B=0)".
"Dim factor" specifies the fraction of the current line color's R, G, and B channels to use for the color of hidden lines and markers. By default, HOOPS will automatically take a fraction of the RGB values to darken the hidden lines and markers. However, if the window color is white (or near white), HOOPS will then effectively use an inverse of the dim factor to actually brighten the hidden lines, thereby providing a consistent means of distinguishing hidden lines from visible lines. Future releases may support specific control of hidden line color and weight. The default value is "dim factor = 0.5"
"face displacement" specifies how many units to push faces into dc z-space. This can help improve hidden line scene quality if distinct polylines/lines are being used to denote user-defined edges on shell/mesh regions, but are not exactly coincident with the actual shell/mesh edges/vertices. The factor sets a tolerance value which allows lines that might not be fully above the shell/mesh surface to still be rendered. (The display of shell/mesh edges themselves does not pose a problem.)
Note: hidden line face displacement is separate from the general face displacement value set via HC_Set_Rendering_Options("face displacement = ddd"). Recall that the latter is used to reduce edge-stitching with the z-buffer hidden surface removal algorithm. The default value is "face displacement = 0.5"
Turning this on causes HOOPS to draw a polyline around the edge of where the image previously resided.
"pattern" specifies line pattern of the hidden lines. See 'patterns.h' for an enumerated list of line patterns. The default value is "line pattern = 3", or a 'dotted' line pattern. (LP_DOTTED in patterns.h.)
Causes triangles to be flagged for display during a hidden-line rendering. HLR visibility & dim factor are applied appropriately. Faces are either visible or hidden based on a centroid test. Transformed text characters are drawn as triangles with the "render faces" flag forced on. The default value is "render faces = off".
Specifies the sorting algorithm that should be used to sort the geometry which has the render faces option turned on. This option does not take a hidden line algorithm as a value. Default is "hzb" unless hardware is not available, in which case it falls back to "painters".
A silhouette edge is defined as any edge for which one adjacent face points towards and the other away from the camera. Silhouette edges can show unpleasant "fishtail" patterns at points on smooth surfaces where curvature in one orientation is very different from the curvature in another (e.g. the inside of a torus). Silhouette cleanup forces a postprocesses to remove most of these patterns. The default setting is "on'.
"Visibility" controls the display of hidden lines and markers. This is NOT to be confused with the choice of the hidden line algorithm itself. The default value is "visibility = on".
Weight applied to the hidden lines. Refer to HC_Set_Line_Weight for appropriate values.
Uses any available hardware acceleration.
Skips over the hardware even if it is available. This option uses the painters algorithm, which may show fewer edge aliasing effects than a hardware Z buffer. It is often used instead of the software z-buffer when memory is limited.
Skips over the hardware even if it is available. Software Z buffer may display fewer edge aliasing effects than a hardware Z buffer depending on the hardware used. The software Z buffer will allocate a frame buffer and a depth buffer in main memory. For complex scenes, the software Z buffer is the fastest, although it can be the most memory intensive algorithm.
Tells the system that the scene does have some hidden surfaces in it, but the full-scale software hidden surface computation won't be necessary. Specifically, "Z-sort only" says a simple sort of the geometry by approximate screen depth will be sufficient to generate an accurate picture. This can significantly decrease the update time for some pictures. You can also think of "Z-sort only" as a "rough draft" hidden-surface.
This is the analytic hidden line option. Instructs the system to display visible (i.e. unobscured) lines, parts of lines, markers and text. Faces of geometry which have a visibility setting of ("faces=on") will be used to obscure the lines, markers and text. Like all true hidden line hsr algorithms this is a fairly computationally intensive algorithm O(nlogn). This is because it needs to clip all visible lines, text and strings against all visible triangles. Triangles are placed into a quad-tree to speed up the clipping process. The insertion points of text and markers are used during the clipping process.
Like hidden line but uses a multi-pass rendering approach that takes advantage of graphics hardware. "zhlr" is a synonym for "fast hidden line". This algorithm falls back to analytic hidden line if the current driver is not OpenGL, or if HOOPS finds an ogl implementation that doesn't support the required features.
See the Restrictions section regarding hidden surface removal.
Use the fast-LOD algorithm, with some visual quality degradation, or the "nice" LOD algorithm, with extra generation time but a better representation. Default is "fast". This option only applies to facetted shells.
Setting the bounding option for LODs affects the calculation usefulness heuristic (see below). In the 'current' case, HOOPS will adapt to whatever changes are made to the current segment's bounding volume while when you provide an explicit bounding box, HOOPS will be ignore any changes to bounding volumes in the database. Default is "no bounding".
This option sets the thresholds below which LOD's will not be calculated. This can be specified as one global value to apply to all levels, or as a list of numbers, a different one for each level. Default is "no calculation usefulness cutoff". (Note: this option, in practice, turned out to be less useful than expected and so may be phased out at some point in the future)
This will cause the LOD module to unconditionally display a certain level of detail. "clamp=0" will have the effect of forcing the original data to be displayed. This will have the same visual effect as turning LOD off. "clamp=-1" is equivalent to "no clamp". With clamping, no new levels of detail will be created unless the preprocess option is used (as opposed to when clamping is disabled, in which case levels of detail will be created as needed). If a requested level is not present, HOOPS will display the next lower resolution. If there is no lower resolution available, it will display the next higher resolution. The default is no clamp.
The collapse duplicate vertices option prevents cracks from forming where there are multiple vertices coincident in space (that were, for example, put there to create a hard edge). Default is "collapse duplicate vertices".
The fallback option dictates switching behavior if and when LOD is clamped to a level that doesn't exist for a particular shell. The default is "coarsest none", where:
Specifies how many levels should be calculated. The lowest level number is the most detailed, and the highest is the most compressed. The default number of levels is 2.
Places a limit on the number of edges that can be connected to a vertex. Default is "max degree=15". This option does not apply to point clouds.
Relevant only if clamp (see above) is set and greater than zero. Causes geometry to generate LOD versions during an update if not already present. Geometry that is not clamped (a.k.a. dynamically switched) will automatically generate LOD representations even without this option. Additionally, one other way that LOD representations can be generated is with an explicit call to Regenerate_LOD(). The default is "no preprocess".
Sets whether the LOD should be attached to the geometry or the segment. In the case where we set 'segment' then all LODs under that segment will be ignored during LOD switches. Furthermore, when you call Regenerate_LOD() 3dGS will try and collapse all shells contain in this portion of the segment tree into a single monolithic shell and generate LODs from it. Default mode is "mode = geometry".
Sets a lower bound on the number of triangles that a LOD representation can have. Simplification will halt at the final level above the given threshold. Quality of simplified representations degrades quickly as the number of triangles gets to be too low. Changes to this variable will not trigger recalculation of representations. The default is "min triangle count = 50". This option only applies to facetted shells.
Specifies how many triangles for facetted shells or points for point clouds each LOD level should have in relation to the previous, expressed as a floating point value between 0 and 1. For example, ratio = 0.25 would mean that level 1 would have 1 triangle for every 4 triangles in level 0 for a shell with a face list. The default is "ratio = 0.50".
An array of floating point values, along with units to determine how they should be interpreted.These values dictate the point at which switching should occur from one LOD level to the next. If specified without units, the values are assumed to be distances in world space from the camera position. The values can be density of triangles in physical square centimeters (resolution independent), density of triangles in terms of square pixels (resolution dependent) or the screen space size of an object (resolution and model complexity independent). The units can be specified by their abbreviations of "tpcm2", "tppix2", or "%", respectively. It is not legal to specify different units for individual levels. The last specified value is copied to all subsequent LOD levels. Note that only the percentage of area option will apply to point clouds. Default is "threshold = 30 tpcm2" (for every LOD level).
Note: for threshold, neither distance nor "% area" factor in the number of triangles at each LOD level. Therefore the only useful way to use it is to specify more than a single value.
This option is only relevant if the "collapse duplicate vertices" option (see above) is also set, in which case it behaves exactly as described in ::Compute_Optimized_Shell(). The default is "no tolerance".
Avoids LOD calculations for objects which do not pass the tests. Legal values for type include:
The per triangle options will only be applicable for facetted shells.
An upper bound on the number of vertices that will be allowed in the tessellation of the NURBS surface. Default is 10000, which is a large enough number that we expect most surfaces to be limited by the other constraints.
Distance, in object space, of the tessellation to the parametric definition of the surface. Note that since this setting is in object space, it should be set differently depending on the scale of the NURBS control points. Default is 1.
The largest angle allowed between the surface tangents evaluated at any two corners of a given facet. Expressed in degrees. Default is 20.
The largest allowable length, in the NURBS Surface's normalized [0..1] parametric space, of any facet's edge. Default is 1.42, which is larger than the longest possible edge that can be created, sqrt(2).
An upper bound on the number of vertices that will be allowed in the tessellation of a trim curve. Default is 500.
Distance, in the NURBS Surface's normalized [0..1] parametric space, of trim curve vertices from the parametric definition of the trimming curve. Default is 0.005.
Objects will be drawn in the color found in the fixed color table that is closest to the desired true-color value. Although thresholding is the fastest method for converting from true-color to a mapped device, it can produce "banding" artifacts on smoothly shaded surfaces.
The desired true-color object will be drawn in a series of screen-aligned fixed color table colors. When viewed from a distance, this series of fixed table colors has the appearance of the desired true-color. Though marginally slower than thresholding, an ordered dither does not produce "banding" artifacts.
A synonym for "ordered dither".
Similar to the "ordered dither," this method produces a more pleasing image, but at greater computational cost.
In each case, using a larger fixed color table will improve the dither quality. See the "fixed colors" option of Set_Driver_Options() for more information. The default method of quantization is "ordered dither". Note: Some HOOPS devices may ignore the quantization option except when drawing into the software Z-buffer.
High-level control of whether shadow maps are generated
Turning this on causes stochastic sampling of shadow maps. This should reduce aliasing in the shadow map. Default is "jitter = on".
The width and height of the shadow map. This value will be clamped up/down to 512, 1024 or 2048.
The number of locations in the shadow map used to determine the percentage value of light received by a pixel in the rendered scene.
Controls the visibility the reflection plane. Default is "off".
Fades the reflection as the model moves away from the reflection plane. The hither and yon settings define the orthogonal distances (in world space) from the reflection plane to the parallel hither and yon planes. Attenuation begins at the hither plane and increases linearly such that the model is not visible in the reflection beyond the yon plane. Default is "no attenuation". This option is only available under the DirectX driver.
An integer between 1 and 31 indicating the level of blurring (softening) that is applied to the reflection. This option is only available under the DirectX driver.
When set, the reflection plane will fade as it moves away from the camera. Default is "fading = on".
A value between 0 and 1 that sets the transparency of the reflection plane. A value of zero will make the plane completely transparent. Default is "opacity = 0.5".
Sets the plane on which the reflection should be projected. Default is "plane=(0,1,0,1)".
Controls the visibility of the shadow. Turning 'on' always causes 3dGS to regenerate the shadow. Default is 'off'
A floating point value between 0 and 1 that sets the transparency of the shadow. The default value is "opacity=1".
Sets the plane that the shadow should be projected onto. Default is (0,1,0,-1)
Sets the direction that the light is coming from. Default is (0,1,0).
A number from 32 to 1024 which sets the resolution of the shadow. The current default is 256.
A number between 1 to 31 indicating the level of blurring (softening) that is applied to the shadow. The effect is more noticeable at lower resolutions as the number controls the size of the blur region, which is effectively a smaller part of high-resolution images.
The desired color of the Shadow. Default is 'black'.
Can be used to limit the amount of memory used by the software frame buffer (at the expense of speed). When limited, the software Z buffer is rendered to the screen using horizontal bands.
Specifies the depth of the software frame buffer. On 24-bit-plane display devices, there is no difference between "match device" and "full color".
For 8-bit-plane display devices, "match device" will require less memory for the buffer, and will allow the finished buffer to be transferred to the screen quickly. However, "match device" may be slower overall since dithering might be applied multiple times per pixel when rendering to the buffer (this depends on scene content).
When "full color" is specified, rendering to the buffer does not require dithering and will be faster. However, "full color" will require more memory (up to a factor of four) and will be slower when transferring the finished buffer to the screen (due to dithering).
Use "match device" for simple scenes, and "full color" for complex scenes (if you have sufficient memory). The default is "match device".
Retention determines whether or not the memory for the software frame buffer is retained from update to update. For most circumstances, "retention" (the default) will allow faster incremental drawing of subsequent updates.
You would normally select "no retention" for applications that have many overlapping Z-buffered windows, due to the extreme memory required to retain multiple buffers.
This aspect of software frame buffer options is only applicable when "no size limit" is also set. The default is "no size limit, color depth = match device, retention".
The software frame buffer (not to be confused with the software z buffer) writes all graphics to an offscreen buffer first, then writes that result to the screen when done. The benefit is that only one bus transfer is involved. The "software frame buffer" rendering option is fully compatible with all the hidden surface algorithms with the obvious exception of "hardware." Additionally, it is very useful in trapping graphics in "no hidden surfaces" mode.
HC_Set_Rendering_Options("tesselation=(sphere=(20, 5, 1, 0, -1 )").
Setting "texture interpolation" (the default) is equivalent to "texture interpolation= (faces=on, edges=on)". Note: Texture mapping both edges and faces simultaneously (with both visible) does not make sense (since texture mapping just faces will render the same image) and will perform slowly. Turn off edge visibility (with Set_Visibility() ) when texture mapping faces.
Style affects 'how' to perform blending. "blended" is the default behavior.
blending: The transparent object will be blended with the color of the underlying object. This is the standard alpha-blending approach and the default behavior for this option.
off : This will disable transparency overriding all other transparency settings and forcing the geometry to be opaque. It can be used to temporarily disable transparency for the object or scene. (Another way to do this is to reset the tranmission component of color to 'black' for transparent objects, but this is much more cumbersome of there are many segments that have a settting for transmission color.)
screen door: This is a pseudo-transparency algorithm that optimizes performance and can be used as shortcut in the place of blending. A fraction of the pixels of the transparent object will be drawn, effectively allowing the user to see through the transparent object (hence the name screen door). This will only produce reasonable results if the tranmission value was close to 'gray' (meaning, the developer wanted 50% of all light to pass through). Additionally, no sorting of transparent objects will be performed when 'screen door' is set; therefore, it should also only be used when there is only 1 'layer' of transparent objects.
Hidden surface removal algorithm(hsra) controls which algorithm will be used to sort all the triangles that represent transparent objects. The default option is z-sort only.
depth peeling : This in a non-sorting technique based on multi-pass drawing, and leverages hardware acceleration to quickly produce an accurate rendering. Depending on the amount of overlayed transparent objects, this approach will give varying accuracy and performance results based on the number of 'layers' that are specified by the user (and how many are currently supported by HOOPS). Currently it is only recommended to specify 1 layer (the default) since each additional layer may incur a performance hit.
painters: This sorting method will produce a completely accurate rendering of transparent scenes that have overlapping transparent objects, but at the cost of additional rendering speed.
z-sort: This sorting method can result in rendering artifacts at locations where transparent objects intersect with one another, but is faster than doing a full-blown 'painter's sort'. It is the default algorithm.
none: No sorting will be performed, but transparent objects will get draw deffered (drawn on top). However, if overlapping transparent objects are present (or if a single transparent object is present that contains overlapping faces, like a sphere), the rendering will not be accurate.
Transparent and non-transparent geometry have separate hidden surface removal algorithms. Default is z-sort only.
NOTE: The none (i.e. no sorting at all) setting should only be used if:
A setting of "nice" sorts every transparent triangle in a shell by its mid-point. Alternatively, the "fast" setting sorts the rendering by the mid-point of each tristrip. Unless a shell has color settings on subgeometry (vertices, edges, etc.) a shell will typically have only one tristrip, and so using the "fast" setting usually affords significant performance improvements over "nice". It is recommended that the user turn off backplane culling when using the "fast" setting, to avoid visual artifacts. The default is "z-sort options = nice".
Legal options for depth peeling options include:
The maximum number of transparent layers to process. Hardware support (opengl and an ATI or NVidia graphics accelerator with drivers dated 2005 or later) is needed to process more than 1 layer. If the hardware cannot handle multiple layers, only the first layer is rendered. Performance will be roughly linearly proportional to 1/(the number of layers requested).
The amount of the screen a layer needs to occupy in order to process another layer. Hardware occlusion testing support is needed to handle minimum area.
Every possible combination of the options is legal and probably meaningful. For example, it is legal and reasonable to ask that Phong lighting interpolation be computed on a color-interpolated surface.
The default setting of the Rendering Options attribute---the setting on the root ("/") segment---can be given a new initial value on most systems by means of the environment variable "HOOPS_RENDERING_OPTIONS".
Hidden surface removal: The hidden surface removal algorithms still make an occasional mistake. This can be improved by breaking unusually wide, deep, and tall objects into smaller pieces, so that items of geometry in the scene are of similar sizes. This especially improves results in the "z-sort only" rendering option. Furthermore, the face displacement rendering option can also be used to obviate most stitching problems; however, even with face displacement, the painters algorithm can have problems. The painter's algorithm splits triangles independently along their edges, even if those edges are shared. This can lead to phasing errors during scan conversion which manifest as pixel dropouts. When setting the hidden surface removal algorithm, we recommend that you set this option only once per driver with the only exception being if you have subwindows.
Screen Door Transparency: "transparency = screen door" is not valid for software rendering. Although using this option with a non-hardware-accelerated driver will not cause HOOPS to generate warnings or errors, the picture will most likely look strange.
| void QSet_Rendering_Options | ( | const char * | segment, | |
| const char * | list | |||
| ) |
Similar to Set_Rendering_Options(), but operates on a given segment rather than the currently open one.
| segment | - | |
| list | - A quoted string or a string variable containing a list of the desired settings. |
| void UnSet_Rendering_Options | ( | void | ) |
Removes all settings established by a previous call to Set_Rendering_Options().
| void UnSet_One_Rendering_Option | ( | const char * | which | ) |
Removes a given setting established by a previous call to Set_Rendering_Options(), rather than all settings.
| which | - A quoted string or a string variable containing the desired setting to be changed. |
| void QUnSet_Rendering_Options | ( | const char * | segment | ) |
Removes all settings established by a previous call Set_Rendering_Options(), but operates on a given segment rather than the currently open one.
| segment | - Name of the segment to be changed. |
| void QUnSet_One_Rendering_Option | ( | const char * | segment, | |
| const char * | which | |||
| ) |
Removes a given setting established by a previous call to Set_Rendering_Options(), but operates on a given segment rather than the currently open one.
| segment | - Name of the segment to be changed. | |
| which | - A quoted string or a string variable containing the desired setting to be changed. |