Method and apparatus for deriving radiation images using a light buffer

Abstract: In the system for deriving radiation images, view independent radiation calculations are precomputed so that they do not need to be repeated for every view of the same environment. To find the form factors for radiosity techniques, a hemi-cube is constructed around the surface with grid cells defined for all faces on the hemi-cube. All other surfaces in the environment are projected onto the hemi-cube to facilitate the form factor calculations. A novel ray-tracing technique is disclosed where a light buffer (204) in the form of a cube is constructed around each radiation source (202) and grid cells (208) are defined on the faces (206) of the cube. Surfaces in the environment are projected onto the cube and the depths from the source are stored for each grid cell to facilitate shadow testing. Light reflected off of the viewed surface from another surface may be modeled by determining mirror positions of the viewer and the image plane. Instead of storing the depths of surfaces from the viewer or the radiation source, the identity of the polygons in the environment are stored instead to speed up the calculations. Scan conversion hardware is used to accelerate each of these operations. In a graphics pipeline, a feedback path is provided from the image processor to the CPU memory to store the result of the form factor or light buffer pre-computations to speed up the radiosity and ray tracing calculations by several orders of magnitude.

Description: Background of the Invention This invention relates to a system for deriving radiation images. The system is particularly useful in computer graphics applications. Much work has been done in the computer processing of three-dimensional data to produce realistic two-dimensional pictures. In order to create realistic images, the global illumination which is derived from the interreflection of light within an environment must be modeled correctly. In most conventional models, a constant ambient factor is used as the global illumination term. Shadows and intersurface illumination are not simulated. Although fast, such an approach is not quite satisfactory, particularly where the simulated environment includes complex lighting and object arrangements. The majority of surfaces in real environments are diffuse reflectors; that is, an incident beam of light is reflected or scattered in all directions within the entire hemisphere above the reflecting surface. A special case of diffuse reflection is the so-called "ideal" diffuse or "Lambertian" reflection. In this case, the incident light is reflected from a surface with equal intensity in all directions. A model assuming ideal diffuse reflection may be adequate for many computer graphics applications. Methods have previously been developed to determine the exchange of thermal radiant energy between surfaces in an enclosure. See Thermal Radiation Heat Transfer, by Robert Siegel and John R. Howell, Hemisphere Publishing Corp., 1978 and Radiation Heat Transfer , by E. M. Sparrow and R. D. Cess, Hemisphere Publishing Corp., 1978. The application of the same concept to the exchange of optical energy in enclosures, known as the radiosity method in computer graphics, is outlined in the paper "Modeling the Interaction of Light Between Diffuse Surfaces," by Cindy M. Goral et al., ACM Computer Graphics (Proceedings 1984), pp. 213-222. In contrast to conventional methods, the radiosity method models the interreflection of light between surfaces in an environment producing shadows and providing more realistic images, particularly where the environment includes many diffuse surfaces. A method of calculating object-to-object diffuse reflections within complex environments containing shadows is disclosed in "The Hemi-Cube : A Radiosity Solution for Complex Environments" by M. Cohen and D. Greenberg, SIGGRAPH Conference Proceedings, Vol. 19, No. 3, 1985, pages 31-40. Ray tracing techniques have also been developed as a model for light reflections which are assumed to be specular. See "An Improved Illumination Model for Shaded Display" by Turner Whitted in Communications of the ACM , vol. 23, No. 6, June 1980. As in the radiosity method, ray tracing accounts for shadows and interreflection of light between surfaces in an environment and produces more realistic images than conventional methods. While the radiosity and ray tracing methods provides better images than the conventional method, these techniques require many computer hours using a commercially available mini-computer. The illumination calculations in these techniques may require considerable time since the surfaces visible to a viewer must be tested to determine whether they are in shadow or not with respect to one or more light sources. Hence, much computer time is required to produce one image. It is thus desirable to provide improved radiosity and ray tracing systems which are faster than known methods. In the conventional, radiosity and ray tracing methods discussed above, a number of steps are required to produce one image of an environment. Frequently, a number of images from different viewing locations may be desired of the static environment. In such event, the steps for producing an image in the conventional and ray-tracing methods must be repeated in their entirety to produce additional images. In the radiosity approach, only some of the steps need to be repeated. In general, it is desirable to provide methods where the steps required for the first image need not be entirely repeated for subsequent images to accelerate the process for producing different images of the same environment. Summary of the Invention The present invention is set out in claims 1 and 23. A preferred embodiment of the invention concerns an improved system for creating a radiation image, where the system is useful for computer graphics employing ray tracing techniques. The method of the preferred embodiment is for defining the radiation data between a surface and a radiation source in an environment. The method comprises defining a polyhedron enclosing a radiation source and defining grid cells on at least one plane of the polyhedron between the radiation source and the environment and determining which grid cells are covered by the projection -of any surface. Using this method, it is possible to determine, for all surfaces in the environment, whether the surfaces or any portion thereof can receive radiation from any particular radiation source or not. This information may be stored as a record list for each grid cell. Hence, when it is known which surfaces are visible from a particular observation position, whether such surfaces receive radiation from radiation sources in the environment or not can be determined in less time than conventional methods. Brief Description of the Drawings Fig. 1A is a flow chart illustrating a conventional computer graphics algorithm for creating light images. Fig. 1B is a conventional computer graphics system for implementing the algorithm of Fig. 1A. Fig. 2 is a flow chart illustrating an aspect of the invention. Figs. 3A and 3B are schematic views of a viewer viewing an object in object space and image space respectively to illustrate a conventional method of perspective transformations used in computer graphics. Figs. 3C, 3D are schematic depth buffer and an intensity buffer respectively used in conventional computer graphics applications. Figs. 4 and 5 are block diagrams of a radiation image system to illustrate another aspect of the invention. Figs. 6A, 6B are schematic views of light buffers for accelerating shadow testing in specular reflection simulation to illustrate yet another aspect of the invention. Fig. 7 is a flow chart illustrating an algorithm for creating the light buffer of Figs. 6A and 6B. Fig. 8 is a schematic view of a viewer viewing a surface which reflects or transmits light from the environment to illustrate a feature of the ray tracing algorithm of the invention. Fig. 9 is a flow chart illustrating the feature of the ray tracing algorithm of Fig. 8. Detailed Description of the Preferred Embodiment The invention is particularly useful in computer graphics for producing light images. To simplify the description and facilitate the understanding of the invention, the invention will be illustrated in its application to creating light images, with the understanding that other types of radiation images such as acoustic, thermal and radioactive may be produced in a similar manner. Fig. 1A is a flow chart illustrating a conventional computer graphics pipeline for creating light images. Conventional graphic pipeline systems treat the creation of images by means of a computer as a sequential process employing many steps. Typically, a model of the environment is created by dividing the surfaces in the environment into polygons (Block 20). The light reflectivity and emission values for each color band are selected for each polygon. A particular viewing location and field of view is selected. The model created for the environment is perspectively transformed from object space to image space into proper relationship with the viewing location and field of view (Block 22), in a process described below in detail to simplify the determination of surfaces visible to the viewer. The surfaces in the environment are then tested to find out which surfaces are visible from the viewing location (Block- 24). Using a constant ambient term for the global illumination, the intensity I of reflected radiation from each visible surface is then calculated in accordance with the following equation (Block 26): where I a is the intensity due to ambient radiation, k d is the diffuse reflection constant, m is the number of radiation sources in the environment, N is the unit surface normal vector, L j is the vector in the direction of the jth radiation source, k s is the specular reflection coefficient, p j is the angle between the reflection vector of light from source j and the vector in the direction of the viewing or observation location, and c a constant, and n is an exponent that depends on the glossiness of the surface. In the equation above for calculating the intensity of reflection from a surface, the first term I a is the ambient term which remains a constant for all surfaces. The second term is the diffuse term which is the sum of the dot products of the unit normal vector of the surface with the unit vector in the direction of the jth radiation source for all j. The third term is the sum of the dot products between the unit reflection vectors of light from the jth radiation source reflecting specularly off of the surface and the unit vector in the viewing direction for all j. For a further elaboration of the conventional model intensity calculation, see "An Improved Illumination Model for Shaded Display" by Turner Whitted in Communications of the ACM , vol. 23, No. 6, June 1980. The illumination calculations can be performed for each pixel, but normally are done at the polygon vertices. Scan conversion of polygons is then performed for the pixels of the image plane (Block 28). The process is as follows. Each polygon is scan-converted and its depth computed at each pixel covered. The depth of the closest polygon at each pixel is stored in a buffer frequently known as the depth buffer. The illumination values of the pixels are linearly interpolated and stored in a buffer often known as an intensity buffer; these values may then be displayed (Block 30). Except for the creation of the model, the entire process described above must be repeated for every different image. In many computer graphic applications, it is necessary to create images of the same static environment but viewed at different locations. For such applications, the steps in Blocks 22-30 must be repeated for each frame. Fig. 1B is a block diagram of a graphics processor pipeline suitable for implementing the conventional method of Fig. 1A. The user creates a model of the environment (Block 20 of Fig. 1A) using central processing unit or CPU 21. The perspective transformations of Block 22 are performed in the transform engine 23. The image processor 25 determines which surfaces are visible to the viewer and calculates the illumination at such surfaces (Blocks 24, 26 of Fig. lA). The results of the illumination calculation are stored in image storage 27 and displayed by video display 29. The image processor performs the polygon scan-conversion operation and the depth-buffer visible surface algorithms in hardware, and stores the resulting information in local memory. Polygon scan-conversion routines are well-known and well-documented ( Fundamentals of Computer graphics , by J. D. Foley and A. Van Dam, Addison-Wesley Publishing Co., 1982, pp. 456-462, and Principles of Interactive Computer Graphics , by W.M. Newman and R.F. Sproull, McGraw Hill, 1979, pp. 232-243, pp. 286-287). The standard scan-conversion algorithm takes advantage of polygon scan-line, and pixel coherence and can easily be implemented in hardware. The most widely used method receives the polygon edges and sorts them according to their y (vertical) coordinates. For a given scan-line, some of the edges intersect the scan-line, and are termed "active" edges. The active edges are sorted in the x (horizontal) direction, and the sorted list is maintained. Segments, which are covered by the polygon, can be determined by the scan-line intersection of the neighboring active edges. Computations are simplified since edge-scan-line intersections can be easily predicted by knowing the shapes of the lines (polygon coherence). Furthermore the sorted edge list tends to remain the same from scan-line to scan-line unless new edges appear or old edges disappear (scan-line coherence). Lastly, the depth and color of the polygon at each pixel along a segment can be incrementally computed along the scan-line (pixel coherence). The simplest visible surface routine is known as the depth buffer or z-buffer algorithm. The depth buffer stores the depth of the current visible polygon at every pixel. As a new polygon is scan-converted, the depth of this polygon is compared at every pixel covered. If the polygon is closer to the observer, the new polygon depth is stored in the depth buffer. The process continues until all polygons have been processed, and only the visible polygons remain in the depth buffer. Every time there is a replacement of a new polygon, a new intensity is computed and stored in an intensity buffer. Because of their simplicity, both of these algorithms are easily implemented in hardware, such as in U.S. Patent No. 4,475,104 to Shen. The hardware execution allows the conversion of polygon data to pixel data to occur at speeds far in excess of software implementation. However, there are several basic restrictions to previous hardware implementations. The scan conversion process has been limited to triangular or convex polygons, and cannot handle concave polygons or polygons with holes. Only the depth and intensity information was maintained, and it was not possible to determine what polygon was visible at a given pixel. Lastly, it was difficult, if not impossible to retrieve information after the algorithms were executed since the intensity was sent directly to the display. By constructing a hardware image processor, which performs the scan-conversion and visible surface operations, which stores the resulting data as intensity information, or polygons or object identifiers, and which can send data back to a general purpose memory device, a new set of image generation algorithms can be executed at speeds several orders of magnitude faster than previously attained. Furthermore, the global illumination information which can rapidly be calculated using this hardware will result in the production of images of very high quality. For the purpose of understanding the invention, some of the new algorithms will be described first before the new hardware implementation. Fig. 2 is a flow chart illustrating the invention. The method illustrated in Fig. 2 is applicable for developing images of radiation which may be light, sound, heat, radioactive emission or other radiation having similar properties. A model of the environment is created (Block 32) in a manner similar to that of block 20 of Fig. 1A, except that the surfaces into which faces of objects are divided into need not be polygons. Instead they may be smaller surfaces or surfaces elements which may or may not be planar. These surfaces or elements may be defined by points, or points together with a defining equation. The radiation data independent of the observation location is then calculated (Block 34). This invention is based on the observation that the first two terms of the reflected radiation intensity equation above are independent of the observation location and need not be repeated for developing subsequent images of the same static environment. Furthermore, the values of (cos cp j ) n may be precomputed for a large number of values of p j and stored in a look-up table. These steps are performed in calculating the radiation data independent of viewing location in Block 34. Next, a viewing position is selected, and a perspective transformation from object space to image space is performed (Block 36). The value of p j for the jth radiation source is determined, and the value of (cos cp j ) n obtained from the look-up table compiled during the view-independent calculations in Block 34. The third term of the radiation intensity equation above for reflected radiation may be calculated (Block 37). The surfaces in the environment observable from the viewing position are determined (Block 38). Then the intensities at the pixels can be computed or the polygons can be scan-converted as before (Block 40). Pixel intensities are then displayed (circle 42). In the method of Fig. 2, in creating the first image, all the steps above should be performed. In order to create subsequent new images, however, all one has to do is to repeat the steps in Blocks 36-42. The view independent radiation data calculations may require a significant portion of the time needed to develop the first image. In creating subsequent images using the method of Fig. 2, such time can be saved. The method illustrated in Fig. 2 is therefore advantageous over that of Fig. 1A in that, where a number of images from different viewing positions of the same environment is desired, the images after the first may be developed much faster than the method of Fig. 1A. In the above description, the method of Fig. 2 is illustrated in the applications where no intersurface reflections or shadows are taken into account. It will be understood, however, that the method of Fig. 2 may also be applied to radiosity and ray-tracing methods where such events are accounted for as discussed in detail below to accelerate the process of creating a number of images of the same static environment. Before describing the invention in more detail, the perspective transformations referred to in Block 22 of Fig. 1A in the conventional method is described below in reference to Figs. 3A, 3B, 3C and 3D as background to the invention. In reference to Block 22, perspective transformation is performed on the objects in the environment relative to an observer in the relative position shown in Fig. 3A. As shown in Fig. 3A, the observer is at position 50 with a field of view defined by planes 52. The image plane is at 54. An arbitrary ray 56 through a pixel at position 58 in the image plane may pass through points A and B of object 60. As is evident from Fig. 3A point B is blocked by the front face of object 60 so that it is not visible at position 50. Determining the intersection point between an arbitrary ray and an arbitrarily oriented surface is time consuming. For this purpose the determination can be simplified by transforming the environment from real object space into what is called an image space, where the viewer views the environment from very far away (infinity) so that all the rays through the pixels of the image plane are essentially parallel to one another as shown in Fig. 3B. As shown in Fig. 3B, the viewer is at location 50' with a field of view defined by parallel planes 52', the image plane at 54', the arbitrary ray at 56' passing through point 58' of the image plane and intersecting points A' and B' of object 60' in the image space. Operating in the image space, it is relatively simple to mathematically determine that the point B' is not visible at position 50'. This is due to the fact that the light rays traveling from object 60 to a viewer at position 50' are parallel. If the image plane 54' is taken as the X, Y plane with the distance of objects from the plane measured as Z, whether any point with coordinate ( X', Y', Z') is visible at position 50' can be determined simply by comparing the Z coordinates of points with the same X and Y coordinates. Thus, points A' and B' have the same X and Y coordinates but point A' has a smaller value for its Z coordinate than point B'. Therefore, point B' is not visible at position 50'. If the Z distance from plane 54' is called the depth value, then which of two points having the same X and Y coordinates are visible can be determined by comparing their depth values. The image plane may be divided into pixels of a desired resolution. The depth and intensity buffers may store the points of surfaces visible to a viewer and their light intensities on a pixel by pixel basis as shown in Figs. 3C, 3D. Each surface is scan-converted to determine which pixels are covered by the surface. Then the depth of the surface are stored as shown in Fig. 3C. The visible surface determination process in Block 24 of Fig. 1A is then completed when all polygons have been processed. After the light intensities at different bandwidths (typically the red, green and blue channels) of the visible surfaces are calculated, they are stored on a pixel by pixel basis in an intensity buffer frequently known as a frame buffer as shown in Fig. 3D. The illumination calculation referred to in Block 26 of Fig. 1A is then completed. The pixels of the image plane 54' may then be displayed. In ray tracing, it is necessary to test whether a surface visible to the viewer is illuminated or in shadow with respect to a particular light source. Shadow testing is time consuming and accounts for a significant part of the processing time in creating computer images by ray tracing techniques. One aspect of the invention is based on the observation that a point can be determined to be in shadow without having to find out which object first occludes it. In addition, shadow testing can be accomplished by referencing surfaces to the direction of light rays in a conceptual device referred to below as a "light buffer". An idealized light buffer can thus be defined as having two algorithms: 1. A procedure to partition the environment with respect to each light's position. 2. A procedure to test if a given point is in shadow by using this partitioned definition of the environment. Again a model of the environment is created and the surfaces in the environment are defined. In order to reference data by using the direction of light rays originating from a particular light source, a light buffer is constructed. The light buffer may be a polyhedron enclosing the light source. In the preferred embodiment, the polyhedron is a cube. Figs. 6A and 6B are simplified perspective views of light buffers with objects in the environment and list records for a particular grid cell of the light buffer to illustrate the preferred embodiment of the invention. As shown in Fig. 6A, a light buffer 204 is defined to enclose light source 202. It is preferable to place the center of the light buffer 204 at the center of the light source. Using the light buffer 204, the environment may be partitioned with respect to light source 202. This procedure allows the subsequent shadow testing procedure with respect to light source 202 to be accelerated compared to conventional methods. The procedure for creating the light buffer 204 for light sources 202 will now be described in reference to Figs. 6A, 6B and 7. While the description below will be in reference to light images and optical reflections, it will be understood that the same system is applicable to the creation of other types of radiation images; all such configurations are within the scope of the invention. While light buffer 204 of Figs. 6A, 6B respectively are described herein as cubes with their respective centers at the centers of the light sources 202, it will be understood, however, that polyhedra other than cubes may be used for the light buffer and the light buffer polyhedron may be placed with its center away from the light source center and the invention described herein will function in essentially the same manner. The partitioning of the environment with respect to light source 202 using buffer 204 will now be described in reference to the flow chart of Fig. 7. The light buffer resolution is defined by specifying the number of grid cells in each of two orthogonal directions of the light buffer face (Block 222). The center of the cube is placed at the center of light source 202 (Block 224). The environment is geometrically transformed so that the light buffer is at the origin with the proper orientation (Block 226). The environment is clipped to the frustum of vision defined by one light buffer face, such as face 206 facing object number 7 (Block 228). The environment is then perspectively transformed from object space to image space and scan conversion is performed to find which grid cells on face 206 are covered by a selected projected surface such as face 3 of the object 7 (Blocks 230, 232). For each grid cell which is covered by the image of the projected surface (such as cell 208), the surface is inserted into the grid cell's record list. The identity of all surfaces and their distances or relative distances from source 202, herein called depth values, are stored in the list. Fig. 6A contains a grid cell list for cell 208 for illustration. As shown in the list, face 3 of object 7 is identified and stored in a list together with its depth value from the source. One then checks to see if there is another surface in the environment which should be projected onto face 206 in the frustum of vision defined in Block 228 (Diamond 236). If there is, then the steps in Blocks 232 and 234 are repeated to add the surface to the list records of the grid cells covered by the projected image of such surface. If all the surfaces within the frustum of vision for face 206 have been projected, one proceeds to check whether there is another light buffer face for which the view transformation and clipping operation of Blocks 226, 228 have not yet been performed (Diamond 238). If there is, the environment is geometrically transformed so that the Z axes passes through such face. The steps in Blocks 228-234 and Diamond 236 are then performed to compile the list records of all the grid cells covered by projected images of surfaces onto such face. When the above-described process has been completed for all six faces of the light buffer 204, one checks to see if there is another light source for which light buffers should be created (Diamond 240). If there is, then the above-described steps in Blocks 224-234 and Diamonds 236, 238 are repeated to compile the list records of the grid cells of the light buffer for such source. In this manner the environment has been partitioned with respect to every light source present. The identity of the surfaces and their depth values may be stored in the list records in such manner that their subsequent use in shadow testing is facilitated. This is illustrated in reference to Fig. 10B. Fig. 6B is a simplified perspective view of a light buffer and certain objects in the environment to illustrate such simplifying techniques. Buffer 204 has on one of its faces grid cell 252. Portions of objects 1-4 lie within the frustum 254 of vision defined by cell 252. The list record of cell 252 after the process described in Fig. 11 is shown as record I in Fig. 6B Where an object has complex shape, a conventional method for testing whether such object is intersected by a light ray is to simplify the task by substituting the object with a bounding volume enclosing the object in the ray tracing test. -Thus, as shown in Fig. 6B, object 2 is enclosed within a bounding volume. To flag the presence of a bounding volume, a negative identifier (-2) with a face identified as (0) is inserted into record II. It will be noted that object 3 fully occludes the frustum 254 so that object 4 will be entirely in shadow. The detection of this condition can be used to greatly simplify the list of record and the subsequent shadow process. Thus, if it is detected that a surface element visible to the viewer is at a distance further away from the light source than object 3, such surface element will be in shadow and no further testing of occlusion will be needed. For this reason the identities and depth values of all surfaces beyond object number 3 may be deleted to prune the list. Preferably the entries in a list records are arranged in an ascending order of depth values as shown in records I, II and III. The record of object 3 which occludes the entire frustum 254 is known as a full occlusion record and is identified by a negative identifier for its Z depth and is listed as the last record in the list record as illustrated in record III in Fig. 6B Thus, a convenient procedure for checking to see if a visible surface is completely occluded is to check the last entry of the list record. If the last entry is a full occlusion record at a smaller depth value than the visible surface element, then the 'visible surface element will be occluded. The manner in -which the image processor hardware, with its ability to create and store item buffers and light buffers, and how it can be used to accelerate ray-tracing, is illustrated below in reference to Figs. 8 and 9 In some light environments, the light observed from a particular surface may originate from other surfaces which are reflected from or transmitted through the surface viewed. Figs. 8 and 9 also illustrate a system for determining the contributions of light originating from other surfaces observed at the viewed surface. Fig. 8 is a schematic view of an observer observing radiation such as light from a surface originating from a number of light sources or surfaces to illustrate the preferred embodiment of the invention. As shown in Fig. 8 the viewer 300 views a surface S1 in the environment at a picture plane 302. Rays V1-V4 are representative light rays from surface S1 reaching the eye 300 through the picture plane 302. Thus, the light intensity observed by the eye is the light intensities of rays such as the representative rays V1-V4. Rays V1-V4 may comprise light reflected off surface S1 directly from light sources, light reflected off surface S1 from other surfaces such as surface S2 and light transmitted through surface S1 from other surfaces such as surface S3. Therefore, to create a realistic image, the contributions of light R1-R4, T1-T4 originating from surfaces S2, S3 respectively are added to the intensities of the directly reflected rays V1-V4. Fig. 9 is a flow chart illustrating the steps for computing the contributions to the light intensity observed by the eye from a surface which originate directly from other light sources or indirectly from other surfaces in the environment. As shown in Fig. 9 a model of the environment is again created in a manner described above (Block 32). A light buffer is created for each light source in the environment in the manner discussed above in reference to Fig. 7 (Block 360). The environment is then transformed so that its reference system is consistent with that of the observer at position 300 in Fig. 8 (Block 362). Using the image processor hardware, a scan-conversion algorithm is applied to determine the surfaces which are visible to the observer in the manner described above. The visible surfaces or portions thereof are then stored in an item buffer (Block 364). Each surface in the environment is tested to see if it is partially specular (Block 366, Diamond 368). One simple manner for testing specularity is to determine whether the specular reflection coefficient of the surface is zero or not. If the coefficient is zero, then the surface is non-specular; if the coefficient is non-zero, the surface is specular or partially specular. If the surface is specular or partially specular, the following steps are then performed. First, the pixels on the image plane covered by the surface are retrieved from the item buffer (Block 370). The exact intersection locations on the surface by rays from the eye passing through each of the covered pixels are computed and saved (Block 372). A predetermined point in each pixel may be selected for tracing the ray. Thus a ray may pass from the eye to one particular corner of a pixel. The intersection point is then found by finding the intersection between the ray and the surface. The intersection locations are tested to see if they are in shadow in reference to the light sources in the environment using the light buffers created (Block 374). The ambient and diffuse components of intensity as well as the specular component of intensity contributed by direct illumination from light sources may now be calculated according to the reflected intensity equation set forth in reference to Block 26 of Fig. 1 (Block 376). The results are stored in the frame buffer (Block 378). At this point only the contribution caused by direct illumination of surface S1 of Fig. 8 to the specular intensity component has been calculated. The contributions to the specular intensity components by other surfaces such as surfaces S2, S3 of Fig. 8 have not been included. This invention is based on the observation that these further contributicns can be determined simply by using the steps below. If such contributions are negligible, the system may simply proceed to diamond 414 to repeat the above process for more surfaces. In reference to Fig. 8 the contributions to the specular component caused by light reflected by surface S1 can be determined by constructing a mirage focal point 304 which is simply the mirror image of the viewer position 300 across surface S1 and a mirage picture plane 310 across S1; as shown in Fig. 8 these are simply mirror images of position 300 and picture plane 302 across S1. The mirror images of the pixels in plane 302 define the mirage pixels in plane 310. Then the surfaces in the environment which contribute light rays such as representative rays R1-R4 which are reflected by surface S1 towards the eye can be determined in a simple manner. Thus, first the mirage point 304 and the mirage picture plane 310 is determined (Block 380 in Fig. 9). A bounding box enclosing the ray intersection locations is constructed on the mirage picture image plane 310 of the mirage focal point system (Block 382). Clipping is performed to the bounding box and a scan-conversion algorithm is applied to determine the surfaces visible at the mirage point. These surfaces potentially reflect light towards the surface S1, which in turn reflect these rays towards the eye. The identity of these surfaces are stored in an item buffer for the mirage point (Block 384). The exact intersection points of the reflected rays (R1-R4 of Fig. 8) must then be determined (Block 386). Since the mirage pixels in the mirage picture plane are mirror images of the pixels in plane 302, and since the item buffer stores the surfaces seen through each mirage pixel within the bounding box, the task of finding the exact intersection locations of the reflected rays is greatly simplified. Furthermore, multiple intersections for all rays striking the same polygon, such as rays R1-R4, can be computed at the same time. The intersection points (such as points 306 on surface S2 of Fig. 8 are then tested to see if they are in shadow relative to the light sources in the environment (Block 388). The testing is done using the light buffers previously created. The indirect specular components contributed by light originating from such ray intersection points (such as point 306) are then computed (Block 390). The indirect specular components of the intensity seen at position 300 from surface S1 contributed by light reflected off of S1 from surface S2 may then be computed in accordance with the following equation: where the quantities in the equation are defined above in the reflected intensity equation discussed in reference to Block 26 of Fig. 1. It is noted that the ambient term I a in the reflected intensity equation should not be counted twice. For the intersection points such as points 306 which are illuminated by light sources, the specular components contributed by reflections off of S1 is then computed as indicated above. These contributions are added to the stored values in the frame buffer and the new totals are then stored in the buffer instead (391). This completes the process for adding the contributions of reflections from surface S2. If the surface S1 is not specular, then the ambient and diffuse components of intensity must be calculated. First, using the item buffer, the exact ray intersection points for each ray covered by the surface must be found (Block 392). Next, shadow testing using the light buffers is done (Block 393). The ambient and diffuse intensity components are then computed (Block 394) and stored in a frame buffer (Block 395). If surface S1 of Fig. 8 is transparent, light originating from light sources or surfaces such as surface S3 may be transmitted through surface S1 and seen at the eye 300. To enable realistic images to be created for environments including transparent surfaces, the following steps may be employed. First the surface is tested to determine if it is transparent (Diamond 396). If it is, then the viewing point is simply set at position 300 of Fig. 8 Since the transformation has already been performed in block 362, no further transformation is needed. The identities of the surfaces stored in the item buffer (performed in Block 364) are retrieved (Block 400). A bounding box on the image plane (such as picture plane 302 in Fig. 12) is constructed (Block 402). The bounding box is then used as the clipping boundary so that only a small number of pixels of the image plane need to be evaluated. Surface S1 is then removed from the environment (Block 406) and the identities of the closest surfaces seen by the eye and within the bounding box are then recomputed. Using the item buffer, the exact ray intersection points of each ray by surfaces after surface S1 has been removed are then computed in object space and shadow testing is performed to determine which of these points are illuminated (Blocks 408-412). As an approximation it is assumed that transparent surfaces such as surface S1 have zero thickness. Thus, the transmitted ray will strike another object or surface in the environment instead of the back surface of a transparent plate which has surface S1 as its front surface. Furthermore, refraction need not be accounted for. The transmitted specular components may be computed in accordance with the following equation: where the quantities in the equation are defined in the reflected intensity equation defined above in reference to Block 26 of Fig. 1. The transmitted specular contribution to the intensity observed at eye 300 is then added to the values stored in the frame buffer; this enables very realistic images to be created. The system then checks to see if there are more surfaces in the environment to be tested and repeats the above process where necessary. If not, the process of Fig. 13 has been completed. In the above process of Fig. 9, the intersection points such as points 306, 308 of Fig. 8 should be found so that the indirect specular components contributing to the intensities of the rays V1-V4 viewed can be determined. Instead of having to trace the rays to find their intersections with surfaces in the environment as done in previously known methods, the method of Fig. 9 makes use of object coherence and "polygon" coherence to simplify the process and reduce processing time. Once the intersection points in object space have been found, such as points 306, 308, the intensities of light reflected from such surfaces towards surface S1 must be calculated. Since a polygon may typically contain 100 to 900 pixels, the testing time is greatly reduced. That is, all of the intersections for a given polygon may be found using the same transformation, and entirely eliminating the sorting procedure for individual rays. The implementation of the methods of Figs. 1A, 6B, 7-9 using the graphic pipeline of Figs. 4 and 5 will now be described. In reference to Fig. 7, steps in Blocks 222, 224 are performed in the CPU 150. The steps in Blocks 228, 230 are performed by the floating point accelerator 152. The scan conversion in Block 232 occurs in the image processor 154 and the compilation of the grid cell list records in Block 234 is maintained in computer memory, such as the memory of CPU 150. The scan conversion in Block 232 defines the grid cells covered bv projected surface images. The surface identifier and depth information in the list records for the grid cells covered are stored in the control store 174 and sent to the CPU memory at an appropriate time. Thus, when the process of Fig. 7 is completed, the CPU memory stores the list records for the grid cells for all the light buffers created. The radiation data so calculated may then be used to accelerate shadow testing. In reference to Fig. 9 the model of the environment is created (Block 32) in the CPU 150. Light buffers are created as described above by means of CPU 150 and image processor 154 (Block 360). The list records of the grid cells in the light buffers are stored in the CPU memory. The environment is transformed in Block 362 in the floating point accelerator 152. The image processor 154 performs the scan-conversion of Block 364. The conjunction with accelerator 152 and image processor 154 recomputes the item buffer within the bounding box in Block 408 and the item buffer is stored in control store 174 of the image processor. Accelerator 152 computes the exact illuminated ray intersection points in Block 410. These points are shadow tested by CPU and the intensity calculations are performed in accelerator 152. The transmitted specular component is then added to the image storage 182. As illustrated in the description above, the feedback path 186 of Fig. 4 allows the precomputed radiation data, in this case the light buffer information, to be stored in the CPU memory. Such data is then fetched at a later time (such as shown in the steps in Blocks 374, 388 and 412). The local storage such as the control store 174 in the image processor also enables a limited amount of radiation data to be stored such as the item buffer information in reference to Blocks 364, 384 and 408. In other words, the local memory in the image processor allows the limited amount of radiation data to be stored for the purpose of speeding up the particular calculations involved at the time. The light buffer information is instead stored in the CPU memory. The light buffers may require considerable storage space and are therefore preferably stored in the CPU memory instead of a local memory such as that in the image processor. Furthermore, since shadow testing is performed by the CPU, the light buffer information is most conveniently fetched from the CPU memory. Alternatively, the item buffer information may also be stored in the CPU memory via path 186. As described above, the most time consuming portions of the ray-tracing calculations have been precomputed and stored in the CPU memory so that a number of images may be created quickly. Each component of the graphics pipeline of Fig. 4 may be constructed from conventional hardware, such as the conventional hardware for performing scan conversion. The invention is also based on the observation that, where the grid cells on the hemi-polyhedron for the light buffer consists of arrays of grid cells of the same shape, the existing conventional hardware for a scan-conversion may be adopted in the image processor of Fig. 5 for constructing the list records of the grid cells. Since the grid cells are essentially identical, they may be treated in a manner similar to the polygons scanned by a conventional scan-converter. Preferably the grid cells on the hemi-polyhedron for ray-tracing schemes are regular in shape and are preferably rectangles or squares. From the above, it is evident that the feedback path 186 in Fig. 4 allows the storage of the results of form factor calculations in radiosity techniques and light buffer calculations in ray tracing techniques. At a later time, the radiation data stored may be used to speed up the illumination calculations and shadow testing. In contrast, the conventional system of Fig. 1B does not allow for such storage.

Claims: A method for defining the radiation data between one or more surfaces and a radiation source in an environment, characterized by the steps of: defining a polyhedron enclosing said light source and defining grid cells on one or more planes of the polyhedron; projecting an image of each of said surfaces onto the polyhedron in the direction of the radiation source and determining which grid cells are enclosed by or in contact with the image; determining for at least one grid cell, for which surfaces the cell is enclosed by or in contact with the images, and determining information concerning the thus identified surfaces; and storing the information concerning the surfaces as a record list. The method of claim 1, wherein the environment includes at least one second surface, said method further characterised in that: the determining step comprises determining the depth values defined as the distances or relative distances between said surfaces and the radiation source; and the storing step comprises storing the identities of said surfaces and their depth values in the record list for such grid cell. The method of claim 2, characterised in that the records on said surfaces and their distances from the radiation source are stored in an ascending order of their depth values. The method of claim 3, further characterised by: testing whether a grid cell is entirely enclosed by the image of at least one surface opaque to the radiation in the environment, and identifying the record for such surfaces as a full occlusion record; and detecting all records of surfaces which are at greater depth values than the surface which has the smallest depth value and which has a full occlusion record, and deleting the records so detected. The method of claim 1, characterised in that the determining step includes; applying a visible surface algorithm to determine which grid cells contain or are in contact with the image. The method of claim 1, characterised in that the environment includes at least one second surface, said method further comprising: defining a bounding volume to enclose the second surface; projecting an image of said bounding volume onto the polyhedron in the direction of the radiation source and determining which grid cells are enclosed by or in contact with the image of the volume; determining, for at least one grid cell, (a) whether the cell is within or in contact with the image of the surface projected upon the polyhedron, and determining the distance or relative distance between the radiation source and the surface when the cell is within or in contact with the image, and (b) whether the cell is within or in contact with the image of the volume projected upon the polyhedron, and determining the distance or relative distance between the radiation source and the volume when the cell is within or in contact with the image of the volume; and storing the identities or said surface and said bounding volume and their distances or relative distances from the radiation source in a record list for such grid cell. The method of claim 1, characterised in that said radiation is light, heat, sound or radioactive emission. The method of claim 1, characterised in that said polyhedron is a cube. The method of claim 8, characterised in that the defining step defines the cube so that its center coincides substantially with said radiation source. The method of claim 1, characterised in that the grid cells defined in the defining step are substantially of the same shape. The method of claim 1, characterised in that the grid cells are substantially squares. The method of claim 1 further characterised by: (i) finding, on a surface by surface basis, which surfaces are closest to the location so that the radiation from these surfaces are observable at the location; (ii) tracing a line from the observation location to a point on a surface to define an intersection point; (iii) determining which grid cell intersects the line connecting the radiation source and the intersection point; (iv) comparing the distance between the intersection point and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the environment when traveling towards the intersection point; (v) computing the intensity of radiation reflected at or emitted by the intersection point towards the location; and (vi) repeating the steps (ii) through (v) for each of the surfaces and summing the intensities of radiation reflected at the intersection points to obtain the intensity of radiation observed at the location from the environment. The method of claim 12, characterised in that the radiation data of the environment is so defined that the records on the surface in the environment and their depth values are stored in an ascending order of their magnitude, and wherein the comparing step compares the distance between the intersection point and the radiation source to depth values in the record in the ascending order. The method of claim 13, characterised in that the comparing step is perfomed in said ascending order until the distance between the intersection point and the radiation source is less than the next deth value stored in the record, upon which the step is terminated. The method of claim 14, characterised in that the radiation data of the environment is so defined that the identities of the surface in the environment and their depth values are stored in the list records of the grid cells in an ascending order of their magnitudes, wherein the radiation data is defined also by (a) testing whether a grid cell is entirely enclosed by the image of at least one surface opaque to the radiation in the environment, (b) identifying the record for such surface as a full occlusion record, (c) detecting all records of surfaces which are at greater depth values than the surface which has the smallest depth value and which has a full occlusion record, and (d) deleting the records so detected, wherein the comparing step includes: relating the distance between the intersection point and the radiation source to the depth value in the full occlusion record, if any, and terminating the comparing step when the distance between the intersection point and the radiation source is greater than the depth value in the full occlusion record; and relating the distance between the intersection point and the radiation source to the depth values in the reocrd in the ascending order. The method of claim 12, characterised in that at least one of the closest surfaces to the location is non-specular, and wherein said computing step computes the ambient and direct diffuse reflection components of the radiation intensity emitted by the surface towards the location. The method of claim 12, characterised in that at least one of the closest surfaces to the location is specular, and wherein said computing step computes the ambient direct diffuse and direct specular reflection components of the radiation intensity emitted by the surface towards the location. The method of claim 1, further characterised by: (i) defining a picture plane having pixels therein with a predetermined size; and (ii) applying a scan conversion algorithm to determine which surfaces are closest to the location, and the pixels covered by each of the closest surface; (iii) for each of the surfaces, tracing a line from the observation location to a predetermined point in a pixel covered by one of the surfaces and determining the intersection point between such line and said one surface to determine the intersection points on said one closest surface; (iv) shadow testing each intersection point by determining which grid cell intersects the line connecting the radiation source and the intersection point, and by comparing the distance between the intersection point and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the environment when traveling towards the intersection point; (v) computing, for at least some pixels, the intensity of radiation reflected at or emitted by each intersection point towards the location; and (vi) displaying the intensities of radiation computed for each pixel to produce the radiation image. The method of claim 18, further characterised by: defining a picture plane having pixels therein with a selected resolution; and applying a scan conversion algorithm to determine the pixels covered by the closest surface for which the line is traced, wherein said tracing step is performed by tracing the line from the location through a predetermined point in a pixel and finding the intersection point between said line and the closest surface; repeating the comparing step (iv) and computing step (v) for each intersection point on the closest surface, and wherein said summing step (vi) is performed on a pixel by pixel basis. The method of claim 19, further characterised by storing the pixels covered by the closest surface determined by the scan conversion in a memory. The method of claim 18, further characterised by: storing, on a pixel by pixel basis and in a frame buffer, the intensity of radiation reflected at or emitted by each intersection point towards the location; storing in an item buffer the identities of the closest surfaces and the pixels covered by each of the closest surfaces; retrieving the pixels covered by one of the closest surfaces defining a specularly reflecting surface; determining the mirror image of the observation location across said specularly reflecting surface to define the mirage point of the location and determining the mirror image of the picture plane and the pixels therein across said specularly reflecting surface to define the mirage picture plane and the mirage pixels; defining a bounding box for the specularly reflecting surface; clippling and scan converting the environment with respect to the bounding box to determine the closest surfaces to the mirage point, the mirage pixels covered by each such surface; for each of the closest surfaces to the mirage point, tracing a line from the observation location to a predetermined point in a mirage pixel covered by such surface and determining the intersection point between such line and such surface to determine the intersection points on such surface; shadow testing each intersection point on such surface by determining which grid cell intersects the line connecting the radiation source and the intersection point, and by comparing the distance between the intersection point and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the envirnment when travelling towards the intersection point; computing, on a mirage pixel by mirage pixel basis, the intensity of radiation reflected at or emitted by each such intersection point and reflected by said specularly reflecting surface towards the location; and adding the intensity of radiation computed for each mirage pixel to the intensity value for the corresponding pixel stored in the frame buffer. The method of claim 18, further characterised by: storing, on a pixel by pixel basis and in a frame buffer, the intensity of radiation reflected at or emitted by each intersection point towards the location; storing in an item buffer the identities of the closest surfaces and the pixels covered by each of the closest surface; testing whether one of the closest surface is at least partially transparent; retrieving the pixels covered by the said one closest surface defining a transmitting surface; defining a bounding box for the transmitting surface; removing said transmitting surface from the environment; clipping and scan converting the environment with respect to the bounding box to determine the closest surfaces to the observation location, and the pixels covered by each such surface; for each of such surface, tracing a line from the observation location to a predetermined point in a pixel covered by such surface and determining the intersection point between such line and such surface to determine the intersection points on such surface; shadow testing each intersection point on such surface by determining which grid cell intersects the line connecting the radiation source and the intersection point, and by comparing the distance between the intersection and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the environment when travelling towards the intersection point; computing, on a mirage pixel by mirage pixel basis, the intensity of radiation reflected at or emitted by each such intersection point and reflected by said specularly reflecting surface towards the location; and adding the intensity of radiation computed in the computing step to the intensity value for the same pixel stored in the frame buffer. An apparatus for defining the radiation data between a surface and a radiation source in an environment, characterised by: means for defining a polyhedron enclosing said light source and defining grid cells on at least one plane of the polyhedron; and means for projecting an image of said surface onto the polyhedron in the direction of the radiation source and determining which grid cells are enclosed by or in contact with the image; means for determining, for the at least one grid cell, for which surfaces the cell is enclosed or in contact with the images of said surfaces; means for determining information concerning said surfaces; and means for storing said information concerning said surfaces as a record list for such grid cell. The apparatus of claim 23, characterised in that the grid cells defined by the defining means are substantially of the same shape. The apparatus of claim 24, characterised in that the grid cells are substantially squares. The apparatus of claim 23, each of said surfaces represented by an identifier, said apparatus further characterised by: means for determining information concerning the surfaces determining the depth values defined as the distance or relative distance between each of said surfaces enclosed by or in contact with the image and the source to define the radiation data; and the storing means stores the identifiers of said surfaces and their depth values as a record list for such grid cell. The apparatus of claim 26, further characterised by: (i) means for finding, on a surface by surface basis, which surfaces are closest to the location so that the radiation from these surfaces are observable at the location; (ii) means for tracing a line from the observation location to a point on a surface to define an intersection point; (iii) means for determining which grid cell intersects the line connecting the radiation source and the intersection point; (iv) means for comparing the distance between the intersection point and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the environment when travelling towards the intersection point; (v) means for computing the intensity of radiation reflected at or emitted by the intersection point towards the location; and (vi) means for summing the intensities of radiation reflected at the intersection points to obtain the intensity of radiation observed at the location from the environment. The apparatus of claim 27, characterised in that the radiation data of the environment is so defined that the records on the surfaces in the environment and their depth values are stored in an ascending order of their magnitude, and wherein the comparing means compares the distance between the intesection point and the radiation source to depth values in the record in the ascending order. The apparatus of claim 27, wherein the comparing means performs the comparison in said ascending order until the distance between the intersection point and the raidation source is less than the next depth value stored in the record, upon which the comparison stops the comparison. The apparatus of claim 27, further characterised by: (i) means for defining a picture plane having pixels therein with a predetermined size; and (ii) means for applying a scan conversion algorithm to determine which surfaces are closest to the location, and the pixels covered by each of the closest surface; (iii) means for tracing, for each of the surfaces, a line from the observation location to a predetermined point in a pixel covered by one of the surfaces and determining the intersection point between such line and said one surface to determine the intersection points on said surface; (iv) means for shadow testing each intersection point by determining which grid cell intersects the line connecting the radiation source and the intersection point, and by comparing the distance between the intersection point and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the environment when traveling towards the intersection point; (v) means for computing, on a pixel by pixel basis, the intensity of radiation reflected at or emitted by each intersection point towards the location; and (vi) means for displaying the intensities of radiation computed for each pixel to produce the radiation image. The apparatus of claim 30, further charactersied by a frame buffer storing, on a pixel by pixel basis, the intensity of radiation reflected at or emitted by each intersection point towards the location; an item buffer storing the identifiers of the closest surfaces and the pixels covered by each of the closest surfaces; means for retrieving the pixels covered by one of the closest surfaces defining a specularly reflecting surface; means for determining the mirror image of the observation location across said specularly reflecting surface to define the mirage point of the location and determining the mirror image of the picture plane and the pixels therein across said specularly reflecting surface to define the mirage picture plane and the mirage pixels; means for defining a bounding box for the specularly reflecting surface; means for clipping and scan converting the environment with respect to the bounding box to determine the closest surfaces to the mirage point, the mirage pixels covered by each such surface; means for tracing a line from the mirage point to a predetermined point in a mirage intersection point between such line and such surfaces to determine the mirage intersection points on such surface; means for shadow testing each mirage intersection point on such surface by determining which grid call intersects the line connecting the radiation source and the mirage intersection point, and by comparing the distance between the mirage intersection point and the radiation source to the depth values in the record list for such grid cell to determine whether radiation from the source is interfered with by any surface in the environment when travelling towards the mirage intersection point; means for computing on a mirage pixel by mirage pixel basis, the intensity of radiation reflected at or emitted by each such mirage intersection point and reflected by said specularly reflecting surface towards the location; and means for adding the intensity of radiation computed for each mirage pixel to the intensity value for the corresponding pixel stored in the frame buffer. The apparatus of claim 30, further comprising: a frame buffer storing on a pixel by pixel basis, the intensity of radiation reflected at or emitted by each intersection point towards the location; an item buffer storing the identities of the closest surfaces and the pixels covered by each of the closest surfaces; means for testing whether one of the closest surfacesis at least partially transparent; means for retrieving the pixels covered by said one closest surface defining a transmitting surface; means for defining a bounding box for the transmitting surface; means for removing said transmitting surface from the environment; means for clipping and scan converting the environment with respect to the bounding box to determine the closest surfaces to the observation location and the pixels covered by each such surface; means for tracing a line from the observation location to a predetermined point in a pixel covered by each such surface and determining the intersection point between such line and such surface to determine the intersection points on such surface, such intersecting points defining a group of points from which radiation is observable through the transmitting surface; means for shadow testing each intersection point in the group on such surfaces by determining which grid cell intersects the line connecting the radiation source and the intersection point in the group, and by comparing the distance between the intersection point in the group and the radiation source to the depth values in the record list for such grid cell to determine whether radiation for the source is interfered with by any surface in the environment when travelling towards the intersection point in the group; means for computing, on a mirage pixel basis the intensity of radiation reflected at or emitted by each such intersection point in the group and reflected by said specularly reflecting surface towards the location; and means for adding the intensity of radiation computed by the computing means to the intensity value for the same pixel stored in the frame buffer.

Inventors: COHEN MICHAEL F, GREENBERG DONALD P, HAINES ERIC A, COHEN, MICHAEL F., GREENBERG, DONALD P., HAINES, ERIC A.
Applicants: HEWLETT PACKARD CO, HEWLETT-PACKARD COMPANY
Application year: 1987
Main classification: G06T15
IPC codes: G06T15