Translate this page:
Please select your language to translate the article


You can just close the window to don't translate
Library
Your profile

Back to contents

Software systems and computational methods
Reference:

Direct Rendering of Three-Dimensional Objects Based on Perturbation Functions Using GPUs

Vyatkin Sergei Ivanovich

PhD in Technical Science

Senior Research Fellow, Institute of Automation and Electrometry of the Siberian Branch of the Russian Academy of Sciences

630090, Russia, g. Novosibirsk, ul. Koptyuga, 1

sivser@mail.ru
Other publications by this author
 

 
Dolgovesov Boris Stepanovich

ORCID: 0000-0002-6255-9315

PhD in Technical Science

Head of the Laboratory, Institute of Automation and Electrometry SB RAS

630090, Russia, g. Novosibirsk, ul. Ak. Koptyuga, 1, kab. 318

bsd@iae.nsk.su

DOI:

10.7256/2454-0714.2023.1.38263

EDN:

IWRNCU

Received:

13-06-2022


Published:

04-04-2023


Abstract: The object of the study is a method of direct rendering of complex three-dimensional objects based on perturbation functions using graphics processors, using a variety of streaming multiprocessors. Direct rendering means that the visualization of functionally defined models takes place without their preliminary conversion to other formats, for example, into triangle grids. The research method is based on analytical geometry in space, differential geometry, interpolation theory and matrix theory, based on mathematical modeling and the theory of computing systems. The main conclusions of the study are: the possibility of direct rendering of functionally specified objects, when rendering it is important that the computing processors are not idle. The first problem that was solved was that different GPUs have different numbers of streaming multiprocessors. Therefore, it was necessary to choose during execution the optimal stage from which the work began. Thus, you can partially get rid of the problem with unused computing resources. The second problem, the balancing problem, was solved by using a large number of computing processors. For implementation, the CUDA parallel programming model was used, which, together with a set of software tools, allows implementing programs in the C language for execution on a GPU. The resulting system visualizes complex functionally defined objects with high resolution interactively. The dependence of performance on the computing power of graphics processors is investigated.


Keywords:

functionally defined object, perturbation functions, constructive solid-state geometry, direct rendering, graphics processor, streaming multiprocessors, parallel computing, parallel programming model, hierarchy of thread groups, acceleration of calculations

This article is automatically translated.

1.       IntroductionFunctionally defined surfaces are a representation of closed manifolds for modeling and visualization.

Functional representations are a way of representing solid-state models [1, 2]. Compared to triangular grids and NURBS, they provide simple CSG operations. It is difficult to introduce attributive information into polygonal models, and algorithms for visualizing topological operations are quite time-consuming. Polygonal models allow you to visualize only the outer layer of an object, while many applications require an internal structure. Functional representations provide unambiguous verification inside and outside of objects, and arbitrary resolution [3, 4]. The main task of solid-state modeling is to know whether a point is inside or outside an object [5-8]. It is also important to know whether the point is within the tolerance to the border.

For models with boundary representations (B-rep), the answer to this question means checking the point for each part of the topology in the model [9-12]. The general approach is to create a ray that starts from the point in question and moves in any direction. If the number of intersections is odd, the point is inside the object, otherwise it is outside. Such a calculation is expensive and error-prone, since faces can be skipped or recalculated twice if they are plotted near their edges or near the tangent to the edges or faces. For B-rep and grid models, this is one of the main problems.

When modeling functionally defined surfaces, information about signs is used to indicate the internal and external region, so calculations are simple [13]. Values close to zero are closer to the boundary, so it is possible to determine whether the point is within the tolerance to the boundary. Both from the point of view of accuracy and from the point of view of performance, the use of functionally defined surfaces is better suited for such a task.

Visualizing functionally defined is not an easy task. The paper [14] describes a method for visualizing surfaces defined algebraically by polynomials of high degree. At the same time, it is difficult to model objects using polynomials, it is not guaranteed how accurately the initial function will be approximated to the Bezier curve. In addition, transferring an object to another coordinate system is not an easy task, so creating dynamic scenes is problematic. The method of visualizing analytically specified objects [15], based on a non-constant step size, calculates a sphere centered at the current point on the ray, but finding a suitable radius of the sphere is not an easy task. In addition, the algorithm uses preprocessing, therefore, as in the previous method, visualization of objects that change their shape and position over time requires large calculations.

For quick visualization, the transformation of functionally defined surfaces into grids of triangles is usually used.

