<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>GPU-Based Rendering for Ray Casting of Multiple Geometric Data</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sergei Vyatkin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Oleksandr Romaniuk</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Oleksandr Dudnyk</string-name>
          <email>dudnyk@vntu.edu.ua</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>. Synthesizing Visualization Systems Laboratory, Institute of Automation and Elecrtrometry SB RAS, RUSSIAN FEDERATION</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Software Engineering, Vinnytsia National Technical University, UKRAINE</institution>
          ,
          <addr-line>Vinnytsia, 95 Khmelnytske shose str.</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>1</fpage>
      <lpage>3</lpage>
      <abstract>
        <p>We present a new GPU-based rendering method for ray casting of multiple geometric data. Our approach supports a polygonal data to calculate scattered light. Terrain is represented for the base of scalar perturbation functions. The geometric model is based on non-polygonal representation. We present a new representation scheme for freeform surfaces it is possible to combine basic surface and perturbation functions. To recognize the place it is often sufficient to fill areas with the generalized texture patterns, such as "themes". Themes designed beforehand and consumption of memory for storing them is not huge.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        Using traditional polygonal representation for the example
complex surface give rise to a range of problems such as
visible surface determination, depth complexity handling,
controlling levels of details, clipping polygons by viewing
frustum, geometry transformations of large number of
polygons [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ].
      </p>
      <p>
        A method for constructing a triangle mesh whose vertices
