首页 / 专利库 / 图形技术 / 光线跟踪 / Method for generating images using ray-tracing

Method for generating images using ray-tracing

阅读:980发布:2021-05-12

专利汇可以提供Method for generating images using ray-tracing专利检索,专利查询,专利分析的服务。并且This invention relates to a method for generating images by using a ray-tracing method.
In the case of the conventional method, a rectangular parallelepiped completely included in an object to be displayed is registered and subject to sampling although an intersection point between the ray and the object surface cannot exist there.
The method for generating images according to the invention registers only a cell containing surface 50 of object 44 among cells that are obtained by dividing region 42 containing object 44 to be displayed. The calculation of intersection points is performed only for rectangular parallelepipeds in which the surface exists. Thus, it is possible to reduce the time required for displaying object 44.,下面是Method for generating images using ray-tracing专利的具体信息内容。

1. A method for generating images, using a data processing system including a display and storage means, said method generating images of at least one object to be projected as a projective plane on a ? of said display which corresponds to the projective plane using a ray-tracing method which comprises the following steps:(a) (a1) supposing a viewpoint, supposing a ray which passes the viewpoint and a point on the projective plane which corresponds to a pel for each pel on the screen. and searching an intersection where the ray meets a surface of the said at least one object which is nearest to the viewpoint for each supposed ray,
and
(a2) if the desired point is obtained, repeating a step at least once which comprises supposing at least one of the reflected ray and the transmitted ray which starts from the intersection obtained in the preceding search and searching an intersection where the supposed ray meets a surface of the said at least one object which is nearest to the intersection obtained in the preceding search, and(b) with respect to the supposed ray which passes the said viewpoint and a point on the said reflective plane which corresponds to a pel on the said screen, if at least one intersection is obtained through the search as described in (a) which begins with the said ray, determining optical information to be assigned to the pel associated with the said ray in consideration of the attribute of the said at least one intersection, if no intersection is obtained through the search as described in (a), assigning optical information which corresponds a background of the said at least one object to the pel associated with the said ray, characterized by that
(I) prior to the step (a1),
(i) defining a space region which contains the said at least one object to be displayed,
(ii) dividing the said space region into a plurality of cells,
(iii) determining whether the cell contains at least one surface of the said at least one object or not for each cell, and if the cell contains the said at least one surface, registering the cell in a table provided in the said storage means,
(II) in the step (a1),
determining whether the ray intersects the said space region or not by calculation prior to performing the calculation for an intersection for each supposed ray,
and ending the search for an intersection for the ray which doesn't intersect the said space region, under a decision that the ray intersects no surface of the said at least one object,
(III) in the step (a1) and (a2),
identifying the cell which the ray intersects for each ray that intersects the said space region by calculation, collating the identified cell with the said table, and if the identified cell is found to contain the surface of the said at least one object, searching an intersection where the ray meets the surface in the cell in a numerically analytic way which uses sampling, and if the identified cell is found not to contain no surface of the said at least one surface, ending the search for an intersection where the ray meets the surface in the cell, under a decision that the ray intersects no surface of the said at least one object there.
(2) A method as claimed in Claim (1), characterized in that in the said step (ii), the said space region is divided into a plurality of cells in the form of a rectangular parallelepiped.(3) A method as claimed in Claim (1) or (2), characterized by in the step (iii), redividing a cell which contains a surface of the said object to be displayed into cells in the form of a smaller rectan­gular parallelepiped, determining for each redivided cell whether a surface of the said object to be displayed exists there or not, and registering only the redivided cell that contains the said surface in the said table.(4) A method as claimed in Claim (1), (2), or (3), characterized in that optical information to be assigned to each of the said pels is color and brightness.
说明书全文

This invention relates to a method for generating images by using a ray-tracing method.

Overview of ray-tracing method

