^{1}

^{*}

^{1}

^{1}

The problem of real-time photorealistic imaging is discussed. New techniques for specifying free forms without their approximation by polygons are considered. Free forms based on the perturbation functions have an advantage of spline representation of surfaces, that is, a high degree of smoothness, and an advantage of arbitrary form for a small number of perturbation functions. Transformations of geometric objects are described for set-theoretic operations, projections, offsetting, and metamorphosis. We propose a GPU solution to render freeform objects at high frame rates.

Nowadays real-time computer graphics oriented to 3D scene visualization has attained considirable success. However, even though a sufficiently high realism of realtime scene imaging has been attained, some problems are still present, for instance, it is necessary to store and visualize scenes containing a greater number of polygons than it is implemented in the present-day systems. Analysis of possible directions of evolution of a real-time visualization system shows that the easiest way to improve picture quality, i.e., to increase the number of polygons rendered per frame, is not the most effective one. Along these lines, the qualitative changes are difficult to achieve.

New techniques for specifying free forms without their approximation by polygons or spline-patches are considered. We suggest expanding the notion of primitives and making it possible to process them by easy and effective method without approximation by polygons. A method to display curved surfaces allows obtaining picture quality which cannot be achieved by the traditional means (even with great number of polygons) and is described below.

The geometric concept of virtual environment modeling using function-based objects can be described as an algebraic system [

where M is the set of geometric objects, F is the set of geometric operations, and W is the set of relations on the set of objects. Geometric objects are considered as closed subsets of n-dimensional Euclidean space E^{n} with the definition:

where f is a real continuous function defined on E^{n}.

A functionally defined object is completely defined by means of the real-valued describing function of three variables (x_{1}, x_{2}, x_{3}) in the form of F(X) ³ 0, then the objects are treated as closed subsets of the Euclidean space E^{n}, defined by the describing function F(X) ³ 0, where F is the continuous real-valued function and X = (x_{1}, x_{2}, x_{3}) is the point in E^{n}, defined by the coordinate variables. Here F(X) > 0 defines points inside the object, F(X) = 0 defines points on the boundary, and F(X) < 0 defines points that lie outside and do not belong to the object.

It is possible to describe complex geometry forms by specifying surface deviation function (of second order) in addition to surface basic function of second order (see

where x, y and z are spatial variables.

Were developed necessary algorithms and set of C++ classes: adaptive ray casting for scenes containing function-based objects (including OpenGL color/depth buffers compatibility); С++ classes for function-based objects representation; С++ classes for rendering of function-based objects; С++ classes interface classes provided to make the whole system to be easily extended to

incorporate new algorithms and features.

For visualizing the binary adaptive ray casting algorithm was used [

The functional representation describes most accurately the object geometry and has the smallest size of the required data. Procedures of functional representation demonstrate compact and flexible representation of surfaces and objects that are the results of logical operations on volumes. Its disadvantage is complicated geometrical processing and visualization in real-time. Some kernels are described in [3-10]: Gaussian function, inverse function, inverse squared function, metaballs, soft objects, Wshaped quartic polynomial, Cauchy function and so on. Radial-based functions (RBFs) are described in [11-13].

A few rendering algorithms are described in [

We propose describing complex geometric objects by specifying the function of deviation (an implicit secondorder function) from the base surfaces [

where f_{i} is the form-factor; the perturbation function R_{i}(x, y, z) is found as follows

Herein, Q_{i}(x, y, z) is the perturbing quadric.

Since, for estimating the maximum Q_{i} on some interval we have to calculate the maximum perturbation function on the same interval. The obtained surfaces are smooth (see Figures 2 and 3), and creation of complex surface forms requires few perturbation functions.

description that would take 2 M byte information. Thus, the problem of object construction reduces to the problem of quadric surface deformation in a desired manner rather than to approximation by primitives (polygons or patches represented by B-spline surfaces). In addition, while solving the descriptive function in the form of inequality F(X) ³ 0, we can visualize not only the surface but also the internal structure of the object.

Two major types of elements of the set of geometric objects are simple geometric objects and complex geometric objects (see Figures 4 and 5). A complex geometric object is a result of operations on simple geometric objects [

The set of geometric operations F is expressed mathematically in the following form:

where n is the number of operation operand.

Let the object G_{1} be defined as f_{1}(X) ³ 0. The unary operation (n = 1) of the object G_{1} means operation G_{2}_{ }= F¡(G_{1}) with the definition

where y is a continuous real function of one variable. Let us consider the following unary, binary operations and relations in more detail.

Projections of a solid onto three orthogonal planes yield us a representation of its different sides. The projection of 3D solid onto the coordinate plane is considered as a union of sections of the solid by planes parallel to the coordinate plane at a sufficiently small distance from each other. We will a mathematical description of the process for a space of arbitrary dimension. Let the initial object G_{1} Ì E_{n} be described by the function

and its projection G_{2}_{ }Ì E_{n–}_{1} be described by the function

The object G_{2} can be defined as a union of sections of the object G_{1} by the hyper plane x_{i} = C_{j}, where C_{j+}_{1} = C_{j} + Dx_{i}, j = 1, N and C_{1} = x_{i}_{min. }Let be the function for the section. As a result, the function for the projection at Dx_{i}®0 is a union of all functions f_{1j}: _{}

.

In the realization of this operation for the whole scene we fixed one coordinate, depending on what projection had to be obtained.

The offsetting operation was implemented by transformation of perturbation function coefficients. Thus, one can created an enlarged or diminished copy of the initial object, i.e., makes positive or negative offsetting. For example, solid beats can be simulated. Let the initial object be defined by the function f(X) > 0, then in the case of this operation, the obtained solid will be described by the function F = f(X) + C, where С < 0 determines the negative offsetting (compression) and C > 0 determines the positive offsetting (extension). Otherwise, adding together the positive or negative constant and the free term of the perturbation function yields extension or compression of the whole object.

Let the objects G_{1} and G_{2} be defined as f_{1}(X) ³ 0 and f_{2}(X) ³ 0. The binary operation (n = 2) of the objects G_{1} and G_{2} means operation G_{3} = F¡(G_{1},G_{2}) with the definition

where y is the continuous real function of two variables. Let us dwell on the binary operations: set-theoretic operations and 3D metamorphosis (morphing).

For function-based objects on the bases of perturbation functions we propose the following. To create a complex scene, one should describe in it a certain number of primitives necessary for a concrete task. The rendered object with which the rendering algorithm interacts by means of query represents the whole 3D scene. Hence, the geometric model should allow designing of objects and their compositions of infinite complexity. This is primarily achieved by means of Boolean operations of uniting and intersection.

This operation transforms the first defined object into second with obtaining multiple intermediate forms. The term originates from the word metamorphosis and refers to the animation technique in which one pattern is gradually transformed to another. During the metamorphosis (morphing), the initial pattern is gradually transformed to the final one.

A sequence of frames of transformation of one object to another is generated by means of the initial, final, and key intermediate models.

Let F_{1} and F_{2} be values of the perturbation functions of the first and second objects, respectively. Then the resulting perturbation function is calculated as follow:

where β is the positive continuous function.

For function-based objects with the use of perturbation functions, one can perform 3D morphing of nongomeomorphic objects.

Twisting is a solid deformation being a particular case of bijective mapping which serves for defining deformations of initial objects. For twisting of the initial solid we found and transformed its coordinates x, y, z.

First thing that is necessary to state is that if we want to propagate the deformation it should be somehow added to all object that it affects. Actually the current scene-tree is organized so that it is no possibility to add object only by referencing i.e. without copying. This is done for avoiding situations when being changed somewhere the object unintentionally change the other part of the scene that referenced to it too. Thus the additional perturbations should have such parameters to assure the part-per-part connectivity for each pair of the object the perturbation affects. In this case it will be looked as one perturbation.

We consider the swept volume as a projection of a moving solid from the 4D (x,y,z,t) space to the 3D (x,y,z) space. Then we draw the solid each time new coordinates that were changed by the proper law. In so doing, the previous images are stored in the memory and used to obtain the result of swept volume. The newly formed figure is a union of images of the swept solid for different positions.

A binary relation is a subset of the set. It can be defined as

The examples of binary relations are inclusion, point membership, interference or collision.

Collision detection is a complicated problem solved in various computer programs. This means that for each animation frame, one should test whether any two or more objects collided. The collision detection algorithm described in [

We propose original way of collision detection without using any bounding volumes around each object and preprocessing stage. For objects based on perturbation functions the object collision is detected in a constant time for collisions of different complexity, and the detection of events is absolutely ensured [

We consider the geometric object that has the property of answering the request on intersection with a bar. The negative answer guarantees that the object is not intersected and has no common points belonging to the intersection is done by recursive subdivision of the space inside the cube defined by boundaries of ±1 along each coordinate (see

The center of the cube matches the origin of the model coordinate system M whereas the plane Z = −1 coincides with the screen plane. Coordinate system in which the algorithm subdivides cubic volume is called work or model space and is denoted M (see

surface intersection calculation. The general block-scheme algorithm is shown on Figures 7 and 8. Starting from the observer’s eye, a viewing ray (a bar) is traced through the object space for each pixel on the view plane.

For each bar-surface intersection test are executed. If the object intersects with given bar, then bar subdivides further. Otherwise, we exclude bar from subdivision. Using results of intersection test, we perform subdivision of sub bars that fall within the quadric completely or, probably, partially, and the knowingly external sub bars are eliminated from processing.

On some recursion level we determine first point, which contains a surface.

After a finding of a point of ray-surface intersection, we calculate normal and color.

Calculation of all color components of a pixel is performed in the same manner by the following formula:

where “ambi” refers to characteristics of ambient light, whereas “diff” and “spec” refer to the diffused and specular components of reflected light, respectively; C are the color components; Q are the weight coefficients. Color components are calculated by a vector light model. Four vectors are involved in the calculation: normal to the surface (n), vector to the light source, reflected light direction (r) and vector to the viewer (v):

C_{lite} is the light source color; C_{surf} is the surface color;

where p is the reflection coefficient.

In [26,27] we proposed a texture memory management policy that substitutes the classical assignation policy of one texel per voxel, applied for the volume representation in texture space. The texture is an object (not mapped) changing the properties of another object. The feature of the texture is that any object may be the texture. A supplement to the data structure with consideration of the

structure is that each object can have a reference to another object being a texture for it.

In our work two applications which visualize free form objects based on perturbation functions have been realized. The first uses only CPU for calculations. The second uses GPU for calculation of depth, normal and illumination, and CPU for geometric transformations. For image display both versions used DirectX. Testing of productivity of the offered variants of realization has been made. Testing was made on the computer with processor Intel Core2 CPU E8400 3.0 GHz, and GPU GeForce 8800 GTX. Performance strongly depends on the speed of memory.

In [

In [

The freeform representations created by means of the perturbation functions have the following advantages: fewer surface for mapping curvilinear objects, short database description, fewer operations for geometric transformations and data transfer, simple animation and deformation of objects and surfaces, and a wide spectrum of applications (interactive graphics systems for visualizing function-based objects, CAD 3D simulation systems, 3D web visualization, etc.). We have investigated various geometric operations on functionally defined objects on the basis of the perturbation functions. We have analyzed the collision detection algorithm by means of recursive object space subdivision. We may conclude that in the proposed function-based object collision detection algorithm, the collision is always detected and does not depend on the relative position of collided objects and parts of their surfaces, i.e., such an algorithm guarantees detection of the event, which has been proved both experimentally and theoretically. Modern high-performance parallel multiprocessor systems graphics accelerators provide an opportunity to expand methods of three-dimensional visualization of the fourth dimension - time. As a result, it is possible to implement new effects on geometric objects, caused by the introduction of operations on functions in real time.