coincide with the zero-valued isosurface is the Marching
Cubes algorithm [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Although it provides many greater
capabilities, the use of voxel-based terrain in real-time virtual
simulations also introduces several new difficulties. The
algorithms used to extract the terrain surface from a voxel
map produce far greater numbers of vertices and triangles
when compared to conventional 2D terrain. The development
of a seamless LOD algorithm for voxel-based terrain is vastly
more complex than the analogous problem for height-based
terrain.
      </p>
      <p>Texturing and shading of voxel-based terrain is more
difficult than it is for height-based terrain. In the cases that
triangle meshes are generated for multiple resolutions, arises
the cracking problem.</p>
      <p>
        A method for patching cracks on the boundary plane
between cells triangulated at different voxel resolutions was
described in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Using a voxel-based model however, can
achieve the same results at a much lower hardware
requirement.
      </p>
      <p>The proposed method includes the following main
features: rendering second-order surfaces; rendering surfaces
defined on a regular altitude grid (Shape texture); rendering
freeform surfaces; scattered light visualization.</p>
    </sec>
    <sec id="sec-2">
      <title>II. VOLUME-ORIENTED RENDERING</title>
      <p>
        Along with possibility to rasterizing 2D space, the main
feature of the proposed method is rasterizing made by 3D
space quadtree subdivision of pyramids of different levels,
which constitute the whole pyramid of vision. Then a
pyramid of the lowest level is binary-tree subdivided into
voxels of the lowest level - Recursive Multilevel Ray Casting
(RMLRC). In the latter case, extent space regions (in depth)
can masked out. Depth subdivision of space performed on the
logarithmic basis. The technique of RMLRC allows
determining an intersection of a ray (pyramid) of any level
with a surface effectively. It is also suitable for fast culling of
a spatial region outside an object. The core of this approach is
effective search of volume elements (hereinafter voxels),
involved in current frame generation, fused with direct
projection [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. If geometry transformation is described by
matrix (C) then new calculated matrix of quotients
(Q)'=(C)T*Q*(C) does in the coordinate system P the same
as the matrix (Q) in the coordinate system P. The matrix (C)
of projecting transformation calculated once for particular
frustum. So the use of projecting transformation generalizes
the discussed algorithm for pyramidal volumes (frustums)
and allows synthesize images with perspective. In our
approach a virtual environment can be described using
polygonal models, surfaces of second order,
threedimensional scalar functions, defined on discrete grid
h=h(u,v), free-form surfaces, which are represented by
composition of base surfaces and shape-driving functions.
The proposed RMLRC algorithm has several advantages in
processing mentioned surface models as compared with
known algorithms. Therefore, for example, RMLRC
algorithm applied for second order surfaces simplifies
calculation of Phuong shading, since at the last level of
subdivision derivative plane coefficients for the surface
obtained. Further, the possibility of second order and free
form surfaces composition allows producing objects that are
more complex. Photorealistic visualization of complex
surfaces, for instance, specified by a three-dimensional
function, defined on discrete grid h=h(u,v) can be done
without intermediate polygonal approximation. Such surfaces
represented by differential height map, i. e. the algebraic
carrier surface is given and in each grid node, only deviation
from this surface needed. This representation facilitates
calculation of contiguous levels of details as well as makes
easy quality filtering. Geometry transformations apply only
to the carrier surface and the height map is kind of surface
texture. Freeform surface representation differs from known
representations, such as for example, Constructive Shell
Representation [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], since the former is free of problems
arising when complex surfaces are approximated with large
number of Bezier patches, B-splines etc. (problems of
rendering patches boundaries, problems of warped
halfspaces). The proposed approach allows specifying surface
representation as composition of base surfaces and
shapedriving functions. Small number of such functions is enough
to describe surfaces of any form including non-convex, with
holes etc. (Fig. 1). Discussed surface representations and the
approach to their processing facilitate description of such
phenomena as waves, dynamic surface warping, morphing,
deformations and animation of wide range of surfaces.
      </p>
    </sec>
    <sec id="sec-3">
      <title>III. FREEFORM SURFACES</title>
      <p>
        Traditionally, the parametric form represents each patch in
a freeform surface as a mapping from 2D parameter space to
3D space. Although parametric patches are powerful for
constructing freeform surfaces, processing these patches
poses fundamental problems, only two - constructive solid
geometry (CSG) and boundary representation (Brep)
commonly represent solids exactly, that is, without
approximation. In particular, "separation" and other such
problems associated with curved halfspaces are hard to solve
in parametric patches. We present a new representation
scheme for freeform surfaces - it is possible to combine basic
surface F(x,y,z) and shape-driving function R(x,y,z) or
perturbation function, where shape-driving function
represents smooth deformation of basic surface [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The
shape-driving function is composed of several second-order
functions using logic intersection and union operations, it is
recursively evaluated during subdivision itself, and therefore,
computation of resulting R (x, y, z) is minimal. At the same
time, it is moderate in computations, so it can implemented in
hardware to carry on realistic object outlook.
      </p>
      <p>Because of application of the 3D space, subdivision
algorithm the possibility appears to render surfaces, which
usually consist of huge amount of patches such as freeform
surfaces.</p>
    </sec>
    <sec id="sec-4">
      <title>IV. SHAPE TEXTURE</title>
      <p>
        Non-regular terrain algorithms are more complex but
have the potential to reduce the number of polygons that the
system must process [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. However, for many terrains with
limited elevation gradient, the average expected reduction in
the image generator load is small for irregular grid as
compared to regular grid. Each irregular grid node consumes
much more computational time and memory than that of
regular. Systems, which employ irregular grids, are very
limited in the number of LODs that can handled. In addition,
it is very difficult to solve problems concerned with terrain
deformation when using irregular grid (explosions, pits in the
ground).
      </p>
      <p>
        Volume oriented rendering and uniformity of object
processing result in an efficient hidden surface removal and
detection of spatial collisions. Chosen representation of
terrain data is based on regular multi-level elevation map
complemented with levels of detail [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This approach has
several advantages, such as rapid generation and
modification, efficient data storing and retrieving, over
polygonal models.
      </p>
    </sec>
    <sec id="sec-5">
      <title>V. THEMATIC TEXTURE</title>
      <p>
        Systematically analyzing geographer’s work, Barr [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] has
described it as operating with the “geographic matrix”. For
clearness, it can thought as three-dimensional, i.e. two
dimensions correspond to the geo-coordinating system, and
the third one corresponds to a description list. Each element
represents a “geographic fact” (Fig. 2). For a large database,
it is resource-intensive to obtain and process geospecific
photo-texture for the entire gaming area. It assumed that most
of the benefits of geospecific photo-texture could attained by
combining a large amount of generic photo-texture with a
small amount of geospecific photo-texture.
      </p>
      <p>Simulation of big areas of terrain in the training system
image generators requires the large capacity of memory for
the photographic data storage. The usual approach to reduce
this information is to compress the data with the help of the
methods such as JPEG, etc. In the approach of the texture
composition it supposed, that the observer (pilot) often is not
interested in the exact, photographic information about the
areas, covered by, for example, forest, water, mountains, etc.
To recognize the place it is often sufficient to fill these areas
with the generalized texture patterns (we will call them
"themes" afterwards). Themes designed beforehand and
consumption of memory for storing them is not huge. Area of
the terrain photo-texture with the same theme approximated
by the polygons, which are bounded by curves. Each of the
polygons has the pointer to the texture theme and to the
procedure of generating the boundaries between the areas
with the different themes. The procedures of generating the
boundaries do not reproduce true boundaries exactly, but
have the goal to keep their features. There are two main
problems in the technique of the texture composition. The
first is the generation of the boundaries between the areas
with the different themes. To resolve this problem, the
algorithms, which allows generating the different kinds of
boundaries, designed. Among the possible kinds of the
boundaries the following can be selected: fractal boundaries,
following natural boundaries in the maps of the texture
themes (for example, following the streets in the texture map
of the town), procedural blend zones (beaches, etc.). The
second problem of the technique of the texture composition is
the filling the areas by the homogeneous texture pattern.
Filling the big area of the terrain by the small texture pattern
leads to the undesirable periodic, unnatural picture. The
introduction of the different kinds of non-regularity, which
keeps the features of the texture pattern, allows obtaining
more natural picture.</p>
      <p>The first stage is the usual rendering of polygons,
describing the texture, and filling the service buffer by the
pointers to the texture themes and kinds of boundaries. The
second stage is access to the buffer through the perturbation
map, to obtain the color of each texel. Perturbation map
calculated beforehand. Note that approach is adapted for the
generation of the fractal boundaries, but it allows to use the
procedural blend zones also, and to generate boundaries,
which coincide with the natural boundaries in the maps. To
generate fractal boundaries the following actions must be
done (some are simplified): access to the perturbation map by
address, defined by the U and V coordinates of the given
texel, to obtain the additions to the values of U and V.
Obtaining the new values of U and V by the addition with the
values from the perturbation map. Access to the buffer of the
source map by the address, defined by new values of U and
V, to obtain the index of the texture theme; access to memory
of the texture themes, to obtain the color of the texel.
Boundaries between regions, obtained by the method
described, looks fractal due to the fractal character of the
perturbation map used. Turbulent noise used to fill this map.
As it is well known, the higher spatial frequencies of the
turbulent noise have the smaller amplitude (and on the
contrary). All of the boundaries, obtained by this method, are
similar, but different themes can have different boundaries,
with different widths (amplitudes) and "crooknesses"
(frequencies). Therefore, the sequence of actions, described
above, must be little more complex: access to the source map
to obtain the characteristics of boundary; scaling of U and V
coordinates to obtain required frequency of the noise, then
access to the noise map (perturbation map). Multiplication of
the values, obtained from the noise map, by the constant
value to provide required amplitude of the noise, then
modification of U and V; access to the source map to obtain
the index of the texture map; access to memory of the texture
themes to obtain the color of the texel.</p>
      <p>Obviously, blending can become correct only if textural
areas have coinciding borders. To satisfy a condition an
additional database is introduced which describes faces of
blending areas. These faces do not differ from others and
their special role is to connect textural areas with different
borders. For this purpose, such face owns border description
of one area, and a texture of the other area. While the
database created, these faces constructed by expanding
polygons, i.e. by moving their edges. By the way,
procedurally generated areas can obtained exactly the same
way: if a certain polygon with any textural theme has a
prescribed blended border, the procedure described above
executed and a newly created polygon assigned descriptions
of the area created.</p>
      <p>The boundaries coinciding with natural borders within a
textural picture are considered. Such borders can formed by
processing the image from the original map buffer after all
textural polygons have been rasterized. Beside difficulties
with forming the borders between areas of different textures,
there is a problem concerning inner filling of these areas by a
homogeneous picture. Therefore, in the proposed approach
the textural coordinates disturbed by a noise-map to provide
singularities on the picture. It is possible to reuse noise values
previously obtained while determining the textural theme
index. Let us estimate memory and time consumption within
the proposed approach. Note, that original map resolution can
be less than final texture map resolution. Maximal spatial
frequency of the final image determined by a spatial
frequency of textural themes and a noise-map; therefore, they
can be scaled, so that one texel of original map is transformed
into an area filled by a certain picture with a fractal border.
Thus, minimal size of original map determined by a required
precision of border presentation. The image kept in an
original map consists of contiguous areas each filled by a
certain textural theme index, that is why these data can be
safely compressed using, for instance, Color Cell
Compression method (this will ensure up to six times
compression). Besides, this task can accomplished during
textural polygon rasterizing with no additional time
consumption. As noise-map, contents do not explicitly
emerge in the final image, periodically wrapped map can
used for this purpose and unwanted regularity will not
noticed. For instance, fractal border has a repeating structure
only if it originally presented as a straight line parallel to one
of textural coordinate axes. The task of rasterizing textured
polygons and filling original map is not extremely difficult
and can be handled by any sufficiently powerful universal
processor, moreover the time is limited only by a needed
uploading due to the camera’s motion. To determine the color
of a texel several steps are completed: fetch operation from
original map, from noise-map, then, modification of U and V
coordinates, fetch operation from original map and from
textural theme memory. As one may see, these operations are
quite simple and, therefore, a conventional textural fetch
operation can substituted. This implementation has several
significant advantages, as follows: overall memory
requirements are less then those for a global texture; texture
animation features become available by simple means, as
fractal border can made animated, if a shift is applied to a
noise-map at each frame. In addition, noise magnitude can
change resulting in an interesting effect. In analogous way,
texture inside the distinct regions can animated. Besides, this
approach would be naturally used also for all other feature
textures (fetch operation from original texture memory
should be excluded). All this could be useful while rendering,
for instance, water surface, flames, snow, etc.</p>
      <p>It should be also mentioned that implementation described
above requires original map, noise-map and textural theme
(as MIP map) storing, Generation of levels of detail for
textural themes and noise-maps is of no difficulty, however
levels of detail for original map is not clear, because these
data are indices, which cannot be blended like colors. A
straightforward solution of this problem is to eliminate details
that are smaller than corresponding texel size, i.e. only
wholly covered texels handled during rasterizing original
textural polygons.</p>
    </sec>
    <sec id="sec-6">
      <title>VI. SCATTERED LIGHT</title>
      <p>The vertex shaders compute the light reaching the eye from
a source or a reflective object and fog component. The inputs
to the vertex shader are vertex position, transformation
matrices, sunlight intensity, the sun direction, the various
extinction and scattering coefficients. In this implementation
using calculate them per-vertex in a vertex shader. If the Sun
is not too low in the sky, this approximation gives good
results at a low cost. For these assumptions, the illumination
of the ground plane and light reaching the eye from it may
easily derived (Fig. 3). To find the color perceived along a
line of sight, we must consider both the light reflected by
objects along the line of sight, attenuated by the inverting
fog, and the light scattered towards the eye by fog along the
line of sight.</p>
    </sec>
    <sec id="sec-7">
      <title>VII. PERFORMANCE</title>
      <p>The visualization time is reduced by using the
computational resources of a graphics processing unit with
compute unified device architecture (CUDA). The result of
running the programs on different processing units is the
same even if they may have a different number of streaming
multiprocessors. A large portion of the cube will be computed
in parallel. Among the functions of the graphics processing
unit was to calculate the coordinates of points of the surfaces,
normals, and illumination. Geometric transformations were
performed by the central processing unit (CPU). Rendering
results using CPU (i7-2700K) and GPU (GTX 550Ti, GTX 750</p>
    </sec>
    <sec id="sec-8">
      <title>Ti, GTX 950) are shown in Table 1.</title>
      <p>Resolution i7-2700K GTX 550TiGTX 750 Ti GTX 950</p>
      <p>The surface obtained will be smooth (Fig. 1 and Fig. 3),
and a small number of perturbation functions (16) will be
necessary to create complex surface forms. The figure shows
a result of modeling a scene object by means of free forms,
whose description required 2Kbyte information, which is 500
times less than the polygonal description that would take
1Mbyte information.</p>
    </sec>
    <sec id="sec-9">
      <title>VIII. CONCLUSION</title>
      <p>The main advantages include ease of calculation of points
on the surface with quick search and rejection of the regions
not occupied by the scene objects. A factor of 100 or more
decrease in the number of surfaces for describing curved
objects. Operations of the Geometry Processor (CPU)
becomes significantly easier and data stream from the
Geometry Processor (CPU) to the Renderer (GPU) reduced.
Paralleling of the system becomes easier because the total
system performance determined by the performance of the
Renderer (GPU) which operations can be easily distributed
between different screen regions. All problems connected to
terrain generation solved. The opportunity to describe objects
with grid values, i.e., with shape texture map; it becomes
possible to morph objects; it is achieved by plain
interpolation or animation of shape texture. It can used to
render clouds, explosions, waves on water, etc.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>R.</given-names>
            <surname>Pajarola</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Gobbetti</surname>
          </string-name>
          .
          <article-title>"Survey on semi-regular multiresolution models for interactive terrain rendering”. The visual computer</article-title>
          .
          <source>International Journal of Computer Graphics</source>
          , Vol.
          <volume>23</volume>
          , P.
          <fpage>583</fpage>
          -
          <lpage>605</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>P.</given-names>
            <surname>Lindstrom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Koller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Ribarsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. F.</given-names>
            <surname>Hodges</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Nick</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G. A.</given-names>
            <surname>Turner</surname>
          </string-name>
          . “
          <article-title>Real-time, continuous level of detail rendering of height fields”</article-title>
          <source>In Proceedings of Siggraph</source>
          ,
          <year>1996</year>
          , P.
          <fpage>109</fpage>
          -
          <lpage>118</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>W. E.</given-names>
            <surname>Lorense</surname>
          </string-name>
          , and
          <string-name>
            <surname>H. E. Cline.</surname>
          </string-name>
          “
          <article-title>Marching cubes: A high resolution 3D surface construction algorithm”</article-title>
          .
          <source>Computer Graphics, Proceedings of SIGGRAPH 87</source>
          , P.
          <fpage>163</fpage>
          -
          <lpage>169</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Shu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhou</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M. S.</given-names>
            <surname>Kankanhalli</surname>
          </string-name>
          . “
          <article-title>Adaptive marching cubes”</article-title>
          .
          <source>The Visual Computer</source>
          , Vol.
          <volume>11</volume>
          ,
          <string-name>
            <surname>P.</surname>
          </string-name>
          <year>202</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Vyatkin</surname>
            <given-names>S. I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Romanyuk</surname>
            <given-names>A. N.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Savitska L. A.</surname>
          </string-name>
          <article-title>“Multi-level ray casting of function-based surfaces</article-title>
          ”
          <source>Journal of Physics: Conference Series</source>
          ,
          <volume>803</volume>
          , №
          <volume>1</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>P.</given-names>
            <surname>Menon</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T. J.</given-names>
            <surname>Watson</surname>
          </string-name>
          <article-title>"Constructive Shell Representation Freeform Surfaces"</article-title>
          .
          <source>IEEE Computer Graphics 0373-17-16</source>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>S. I. Vyatkin.</surname>
          </string-name>
          “
          <article-title>Complex Surface Modeling using Perturbation Functions”</article-title>
          .
          <source>Optoelectronics, Instrumentation and Data Processing</source>
          .
          <volume>43</volume>
          (
          <issue>3</issue>
          ), P.
          <fpage>226</fpage>
          -
          <lpage>231</lpage>
          (
          <year>2007</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>R.</given-names>
            <surname>Barr</surname>
          </string-name>
          "
          <source>Automated cartography and geographical information: Part</source>
          <volume>2</volume>
          ", Advances in Computer Graphics, Volume
          <volume>11</volume>
          , Springer, page
          <volume>29</volume>
          ,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>