First, overview is described for the ray-tracing method, for example, stated by Turner Whitted in "An Improved Illumination Model for Shaded Display," Com. of the ACM, June, 1980, Vol. 23, No. 6. In the ray-tracing method, as shown in Figure 2, ray L (line of sight) emitted from viewpoint 12 is supposed for each pel (i, j) on screen 10 (matched with a plane of projection for convenience of the description), and the surfaces of objects intersecting the ray are searched. Of objects 14 and 16 intersecting ray L, the first seen is object 14, whose surface is closer to the viewpoint.

Now, as shown in Figure 3, it is assumed that, based on optical properties of an area of the outer surface of object 14 which ray L encounters, a reflected ray S₁ and refracted ray T₁ originates from intersection point 18. In this case, a search is made for each of ray S₁ and T₁ to determine whether it intersects any surface of any object or not. In the example of Figure 3, ray S₁ intersects object 20 at intersection point 22. If reflected ray S₂ and refracted ray T₂ origin­ating from intersection point 22 exist, a search is made for each of them to determine whether it intersects an object surface or not. On the other hand, ray T₁ intersects object 14 again at intersection point 24. If, owing to optical properties of an area of the internal surface of object 14 where intersection point 14 exists, a reflected ray origin­ating from intersection point 14 cannot exist, or if the reflected ray is too weak for consideration, a search is made only for refracted ray T₃ to determine whether it intersects an object surface or not. Thus, once an intersection point between a line of sight and a surface of an object to be displayed is found, tracing of a ray originating from the intersection point is sequentially performed. In Figure 2, N₁, N₂ and N₃ represent normal vectors at intersection points 18, 22 and 24, respect­ively.

Now, although the above-mentioned tracing of a ray may be almost infinitely repeated, it is usually discontinued appropriately, taking into consideration the time required for generating an image. For convenience of description, in the example of Figure 2, a search is not performed for rays S₂, T₂ and T₃ to determine whether there are inter­section points between them and the surfaces of the object to be dis­played.

Now, color, brightness, etc., of intersection point 18, of course, reflect attributes of the external surfaces of object 20 at intersection point 22 and those of the internal surfaces of object 14 at intersection point 24 as well as attributes of the external surfaces of object 14 at intersection point 18. Examples of attribute of an object are color specific thereto, its reflection coefficient and its unevenness, etc. Therefore, very real images can be generated by determining optical information such as color and brightness to be assigned to pel (i, j) on screen 10 (Figure 1).

Calculation of intersection points

Methods for calculating intersection points of rays and each object surface are classified into an algebraic method and a method of numeri­cal analysis on the basis of the figure of an object to be displayed.

The algebraic method is the one used to directly find an intersection point as the solution of an equation, according to a formula for solu­tion.

The method of numerical analysis is one for searching a region where an intersection point exists first by sampling points on ray L as shown in Figure 4. If an equation for an equi-valued surface is repre­sented by F(X, Y, Z) = C, check is made for sign of >F(X, Y, Z) - C½ on each sampled point to find a region where an intersection point exists, or a region where the sign changes (between sampled points 30 and 32 for the example of Figure 4). Then, the intersection point is calculated for the region using the bisection method or the Newton method. In a case where the surface of the object to be displayed can be represented by a function of F(X, Y, Z) = C of the fifth degree or higher, the method of numerical analysis using the sampling becomes essential.

Although the ray-tracing method can generally generate a high quality image, the amount of calculation becomes enormous because an intersection point with the surfaces of the objects needs to be found for each pel respectively. Therefore, the following method for increas­ing speed is disclosed by, for example, Akira Fujimoto et. al. in "Accelerated Ray-Tracing System," IEEE CG & A, April, 1986 or Japanese PUPA 61-139890.

  • (I) Grid space 33 as shown in Figure 5 is considered. Information about which object exists in rectangular parallelepiped (cell) 34 obtained by dividing grid space 33 is stored into storage means in the form of table 35.
  • (II) For each ray it is judged whether or not it intersects the grid space. Then for a ray intersecting the grid space, it is determined which rectangular parallelepiped the ray intersects, and finally whether or not it intersects the surface of the object contained in the rectan­gular parallelepiped.

