# Patent

## Title
Non-linear beam tracing for computer graphics

## Abstract

A non-linear beam tracing technique that supports full non-linear beam tracing effects including multiple reflections and refractions for computer graphics applications. The technique introduces non-linear beam tracing to render non-linear ray tracing effects such as curved mirror reflection, refraction, caustics, and shadows. Beams are allowed to be non-linear where rays within the same beam are not parallel or do not intersect at a single point. Such is the case when a primary beam bounces off of a surface and spawns one or more secondary rays or beams. Secondary beams can be rendered in a similar manner to primary rays or beams via polygon streaming. Beyond smooth ray bundles, the technique can also be applied to incoherent ray bundles which is useful for rendering bump mapped surfaces.

## Background
BACKGROUND
Computer graphics have advanced significantly in the past years, especially in light of the increased popularity of video gaming. Various techniques have been employed to create fast and realistic computer graphics for various applications and to overcome common problems with rendering scenes and objects in computer graphics applications.
Reflections and refraction are difficult to model in computer graphics applications because they often produce non-linear rays or beams. For reflection, the ultimate goal is to render curved reflections of nearby objects with fully dynamic motion in real time. However, in the past in an attempt to meet such a goal, it has been necessary to either assume distant objects, planar reflectors, static scenes, limited motion for frame-to-frame coherence, or to rely on extensive pre-computation for all possible motion parameters. For example, some methods allow curved mirror reflection of distant objects but not for nearby objects. Additionally, some previous rendering techniques have required fine tessellation of scene geometry for rendering curvilinear effects. This requires a high geometry computation workload regardless of the original scene complexity, which is often quite simple for interactive applications such as games. Refraction poses an even bigger challenge than reflection, as even planar refraction can produce non-linear effects. Common rendering techniques typically handle only nearly planar refractors or only far away scene objects, but not refraction of near objects.
Some techniques for displaying computer graphics include ray tracing and beam tracing. Ray tracing is a rendering algorithm where visualisations of programmed scenes are produced using a technique which follows rays from the eyepoint outward, rather than originating at the light source. Ray tracing efficiently provides accurate simulations of reflection and refraction of light off of objects in a scene. However, most existing ray tracing techniques store scene geometry in a database and pre-compute certain data structures for efficient rendering. As such ray tracing is less suitable for rendering dynamic scenes.
Beam tracing is a derivative of ray tracing that replaces rays, which have no thickness, with beams. Beams are shaped like unbounded pyramids, with polygonal cross sections and with a beam base that intersects the film or sensor plane of the camera capturing the scene. Beam tracing combines the flexibility of ray tracing and the speed of polygon rasterization in computer graphics applications. One primary advantage of beam tracing is efficiency as it can render individual beams via polygon rasterization which is readily performed by conventional graphics processing units (GPUs). Beam tracing can also resolve sampling, aliasing and level of detail issues that plague conventional ray tracing. However, beam tracing to date has been only able to process linear transformations. Thus, beam tracing has only been applicable to linear effects such as planar mirror reflections but not to non-linear effects such as curved mirror reflection, refraction, caustics, and shadows. Note that such non-linear effects are not limited to curved geometry as even planar refraction is non-linear. Another common non-linear effect arises from bump-mapped surfaces as modeling them requires incoherent ray bundles that cannot be handled using non-linear beams. Furthermore, non-linear beam tracing is highly challenging because common graphics hardware, such as, for example, commodity graphics hardware, supports only linear vertex transformation and triangle rasterization.
SUMMARY
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The non-linear beam tracing technique described herein supports full non-linear beam tracing effects including multiple reflections and refractions. The technique introduces non-linear beam tracing to render non-linear ray tracing effects such as curved mirror reflection, refraction, caustics, and shadows. Beams are non-linear where rays within the same beam are not parallel or do not intersect at a single point. Such is the case when a primary beam bounces off of a surface and spawns one or more secondary rays or beams. Secondary beams can be rendered in a similar manner to primary rays or beams via polygon streaming. The technique can also be applied to incoherent ray bundles such as occur when rendering bump mapped surfaces.
In one embodiment of the non-linear beam forming technique, image data of a scene or object to be displayed on a computer display and a texture mesh are input. As a first step, a beam tree is constructed on a CPU by bouncing the primary beam off of scene reflectors/refractors to spawn secondary or higher order beams. This beam tree construction step produces beams with triangular cross sections, and may include both smooth and perturbed beams. These smooth and perturbed beams are typically non-linear with the exception of each primary beam. After the beam tree is constructed on a CPU, the content of the beams are then rendered on a GPU. More specifically, in beam parameterization, for each point P on the beam base triangle of a beam an associated ray with a specific origin and direction are computed. A bounding triangle of each scene triangle of the image data projected onto a corresponding beam base triangle is computed for all smooth beams (beams that are not perturbed by a bump map). A bounding triangle for each of any perturbed beams (beams perturbed by a bump map) is then computed by expanding the bounding triangle as computed for the smooth beams. Pixel shading is then performed by determining how each pixel P within each bounding triangle is rendered. Using the previous beam parameterization where for each pixel within the bounding triangle a ray origin and direction was computed, for each pixel the computed ray is followed into space. If the ray does not intersect a scene triangle the pixel is removed from further calculations. If the ray does intersect a scene triangle, the pixel attributes (depth, color or texture coordinates) are determined from the ray's intersection point with the scene triangle and these attributes at the ray's intersection with the scene triangle are used to render the pixel.
In the following description of embodiments of the disclosure, reference is made to the accompanying drawings which form a part hereof, and in which are shown, by way of illustration, specific embodiments in which the technique may be practiced. It is understood that other embodiments may be utilized and structural changes may be made without departing from the scope of the disclosure.



DESCRIPTION OF THE DRAWINGS
The specific features, aspects, and advantages of the disclosure will become better understood with regard to the following description, appended claims, and accompanying drawings where:
FIG. 1 provides an overview of an environment in which beam tracing is typically carried out.
FIG. 2 is a diagram depicting one exemplary architecture in which one embodiment of the non-linear beam tracing technique can be employed.
FIG. 3 is an example of beam tracing for one scene triangle using the non-linear beam tracing technique.
FIG. 4 is a flow diagram depicting a generalized exemplary embodiment of a process employing one embodiment of the non-linear beam tracing technique.
FIG. 5 is a flow diagram depicting another exemplary embodiment of a process employing one embodiment of the non-linear beam tracing technique.
FIG. 6 is a schematic of an exemplary computing device in which the present non-linear beam tracing technique can be practiced.