However, it is very difficult to make such transformations reliable. For example, for topological spaces that are locally similar to Euclidean, and for the detection of thin objects, a high sampling resolution is required. Therefore, the development of a method for direct rendering of functionally specified objects is an urgent task.

In our work, one of the main tasks is to efficiently find the first intersection of the beam with the surface. Specifying objects using perturbation functions makes it possible to efficiently search for surface points. To calculate the intersection of rays with the surfaces of three-dimensional objects, a method is proposed in which there are no disadvantages characteristic of known approaches. The reduction of visualization time is achieved due to the efficient use of computing resources of the GPU with the CUDA architecture.

The purpose of this work is to develop a method for direct rendering of 3D objects based on perturbation functions using graphics processors.

 

2.        Direct rendering of models based on perturbation functions  The assignment of models using perturbation functions is described in [13].

To implement the rendering algorithm on a graphics processor (GPU), its architecture was taken into account. For example, conditional transitions are very expensive to implement in such an architecture, both in terms of operation execution time and computational efficiency. It is effective for the GPU to immediately "charge" it with data so that it starts performing parallel calculations, otherwise parallel calculations are not effective and synchronization is requiredIn addition, GPUs have a different number of streaming multiprocessors, so it is necessary to take into account the optimal stage from which to start working. Thanks to such measures, it is only possible to partially solve the problem of unused computing resources, since there is still a balancing task. Consider a scene located in a single three-dimensional cube.

The observer looks at the cube along the Z axis. From the observer's point of view, rays are emitted such that each ray corresponds to a pixel in the image. Each of the rays is divided along the Z axis. Thus, we calculate the density function along the beam, which depends on one variable. The task is to find the first point at which the function turns to zero. Since we have an analytically given density function, this allows us to efficiently search for the intersection point of the beam with the surface. After calculating the intersection point with the surface of each ray, we determine the depth of the frame. Then we calculate the normal in each pixel. Using the depth and normal data in each pixel, we use a local lighting model. As a result, we get an image of a smooth object taking into account lighting.

The CUDA architecture was used for implementation). This made it possible to use a large number of computing processors that simultaneously calculate several beams. The influence of the speed of working with memory was also taken into account. Registers are used as much as possible to speed up calculations, since this is the fastest type of available memory. The next fastest is shared memory. In all other cases, the shared memory of the GPU was used.As a result, an application was implemented with the help of which it is possible to perform direct rendering of functionally specified models.

Frame depth, normals, and lighting are calculated using the GPU. The functions of the CPU include geometric transformations. DirectX was used to display the image.  Testing was performed on Intel Core2 CPU E8400 3.0 GHz, GPU 9800 GT and 470 GTX. Table 1 shows the calculation time, number of operations per second and acceleration.

 

Table 1. Calculation time, number of frames per second and acceleration

 

 

 

 

0

1

2

3

4

6

7

8

Time

9800 GT

0,1164

0,39797

0,68046

0,3689

0,17703

0,07047

0,09109

0,1395

470 GTX

0,0178

0,06266

0,07235

0,04251

0,02109

0,01203

0,01125

0,0172

E8400

0,9015

3,17578

3,27562

2,0336

0,80265

0,59422

0,42344

0,6379

Number of frames per second.

9800 GT

42,955

12,5637

7,34797

13,5538

28,2438

70,9521

54,8907

35,834

470 GTX

280,58

79,7957

69,1085

117,619

237,079

415,627

444,444

290,69

E8400

5,5459

1,57441

1,52642

2,45869

6,22936

8,41439

11,8080

7,8374

Boost

9800 GT

7,7453

7,97994

4,81383

5,51260

4,53397

8,43224

4,64858

4,5722

470 GTX

50,592

50,6827

45,27464

47,83816

38,05832

49,39485

37,6391

37,090

 

Figure 1 shows the diagram: the abscissa axis shows the test number, and the ordinate axis shows the number of frames per second for different tests. Figure 2 shows the average time per frame for different tests. Figure 3 shows the acceleration relative to the E8400.

Fig. 1. The number of frames per second for different tests

Fig. 2. Average frame time for different tests

Fig. 3. Acceleration relative to the E8400 CPU for different tests

 

We compared the proposed method of direct rendering with known approaches.

Thus, in [14], a method for rendering algebraically given surfaces is described. However, the variety of surfaces that can be described using perturbation functions is much broader than algebraically given surfaces. In addition, the method [14] does not guarantee how accurately the initial function is approximated to the Bezier curve. Also, the disadvantage of this method is that it is not easy to convert an object to another coordinate system. Therefore, creating dynamic scenes is problematic.