Description is made by referring the example shown in Figure 6. Ray A intersects a rectangular parallelepiped where an object exists (for example, rectangular parallelepiped 38 where object 36 exists), but ray B does not intersect a rectangular parallelepiped where an object exists, and no calculation is required for the intersection point with an object surface. Because it is not necessary to calculate the inter­section point with an object surface for a rectangular parallelepiped which contains no object, it is possible to reduce the number of calcu­lations of the intersection point. 40 in Figure 6 is a plane of projec­tion.

Here, it is noticed that the invention and the prior art are described by using a drawing respresented two-dimensionally for conven­ience of description as in Figures 3 through 6.

Judgment of intersection between ray and rectangular parallelepiped

Whether a ray intersects a grid space or not is determined by finding intersection points with six planes forming the surfaces of the grid space which is in a form of a rectangular parallelepiped, and by checking whether the intersection points are contained in the grid space or not. If there is an intersection point contained in the grid space, a rectangular parallelepiped which the ray first enters is determined from the intersection point nearest to the viewpoint. A rectangular parallelepiped which the ray next enters can be determined only by incremental calculation based on the first rectangular parallelepiped and inclination of the ray. Now, description is made by referring to Figure 7. The equation for the ray is expressed by vt + s wherein inclination of ray is v, an intercept of the ray is s, and line parame­ter is t. In addition, it is assumed that the distance between X, Y and Z grids along the ray is dtx, dty and dtz, respectively, and that t parameter on X, Y and Z grid which the ray traverses next is tx, ty, tz, respectively. As shown in Figure 7 that is represented two-dimensional­ly for convenience of the description, rectangular parallelepiped (i′, j′, k′) which the ray enters next can be determined only by incrementing axis l (l = x, y, z), which has a minimum value among current tx, ty and tz, by 1 (+1 if the inclination is positive, -1 if it is negative). Once transfer to the next rectangular parallelepiped is made, dtl (l = x, y, z) is added to t parameter tl (l = x, y, z) for the axis. Then, rectangular parallelepipeds can be sequentially traversed by applying similar processing.

Problems to be solved by the invention

In the case of the conventional method consisting of the above-­mentioned (I) and (II), a rectangular parallelepiped completely included in an object to be displayed is registered and subject to sampling although an intersection point between the ray and the object surface cannot exist there. That is, as shown in Figure 8, in a case where a ray passes through a transparent object having a plurality of rectangu­lar parallelepipeds in grid space 42, sampling is performed for rectan­gular parallelepipeds 46 and 48 that do not require processing for searching the intersection point, which wastes time for that. This problem becomes serious particularly when it is necessary to generate images of a number of transparent objects.

Means for solving the problems

The method for generating images according to the invention regis­ters only a cell containing surface 50 of object 44 among cells that are obtained by dividing region 42 containing object 44 to be displayed, as shown in Figure 1. The calculation of intersection points is performed only for rectangular parallelepipeds in which the surface exists. Thus, it is possible to reduce the time required for displaying object 44.

In the present invention, the region containing the object to be displayed or the cells obtained by dividing it may be a non-rectangular parallelepiped, but it is advantageous for them to be in the form of rectangular parallelepiped when implementation is considered. In the following, the former is simply called a grid space, the latter a rectangular parallelepiped.