DETAILED DESCRIPTION
In the following description of the non-linear beam tracing technique, reference is made to the accompanying drawings, which form a part thereof, and which is shown by way of illustration examples by which the non-linear beam tracing technique may be practiced. It is to be understood that other embodiments may be utilized and structural changes may be made without departing from the scope of the claimed subject matter.
1.0 Non-Linear Beam Tracing
Realizing non-linear beam tracing is challenging as typical graphics hardware units (GPUs) support only linear vertex transforms and triangle rasterization. One embodiment of the non-linear beam tracing technique described herein overcomes this by implementing a non-linear graphics pipeline on top of a standard GPU (e.g., a commodity GPU). Specifically, the technique can render a given scene triangle into a projection region with non-linear edges. This is achieved by customizing the vertex computations to estimate a bounding triangle for the projection region of a scene triangle. The scene triangle is then rendered by a shader/fragment module using the bounding triangle. For each pixel within the bounding triangle, the fragment module performs a simple ray-triangle intersection test to determine if the pixel is within the true projection of the scene triangle. If so, the pixel is shaded, otherwise it is discarded via fragment kill. The technique provides a bounding triangle computation that is both tight and easy to compute, and that remains so for both smooth and perturbed beams. Other technical contributions include beam parameterization that allows efficient bounding triangle estimation and pixel shading while ensuring projection continuity across adjacent beams. Some embodiments of the technique also employ a frustum culling strategy where the frustum sides are no longer planes, and a fast non-linear beam tree construction that supports multiple beam bounces. The non-linear beam tracing technique supports fully dynamic scenes or larger polygon-count scenes since it does not require pre-storage of a scene database. As a result, scenes can be rendered in real-time.
1.1 Operating Environment
FIG. 1 provides an exemplary operating environment wherein the non-linear beam tracing technique can be practiced. More specifically, FIG. 1 depicts a simple example of a path of rays recursively generated from the camera (or eye beam) 102 to a light source 104. The camera 102 can be connected to a computing device 120 that can manipulate the scene or image data. First, a ray is created at an eyepoint 102 and traced through a pixel 108 and into the scene, where it hits a surface 110. The surface reflects light in all directions. From that surface 110 the algorithm recursively generates a reflection ray 112, which is traced through the scene, where it hits another surface 114. Finally, another reflection ray 116 is generated and traced through the scene, where it hits the light source 104 and is absorbed. The color of the pixel now depends on the colors of both of the surfaces and the color of the light source. Beam tracing, vice ray tracing is used in the non-linear beam tracing technique described herein. In beam tracing, the rays 108, 112, 116, as shown in FIG. 1, which have no thickness in ray tracing, are replaced with beams in a beam tracing scenario. These beams are shaped like unbounded pyramids. In beam tracing, a pyramidal beam is initially cast through the entire viewing frustrum 118, for example, a computer display. This initial viewing beam is intersected with each polygon in the environment, from nearest to farthest. Each polygon that intersects with the beam must be visible, and is removed from the shape of the beam and added to a render queue. When a beam intersects with a reflective or refractive polygon, a new beam is created in a similar fashion to ray-tracing.
1.2 Exemplary Architecture
FIG. 2 depicts an exemplary architecture in which the non-linear beamforming technique can be practiced. Image or scene data 202 of a three dimensional object that is to be displayed on a computer display (two dimensional by nature) is input into a computing device 600 such as will be described in more detail with respect to FIG. 6. The computing device 600 employs a central processing unit (CPU) 204 which hosts a beam tree construction module 206 and a mesh construction module 208. The beam tree construction module 206 constructs a beam tree for linear and non-linear beams, recording the boundary rays for each beam of the beam tree. The beam tree is built in a depth first order (i.e., using the tree root first, followed by the first layer, followed by the second layer). The beams caused by reflections and refractions are non-linear (a beam is linear only when all of its rays merge at a single eye point), while the primary beam (the beams prior to reflection/refraction) is linear. The mesh construction module 208 constructs one or more meshes for three dimensional objects that are reflectors or refractors. Objects that are not reflectors or refractors are simply obtained from the scene data set, as is the case in any typical rendering application. The meshes are used to overlay textures on once the pixel shading and location has been determined by the non-linear beam tracing technique as will be discussed later.
The beam tree, mesh, and any command from the CPU are input into a GPU front end module 210 which resides on a Graphics Processing Unit module 212. This GPU front end module 210 carves the scene or image data into triangular sections which are defined by vertices. The GPU front end module 210 sends the vertices of the triangular sections of the image data to a programmable vertex processor 214. The programmable vertex processor 214 transforms the vertices of the sections of the scene or image data into a global coordinate system and further computes a linear bounding triangle containing a projection of a scene triangle for each beam (e.g., beam base) of the beam tree. The programmable vertex processor 214 has separate modules for bounding triangle estimation for smooth beams 216 and for bounding triangle estimation for perturbed beams 218. The transformed vertices and bounding triangles for all beams are input into a primitive assembly module 220 that assembles primitives (geometric objects the system can draw) from the vertices in the global coordinates. The primitives and the bounding triangles are input into a rasterization and interpolation module 222 that determines the pixel location of fragments of the primitives (scene triangles) on the visible portions of the computer display. The computed fragments (scene triangles) are then input into a programmable fragment processor/shader module 224 that computes a color value for each pixel, rejecting pixels that are not inside the bounding triangle containing the projection of a scene triangle computed by the vertex processor 214. To do this the programmable fragment processor module 224 simply computes the ray (origin and direction according to the beam parameterization) for each pixel inside the bounding triangle and intersects the ray with the scene triangle to determine if it is a hit or miss; if it is a hit the pixel is shaded according to the intersection point, otherwise it is a miss and the pixel is killed. The pixel color and pixel location stream of the fragments are input into a raster operations module 226 that combines these inputs to update the color and location of every pixel, thereby creating the frame buffer or output image 228.
The following paragraphs provide an example of the rendering of a scene triangle within a beam using the exemplary architecture of the non-linear beam tracing technique described above.
One embodiment of the non-linear beam tracing technique renders scene triangles one by one via feed-forward polygon rasterization. As illustrated in FIG. 3, due to the non-linear nature of the beams, straight edges of a triangle might project onto curves on the beam base plane and the triangle might project onto multiple and/or non-triangular components. Such a non-linear projection cannot be directly achieved by a conventional linear graphics pipeline. Instead, in one embodiment of the technique, a non-linear graphics pipeline is implemented on a GPU by customizing both the vertex 214 and fragment modules 224 as follows. For each scene triangle 302, the vertex program 214 estimates a bounding triangle 308 that properly contains the projected region of the scene triangle on the beam base plane 310. This bounding triangle 308 is then passed down to the rasterizer 222. Note that even though the projected region 310 may contain curved edges or even multiple components, the bounding triangle 308 possesses straight edges so that it can be rasterized as usual. For each pixel within the bounding triangle, the fragment module 224 performs a simple ray-triangle intersection test to determine if it is within the true projection; if so, the pixel is shaded, otherwise, it is discarded via fragment kill.
More specifically, FIG. 3 depicts the rendering of one scene triangle within one beam. The scene triangle 302 is projected onto the beam base triangle of the camera sensor/film plane 304. Due to non-linear projection of the scene triangle 302, the projected region 306 may have curved edges. The rendering is performed by a combination of the previously discussed programmable vertex processor 214 that estimates the bounding triangle 308, and the fragment processor 224 that shades and determines if each bounding triangle pixel is within the true projection of the scene triangle 302. In this example, p1 312 lies within the true projection but not p2 314.
Rendering results for each beam are stored as a texture on its base triangle. The collection of beam base triangles is then texture mapped onto the original reflector/refractor surfaces (e.g., textures 208) for final rendering. For clarity, the collection of beam base triangles corresponding to a single reflector/refractor object is called a BT (beam tracing) mesh. The resolution of the BT mesh trades off between rendering quality and speed. A BT mesh is associated with a reflector/refractor interface through either mesh simplification or procedural methods, depending on whether the interface is static (e.g. a mirror teapot) or dynamic (e.g. water waves).
1.3 Exemplary Processes
FIG. 4 depicts an exemplary flow diagram of an exemplary process employing the non-linear beam forming technique. In this embodiment of the technique, image data of a scene or object to be displayed on a computer display is input (box 402). A beam tree of linear and non-linear beams of triangular cross-sections is built by employing non-linear beam tracing while recording three boundary rays for each beam (box 404). The beam tree has nodes which represent beams of light and links which represent the parent-child relationships among these beams. The beam tree is preferably constructed in a depth-first traversal order (e.g., starting at the root). The linear and non-linear beams are then rendered in a depth-first order according to the beam tree, and the final beam rendered, corresponding to the eye beam, produces the final image on the computer display (box 406).
FIG. 5 depicts another flow diagram of an exemplary process employing one embodiment of the non-linear beam forming technique to display image or scene data on a computer display. Scene data or image data of an object to be displayed on a computer display and a texture mesh are input (box 502). Beam parameterization of triangular-shaped smooth and perturbed beams is computed (e.g. for each point P on the beam base triangle of the beam an associated ray with a specific origin and direction is computed (this can be done using equations 1 and 2 to be discussed in Section 1.4.1) (box 504). A beam tree is computed using the beam tree parameterization of linear and non-linear beam (box 506). After the beam tree is built, the beams are rendered as follows. The scene or image data is divided into scene triangles (box 512). For each scene triangle, a bounding triangle is computed for each smooth beam (box 508). A bounding triangle for perturbed beams (e.g. beams perturbed by a bump map) is then computed by expanding the bounding triangle as calculated for a smooth beam (box 510). Pixel shading is then performed by determining how each pixel P within the bounding triangle is rendered. For each pixel within each bounding triangle the previously computed ray origin and direction are used. If the ray does not intersect a scene triangle the pixel is removed from further calculations. If the ray does intersect a scene triangle, the pixel attributes (depth, color or texture coordinates) are determined from the ray's intersection point with the scene triangle and these attributes at the ray's intersection with the scene triangle are used to render the pixel (box 514). The pixel results for each beam are stored as a texture and then mapped onto the texture map during rendering (box 516).
An exemplary architecture and process employing the non-linear beam tracing technique having been discussed the following paragraphs provide details.
1.4 Technique Details and Alternate Embodiments
An overview of one embodiment of the non-linear beam tracing technique is summarized in Table 1. The steps of the technique described in Table 1 are cross-correlated to the flow chart shown in FIG. 4. Details follow in the sections below.







TABLE 1





Process Overview of One Embodiment of the Non-Linear Beam


Tracing Technique.















function Non-linearBeamTracing( )


B0 ← eye beam from viewing parameters


{Bij} ← BuildBeamTree(B0)//on CPU or GPU (boxes 402, 404 of FIG. 4)


//i indicates depth of beam tree with j labels nodes in level i


for each (i,j) in depth first order


  RenderBeam (Bij)//on GPU (box 406 of FIG. 4)


end for


function {Bij} ← BuildBeamTree(B0) (boxes 402, 404 of FIG. 4)


  trace beam shapes recursively allowing non-linear beams to bounce


   off of curved surfaces


  record boundary rays { {{right arrow over (dijk)}}k=1,2,3 for each Bij


function RenderBeam (B) (box 406 of FIG. 4)


  if perturbation required //bump map or other sources


  perturb rays in B


  δ ← maximum angular deviation of B from original (smooth)


    beam parameterization


  else


  δ ← 0


  end if


  for each scene triangle Δ


    {tilde over (Δ)} ← Bounding Triangle (Δ, B, δ }//vertex shoulder


    RenderTriangle({tilde over (Δ)}, Δ, B)// fragment shader


  end for









As shown in FIG. 4 and Table 1, the non-linear beam tracing framework of one embodiment of the technique is divided into two major parts: building a beam tree a on CPU or GPU (boxes 402, 404 of FIG. 4), and rendering the beams on GPU (as illustrated in Non-linearBeamTracing( ) portion of Table 1 and box 406 of FIG. 4). In one embodiment of the technique the beams have triangular cross sections and three boundary rays associated with each beam are computed and recorded (as illustrated in the BuildBeamTree( ) portion of Table 1 and shown in FIG. 4, box 404).
The following paragraphs provide details regarding the previously discussed process actions.
1.4.1 Beam Parameterization
As previously described with respect to FIG. 4, boxes 402, 404 and Table 1, in one embodiment of the technique, beams with triangular cross sections are employed for easy processing. For each point {right arrow over (P)} on the beam base triangle, the beam parameterization defines an associated ray with a specific origin and direction. The beam parameterization for ray origins and directions has the following characteristics: (1) the vertex values can be interpolated, (2) edge values of the triangles depend only on the two adjacent vertices, (3) C0 continuity (Cn continuity means that the function values are continuous up to the nth derivative, so C0 continuity simply means that the function values are continuous and specifically there are no sudden jumps.) exists across adjacent beams to ensure pattern continuity, (4) no excessive undulations occur inside each beam, (5) the beam parameterization is easy to compute on a per pixel basis for efficient fragment program execution, and (6) it allows for easy bounding triangle estimation for efficient vertex program execution. Two types of parameterizations are employed in one embodiment of the technique: a smooth parameterization for coherent beams and a bump-map parameterization for perturbed beams.
More specifically, given a beam B with normalized boundary rays {{right arrow over (d1)},{right arrow over (d2)},{right arrow over (d3)}} defined on three vertices of its base triangle ΔP1P2P3, the smooth parameterization of the ray origin and direction for any point P on the beam base plane is defined via the following formula:




  
    
      
        
          
            O
            →
          
          =
          
            
              ∑
              
                
                  i
                  +
                  j
                  +
                  k
                
                =
                n
              
            
            ⁢
            
              
            
            ⁢
            
              
                
                  a
                  ijk
                
                _
              
              ⁢
              
                ω
                1
                i
              
              ⁢
              
                ω
                2
                j
              
              ⁢
              
                ω
                3
                k
              
              ⁢
              
                
              
              ⁢
              
                (
                
                  ray
                  ⁢
                  
                    
                  
                  ⁢
                  origin
                
                )
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            d
            →
          
          =
          
            
              ∑
              
                
                  i
                  +
                  j
                  +
                  k
                
                =
                n
              
            
            ⁢
            
              
            
            ⁢
            
              
                
                  b
                  ijk
                
                _
              
              ⁢
              
                ω
                1
                i
              
              ⁢
              
                ω
                2
                j
              
              ⁢
              
                ω
                3
                k
              
              ⁢
              
                
              
              ⁢
              
                (
                
                  ray
                  ⁢
                  
                    
                  
                  ⁢
                  direction
                
                )
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            ω
            i
          
          =
          
            
              area
              ⁡
              
                (
                
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    P
                    i
                  
                  ⁢
                  
                    P
                    j
                  
                  ⁢
                  
                    P
                    k
                  
                
                )
              
            
            
              
                area
                ⁡
                
                  (
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      P
                      1
                    
                    ⁢
                    
                      P
                      2
                    
                    ⁢
                    
                      P
                      3
                    
                  
                  )
                
              
              
                
                  i
                  =
                  1
                
                ,
                2
                ,
                3
                ,
                
                  j
                  =
                  
                    
                      (
                      
                        i
                        ⁢
                        mod
                        ⁢
                        3
                      
                      )
                    
                    +
                    1
                  
                
                ,
                
                  k
                  =
                  
                    
                      (
                      
                        i
                        ⁢
                        
                          
                        
                        ⁢
                        
                          mod
                          ⁢
                          3
                        
                      
                      )
                    
                    +
                    2
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            
              a
              ijk
            
            _
          
          =
          
            
              
                L
                ijk
              
              _
            
            (
            
              
                
                  P
                  1
                
                _
              
              ,
              
                
                  P
                  2
                
                _
              
              ,
              
                
                  P
                  3
                
                _
              
            
            )
          
        
        ⁢
        
          

        
        ⁢
        
          
            
              b
              ijk
            
            _
          
          =
          
            
              
                L
                ijk
              
              _
            
            (
            
              
                
                  d
                  1
                
                _
              
              ,
              
                
                  d
                  2
                
                _
              
              ,
              
                
                  d
                  3
                
                _
              
            
            )
          
        
      
    
    
      
        (
        1
        )
      
    
  




where {right arrow over (L)} is a function satisfying the following linear property for any real number s, {{right arrow over (P1)},{right arrow over (P2)},{right arrow over (P3)}}, and {{right arrow over (d1)},{right arrow over (d2)},{right arrow over (d3)}}:





  
    
      
        
          
            L
            →
          
          (
          
            
              
                
                  P
                  1
                
                _
              
              +
              
                s
                ⁢
                
                  
                
                ⁢
                
                  
                    d
                    1
                  
                  _
                
              
            
            ,
            
              
                
                  P
                  2
                
                _
              
              +
              
                s
                ⁢
                
                  
                
                ⁢
                
                  
                    d
                    2
                  
                  _
                
              
            
            ,
            
              
                
                  P
                  3
                
                _
              
              +
              
                s
                ⁢
                
                  
                
                ⁢
                
                  
                    d
                    3
                  
                  _
                
              
            
          
          )
        
        =
        
          
            
              L
              →
            
            (
            
              
                
                  P
                  1
                
                _
              
              ,
              
                
                  P
                  2
                
                _
              
              ,
              
                
                  P
                  3
                
                _
              
            
            )
          
          +
          
            s
            ⁢
            
              
            
            ⁢
            
              
                L
                →
              
              (
              
                
                  
                    d
                    1
                  
                  _
                
                ,
                
                  
                    d
                    2
                  
                  _
                
                ,
                
                  
                    d
                    3
                  
                  _
                
              
              )
            
          
        
      
    
    
      
        (
        2
        )
      
    
  




This formulation is termed as the Sn parameterization, the beam parameterization for a smooth beam (where {right arrow over (L)} contains





  
    {
    
      
        n
        !
      
      
        
          i
          !
        
        ⁢
        
          j
          !
        
        ⁢
        
          k
          !
        
      
    
    }
  
  
    
      i
      +
      j
      +
      k
    
    =
    n
  




terms). Note that this is an extension of the computation of triangular Bezier patches with two additional constraints: (1) the identical formulations of {right arrow over (aijk)} and {right arrow over (bijk)} in Equation 1, and (2) the linear property for {right arrow over (L)} as in Equation 2. These are essential for an efficient GPU implementation. Even with these two restrictions, the Sn parameterization is still general enough to provide desired level of continuity. Note that in general {right arrow over (O)}≠{right arrow over (P)} unless under the C0 parameterization.





  
    
      
        
          
            O
            →
          
          =
          
            
              
                
                  ω
                  1
                
                ⁢
                
                  
                    P
                    1
                  
                  _
                
              
              +
              
                
                  ω
                  2
                
                ⁢
                
                  
                    P
                    2
                  
                  _
                
              
              +
              
                
                  ω
                  3
                
                ⁢
                
                  
                    P
                    3
                  
                  _
                
              
            
            =
            
              P
              →
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            d
            →
          
          =
          
            
              
                ω
                1
              
              ⁢
              
                
                  d
                  1
                
                _
              
            
            +
            
              
                ω
                2
              
              ⁢
              
                
                  d
                  2
                
                _
              
            
            +
            
              
                ω
                3
              
              ⁢
              
                
                  d
                  3
                
                _
              
            
          
        
      
    
    
      
        (
        3
        )
      
    
  




Even though in theory general Ck continuity might be achieved via a large enough n in the Sn parameterization, it has been found out through experiments that an excessively large n not only slows down computation but also introduces excessive undulations. The tradeoff between C0 and S3 (Sn mentioned above with n equals to 3) parameterizations is that C0 is faster to compute (both in vertex and pixel programs) but S3 offers higher quality as it ensures C1 continuity at BT mesh vertices. This quality difference is most evident for scene objects containing straight line geometry or texture.
For perturbed beams, {right arrow over (d)} and {right arrow over (O)} are computed via the C0 parameterization followed by standard bump mapping. Due to the nature of perturbation it has been found a parameterization with higher level continuity unnecessary. For efficient implementation and ease of computation, it is assumed that all rays {{right arrow over (d1)},{right arrow over (d2)},{right arrow over (d3)}} point to the same side of the beam base plane. The exception happens only very rarely for beams at grazing angles. This is enforced in one implementation by proper clamping of {{right arrow over (d1)},{right arrow over (d2)},{right arrow over (d3)}}.
1.4.2 Shading
In this section how one embodiment of the fragment module (FIG. 2, 224) renders each point {right arrow over (P)} within the bounding triangle {tilde over (Δ)} is computed by the vertex module (FIG. 2, 214) is described. As previously discussed, for each point {right arrow over (P)}, first its ray origin {right arrow over (OP)} and direction {right arrow over (dP)} is computed via Equation 1 (followed by a bump map computation if necessary) (FIG. 5, box 504). Then a simple ray-triangle intersection between the ray ({right arrow over (OP)},{right arrow over (dP)}) and the scene triangle is performed. If the ray does not intersect the scene triangle, the pixel associated with {right arrow over (P)} is immediately removed from further processing. Otherwise, its attributes (depth, color, or texture coordinates) are determined from the intersection point {right arrow over (Q)} and {right arrow over (P)} is shaded followed by frame-buffer write with hardware z-test (FIG. 5, boxes 514, 516). From now on, it is said that a scene point {right arrow over (Q)} has a projection {right arrow over (P)} on beam base Πb if there exists a real number t so that {right arrow over (Q)}={right arrow over (OP)}+t{right arrow over (dP)}. In the bounding triangle estimation procedure below, a related operation termed transfer that is defined as follows is employed. A scene point {right arrow over (Q)} has a transfer {right arrow over (P)} on a plane Πb in the direction {right arrow over (d)} if there exists a real number t so that {right arrow over (Q)}={right arrow over (P)}+t{right arrow over (d)}. In other words, unlike projection, transfer is a pure geometric operation and has no association with beam parameterization.
1.4.3 Bounding Triangle Estimation
In this section, as previously discussed with respect to FIG. 4, box 406 and Table 1, one embodiment of the bounding triangle estimation procedure as implemented in the programmable vertex module is described. The bounding triangle procedure should satisfy two goals simultaneously: (1) it should be easily computed to provide for a fast/short vertex program and (2) it should create a tight bounding region for a low pixel overdraw ratio. The pixel overdraw ratio is defined as the relative number of pixels of the bounding triangle over the projected area. Since a typical GPU has two main execution stages, the procedure was designed to properly balance the workload between vertex and fragment stages. However, the performance improvement remains even if the technique is implemented in a unified shader architecture.
In the following paragraphs, the bounding triangle computation for Sn (δ=0) and bump-map (δ>0) parameterizations is presented. The procedures performed rely on several math quantities: (1) external directions {{circumflex over (d)}{circumflex over (d1)},{circumflex over (d)}{circumflex over (d2)},{circumflex over (d)}{circumflex over (d3)}}, which are expansions of the original beam directions {{right arrow over (d1)},{right arrow over (d2)},{right arrow over (d3)}} so that they “contain” all interior ray directions {right arrow over (d)}, (2) an affine plane Πa(t), which is t distances away from the beam base plane Πb and contains affine triangle Δa(t) with vertices {right arrow over (Hi)}={right arrow over (Pi)}+t{right arrow over (di)},i=1,2,3, (3) threshold plane ΠT, which is a special affine plane Πa(tres) with a particular value tres so that any space point {right arrow over (Q)} above ΠT is guaranteed to have at most one projection within the beam base triangle ΔP1P2P3, and (4) maximum offsets μb and μd, which are maximum offsets between the Sn and C0 parameterizations of ray origin and direction for all {right arrow over (P)} on the base triangle Δb. Appendix A provides more detailed mathematical definitions of these variables.
1.4.3.1 Bounding Triangle for Smooth Beam with Sn Parameterization
In one embodiment of the non-linear beam tracing technique, for a Sn beam parameterization as computed in Equation 1, the bounding triangle can be accurately estimated by computing tangent lines to each projected edge of the scene triangle. (For example, for C0 parameterization all projected edges are quadratic curves.) However, this strategy has some drawbacks. First, since the projection region may have an irregular shape (for example, it may not be a triangle or even a single region), handling all these cases robustly can be difficult. Second, it was found through experimentation that it is too computationally expensive for vertex programs. Third, it is not general as different n values for Sn typically require different algorithms. Instead, one embodiment of the non-linear beam tracing technique produces less tight bounding triangles than the aforementioned tangent line method but is more general (applicable to any Sn), more robust (works for any projected shape), and faster to compute. For clarity, a procedure employed by one embodiment of the non-linear beam tracing technique for computing a bounding triangle for a smooth beam (as was previously discussed with respect to FIG. 5, box 508 and FIG. 2 modules 214, 216, 218) is delineated in Table 2. The paragraphs following Table 2 provide details for computing a bounding triangle for smooth beams and an expanded triangle for perturbed beams.







TABLE 2





Bounding Triangle Estimation for Smooth Beams















function {tilde over (Δ)} ← BoundingTriangle( Δ, B ,δ = 0 )









{ {circumflex over (d)}i}i=1,2,3 ← extremal rays of B



{ Pi }i=1,2,3 ← base vertices of B



Πb ← base plane of B







Δb ← base triangle of B









μb, μd ← maximum offsets of B



ΠT ← threshold plane of B







//all quantities above are pre-computed per B


{ Qi}i=1,2,3 ← vertices of scene triangle Δ


if { Qi}i=1,2,3 not all inside or outside B









//brute force case







{tilde over (Δ)} ← entire base triangle of B


elseif Δ not above ΠT


//general case


for each i,j=1,2,3









Pi,j ← Transfer( Qi′ {circumflex over (d)}i′ Πb )



{tilde over (Δ)} ← ExpandedBoundingTriangle ( {Pij }i,j=1,2,3′ Δb )







else









//unique projection case



Πa ← affine plane of B passing through the top of Δ



Δa ← affine triangle on Πa







for each i,j=1,2,3









Hij ← Transfer ( Qi′ {circumflex over (d)}i′ Πa )









ΔE1E2E3 ← ExpandedBoundingTriangle ( {Hij}i,j=1,2,3′ Δa )



{ ωk}k=1,2,3 ← Ω({ Ei}i=1,2,3, Δa) //barycentric coordinates



{ Fi}i=1,2,3 ← Ω−1({ωk}k=1,2,3, Δb)



{tilde over (Δ)} ← ΔF1F2F3







endif


function {tilde over (Δ)}_ ← ExpandedBoundingTriangle( {Pij}i,j=1,2,3′ Δa ) 









{tilde over (Δ)} ← BoundingTriangle( {Pij}i,j=1,2,3)



Πa ← plane containing Δa



θmin ← min(angle({circumflex over (d)}i,Πa),∀i = 1,2,3)







t←the t value Δa relative to Δb


 


expand {tilde over (Δ)} outward with distance 



  ɛ
  =
  
    
      
        μ
        b
      
      +
      
        t
        ⁢
        
          
        
        ⁢
        
          μ
          d
        
      
    
    
      sin
      ⁡
      
        (
        
          θ
          min
        
        )
      
    
  













More specifically, for each scene triangle Δ with vertices {{right arrow over (Qi)}}i=1,2,3 nine transfer points {Pij}i,j=1,2,3 on the beam base plane Πb are computed where Pi,j is the transfer of {right arrow over (Qi)} in the direction of {right arrow over (dj)}. A bounding triangle {tilde over (Δ)} is then computed from {Pij}i,j=1,2,3. This procedure only works for C0 parameterization but one can extend it for the general Sn (n>1) parameterization by replacing {right arrow over (dj)} with {circumflex over (d)}{circumflex over (dj)} followed by proper ε-expansion of the bounding triangle {tilde over (Δ)} as described under ExpandedBoundingTriangle( ) in Table 2. (The amount of expansion ε is zero for C0 paramaterization, and is non-zero for Sn parameterization to ensure that {tilde over (Δ)} is conservative even when {right arrow over (OP)}≠{right arrow over (P)}.) This procedure is termed the general case as in Table 2. It can be shown that {tilde over (Δ)} computed above is guaranteed to be a bounding triangle for the projection of the scene triangle Δ as long its three vertices completely lie within the beam. However, the bounding triangle computed by this procedure is too crude; as the scene triangle gets smaller or further away from Πb, the overdraw ratio can become astronomically large, making rendering of large scene models impractical.
Another embodiment of the non-linear beam tracing technique employs a different procedure to compute the bounding triangle as follows. The large overdraw ratio in the general case of the procedure only happens when the rays are diverging. The technique addresses this issue by first computing nine transfer points {Hij}i,j=1,2,3 and the associated bounding triangle ΔE1E2E3 similar to the general case procedure, but instead of the base plane Πb these computations are performed on an affine plane Πa that passes through the top of the scene triangle Δ. (If there are multiple affine planes Πa(t) that pass through the top, one chooses the one with largest t value.) One then transports the vertices of ΔE1E2E3 on Πa to the vertices of ΔF1F2F3 on Πb so that they share identical barycentric coordinates. It can be proven that ΔF1F2F3 is guaranteed to be a proper bounding triangle as long the scene triangle Δ is above the threshold plane ΠT. Furthermore, since Πa is much closer to the scene triangle Δ than to the beam base plane Πb, the bounding region is usually much tighter and thus the overdraw ratio is reduced. Since this procedure is faster than the general case procedure but works only when each space point {right arrow over (Q)}εΔ A has at most one projection in the base triangle (due to the fact that Δ is above ΠT), it is termed the unique projection case procedure (i.e., finitesceneboundingbox).
Since the unique projection case procedure is not guaranteed work when the scene triangle Δ is not above the threshold plane ΠT, in this case, the general case procedure is applied. Unlike the diverging case, the region below the threshold plane is mostly converging and the volume is bounded, so the overdraw ratio is usually small. The procedure also fails to be conservative when the three vertices of the scene triangle lie on different sides of the beam boundary. When this happens, the entire beam base is used as the bounding triangle. Since each frustum side of the beams is a bilinear surface for the C0 parameterization, this frustum intersection test can be efficiently performed. (For the S3 parameterization it is a bi-cubic surface and analogous strategies can be applied.) Furthermore, triangles that intersect the beam boundary are relatively rare so this brute force solution does not significantly affect the run-time performance.
1.4.3.2 Bounding Triangle for Perturbed Beam with Bump-Map Parameterization
As mentioned previously with respect to FIG. 5, boxes 508, 510, the bounding triangle for a perturbed beam is obtained by expanding the bounding triangle as computed for a smooth beam. More specifically, mathematically this can be described as follows. With a set of properly computed external directions {{circumflex over (d)}i}, the general case procedure for Sn can be directly applied for bump map parameterization. However, since bump map pixels can point in arbitrary directions, the bump map parameterization defies general analysis of Πa and ΠT as described for the Sn parameterization. Consequently, the unique projection case procedure is not applicable and rendering of bump mapped beams will be slow. To address this deficiency, a procedure can be employed that allows the technique to take advantage of the efficiency of the Sn bounding triangle procedure. First, the maximum perturbation angle δ formed by each ray and its unperturbed equivalent sharing the same origin as determined by the C0 parameterization is pre-computed. Given a scene triangle ΔQ1Q2Q3, first its C0 bounding triangle is computed via the Sn procedure. This C0 bounding triangle is extended outward via a distance D computed via the following formula:




  
    
      
        
          
            τ
            =
            
              δ
              +
              φ
            
          
          ⁢
          
            

          
          ⁢
          
            
              θ
              1
            
            =
            
              arc
              ⁢
              
                
              
              ⁢
              
                sin
                (
                
                  min
                  (
                  
                    
                      
                        n
                        →
                      
                      ·
                      
                        
                          d
                          
                            Q
                            1
                          
                        
                        _
                      
                    
                    ,
                    
                      
                        n
                        →
                      
                      ·
                      
                        
                          d
                          
                            Q
                            2
                          
                        
                        _
                      
                    
                    ,
                    
                      
                        n
                        →
                      
                      ·
                      
                        
                          d
                          
                            Q
                            3
                          
                        
                        _
                      
                    
                  
                  )
                
                )
              
            
          
          ⁢
          
            

          
          ⁢
          
            θ
            2
          
          =
          
            arc
            ⁢
            
              
            
            ⁢
            
              sin
              (
              
                min
                (
                
                  
                    
                      n
                      →
                    
                    ·
                    
                      
                        d
                        1
                      
                      _
                    
                  
                  ,
                  
                    
                      n
                      →
                    
                    ·
                    
                      
                        d
                        2
                      
                      _
                    
                  
                  ,
                  
                    
                      n
                      →
                    
                    ·
                    
                      
                        d
                        3
                      
                      _
                    
                  
                
                )
              
              )
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            θ
            3
          
          =
          
            
              
                
                  
                    
                      θ
                      2
                    
                    ⁢
                    
                      
                    
                    ⁢
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      2
                    
                  
                  >
                  τ
                
              
            
            
              
                
                  
                    
                      θ
                      1
                    
                    ⁢
                    
                      
                    
                    ⁢
                    else
                    ⁢
                    
                      
                    
                    ⁢
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      1
                    
                  
                  >
                  τ
                
              
            
            
              
                
                  τ
                  ⁢
                  
                    
                  
                  ⁢
                  else
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          D
          =
          
            
              
                
                  max
                  ⁡
                  
                    (
                    
                      
                        
                        
                          
                            Q
                            i
                          
                          ⁢
                          
                            P
                            ij
                          
                        
                        
                      
                      ,
                      
                        ∀
                        i
                      
                      ,
                      
                        j
                        =
                        1
                      
                      ,
                      2
                      ,
                      3
                    
                    )
                  
                
                ·
                sin
              
              ⁢
              
                
              
              ⁢
              τ
            
            
              sin
              ⁡
              
                (
                
                  
                    θ
                    3
                  
                  -
                  τ
                
                )
              
            
          
        
      
    
    
      
        (
        4
        )
      
    
  




where φ is the maximum angle formed between any two rays within the same beam, {right arrow over (n)} is the normal of the beam base (facing the inside of the beam),





  
    
      d
      
        Q
        i
      
    
    →
  
  =
  
    
      
        
          Q
          i
        
        →
      
      -
      
        
          P
          
            Q
            i
          
        
        →
      
    
    
      
      
        
          
            Q
            i
          
          →
        
        -
        
          P
          
            Q
            i
          
        
      
      
    
  




with {right arrow over (PQi)} being the un-perturbed projection of {right arrow over (Qi)}, {right arrow over (di)} the direction at {right arrow over (Pi)}, and {right arrow over (Pij)} the transfer of {right arrow over (Qi)} at direction {right arrow over (dj)} (as in the Sn bounding triangle procedure). Intuitively, this procedure extends the original C0 bounding triangle by an amount D so that to cover all shifted projection locations caused by bump maps. Note that obtaining {{right arrow over (PQi)}}i=1,2,3 requires solving three cubic polynomials; fortunately, this is only needed when θ2≦τ, a rare condition in practical situations.

1.4.4 Beam Tracing (BT) Mesh Construction
For a static reflector/refractor, the technique builds a beam tracing mesh by summing the beam base triangles corresponding to a single refractor/reflector objects. Various methods of mesh simplification can be used to reduce the polygon counts of the original texture mesh to a smaller number of polygon counts while still preserving the overall shape of the mesh. One embodiment of the technique employs a procedural method to ensure real-time performance. For example, water waves are often simulated in games via a planar base mesh with procedural, sinusoidal-like vertex motions plus further mesh subdivision for rendering. In one embodiment of the technique a base mesh is used as the beam tracing mesh and the texture-map of the beam tracing results are mapped back onto the subdivided mesh. Similar strategies could be applied for other kinds of simulation techniques in games and interactive applications.
1.4.5 Beam Tree Construction
A discussed previously with respect to FIG. 3 and Table 1, a beam tree is built. Beam tree construction is similar to prior methods of constructing a beam tree, however, instead of using only linear beams, non-linear beams are employed in the beam tree. For each primary beam B that interacts with a secondary beam with base triangle ΔQ1Q2Q3, projection direction(s) {{right arrow over (dij)}} are computed for each {right arrow over (Qi)} with respect to B. In doing so it is necessary to deal with general non-linear beam interactions which may cause multiple values for {{right arrow over (dij)}}. The reason behind this is simple. Similar to the diverse situations that might happen when a scene triangle is projected onto a non-linear beam, a secondary beam vertex {right arrow over (Q)} might also have multiple projections onto the primary beam B.
To handle these situations, in one embodiment, the technique employs a beam construction procedure as summarized in Table 3. In general, the beam tracing method culls beam components outside the beam base triangle and clips those crossing the bounding triangle borders. More specifically, in one embodiment, given a primary beam B and a secondary beam base triangle ΔQ1Q2Q3 (beam base triangle of a beam caused by reflection or refraction), the technique first computes the projections {Vij} of each {right arrow over (Qi)} onto B. The projections {Vij} correspond to vertices of the components of the projection regions from ΔQ1Q2Q3. The technique groups {Vij} into disjoint components {Rk}, culls those outside the base triangle  of B, and clips those crossing the boundary of . The technique then handles each remaining Rk separately. In the benign case where Rk (1) has exactly three vertices and (2) is not clipped, it can be shown that (1) each {right arrow over (Qi)} has a unique projection Vi corresponding to one of the vertices of Rk and (2) Rk corresponds to the entire ΔQ1Q2Q3. Consequently the projection direction {right arrow over (di)} of {right arrow over (Qi)} can be computed from Vi relative to the primary beam B. In complex cases where Rk either (1) has number of vertices other than three or (2) is clipped, it could happen that (1) at least one {right arrow over (Qi)} projects onto multiple vertices of Rk and consequently has multiple directions {right arrow over (di,j)} defined or (2) Rk corresponds to a curved subset of ΔQ1Q2Q3. In these cases, the technique represents ΔQ1Q2Q3 with multiple beams {B′} so that each one of them has uniquely defined directions over the corresponding beam base vertices. The technique achieves this by triangle-stripping Rk into multiple components {Rkm} so that each {right arrow over (Q)}εΔQ1Q2Q3 has at most one projection within each Rkm, and handle Rkm via the benign case procedure.
Since the eye-beam is single-perspective, all of the secondary beams (for first level reflections and refractions) belong to the benign cases and the more complicated cases can arise only for third or higher level beams. Additionally, the technique clips the disjoint components Rk against the boundary of the bounding triangle Δb, so it guarantees consistency across multiple primary beams via the vertices created through clipping, e.g. when ΔQ1Q2Q3 projects onto the bases of two adjacent primary beams. Finally, since each Rkm corresponds to a subset of ΔQ1Q2Q3, this beam splitting process does not require re-building of beam tracing meshes or the associated textures as each new beam can be rendered into a subset of the original texture atlases. Since beam tracing meshes are coarser than the real reflector/refractor geometry, the technique can trace beam shapes entirely on a CPU.







TABLE 3





Beam Construction

















function {B′}_← ConstructBeams(ΔQ1Q2Q3, B )



//ΔQ1Q2Q3 ← secondary beam base triangle



//B ← primary beam



//{(B′} ← secondary beams from reflections or refractions



(B′} ← emptyset



foreach i=1,2,3



    {Vi,j}← Project({right arrow over (Qi)}, B)



group{Vij}i=1,2,3 into disjoint regions {Rk}



cull and clip{Rk} against beam base triangle Δb of B



foreach Rk



   if # vertices of Rk equals 3 and Rk not clipped



     // each {right arrow over (Qi)} has unique Vi ∈ Rk and hence unique {right arrow over (di)}



    B′← beamwithbase ΔQ1Q2Q3 and directions {{right arrow over (di)}}



    add B′ to{B′}



   else // some {right arrow over (Qi)} may have multiple directions {{right arrow over (dij)}}



    triangle-strip Rk into multiple regions {Rkm} so that each



    {right arrow over (Q)} ∈ ΔQ1Q2Q3 has at most one projection within each Rkm



    handle each Rkm as the “if” case above



  end if



endfor









1.4.6 Texture Storage for Multiple Bounces
For single-bounce beam tracing the non-linear technique simply records the rendering results over a texture map parameterized by a beam tracing mesh. However, for multi-bounce situations (e.g. multiple mirrors reflecting each other), one texture map might not suffice as each beam base triangle might be visible from multiple beams. For the worst case scenario where M beams can all see each other, the number of different textures can be O(Mn) for n-bounce beam tracing. Fortunately, it can be easily proven that the maximum amount of texture storage is O(Mn) if the beam tree is rendered in a depth-first order. In one embodiment the technique simply keeps n copies of texture for each beam for n-bounce beam tracing.
1.4.7 Acceleration
Given M scene triangles and N beams, the technique would require O(MN) time complexity for geometry processing. Fortunately, this theoretical bound on computation speed can be reduced in practice by view frustum culling and level of detail (LOD) control, as discussed below.
1.4.7.1 Frustum Culling
The viewing frustum is the field of view of the notional camera. The exact shape of this region varies depending on what kind of camera lens is being simulated, but typically it is a frustum of a rectangular pyramid. The planes that cut the frustum perpendicular to the viewing direction are called the near plane and the far plane. Objects that are closer to the camera than the near plane or are further than the far plane are not drawn. View frustum culling is the process of removing objects that lie completely outside the viewing frustum from the rendering process. For a linear view frustum, culling can be efficiently performed since each frustum side is a plane. However, in one embodiment of the technique, each beam has a non-linear view frustum where each frustum side is a non-planar surface. Furthermore, for beam bases lying on a concave portion of the reflector the three boundary surfaces might intersect each other, making the sidedness test of traditional culling incorrect. To resolve these issues, one embodiment of the non-linear beam tracing technique adopts a simple heuristic via a cone which completely contains the original beam viewing frustum. In the one implementation of the technique computation of the bounding cones and culling operations are performed per object on a CPU as well as per triangle on a GPU. Portions of objects outside the bounding cone are culled. Details of how this culling is performed and the associated mathematical computations are provided in Appendix A.5.
1.4.7.2 Geometry (Level of Detail) LOD Control
In computer graphics, accounting for level of detail involves decreasing the complexity of a 3D object representation as it moves away from the viewer or according other metrics such as object importance, eye-space speed or position. Geometry level of detail (LOD) can be naturally achieved by the non-linear beamforming technique. In one embodiment, the technique estimates the proper LOD for each object when rendering a particular beam. This not only reduces aliasing artifacts but also accelerates the rendering speed. Geometry LOD is more difficult to achieve for ray tracing as it requires storing additional LOD geometry in the scene database. In one current implementation, the technique uses a simple heuristic by projecting the bounding box of an object onto a beam, and utilize the rasterized projection area to estimate proper LOD.
1.4.8 Anti-Aliasing
Anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution signal at a lower resolution. Anti-aliasing can be efficiently performed by the GPU in every major step of the non-linear beamforming technique. In addition to the geometry LOD control as mentioned above, the technique also performs full screen anti-aliasing for each rendered beam. The computed beam results are stored in textures, which in turn are anti-aliased via standard texture filtering.
2.0 The Computing Environment
The non-linear beam tracing technique is designed to operate in a computing environment. The following description is intended to provide a brief, general description of a suitable computing environment in which the non-linear beam tracing technique can be implemented. The technique is operational with numerous general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable include, but are not limited to, personal computers, server computers, hand-held or laptop devices (for example, media players, notebook computers, cellular phones, personal data assistants, voice recorders), multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
FIG. 6 illustrates an example of a suitable computing system environment. The computing system environment is only one example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the present technique. Neither should the computing environment be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary operating environment. With reference to FIG. 6, an exemplary system for implementing the non-linear beam tracing technique includes a computing device, such as computing device 600. In its most basic configuration, computing device 600 typically includes at least one processing unit 602 and memory 604. The computing device 600 also has a graphics processing unit 620 to aid in accelerating graphics rendering, among other functions. Depending on the exact configuration and type of computing device, memory 604 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.) or some combination of the two. This most basic configuration is illustrated in FIG. 6 by dashed line 606. Additionally, device 600 may also have additional features/functionality. For example, device 600 may also include additional storage (removable and/or non-removable) including, but not limited to, magnetic or optical disks or tape. Such additional storage is illustrated in FIG. 6 by removable storage 608 and non-removable storage 610. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Memory 604, removable storage 608 and non-removable storage 610 are all examples of computer storage media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by device 600. Any such computer storage media may be part of device 600.
Device 600 has a display 618, and may also contain communications connection(s) 612 that allow the device to communicate with other devices. Communications connection(s) 612 is an example of communication media. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal, thereby changing the configuration or state of the receiving device of the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. The term computer readable media as used herein includes both storage media and communication media.
Device 600 may have various input device(s) 614 such as a keyboard, mouse, pen, camera, touch input device, and so on. Output device(s) 616 such as speakers, a printer, and so on may also be included. All of these devices are well known in the art and need not be discussed at length here.
The non-linear beam tracing technique may be described in the general context of computer-executable instructions, such as program modules, being executed by a computing device. Generally, program modules include routines, programs, objects, components, data structures, and so on, that perform particular tasks or implement particular abstract data types. The non-linear beam tracing technique may be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It should also be noted that any or all of the aforementioned alternate embodiments described herein may be used in any combination desired to form additional hybrid embodiments. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. For example, one embodiment of the non-linear beam tracing technique can create higher accuracy models of reflections and refractions by using finer beams at the expense of more computations. Additionally, some of the processing that occurs on the CPU can be performed on the GPU and vice versa. The specific features and acts described above are disclosed as example forms of implementing the claims.
Appendix A. Detailed Mathematical Definitions
A.1 S3 Parameterization
The formula for S3 is:



  
    
      
        
          L
          ijk
        
        _
      
      (
      
        
          
            X
            1
          
          _
        
        ,
        
          
            X
            2
          
          _
        
        ,
        
          
            X
            3
          
          _
        
      
      )
    
    =
    
      
        
          3
          !
        
        
          
            i
            !
          
          ⁢
          
            j
            !
          
          ⁢
          
            k
            !
          
        
      
      ⁢
      
        
          c
          ijk
        
        (
        
          
            
              X
              1
            
            _
          
          ,
          
            
              X
              2
            
            _
          
          ,
          
            
              X
              3
            
            _
          
        
        )
      
    
  




  
    
      
        
          c
          300
        
        _
      
      =
      
        
          X
          1
        
        _
      
    
    ,
    
      
        
          c
          030
        
        _
      
      =
      
        
          X
          2
        
        _
      
    
    ,
    
      
        
          c
          003
        
        _
      
      =
      
        
          X
          3
        
        _
      
    
  




  
    
      
        w
        ij
      
      =
      
        
          (
          
            
              
                X
                j
              
              _
            
            -
            
              
                X
                i
              
              _
            
          
          )
        
        ·
        
          
            n
            i
          
          →
        
      
    
    ;
    
      
        
          n
          i
        
        →
      
      ⁢
      
        
      
      ⁢
      indicates
      ⁢
      
        
      
      ⁢
      normal
      ⁢
      
        
      
      ⁢
      at
      ⁢
      
        
      
      ⁢
      
        
          P
          →
        
        i
      
    
  




  
    
      
        c
        210
      
      →
    
    =
    
      
        (
        
          
            2
            ⁢
            
              
                X
                1
              
              _
            
          
          +
          
            
              X
              2
            
            _
          
          -
          
            
              w
              12
            
            ⁢
            
              
                n
                1
              
              →
            
          
        
        )
      
      /
      3
    
  




  
    
      
        c
        120
      
      →
    
    =
    
      
        (
        
          
            2
            ⁢
            
              
                X
                2
              
              _
            
          
          +
          
            
              X
              1
            
            _
          
          -
          
            
              w
              21
            
            ⁢
            
              
                n
                2
              
              →
            
          
        
        )
      
      /
      3
    
  




  
    
      
        c
        021
      
      →
    
    =
    
      
        (
        
          
            2
            ⁢
            
              
                X
                2
              
              _
            
          
          +
          
            
              X
              3
            
            _
          
          -
          
            
              w
              23
            
            ⁢
            
              
                n
                2
              
              →
            
          
        
        )
      
      /
      3
    
  




  
    
      
        c
        012
      
      →
    
    =
    
      
        (
        
          
            2
            ⁢
            
              
                X
                3
              
              _
            
          
          +
          
            
              X
              2
            
            _
          
          -
          
            
              w
              32
            
            ⁢
            
              
                n
                3
              
              →
            
          
        
        )
      
      /
      3
    
  




  
    
      
        c
        102
      
      →
    
    =
    
      
        (
        
          
            2
            ⁢
            
              
                X
                3
              
              _
            
          
          +
          
            
              X
              1
            
            _
          
          -
          
            
              w
              31
            
            ⁢
            
              
                n
                3
              
              →
            
          
        
        )
      
      /
      3
    
  




  
    
      
        c
        201
      
      →
    
    =
    
      
        (
        
          
            2
            ⁢
            
              
                X
                1
              
              _
            
          
          +
          
            
              X
              3
            
            _
          
          -
          
            
              w
              13
            
            ⁢
            
              
                n
                i
              
              →
            
          
        
        )
      
      /
      3
    
  




  
    
      e
      →
    
    =
    
      
        (
        
          
            
              c
              210
            
            →
          
          +
          
            
              c
              120
            
            →
          
          +
          
            
              c
              021
            
            →
          
          +
          
            
              c
              021
            
            →
          
          +
          
            
              c
              102
            
            →
          
          +
          
            
              c
              201
            
            →
          
        
        )
      
      /
      6
    
  




  
    
      v
      →
    
    =
    
      
        (
        
          
            
              X
              1
            
            _
          
          +
          
            
              X
              2
            
            _
          
          +
          
            
              X
              3
            
            _
          
        
        )
      
      /
      3
    
  




  
    
      
        c
        111
      
      →
    
    =
    
      
        
          e
          →
        
        ⁡
        
          (
          
            
              e
              →
            
            -
            
              v
              →
            
          
          )
        
      
      /
      2
    
  



It can be easily shown that this formulation satisfies Equations 1 and 2.
A.1 External Directions {{circumflex over (d)}{circumflex over (di)}}i=1,2,3 
Given a beam B with base triangle ΔP1P2P3, its external directions is a set of ray directions {{circumflex over (d)}1,{circumflex over (d)}2,{circumflex over (d)}3} emanating from {P1,P2,P3} so that for each P within ΔP1P2P3 there exists a set of real numbers {circumflex over (ω)}1,{circumflex over (ω)}2, {circumflex over (ω)}3, 0≦{circumflex over (ω)}1,{circumflex over (ω)}2,{circumflex over (ω)}3 and {circumflex over (ω)}1+{circumflex over (ω)}2+{circumflex over (ω)}3=1 that can express {right arrow over (d)}(P) as follows:

{right arrow over (d)}(P)={circumflex over (ω)}1{circumflex over (d)}1+{circumflex over (ω)}2{circumflex over (d)}2+{circumflex over (ω)}3{circumflex over (d)}3 

External directions exist as long all the beam directions point away to the same side of the beam base plane. Note that for C0 parameterization one could have {circumflex over (d)}i={right arrow over (di)}, but this is not true for general Sn parameterization and bump mapped surfaces. External directions can be computed analytically for Sn parameterization and from the maximum perturbation angle δ for bump map parameterization.
A.2. Affine plane Πa 
Given a beam B with base triangle ΔP1P2P3 and associated rays {{right arrow over (d)}1,{right arrow over (d)}2,{right arrow over (d)}3}, one defines affine triangle Δa(t) as a triangle ΔH1H2H3 where {right arrow over (Hi)}={right arrow over (Pi)}+t{right arrow over (di)}, for a real number t. Note that an affine triangle is uniquely defined by the value t. Define affine plane Πa(t) as a plane which contains the affine triangle Δa(t). Note that the base plane of B is a special case of affine plane with t=0. Affine planes have this nice property that if {right arrow over (H)}εΠa has the same set of barycentric coordinates as {right arrow over (P)}εΠb, then {right arrow over (P)} is a projection of {right arrow over (H)} on Πb.
A.3 Threshold Plane ΠT 
The threshold plane ΠT of a beam B is defined as an affine plane Πa(tres) with a particular value tres so that any space point {right arrow over (Q)} above ΠT is guaranteed to have at most one projection within the beam base triangle ΔP1P2P3. Intuitively, the beam frustum above the threshold plane ΠT has diverging ray directions. The threshold plane for the Sn parameterization (Equation 1) is now defined. Let {right arrow over (Pi,t)}={right arrow over (Pi)}+t{right arrow over (di)}, i=1,2,3. Define the following three quadratic functions

ƒhd 1(t)=({right arrow over (P2,t)}−{right arrow over (P1,t)})×({right arrow over (P3,t)}−{right arrow over (P1,t)})·{right arrow over (d1)}

ƒ2(t)=({right arrow over (P3,t)}−{right arrow over (P2,t)})×({right arrow over (P1,t)}−{right arrow over (P2,t)})·{right arrow over (d2)}

ƒ3(t)=({right arrow over (P1,t)}−{right arrow over (P3,t)})×({right arrow over (P2,t)}−{right arrow over (P3,t)})·{right arrow over (d3)}

Solving the three equations separately ƒ1(t)=ƒ2(t)=ƒ3(t)=0 one obtains a set of (at most 6) real roots I. Denote tmax=max(0,I). The threshold plane ΠT is then defined as the affine plane Πa(tres) so that min(∥{right arrow over (Pres)}−{right arrow over (Pmax)}∥,∀{right arrow over (Pres)}εΔa(tres),{right arrow over (Pmax)}εΔa(xt))>μb+tmaxμd (μb and μd are defined in the equation below for maximum offsets. Note that Πa(tres) always exists as long tres is large enough.
A.4 Maximum Offsets μb and μd 
One defines μb and μd as the maximum offsets between the Sn and C0 parameterizations of ray origin and direction for all {right arrow over (P)} on the base triangle Δb:



  
    
      μ
      b
    
    =
    
      max
      (
      
        
          
          
            
              
                O
                P
              
              _
            
            -
            
              
                ∑
                
                  i
                  =
                  1
                
                3
              
              ⁢
              
                
              
              ⁢
              
                
                  ω
                  i
                
                ⁢
                
                  
                    P
                    i
                  
                  _
                
              
            
          
          
        
        ,
        
          ∀
          
            
              P
              →
            
            ∈
            
              Δ
              b
            
          
        
      
      )
    
  




  
    
      μ
      d
    
    =
    
      max
      (
      
        
          
          
            
              
                d
                P
              
              _
            
            -
            
              
                ∑
                
                  i
                  =
                  1
                
                3
              
              ⁢
              
                
              
              ⁢
              
                
                  ω
                  i
                
                ⁢
                
                  
                    d
                    i
                  
                  _
                
              
            
          
          
        
        ,
        
          ∀
          
            
              P
              →
            
            ∈
            
              Δ
              b
            
          
        
      
      )
    
  



where {right arrow over (OP)} and {right arrow over (dP)} are ray origin and direction computed according to the Sn parameterization,





  
    ∑
    
      i
      =
      1
    
    3
  
  ⁢
  
    
  
  ⁢
  
    
      ω
      i
    
    ⁢
    
      
        P
        i
      
      _
    
    ⁢
    
      
    
    ⁢
    and
    ⁢
    
      
    
    ⁢
    
      
        ∑
        
          i
          =
          1
        
        3
      
      ⁢
      
        
      
      ⁢
      
        
          ω
          i
        
        ⁢
        
          
            d
            i
          
          _
        
      
    
  




are same quantities computed via the C0 parameterization, and {ωi}i=1,2,3 are the barycentric coordinates of {right arrow over (P)} with respect to Δb. Since the Sn parameterizations are just polynomials, μb and μd can be calculated by standard optimization techniques.

A.5 Bounding Cone for Frustum Culling

The cone center {right arrow over (PC)}, direction {right arrow over (dC)}, and angle θC are computed as follows:



  
    
      
        d
        C
      
      _
    
    =
    
      
        (
        
          
            
              d
              ^
            
            1
          
          +
          
            
              d
              ^
            
            2
          
          +
          
            
              d
              ^
            
            3
          
        
        )
      
      
        
        
          (
          
            
              
                d
                ^
              
              1
            
            +
            
              
                d
                ^
              
              2
            
            +
            
              
                d
                ^
              
              3
            
          
          )
        
        
      
    
  




  
    
      θ
      C
    
    =
    
      arc
      ⁢
      
        
      
      ⁢
      
        cos
        (
        
          min
          (
          
            
              
                
                  d
                  ^
                
                1
              
              ·
              
                
                  d
                  ^
                
                C
              
            
            ,
            
              
                
                  d
                  ^
                
                2
              
              ·
              
                
                  d
                  ^
                
                C
              
            
            ,
            
              
                
                  d
                  ^
                
                3
              
              ·
              
                
                  d
                  ^
                
                C
              
            
          
          )
        
        )
      
    
  




  
    
      
        P
        C
      
      _
    
    =
    
      
        
          P
          G
        
        _
      
      -
      
        
          
            d
            C
          
          _
        
        ·
        
          
            max
            (
            
              
                
                
                  
                    
                      O
                      P
                    
                    _
                  
                  -
                  
                    
                      P
                      G
                    
                    _
                  
                
                
              
              ,
              
                ∀
                
                  
                    P
                    →
                  
                  ∈
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      P
                      1
                    
                    ⁢
                    
                      P
                      2
                    
                    ⁢
                    
                      P
                      3
                    
                  
                
              
            
            )
          
          
            sin
            ⁢
            
              
            
            ⁢
            
              θ
              C
            
          
        
      
    
  



where {{circumflex over (d)}1,{circumflex over (d)}2,{circumflex over (d)}3} is the set of external directions and {right arrow over (PG)} is the barycenter of beam base ΔP1P2P3. It can be easily proven that this cone properly contains every point {right arrow over (Q)} inside the original view frustum and it works for both Sn and bump-map parameterizations. Once the bounding cone is computed, it can be used for frustum culling as follows. For each scene object, a bounding sphere is computed with center {right arrow over (O)} and radius R, and the following steps are used to judge if the sphere and cone intersect. First, one checks if {right arrow over (PC)} is inside the sphere. If not, let





  
    
      θ
      S
    
    =
    
      arc
      ⁢
      
        
      
      ⁢
      
        sin
        (
        
          R
          
            
            
              
                O
                →
              
              -
              
                
                  P
                  C
                
                →
              
            
            
          
        
        )
      
    
  
  ,




which is the critical angle formed between {right arrow over (O)}−{right arrow over (PC)} and the cone boundary when the sphere and cone boundary barely touch each other. Then it naturally follows that the sphere and cone intersect each other if and only if





  
    
      
        
          O
          →
        
        -
        
          
            P
            C
          
          →
        
      
      
        
        
          
            O
            →
          
          -
          
            
              P
              C
            
            →
          
        
        
      
    
    ·
    
      
        d
        C
      
      →
    
  
  >
  
    
      cos
      ⁡
      
        (
        
          
            θ
            C
          
          +
          
            θ
            S
          
        
        )
      
    
    .

## Claims

1. A computer-implemented process to display images of one or more objects on a computer display, comprising:
inputting image data of one or more objects to be displayed on a computer display;
using non-linear beam tracing, on a computer processing unit (CPU), building a beam tree with nodes which represent beams of light of both a primary linear light beam and non-linear light beams caused by reflections and refractions of the primary beam, recording the boundary rays for each beam of the beam tree, the beams having triangular cross-sections; and
rendering the linear and non-linear beams of the beam tree on a graphics processing unit (GPU) to display the one or more objects on the computer display.

2. The computer-implemented process of claim 1 wherein the linear and non-linear beams are defined by three boundary rays, a beam base projected onto a camera sensor plane and a depth in the beam tree.

3. The computer-implemented process of claim 1 wherein the beam tree is constructed in a depth-first traversal order, using the tree root first, followed by a first layer, followed by a second layer.

4. The computer-implemented process of claim 1, further comprising:
sectioning the image data into scene triangles;
for each scene triangle,
projecting the scene triangle onto a beam base of a beam on the camera sensor plane;
defining a bounding triangle that surrounds the projection of the scene triangle onto the beam base of a beam on the sensor plane;
for each pixel within the bounding triangle, defining a ray origin and direction;
determining if each pixel is within the true projection of the scene triangle by determining if the ray that originates at the pixel intersects the scene triangle;
if the pixel within the bounding triangle is within the true projection of the scene triangle, rendering the pixel with the value of the pixel of the scene triangle which intersects the ray; and
if the pixel within the bounding triangle is not within the true projection of the scene triangle not rendering the pixel.

5. The computer-implemented process of claim 4 wherein a bounding triangle for a beam that is perturbed by a bump map is an expansion of a bounding triangle that is computed for a smooth beam.

6. The computer-implemented process of claim 2 further comprising rendering the linear and non-linear beams by:
determining pixel attributes of the one or more objects to be displayed;
storing the determined pixel attributes on each beam base plane for each linear and non-linear beam; and
applying the pixel attributes stored on each base plane for each linear and non-linear beam to a texture mesh of the one or more objects to be displayed.

7. The computer-implemented process of claim 1 further comprising building the beam tree on a computer processing unit and rendering the linear and non-linear beams using a graphics processing unit.

8. A system for displaying graphics on a computer monitor, comprising:
a general purpose computing device;
a computer program comprising program modules executable by the general purpose computing device, wherein the computing device is directed by the program modules of the computer program to,
receive a set of image data composed of one or more objects to be displayed on a computer monitor;
use non-linear beam tracing to create a beam tree for the set of image data composed of a combination of a linear primary light beam and non-linear light beams caused by reflections and refractions, recording the boundary rays for each beam;
divide the set of image data composed of linear and non-linear light beams into a set of scene triangles;
for each scene triangle,
project the scene triangle onto a base of a beam;
define a bounding triangle that surrounds the projection of the scene triangle onto the base of a beam;
for each pixel within the bounding triangle, define a ray origin and direction;
determine if each pixel is within the true projection of the scene triangle by determining if the ray that originates at the pixel intersects the scene triangle;
if the pixel within the bounding triangle is within the true projection of the scene triangle, render the pixel with the value of the pixel of the scene triangle which intersects the ray; and
if the pixel within the bounding triangle is not within the true projection of the scene triangle do not render the pixel.

9. The system of claim 8 wherein the program module to compute the bounding triangle further comprises sub-modules to;
compute a bounding triangle for smooth beams; and
compute a bounding triangle for beams perturbed by a bump map.

10. The system of claim 8 further comprising a program module to input a texture mesh for objects that are reflectors or refractors.

11. The system of claim 10 wherein the program module to render pixels within the true projection of the scene triangle further comprises utilizing the texture mesh to render objects that are reflectors or refractors by applying the rendered pixels to the texture mesh for objects that are reflectors or refractors.

12. A computer-implemented process for displaying three dimensional objects in a scene on a computer display, comprising:
inputting image data to be displayed on a computer display and a texture mesh;
computing a beam parameterization of the image data to define the image data as triangular-shaped smooth and perturbed beams each having a beam base;
using non-linear beam tracing, on a computer processing unit (CPU), computing a beam tree with nodes that represent beams of light of both a linear primary beam and non-linear reflective and refractive beams using the beam parameterization of the image data;
computing a bounding triangle on the beam base for each of the smooth beams, the bounding triangle containing a projection of a scene triangle of the image data;
computing a bounding triangle on the beam base for each of the perturbed beams by expanding the bounding triangle for each of the smooth beams;
dividing the image data into scene triangles;
for each scene triangle, projecting the scene triangle onto a beam base plane;
performing pixel shading by determining how each pixel within each bounding triangle is rendered using a graphics processing unit (GPU) by determining if the pixel is within a true projection of the scene triangle.

13. The computer-implemented process of claim 12 wherein the beam parameterization further comprises, for each point p on a beam base triangle defining an associated ray with a specific origin and direction.

14. The computer-implemented process of claim 12 wherein the pixel parameters used to render the pixel within the bounding triangle are depth, color and texture coordinates.

15. The computer-implemented process of claim 12 wherein determining how each pixel within the bounding triangle is rendered comprises:
for each pixel within the bounding triangle determining if the computed ray for the given pixel intersects the scene triangle; and
if the computed ray for the given pixel intersects the scene triangle rendering the pixel with the parameters of the pixel of the scene triangle at the intersection point.

16. The computer-implemented process 12 wherein computing a bounding triangle on the beam base for each of the smooth beams further comprises computing tangent lines of each of the projected edges of each scene triangle.

17. The computer-implemented process of claim 12 further comprising employing a non-linear viewing frustum to cull pixels outside the viewing frustum.

18. The computer-implemented process of claim 12 further comprising projecting a bounding box of an object in a scene onto a beam and utilizing the projection area to estimate the proper level of detail to render for the object.

19. The computer-implemented process of claim 12 further comprising for each bounding triangle, rendering the pixels within the true projection of each scene triangle by culling beam components outside of the bounding triangle and clipping beam components crossing a border of the bounding triangle.