Library

Your profile 
Software systems and computational methods
Reference:
Vyatkin S.I., Dolgovesov B.S.
Direct Rendering of ThreeDimensional Objects Based on Perturbation Functions Using GPUs
// Software systems and computational methods.
2023. ¹ 1.
P. 4250.
DOI: 10.7256/24540714.2023.1.38263 EDN: IWRNCU URL: https://en.nbpublish.com/library_read_article.php?id=38263
Direct Rendering of ThreeDimensional Objects Based on Perturbation Functions Using GPUs
DOI: 10.7256/24540714.2023.1.38263EDN: IWRNCUReceived: 13062022Published: 04042023Abstract: The object of the study is a method of direct rendering of complex threedimensional 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 solidstate geometry, direct rendering, graphics processor, streaming multiprocessors, parallel computing, parallel programming model, hierarchy of thread groups, acceleration of calculationsThis article is automatically translated. You can find original text of the article here. 1. IntroductionFunctionally defined surfaces are a representation of closed manifolds for modeling and visualization. Functional representations are a way of representing solidstate 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 timeconsuming. 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 solidstate modeling is to know whether a point is inside or outside an object ^{[58]}. It is also important to know whether the point is within the tolerance to the border. For models with boundary representations (Brep), the answer to this question means checking the point for each part of the topology in the model ^{[912]}. 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 errorprone, 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 Brep 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 nonconstant 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 threedimensional 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 required. In 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 threedimensional 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
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, threedimensional 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/ETHZA005267203 Corpus ID: 124349594
2. Dekkers, D., Overveld, K.V. Golsteijn, R. Combining CSG modeling with soft blending using Lipschitzbased 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. 102108. 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 9780444511041. 6. Pottmann, H., BrellCokcan, S., Wallner, J. Discrete Surfaces for Architectural Design. Archived 20090812 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 9780972848275. 7. Farin, G. Curves and Surfaces for CAGD. A Practical Guide, MorganKaufmann, 2002 ISBN 1558607374. 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.), SpringerVerlag, Berlin (2000), pp. 367381. 9. Stroud, I. Boundary Representation Modelling Techniques. Publisher: Springer, January 2006, ISBN: 9781846283123 DOI:10.1007/9781846286162 10. Kainz, W., Neufeld, E., Bolch, W.E., Graff, C.G. Advances in Computational Human Phantoms and Their Applications in Biomedical EngineeringA Topical Review. IEEE Transactions on Radiation and Plasma Medical Sciences PP(99):11. 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 BRep Analysis of penaltycoupled 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. 4047. 14. Reimers, M., Seland, J. Ray Casting Algebraic Surfaces using the Frustum Form. Eurographics, vol. 27 (2008), no. 2, pp. 361370. 15. Liktor, G. Ray Tracing Implicit Surfaces on the GPU. Computer Graphics and Geometry, vol. 10, no. 3, 2008, pp. 3653. http://www.cggjournal.com/20083/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 doubleblind review policy, the reviewer's identity is kept confidential.
