专利汇可以提供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专利的具体信息内容。
This invention relates to a method for generating images by using a 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₂ originating 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 originating 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, respectively.
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 intersection points between them and the surfaces of the object to be displayed.
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).
Methods for calculating intersection points of rays and each object surface are classified into an algebraic method and a method of numerical 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 solution.
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 represented 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 increasing 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.
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 intersection point with an object surface for a rectangular parallelepiped which contains no object, it is possible to reduce the number of calculations of the intersection point. 40 in Figure 6 is a plane of projection.
Here, it is noticed that the invention and the prior art are described by using a drawing respresented two-dimensionally for convenience of description as in Figures 3 through 6.
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 parameter 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-dimensionally 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.
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 rectangular parallelepipeds in grid space 42, sampling is performed for rectangular 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.
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, 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:
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.
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 provides 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 parallelepiped (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 parallelepiped 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 parallelepiped (i, j, k) is determined to be a space where the equi-valued surface 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 surface 54 as shown in Figure 11 has a significant locality, the values of Mi, Mj and Mk are made larger.
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.
The rectangular parallelepiped which the ray intersects can be determined only by calculation of increment based on the first rectangular 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.
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).
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.
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.
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 rectangular parallelepiped 117 is taken out by a flow of blocks 74 -[ 75 -[ 76. Because the equi-valued surface exists in rectangular parallelepiped 117, the flow enters block 77 to perform the sampling. In this case, since ray III and the equi-valued surface in rectangular parallelepiped 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 sampling. 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 transmission, 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 intersection 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 parallelepipeds 118, 124 and 125. Therefore, the flow from block 80 passes through blocks 82 -[ 83 (taking out of refracted ray III′ with orientation 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 parallelepiped. 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 background). Then, the process for next ray IV is performed.
The invention applied to the following equi-valued surface, and measurement was made for the number of division vs. the CPU time required 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 division 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.
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 existence of the surface.
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 simulation by displaying an object with a transparent equi-valued surface.
标题 | 发布/更新时间 | 阅读量 |
---|---|---|
测量对象的系统、方法和非暂时性计算机可用介质 | 2020-05-14 | 840 |
使用光线跟踪渲染以生成可见性流 | 2020-05-16 | 865 |
基于双波长法补偿空气折射率的激光追踪系统ZEMAX仿真方法 | 2020-05-08 | 868 |
基于左右眼空间复用的虚拟三维场景立体画面绘制方法 | 2020-05-17 | 878 |
三维场景光线跟踪渲染画面的自适应反走样方法 | 2020-05-11 | 400 |
面向数字博物馆的三维场景精细化重建方法 | 2020-05-12 | 818 |
在虚拟空间中探索医学可视化参数 | 2020-05-15 | 982 |
使用多向相机评估封闭空间的尺寸 | 2020-05-16 | 607 |
结合云端全局光照渲染的VR三维场景立体画面生成方法 | 2020-05-11 | 776 |
一种基于光线跟踪算法的光场显示设备仿真方法 | 2020-05-14 | 526 |
高效检索全球专利专利汇是专利免费检索,专利查询,专利分析-国家发明专利查询检索分析平台,是提供专利分析,专利查询,专利检索等数据服务功能的知识产权数据服务商。
我们的产品包含105个国家的1.26亿组数据,免费查、免费专利分析。
专利汇分析报告产品可以对行业情报数据进行梳理分析,涉及维度包括行业专利基本状况分析、地域分析、技术分析、发明人分析、申请人分析、专利权人分析、失效分析、核心专利分析、法律分析、研发重点分析、企业专利处境分析、技术处境分析、专利寿命分析、企业定位分析、引证分析等超过60个分析角度,系统通过AI智能系统对图表进行解读,只需1分钟,一键生成行业专利分析报告。