In [15], a method with a variable step size on the beam is described. However, the disadvantage is finding a suitable radius, since it is only effective for static scenes. For this purpose, preliminary calculations are used. Thus, this method can be used only when objects are static. Therefore, as in the previous method, rendering objects that change their shape and position over time is not effective.

 

 

ConclusionThe proposed method of specifying functional objects and the direct rendering method have advantages over known approaches.

 

The main advantages of the proposed method of specifying objects based on perturbation functions and the direct rendering method include: simplicity and efficiency of calculating the intersection points of a surface with rays; compact description of curved objects (specifying objects with functionally specified surfaces reduces the description of the database by 100 or more times compared to the description of their polygons); simplicity of animation and deformation of surfaces.

The functional assignment of objects is especially relevant in a number of computer graphics tasks, including modeling soft or organic objects, three-dimensional morphing, determining collisions of objects and constructive solid geometry. Applications of functionally defined objects: molecular biology, interactive graphical visualization systems, CAD systems, 3D modeling systems, 3D web visualization, additive manufacturing, etc.

References
1. Sigg, C. Representation and rendering of implicit surfaces. Diss. ETH No. 16664, Dipl. Rechn. Wiss. ETH Zurich, Switzerland, 2006, pages 162. DOI:10.3929/ETHZ-A-005267203 Corpus ID: 124349594
2. Dekkers, D., Overveld, K.V. Golsteijn, R. Combining CSG modeling with soft blending using Lipschitz-based implicit surfaces. Visual Computer, vol. 20, no. 6, 2004. pp. 380–391.
3. Vyatkin, S. An Interactive System for Modeling, Animating and Rendering of Functionally Defined Objects. American Journal of Computer Science and Engineering Survey, 2014, vol. 2, no. 3. pp. 102-108.
4. Vyatkin, S. Perturbation functions for compact database. Review of computer engineering research. 2017. vol. 4., no. 1. pp. 30–37. doi: 10.18488/journal.76.2017.41.30.37
5. Farin, G., Hoschek, J., Kim, M.S. Handbook of Computer Aided Geometric Design. [electronic resource]. 2002 Elsevier. ISBN 978-0-444-51104-1.
6. Pottmann, H., Brell-Cokcan, S., Wallner, J. Discrete Surfaces for Architectural Design. Archived 2009-08-12 at the Wayback Machine, pp. 213–234 in Curve and Surface Design, Patrick Chenin, Tom Lyche and Larry L. Schumaker (eds.), 2007. Nashboro Press, ISBN 978-0-9728482-7-5.
7. Farin, G. Curves and Surfaces for CAGD. A Practical Guide, Morgan-Kaufmann, 2002 ISBN 1-55860-737-4.
8. Sturm, T. An Algebraic Approach to Offsetting and Blending of Solids in Computer Algebra in Scientific Computing. CASC 2000, V.G. Ganzha, E.W.Mayr and E.V.Vorozhtsov (Eds.), Springer-Verlag, Berlin (2000), pp. 367-381.
9. Stroud, I. Boundary Representation Modelling Techniques. Publisher: Springer, January 2006, ISBN: 978-1-84628-312-3 DOI:10.1007/978-1-84628-616-2
10. Kainz, W., Neufeld, E., Bolch, W.E., Graff, C.G. Advances in Computational Human Phantoms and Their Applications in Biomedical Engineering-A Topical Review. IEEE Transactions on Radiation and Plasma Medical Sciences PP(99):1-1. December 2018 DOI:10.1109/TRPMS.2018.2883437
11. Arioli, C., Shamanskiy, A., Klinkel, S., Simeon, B. Scaled boundary parametrizations in isogeometric analysis. Computer Methods in Applied Mechanics and Engineering 349, March 2019, DOI:10.1016/j.cma.2019.02.022
12. Leidinger, L.F, Breitenberger, M., Bauer, A.M., Hartmann, S. Explicit dynamic isogeometric B-Rep Analysis of penalty-coupled trimmed NURBS shells. Computer Methods in Applied Mechanics and Engineering 351 April 2019, DOI:10.1016/j.cma.2019.04.016
13. Vyatkin, S.I. Complex Surface Modeling Using Perturbation Functions. Optoelectronics, Instrumentation and Data Processing, vol. 43, no. 3, 2007. pp. 40-47.
14. Reimers, M., Seland, J. Ray Casting Algebraic Surfaces using the Frustum Form. Eurographics, vol. 27 (2008), no. 2, pp. 361-370.
15. Liktor, G. Ray Tracing Implicit Surfaces on the GPU. Computer Graphics and Geometry, vol. 10, no. 3, 2008, pp. 36-53. http://www.cgg-journal.com/2008-3/04.htm