In order that the invention may be fully understood it will now be described by way of example with reference to the accompanying drawings in which:

  • Figure 1 is a diagram illustrating how to have information about an object for a grid space according to the invention.
  • Figure 2 is a diagram illustrating the concept of the ray-tracing method.
  • Figure 3 is a diagram illustrating the tracing of rays reflected and refracted on the surface of the object.
  • Figure 4 is a diagram represented two-dimensionally, illustrating sampling according to a method of numerical value analysis.
  • Figure 5 is a diagram represented two-dimensionally, illustrating how to have information about the object for the divided grid space.
  • Figure 6 is a diagram represented two-dimensionally, illustrating judgment of intersection with the object in the grid space.
  • Figure 7 is a schematic diagram of the judgment of intersection between a ray and a rectangular parallelepiped.
  • Figure 8 is a diagram illustrating how to have information about the object for a grid space in a conventional way.
  • Figure 9 is a perspective diagram illustrating a case where a rectangular parallelepiped is divided into eight.
  • Figure 10 is a perspective diagram illustrating a case where a rectangular parallelepiped is divided into twenty-seven.
  • Figure 11 is a two-dimensional diagram illustrating a case where the locality of the equi-valued surface is significant.
  • Figure 12 is a flowchart illustrating an entire flow of the tech­nique according to the invention.
  • Figure 13 is a diagram representing the sectioned grid space where the equi-valued surface exists.
  • Figure 14 is a graph illustrating the processing time according to the invention, varying the number of division of the grid space.
  • Figure 15 is a diagram represented two-dimensionally, illustrating a case where the grid space is unevenly divided.

Embodiment

The preferred embodiments will be described by taking as an example a case where the surface of an object is represented as one equi-valued surface. The equi-valued surface is a set of points satisfying F (X, Y, Z) = C for a function F (X, Y, Z) on a given space. First, it is necessary to find for each pel an intersection point between the ray and the equi-valued surface nearest to the viewpoint. This means to find smallest parameter t satisfying

    F (vxt + sx, vyt + sy, vzt + sz) = C      (1)

based on the ray equation vt + s and the equi-valued surface F (X, Y, Z) = C. Equation (1) has t as a variable. If equation (1) is a unitary quadratic equation, its root can be easily obtained from a formula. However, if the equation is of fifth degree or higher, its solution is generally impossible to obtain by an algebraic method, but is obtained by the technique of numerical value analysis. The invention covers a ray-tracing method that performs the calculation of the intersection point by the technique of numerical value analysis.

Preprocessing

In the technique described below it is assumed that the equi-valued surface is given in a form of F (x, y, z) = C, and that the user pro­vides an region where the equi-valued surface exists (Xmin, Ymin, Zmin ] X, Y, Z ] Xmax, Ymax, Zmax).

In the preprocessing, a space region is divided into rectangular parallelepipeds. The reason why the parallelepiped division is used is that it reduces calculation on traversing the grid space compared with an octree structure. Here, the grid points are represented by (i, j, k) (i = 1, Ni, j = 1, Nj, K = 1, Nk where Ni, Nj and Nk are the number of grids in x, y and z directions, respectively). A rectangular parallel­epiped (i, j, k) means the one of which apexes are (i, j, k), (i+1, j, k) (i, j+1, k), (i, j, k+1), (i+1, j+1, k), (i+1, j, k+1), (i, j+1, k+1), (i+1, j+1, k+1). First, the region provided by the user where the equi-valued surface exists (Xmin, Ymin, Zmin ] X, Y, Z ] Xmax, Ymax, Zmax) is divided into Ni x Nj x Nk. Then, each rectangular parallelepi­ped is classified into two:

* Space where the equi-valued surface exists

* Space where the equi-valued surface does not exist

This is judged by the following method.

By obtaining the function value F (x, y, z) on each grid point (i, j, k), it is checked whether or not equi-valued surface exists in a rec­ tangular parallelepiped (i, j, k) with grid points as the apexes. This is determined by relations of size between each function value in a rectangular parallelepiped and the constant C. That is, when F-C is calculated for eight apexes of the rectangular parallelepiped (i, j, k), and if at least one sign differs from others, the rectangular parallele­piped (i, j, k) is determined to be a space where the equi-valued sur­face exists. If all signs are the same, the rectangular parallelepiped is again divided into Mi x Mj x Mk, and then F-C is calculated for each apex after re-division. At a stage when it is found that for at least one apex a calculated sign differs, the rectangular parallelepiped (i, j, k) is registered as the space where the equi-valued surface exists. If each apex after the re-division has the same sign, it is determined that it is the space where the equi-valued surface does not exists.

How many pieces each rectangular parallelepiped (i, j, k) is divided into also depends on the locality of the equi-valued surface, but it is generally sufficient that rectangular parallelepiped 52 is divided into eight (Mi = Mj = Mk = 2) as shown in Figure 9 if the values of Ni, Nj and Nk are large (Ni, Nj, Nk [ 20) and the region is properly specified, and that it is divided into as many as twenty-seven (Mi = Mj = Mk = 3) if the values of Ni, Nj and Nk are small. If equi-valued sur­face 54 as shown in Figure 11 has a significant locality, the values of Mi, Mj and Mk are made larger.

Judgment of intersection between ray and grid space

Because the grid space is surrounded by six planes represented as equation, X = Xmin, Y = Ymin, Z = Zmin, X = Xmax, Y = Ymax, Z = Zmax, it is sufficient to search the intersection point between the ray and each plane algebraically, and to check that the value is contained in the grid space. The rectangular parallelepiped which the ray first enters is determined from the intersection point nearest to the viewpoint among those contained in the grid space.

Traversing of grid space

The rectangular parallelepiped which the ray intersects can be determined only by calculation of increment based on the first rectangu­lar parallelepiped and the inclination of the ray. Description of this is omitted because it is already described in a section of the prior art. For the rectangular parallelepiped where the equi-valued surface exists, sampling is performed for points on the ray contained in the rectangular parallelepiped, for each of which function value F is calculated. A sampling width of about 1/20 or less of the maximum width of the rectangular parallelepiped has been judged to be sufficient from experience.

Image generation algorithm utilizing grid space

Figure 12 shows an entire flow. In the following, the image generation algorithm is described in detail by referring to Figure 13. By the preprocessing, the rectangular parallelepipeds contained in the grid space are classified into those where the equi-valued surface exists and those where the equi-valued surface does not exist. The flow of the algorithm is described by exemplifying rays I, II, III and IV from viewpoint Q. In this example, only color is assumed as the optical information assigned to pels on screen 56 (Figure 13).

(Case 1: Ray I)

Because ray I does not intersect the grid space, it is processed by the flow of blocks 70 -[ 71 -[ 72 -[ 73 -[ 84. It terminates after the color is calculated from the information stacked in block 84. The color is background one because it does not intersect the grid space. Then, the process for next ray is performed.

(Case 2: Ray II)

Because ray II intersects the grid space but does not intersect a rectangular parallelepiped where the equi-valued surface exists, the processing is performed in a flow of blocks 70 -[ 71 -[ 72 -[ 74 (taking out of rectangular parallelepiped 106) -[ 75 -[ 76 -[ 74 (taking out of rectangular parallelepiped 107), and then by repeating a flow of blocks 75 -[ 76 -[ 74 ... .

When rectangular parallelepipeds to be taken out in block 75 are exhausted, the flow enters block 73 to stack a background color, and then enters block 84. Then, the process for the next ray is performed.

(Case 3: Ray III)

For ray III, rectangular parallelepiped 116 is taken out by a flow of blocks 70 -[ 71 -[ 72 -[ 74 -[ 75 -[ 76, and checked for whether there is the equi-valued surface or not. Because the equi-valued surface does not exist in rectangular parallelepiped 116, the next rec­tangular parallelepiped 117 is taken out by a flow of blocks 74 -[ 75 -[ 76. Because the equi-valued surface exists in rectangular parallele­piped 117, the flow enters block 77 to perform the sampling. In this case, since ray III and the equi-valued surface in rectangular paralle­lepiped do not intersect with each other and there is no change of sign, rectangular parallelepiped 118 is taken out by a flow from block 78 to blocks 74 -[ 75 -[ 76. Because rectangular parallelepiped 118 also has the equi-valued surface, the flow enters block 77 to perform the sampl­ing. However, because the sign changes during the sampling, it enters block 79. Because a solution exists in this region on the basis of the intermediate-value theorem, intersection point X is found by a method such as the bisection method or the Newton method.

In a case where the object does not cause reflection or transmis­sion, the flow enters block 81 to stack the information on intersection point, and then enters block 84.

In a case where the object causes reflection or transmission, ray III′ is supposed in the direction of the reflection or transmission from intersection point X. The ray is processed in a manner similar to that described for ray III. The process of the calculation for the intersec­tion point according to the invention is described by exemplifying a case where the object in Figure 13 is transparent. Transmitted ray III′ starts from intersection point X and traverses rectangular parallele­pipeds 118, 124 and 125. Therefore, the flow from block 80 passes through blocks 82 -[ 83 (taking out of refracted ray III′ with orienta­tion slightly different from III) -[ 77 -[ 78, and enters block 74 to take out rectangular parallelepiped 124. However, because rectangular parallelepiped 124 is not a space where the equi-valued surface exists, useless sampling is not performed, and rectangular parallelepiped 125 is taken out by a flow of blocks 75 -[ 76 -[ 74. Because rectangular parallelepiped 125 is a space where the equi-valued surface exists, the flow passes through blocks 76 -[ 77 -[ 78 -[ 79, and a new intersection point Y is obtained. Because further calculation is performed for the transmitted ray in the block, the flow enters block 82 to stack the information of intersection point Y, and passes through blocks 83 -[ 77 -[ 78 -[ 74 -[ 75. In block 75, there is no next rectangular parallele­piped. Then the flow enters block 73, and finally the color calculation is performed in block 84 from the stacked information on intersection points (here, information about intersection points X and Y, and back­ground). Then, the process for next ray IV is performed.

Evaluation of the technique

The invention applied to the following equi-valued surface, and measurement was made for the number of division vs. the CPU time requir­ed until image data is generated on the main memory after reading data. The used function was:

    F (X, Y, Z) = (X² + Y² - 1)² + 4*Z² + 0.5*X = C

Figure 14 shows measured processing time. The number of pels on the screen was 512 x 512. The measurement was made for the number of division Ni = Nj = Nk = 0, 4, 8, 15, 30, 45 and 60. The number of divi­sion 0 means a case where the ray-tracing method is directly used without the technique of the invention. It is realized that high quality images can be displayed more quickly by way of the present technique. In addition, this technique is so simple that hardware can be easily configured.

Other applications

Although, in the above, the description is made for a case where the surface of the object is represented as one equi-valued surface, the present invention can also apply to a case where the surface of the object is comprised of a plurality of equi-valued surfaces that differ in dependence on position. In addition, information about the surface of the object may be acquired in an unequal division technique, that is, in a manner where a rectangular parallelepiped with the surface of the object is divided more finely than that without it for checking exis­tence of the surface.

Effect of the invention

According to the invention, it becomes possible to perform the ray-tracing at higher speed than with the conventional technique. The invention is particularly effective in performing analysis of a simula­tion by displaying an object with a transparent equi-valued surface.

高效检索全球专利

专利汇是专利免费检索,专利查询,专利分析-国家发明专利查询检索分析平台,是提供专利分析,专利查询,专利检索等数据服务功能的知识产权数据服务商。

我们的产品包含105个国家的1.26亿组数据,免费查、免费专利分析。

申请试用

分析报告

专利汇分析报告产品可以对行业情报数据进行梳理分析,涉及维度包括行业专利基本状况分析、地域分析、技术分析、发明人分析、申请人分析、专利权人分析、失效分析、核心专利分析、法律分析、研发重点分析、企业专利处境分析、技术处境分析、专利寿命分析、企业定位分析、引证分析等超过60个分析角度,系统通过AI智能系统对图表进行解读,只需1分钟,一键生成行业专利分析报告。

申请试用

QQ群二维码
意见反馈