Peer Review

Peer reviewers' evaluations remain confidential and are not disclosed to the public. Only external reviews, authorized for publication by the article's author(s), are made public. Typically, these final reviews are conducted after the manuscript's revision. Adhering to our double-blind review policy, the reviewer's identity is kept confidential.
The list of publisher reviewers can be found here.

The subject of the study is the development of a method for direct rendering of 3D objects based on perturbation functions using graphics processors. The research methodology is based on a combination of theoretical and empirical approaches using methods of analysis, modeling, numerical experiment, generalization, comparison, synthesis. The relevance of the research is determined by the widespread use of computer graphics technologies, the need to develop appropriate software systems and computational methods, including rendering three-dimensional objects using graphics processors. The scientific novelty is associated with the method of defining functional objects proposed by the author and the direct rendering method, which has a number of advantages over well-known analogues (simplicity and efficiency of calculating the points of intersection of a surface with rays, compact description of curved objects, simplicity of animation and deformation of surfaces). The article is written in Russian literary language. The style of presentation is scientific. The structure of the manuscript includes the following sections: 1. Introduction (functionally defined surfaces, representation of closed manifolds for modeling and visualization, solid-state models, triangular grids and NURBS, simple operations with CSG, polygonal models, models with boundary representations (B-rep), visualization problem, visualization method for surfaces defined algebraically by high-degree polynomials, visualization method based on non-constant step size, transformation of functionally specified surfaces into triangle grids, development of a method for direct rendering of functionally specified objects, effective finding of the first intersection of the ray with the surface), 2. Direct rendering of models based on perturbation functions (setting models using perturbation functions, implementation of a rendering algorithm on a graphics processor (GPU), a scene in a single three-dimensional cube, obtaining an image of a smooth object taking into account lighting, CUDA architecture, an application for direct rendering of functionally specified models (frame depth, normals and lighting are calculated), DirectX image display, testing on Intel Core2 CPU E8400 3.0 GHz, GPU 9800 GT and 470 GTX, number of frames per second, average frame time and acceleration (relative to the E8400 CPU) for different tests, comparison of the proposed direct rendering method with known approaches – the method of rendering algebraically specified surfaces, the method with a variable step size on the beam), Conclusion (conclusions), Bibliography. The sections "Introduction" and "Conclusion" should be numbered uniformly or left without numbering. Duplication of data in the table and in the figures is not advisable, which should be corrected. The text includes one table and three figures. Duplication of data in the table and in the figures is not advisable, which should be corrected. For the presented values, you need to specify the dimension. The content generally corresponds to the title. Abbreviations found in the text (CSG, CUDA, etc.) should be given in full at the first mention. The bibliography includes 15 sources of domestic and foreign authors – monographs, scientific articles, Internet resources, etc. Bibliographic descriptions of some sources require adjustments in accordance with GOST and editorial requirements, for example: 1. Sigg C. Representation and rendering of implicit surfaces. Zurich, Switzerland : Dipl. Rechn. Wiss. ETH, 2006. 162 p. 2. Dekkers D., Overveld K. V., Golsteijn R. Combining CSG modeling with soft blending using Lipschitz-based implicit surfaces // Visual Computer. 2004. Vol. 20. ¹ 6. P. 380–391. 5. Farin G., Hoschek J., Kim M.S. Handbook of Computer Aided Geometric Design.The place of publication ??? Elsevier, 2002. ??? p. Excessive self-citation is possible (Vyatkin S.I. with co-authors). Appeal to opponents (Sigg C., Dekkers D., Overveld K. V., Golsteijn R., Farin G., Hoschek J., Kim M. S., Pottmann H., Brell-Cokcan S., Wallner J., Farin G., Sturm T., Stroud I., Kainz W., Neufeld E., Bolch W.E., Graff C. G., Arioli C., Shamansky A., Klinkel S., Simeon B., Leidinger L. F, Breitenberger M., Bauer A.M., Hartmann S., Reimers M., Seland J., Liktor G., etc.) takes place. In general, the material is of interest to the readership and, after revision, can be published in the journal "Software Systems and Computational Methods".