Claims
- 1. A method of shading an object representation, the object being one of a plurality of objects included in an object scene, the method including:
creating a plurality of representations for the object; establishing a plurality of primary positions on a representation included in the plurality of representations; selecting shading positions on one or more other representations included in the plurality of representations, said shading positions being selected by reference to the plurality of primary positions, said one or more other representations included in the plurality of representations having a coarser resolution than the representation included in the plurality of representations; computing shading values for the shading positions; and applying one or more of the shading values to each of the plurality of primary positions.
- 2. The method of claim 1, wherein said creating step includes dicing an object to produce one or more grids of polygons, said one or more grids of polygons constituting a representation, said dicing governed by a dicing rate.
- 3. The method of claim 2, wherein the dicing rate is selected by reference to an area in a screen space such that each polygon in the one or more grids of polygons is substantially equal in size to the area.
- 4. The method of claim 3, wherein the area is coincident with a pixel of a display.
- 5. The method of claim 2, wherein the dicing rate is proportional to a curvature of the object.
- 6. The method of claim 2, wherein 010626-0018-999 - 34 - CAI -307908.1 the dicing rate is selected by reference to a technique for computing a shading value for a position on a representation.
- 7. The method of claim 2, wherein a distinct dicing rate is selected for each of the plurality of representations.
- 8. The method of claim 1, wherein each of the plurality of representations comprises one or more grids of polygons, a polygon being defined by three or more vertices, said establishing includes designating said three or more vertices as the plurality of primary positions.
- 9. The method of claim 8, wherein another representation in the plurality of representations comprises one or more grids of polygons, said selecting includes designating vertices of said another representation as the shading positions.
- 10. The method of claim 9, wherein the shading positions comprise a subset of the plurality of primary positions.
- 11. The method of claim 9, wherein for each of the shading positions, there is a defined number of primary positions.
- 12. The method of claim 9, wherein the selecting includes identifying a vertex in the vertices of the another representation closest, in view of their respective locations in the object scene, to a primary position in the plurality of primary positions on the representation as a shading position corresponding to said primary position.
- 13. The method of claim 8, wherein another representation in the plurality of representations comprises one or more grids of polygons, the shading positions disposed on edges of polygons composing said one or more grids of polygons. 010626-0018-999 - 35 - CAI -307908.1
- 14. The method of claim 13, wherein the selecting includes identifying a position on an edge of a polygon from the polygons composing said one or more grids of polygons closest, in view of their respective locations in the object scene, to a primary position in the plurality of primary positions on the representation as a shading position corresponding to said primary position.
- 15. The method of claim 1, wherein the selecting includes calculating a projected path of a ray if cast from a primary position in the plurality of primary positions on the representation;
identifying an intersection of the projected path of the ray and another representation in the plurality of representations as a shading position corresponding to the primary position; and casting the ray from the shading position into the object scene to compute a shading value for said shading position.
- 16. The method of claim 1, wherein the selecting includes calculating a projected path of a ray if cast from a primary position in the plurality of primary positions on the representation;
locating an intersection of the projected path of the ray and another representation in the plurality of representations; identifying a vertex of the another representation closest, in view of their respective locations in the object scene, to the intersection as a shading position corresponding to the primary position; and casting the ray from the shading position into the object scene to compute a shading value for said shading position.
- 17. The method of claim 1, including calculating a path of a ray cast from a primary position in the plurality of primary positions on the representation;
designating an intersection of the path of the ray and one of said one or more other representations included in the plurality of representations as a shading position corresponding to the primary position. 010626-0018-999 - 36 - CAI - 307908.1
- 18. The method of claim 17, wherein the ray is cast from the primary position to obtain input to a technique for computing a shading value, said method further including limiting consideration for the intersection to representations created to suit said technique for computing the shading value.
- 19. The method of claim 1, the selecting includes identifying four positions on one of said one or more other representations included in the plurality of representations that encompass a primary position included in the plurality of primary positions;
computing position weights by reference to parametric values associated with the four positions and the primary position; applying the position weights to coordinates of each of said four positions to compute a shading position, said shading position being a weighted average of the four positions.
- 20. The method of claim 1, wherein the computing includes tracing rays into the object scene from a shading position;
designating locations on representations intersected by the rays as secondary shading positions corresponding to the shading position; computing secondary shading values for the secondary shading positions; and combining the shading values to form a shading value for the shading position.
- 21. The method of claim 1, including creating a representation, on which a shading position is disposed, to suit a technique for computing a shading value;
calculating a path of a ray cast from the shading position to obtain input to the technique for computing the shading value; and limiting consideration for an intersection with the path of the ray to representations created to suit the technique for computing the shading value.
- 22. The method of claim 1, wherein a technique for computing a shading value includes determining a direct contribution from a light source, said light source comprising an object in the object scene. 010626-0018-999 - 37 - CAI - 307908.1
- 23. The method of claim 1, wherein a technique for computing a shading value includes determining a specular contribution from a reflecting object in the object scene.
- 24. The method of claim 1, wherein a technique for computing a shading value includes determining a diffuse contribution from a reflecting object in the object scene.
- 25. The method of claim 1, wherein the establishing includes calculating paths of a plurality of rays cast through a screen space into the object scene; and
identifying intersections of the plurality of rays and the representation included in the plurality of representations as the plurality of primary positions.
- 26. The method of claim 1, further comprising triggering the creation of the representation included in the plurality of representations while computing visibility of the object.
- 27. The method of claim 26, further comprising culling the representation included in the plurality of representations after the computing visibility of the object.
- 28. The method of claim 26, further comprising triggering the creation of a subset of the plurality of representations when computing shading values for the shading positions, said subset of the plurality of representations excluding the representation included in the plurality of representations.
- 29. The method of claim 28, further comprising applying the shading values to a representation of another object.
- 30. The method of claim 28, further comprising applying the shading values to the representation included in the plurality of representations. 010626-0018-999 - 38 - CAI - 307908.1
- 31. The method of claim 28, wherein the step of triggering the creation of the subset of the plurality of representations precedes the step of triggering the creation of the representation included in the plurality of representations.
- 32. The method of claim 26, further comprising culling the subset of the plurality of representations after the computing visibility of the object if said subset of the plurality of representations is not to compute shading values applied to a representation of another object.
- 33. A method of rendering an object scene, the method including:
creating a visibility representation of a first object in the object scene; creating a first shading representation of the first object, said first shading representation of the first object having a coarser resolution than the visibility representation of the first object; determining visibility of the first object by reference to the visibility representation of the first object; and computing a shading value related to the first object by reference to the first shading representation of the first object, wherein shading representations of other objects are referenced for the first object only through the first shading representation.
- 34. The method of claim 33, wherein the shading value is computed for the first object, the method further comprising applying said shading value to the visibility representation of the first object.
- 35. The method of claim 34, wherein the computing step includes creating a representation of a second object in the object scene; and
making reference to the representation of the second object in the object scene when the shading value is also related to the second object. 010626-0018-999 - 39 - CAI -307908.1
- 36. The method of claim 33, wherein the shading value is computed for a second object in the object scene, said shading value also related to said second object, the method further comprising creating a shading representation of the second object, the first shading representation of the first object being referenced through said shading representation of the second object; and
applying the shading value to a visibility representation of the second object.
- 37. The method of claim 33, wherein the shading value relates to an object in the object scene when a characteristic of the object affects said shading value.
- 38. The method of claim 33, wherein the first shading representation of the first object is created to suit a first technique for computing a first component of the shading value, said method further comprising creating a first shading representation of a second object in the object scene to suit the first technique for computing the first component of the shading value; and
making reference to the first shading representation of the second object in the object scene when the shading value is also related to said second object.
- 39. The method of claim 38, wherein the first shading representation of the first object is referenced, for the second object, only through the first shading representation of the second object.
- 40. The method of claim 38, further comprising creating a second shading representation of the first object to suit a second technique for computing a second component of the shading value.
- 41. The method of claim 40, wherein the second shading representation of the first object and the first shading representation of the first object having distinct resolutions. 010626-0018-999 - 40 - CAI -307908.1
- 42. The method of claim 40, further comprising creating a second shading representation of a second object in the object scene to suit the second technique for computing the second component of the shading value; and
making reference to the second shading representation of the second object in the object scene when the shading value is also related to said second object.
- 43. The method of claim 42, wherein the second shading representation of the first object is referenced, for the second object, only through the second shading representation of the second object.
- 44. The method of claim 33, wherein a technique for computing a shading value includes determining a direct contribution from a light source, said light source comprising an object in the object scene.
- 45. The method of claim 33, wherein a technique for computing a shading value includes determining a specular contribution fpresent invention also addresses a problem that often occurs when casting rays from vertices of primitives (either visibility grids or shading grids). In prior art REYES architectures, and in the present invention, primitives are shaded without information about the locations of other primitives. As a result, rays cast from a primitive may enter invalid object scene space 612 (FIG. 6A). FIG. 6A is illustrative of this problem and includes a side-view of two flat, perpendicular primitives 120 (i.e., the first and second primitive) that abut each other along a common edge that includes the primitive-edge vertex designated 606, a set of rays 608 cast from the primitive-edge vertex 606, valid object scene space 610, and invalid object scene space 612. In this example, the two primitives 120 model the surface a common object. The space to the right of the two primitives 120 is an interior cavity of the common object and should not, therefore, be checked for possible sources of direct and indirect light for the primitive-edge vertex 606.
But since the renderer 23 does not typically have information about the location of the second primitive, the renderer 23 may cast rays directly into the invalid object scene space 612, as illustrated in FIG. 6A, while shading the primitive-edge vertex 606 for the first 010626-0018-999 - 28 - CAI - 307908.1 primitive. Such rays typically return color values that produce invalid shadows along edges of a primitive. To avoid this problem, the renderer 23 preferably offsets the origin of the set of rays 608 so that the rays 608 can not be cast directly into the invalid object scene space 612. Any direction that will not result in a ray being invalidly cast through the surface of the first primitive will also not result in a ray being cast directly into the invalid object scene space 612. FIGS. 6B and 6C illustrate ray origin shifting. FIG. 6B illustrates a result of shifting the origin of the rays 608 illustrated in FIG. 6A away from the primitive-edge vertex 606. In this particular example, each ray origin is shifted to the same location. This is not, however, a limitation of the present invention. In some embodiments, one or more of the rays may be shifted to a unique location. FIG. 6C illustrate the general direction that ray origins are shifted for a primitive comprised of six polygons in an embodiment of the present invention. The amount by which the rays are shifted can be determined in a number of ways without departing from the scope of the present invention. In some embodiments, for example, the amount may be fixed for all ray origins shifted (even though the direction of the shift may vary for each ray). In other embodiments, the amount of a shift is a function of a distance between the primitive-edge vertex and surrounding vertices. As noted above, rays are used to determine light that shines on a primitive. Colors or color values computed for the vertices of a primitive are then combined to form a color value for the entire primitive. In some embodiments, the color values computed for the vertices are bilinearly interpolated to form a color value for primitives. Persons skilled in the art recognize that interpolation is the process of determining plausible in-between values by reference to explicit values at particular points. Linear means that the values fall along a line from one known point to the next. This means the value changes a fixed amount for a fixed-sized step. Bi-linear means this process is carried out in two dimensions. 010626-0018-999 - 29 - CAI -307908.1However, the light detected by the rays 608 in FIG. 6B does not correspond precisely to the light that actually falls on the primitive-edge vertex 606. So in some embodiments, the location of the new ray origin for the rays 608 is an input to the bi-linear interpolation process described above. In still other embodiments, other vertices of the primitive are used in conjunction with the location of a new ray origin for the rays 608 to extrapolate a color value for the primitive-edge vertex 606. In yet another embodiment, the light energy detected by the rays 608 is treated as if it were detected by rays with an origin at the primitive-edge vertex 606. As noted above, the step of shading a visibility grid may include casting rays into the object scene for intersection with shading grids. Determining whether a ray intersects an object may include several steps. If a shading grid has been created for a modeled object in an object scene, the renderer first determines whether the ray intersects a bounding box of the primitive corresponding to the object. If so, the renderer 23 determines whether the ray intersects the bounding box of the shading grid, which typically requires substantially more processing time than determining whether the ray intersects the bounding box of the primitive corresponding to the object. It may be, however, that a shading grid has not yet been created such that determining whether a ray intersects a primitive also includes creating a shading grid so that a bounding box for the shading grid can be computed. For this reason, a shading grid may be created before a visibility grid of a corresponding primitive. In other words, a ray may intersect a primitive before the primitive is hidden in step 258. After shading the visibility grid corresponding to the selected primitive or portion of a primitive (step 256) or if the visibility grid corresponding to the selected primitive or portion of a primitive is already shaded (step 254—Yes), the renderer hides the visibility grid corresponding to the selected primitive or portion of a primitive (step 258). This step typically includes the renderer 23 projecting the visibility grid onto the image plane and sampling the visibility grid. In other words, the renderer 23 determines elements of the visibility grid that are actually visible or contribute color values to one or more pixels. The renderer 23 may use a number of sampling techniques without departing from the scope of the present invention. For example, the renderer 23 may sample the visibility grid with points, lines, or areas. The renderer 23 may also use area averaging to compute primitive visibility and colors for pixels. 010626-0018-999 - 30 - CAI -307908.1The result of the hiding step is typically a plurality of color values maintained by the renderer 23 in the z-buffers 38. These color values may or may not be subsequently overwritten by the renderer 23 following another execution of the hiding step (step 258) in conjunction with other visibility grids. Such visibility grids may actually be closer to the image plane 110 than the (current) visibility grid and, therefore, occlude the (current) visibility grid. After hiding the visibility grid corresponding to the selected primitive or portion of a primitive, the renderer 23 preferably removes the pointer to the selected primitive or portion of a primitive from its primitive bucket 36 (step 260). The renderer 23 then determines whether the selected primitive or portion of a primitive is still on-screen (step 262). The step of shading the visibility grid may offset vertices of the visibility grid such that it is no longer in the viewing volume. As a result, step 262 includes bounding the shaded visibility grid corresponding to the selected primitive or portion of a primitive and determining whether the resulting bounding box is on-screen. If the renderer 23 determines that the selected primitive or portion of a primitive is not still on-screen (step 262—No), the renderer 23 removes all pointers to the selected primitive or portion of a primitive from remaining primitive buckets 36 (step 263). But if the renderer 23, for example, also determines in step 262 that the entire primitive that includes the selected portion is not still on-screen, the renderer 23 may remove all pointers to this primitive from the primitive buckets 36. The renderer 23 then preferably culls corresponding visibility grids from the active object scene data 32 (step 264). At the very least, a visibility grid created for the selected primitive or the selected portion of a primitive is removed. But if the renderer 23 determines in step 262 that the primitive that includes the selected portion is not still on-screen, the renderer 23 may remove all visibility grids created for this primitive. The renderer 23 then determines whether the selected primitive or portion of a primitive is ray traceable (step 266). If the renderer 23 determines that the selected primitive or portion of a primitive is ray traceable (step 226—Yes), the renderer 23 returns to step 208 to select another primitive or portion of a primitive. Since the selected primitive or portion of a 010626-0018-999 - 31 - CAI - 307908.1 primitive may be intersected by a ray while the renderer 23 is shading another primitive, data about the selected primitive or portion of a primitive is preferably maintained. If the renderer 23 determines that the selected primitive or portion of a primitive is not ray traceable (step 266—No), the renderer 23 culls data related to the selected primitive or the primitive that includes the selected portion from the active object scene data 32 (except, for example, an indication that the selected primitive or the primitive that includes the selected portion has already been processed) (step 268). The renderer 23 then returns to step 208 to select another primitive or portion of a primitive. If the renderer 23 determines that the selected primitive or portion of a primitive is still on-screen (step 262—Yes), the renderer 23 determines whether the selected primitive or the primitive that includes the selected portion is referenced in any primitive buckets 36 (step 270). If not (step 270—No), the renderer 23 culls the visibility grid created for the selected primitive or the selected portion of a primitive (step 272). But if the selected primitive or the primitive that includes the selected portion is referenced in any primitive buckets 36 (step 270—Yes) or after executing step 272, the renderer 23 determines whether the selected primitive or portion of a primitive is ray traceable (step 274). If the renderer 23 determines that the selected primitive or portion of a primitive is ray traceable (step 274—Yes), the renderer 23 returns to step 208 to select another primitive or portion of a primitive. Since the selected primitive or portion of a primitive may be intersected by a ray while the renderer 23 is shading another primitive, data about the selected primitive or portion of a primitive is preferably maintained. If the renderer 23 determines that the selected primitive or portion of a primitive is not ray traceable (step 274—No), the renderer 23 culls data related to the selected primitive or the primitive that includes the selected portion from the active object scene data 32 (except, for example, an indication that the selected primitive or the primitive that includes the selected portion has already been processed) (step 276). The renderer 23 then returns to step 208 to select another primitive or portion of a primitive. While the present invention has been described with reference to a few specific embodiments, the description is illustrative of the invention and is not to be construed as 010626-0018-999 -32 - CAI -307908.1 limiting the invention. Various modifications may occur to those skilled in the art without departing from the true spirit and scope of the invention as defined by the appended claims. For example, in some embodiments, the renderer 23 creates a plurality of shading grids for one or more primitives. Each primitive is used in conjunction with a specific shading process. For example, in one embodiment, separate shading grids are used when tracing rays from highly reflective objects such as mirrors and minimally reflective objects such as cardboard boxes. A mirror reproduces reflected objects much more clearly than a cardboard box, so objects reflected in a mirror require a more accurate representation. Similarly, a second shading grid may be used when intersecting primitives with secondary rays. As described above, rays cast from intersections of primitives and another ray may be thought of as secondary rays. Again, these rays have a more limited effect on a vertex being shaded than primary rays (e.g., rays that trigger secondary rays). The shading grids intersected by secondary rays may not, therefore, need the same level of detail as shading grids intersected by primary rays. Another example is the use of rays to compute object visibility instead of projecting primitives onto the image plane 110. Much like prior art ray tracing renderers, these embodiments of the present invention use rays cast through the image plane 110 to select positions on primitives that are used to c positions;
computing position weights by reference to parametric values associated with the four positions and the primary position; applying the position weights to coordinates of each of said four positions to compute a shading position, said shading position being a weighted average of the four positions.
- 20. The method of claim 1, wherein the computing includes tracing rays into the object scene from a shading position;
designating locations on representations intersected by the rays as secondary shading positions corresponding to the shading position; computing secondary shading values for the secondary shading positions; and combining the shading values to form a shading value for the shading position.
- 21. The method of claim 1, including creating a representation, on which a shading position is disposed, to suit a technique for computing a shading value;
calculating a path of a ray cast from the shading position to obtain input to the technique for computing the shading value; and limiting consideration for an intersection with the path of the ray to representations created to suit the technique for computing the shading value.
- 22. The method of claim 1, wherein a technique for computing a shading value includes determining a direct contribution from a light source, said light source comprising an object in the object scene. 010626-0018-999 - 37 - CAI - 307908.1
- 23. The method of claim 1, wherein a technique for co puting a shading value includes determining a specular contribution from a reflecting object in the object scene.
- 24. The method of claim 1, wherein a technique for computing a shading value includes determining a diffuse contribution from a reflecting object in the object scene.
- 25. The method of claim 1, wherein the establishing includes calculating paths of a plurality of rays cast through a screen space into the object scene; and
identifying intersections of the plurality of rays and the representation included in the plurality of representations as the plurality of primary positions.
- 26. The method of claim 1, further comprising triggering the creation of the representation included in the plurality of representations while computing visibility of the object.
- 27. The method of claim 26, further comprising culling the representation included in the plurality of representations after the computing visibility of the object.
- 28. The method of claim 26, further comprising triggering the creation of a subset of the plurality of representations when computing shading values for the shading positions, said subset of the plurality of representations excluding the representation included in the plurality of representations.
- 29. The method of claim 28, further comprising applying the shading values to a representation of another object.
- 30. The method of claim 28, further comprising applying the shading values to the representation included in the plurality of representations. 010626-0018-999 - 38 - CAI - 307908.1
- 31. The method of claim 28, wherein the step of triggering the creation of the subset of the plurality of representations precedes the step of triggering the creation of the representation included in the plurality of representations.
- 32. The method of claim 26, further comprising culling the subset of the plurality of representations after the computing visibility of the object if said subset of the plurality of representations is not to compute shading values applied to a representation of another object.
- 33. A method of rendering an object scene, the method including:
creating a visibility representation of a first object in the object scene; creating a first shading representation of the first object, said first shading representation of the first object having a coarser resolution than the visibility representation of the first object; determining visibility of the first object by reference to the visibility representation of the first object; and computing a shading value related to the first object by reference to the first shading representation of the first object, wherein shading representations of other objects are referenced for the first object only through the first shading representation.
- 34. The method of claim 33, wherein the shading value is computed for the first object, the method further comprising applying said shading value to the visibility representation of the first object.
- 35. The method of claim 34, wherein the computing step includes creating a representation of a second object in the object scene; and
making reference to the representation of the second object in the object scene when the shading value is also related to the second object. 010626-0018-999 - 39 - CAI -307908.1
- 36. The method of claim 33, wherein the shading value is computed for a second object in the object scene, said shading value also related to said second object, the method further comprising creating a shading representation of the second object, the first shading representation of the first object being referenced through said shading representation of the second object; and
applying the shading value to a visibility representation of the second object.
- 37. The method of claim 33, wherein the shading value relates to an object in the object scene when a characteristic of the object affects said shading value.
- 38. The method of claim 33, wherein the first shading representation of the first object is created to suit a first technique for computing a first component of the shading value, said method further comprising creating a first shading representation of a second object in the object scene to suit the first technique for computing the first component of the shading value; and
making reference to the first shading representation of the second object in the object scene when the shading value is also related to said second object.
- 39. The method of claim 38, wherein the first shading representation of the first object is referenced, for the second object, only through the first shading representation of the second object.
- 40. The method of claim 38, further comprising creating a second shading representation of the first object to suit a second technique for computing a second component of the shading value.
- 41. The method of claim 40, wherein the second shading representation of the first object and the first shading representation of the first object having distinct resolutions. 010626-0018-999 - 40 - CAI -307908.1
- 42. The method of claim 40, further comprising creating a second shading representation of a second object in the object scene to suit the second technique for computing the second component of the shading value; and
making reference to the second shading representation of the second object in the object scene when the shading value is also related to said second object.
- 43. The method of claim 42, wherein the second shading representation of the first object is referenced, for the second object, only through the second shading representation of the second object.
- 44. The method of claim 33, wherein a technique for computing a shading value includes determining a direct contribution from a light source, said light source comprising an object in the object scene.
- 45. The method of claim 33, wherein a technique for computing a shading value includes determining a specular contribution fpresent invention also addresses a problem that often occurs when casting rays from vertices of primitives (either visibility grids or shading grids). In prior art REYES architectures, and in the present invention, primitives are shaded without information about the locations of other primitives. As a result, rays cast from a primitive may enter invalid object scene space 612 (FIG. 6A). FIG. 6A is illustrative of this problem and includes a side-view of two flat, perpendicular primitives 120 (i.e., the first and second primitive) that abut each other along a common edge that includes the primitive-edge vertex designated 606, a set of rays 608 cast from the primitive-edge vertex 606, valid object scene space 610, and invalid object scene space 612. In this example, the two primitives 120 model the surface a common object. The space to the right of the two primitives 120 is an interior cavity of the common object and should not, therefore, be checked for possible sources of direct and indirect light for the primitive-edge vertex 606.
But since the renderer 23 does not typically have information about the location of the second primitive, the renderer 23 may cast rays directly into the invalid object scene space 612, as illustrated in FIG. 6A, while shading the primitive-edge vertex 606 for the first 010626-0018-999 - 28 - CAI - 307908.1 primitive. Such rays typically return color values that produce invalid shadows along edges of a primitive. To avoid this problem, the renderer 23 preferably offsets the origin of the set of rays 608 so that the rays 608 can not be cast directly into the invalid object scene space 612. Any direction that will not result in a ray being invalidly cast through the surface of the first primitive will also not result in a ray being cast directly into the invalid object scene space 612. FIGS. 6B and 6C illustrate ray origin shifting. FIG. 6B illustrates a result of shifting the origin of the rays 608 illustrated in FIG. 6A away from the primitive-edge vertex 606. In this particular example, each ray origin is shifted to the same location. This is not, however, a limitation of the present invention. In some embodiments, one or more of the rays may be shifted to a unique location. FIG. 6C illustrate the general direction that ray origins are shifted for a primitive comprised of six polygons in an embodiment of the present invention. The amount by which the rays are shifted can be determined in a number of ways without departing from the scope of the present invention. In some embodiments, for example, the amount may be fixed for all ray origins shifted (even though the direction of the shift may vary for each ray). In other embodiments, the amount of a shift is a function of a distance between the primitive-edge vertex and surrounding vertices. As noted above, rays are used to determine light that shines on a primitive. Colors or color values computed for the vertices of a primitive are then combined to form a color value for the entire primitive. In some embodiments, the color values computed for the vertices are bilinearly interpolated to form a color value for primitives. Persons skilled in the art recognize that interpolation is the process of determining plausible in-between values by reference to explicit values at particular points. Linear means that the values fall along a line from one known point to the next. This means the value changes a fixed amount for a fixed-sized step. Bi-linear means this process is carried out in two dimensions. 010626-0018-999 - 29 - CAI -307908.1However, the light detected by the rays 608 in FIG. 6B does not correspond precisely to the light that actually falls on the primitive-edge vertex 606. So in some embodiments, the location of the new ray origin for the rays 608 is an input to the bi-linear interpolation process described above. In still other embodiments, other vertices of the primitive are used in conjunction with the location of a new ray origin for the rays 608 to extrapolate a color value for the primitive-edge vertex 606. In yet another embodiment, the light energy detected by the rays 608 is treated as if it were detected by rays with an origin at the primitive-edge vertex 606. As noted above, the step of shading a visibility grid may include casting rays into the object scene for intersection with shading grids. Determining whether a ray intersects an object may include several steps. If a shading grid has been created for a modeled object in an object scene, the renderer first determines whether the ray intersects a bounding box of the primitive corresponding to the object. If so, the renderer 23 determines whether the ray intersects the bounding box of the shading grid, which typically requires substantially more processing time than determining whether the ray intersects the bounding box of the primitive corresponding to the object. It may be, however, that a shading grid has not yet been created such that determining whether a ray intersects a primitive also includes creating a shading grid so that a bounding box for the shading grid can be computed. For this reason, a shading grid may be created before a visibility grid of a corresponding primitive. In other words, a ray may intersect a primitive before the primitive is hidden in step 258. After shading the visibility grid corresponding to the selected primitive or portion of a primitive (step 256) or if the visibility grid corresponding to the selected primitive or portion of a primitive is already shaded (step 254—Yes), the renderer hides the visibility grid corresponding to the selected primitive or portion of a primitive (step 258). This step typically includes the renderer 23 projecting the visibility grid onto the image plane and sampling the visibility grid. In other words, the renderer 23 determines elements of the visibility grid that are actually visible or contribute color values to one or more pixels. The renderer 23 may use a number of sampling techniques without departing from the scope of the present invention. For example, the renderer 23 may sample the visibility grid with points, lines, or areas. The renderer 23 may also use area averaging to compute primitive visibility and colors for pixels. 010626-0018-999 - 30 - CAI -307908.1The result of the hiding step is typically a plurality of color values maintained by the renderer 23 in the z-buffers 38. These color values may or may not be subsequently overwritten by the renderer 23 following another execution of the hiding step (step 258) in conjunction with other visibility grids. Such visibility grids may actually be closer to the image plane 110 than the (current) visibility grid and, therefore, occlude the (current) visibility grid. After hiding the visibility grid corresponding to the selected primitive or portion of a primitive, the renderer 23 preferably removes the pointer to the selected primitive or portion of a primitive from its primitive bucket 36 (step 260). The renderer 23 then determines whether the selected primitive or portion of a primitive is still on-screen (step 262). The step of shading the visibility grid may offset vertices of the visibility grid such that it is no longer in the viewing volume. As a result, step 262 includes bounding the shaded visibility grid corresponding to the selected primitive or portion of a primitive and determining whether the resulting bounding box is on-screen. If the renderer 23 determines that the selected primitive or portion of a primitive is not still on-screen (step 262—No), the renderer 23 removes all pointers to the selected primitive or portion of a primitive from remaining primitive buckets 36 (step 263). But if the renderer 23, for example, also determines in step 262 that the entire primitive that includes the selected portion is not still on-screen, the renderer 23 may remove all pointers to this primitive from the primitive buckets 36. The renderer 23 then preferably culls corresponding visibility grids from the active object scene data 32 (step 264). At the very least, a visibility grid created for the selected primitive or the selected portion of a primitive is removed. But if the renderer 23 determines in step 262 that the primitive that includes the selected portion is not still on-screen, the renderer 23 may remove all visibility grids created for this primitive. The renderer 23 then determines whether the selected primitive or portion of a primitive is ray traceable (step 266). If the renderer 23 determines that the selected primitive or portion of a primitive is ray traceable (step 226—Yes), the renderer 23 returns to step 208 to select another primitive or portion of a primitive. Since the selected primitive or portion of a 010626-0018-999 - 31 - CAI - 307908.1 primitive may be intersected by a ray while the renderer 23 is shading another primitive, data about the selected primitive or portion of a primitive is preferably maintained. If the renderer 23 determines that the selected primitive or portion of a primitive is not ray traceable (step 266—No), the renderer 23 culls data related to the selected primitive or the primitive that includes the selected portion from the active object scene data 32 (except, for example, an indication that the selected primitive or the primitive that includes the selected portion has already been processed) (step 268). The renderer 23 then returns to step 208 to select another primitive or portion of a primitive. If the renderer 23 determines that the selected primitive or portion of a primitive is still on-screen (step 262—Yes), the renderer 23 determines whether the selected primitive or the primitive that includes the selected portion is referenced in any primitive buckets 36 (step 270). If not (step 270—No), the renderer 23 culls the visibility grid created for the selected primitive or the selected portion of a primitive (step 272). But if the selected primitive or the primitive that includes the selected portion is referenced in any primitive buckets 36 (step 270—Yes) or after executing step 272, the renderer 23 determines whether the selected primitive or portion of a primitive is ray traceable (step 274). If the renderer 23 determines that the selected primitive or portion of a primitive is ray traceable (step 274—Yes), the renderer 23 returns to step 208 to select another primitive or portion of a primitive. Since the selected primitive or portion of a primitive may be intersected by a ray while the renderer 23 is shading another primitive, data about the selected primitive or portion of a primitive is preferably maintained. If the renderer 23 determines that the selected primitive or portion of a primitive is not ray traceable (step 274—No), the renderer 23 culls data related to the selected primitive or the primitive that includes the selected portion from the active object scene data 32 (except, for example, an indication that the selected primitive or the primitive that includes the selected portion has already been processed) (step 276). The renderer 23 then returns to step 208 to select another primitive or portion of a primitive. While the present invention has been described with reference to a few specific embodiments, the description is illustrative of the invention and is not to be construed as 010626-0018-999 -32 - CAI -307908.1 limiting the invention. Various modifications may occur to those skilled in the art without departing from the true spirit and scope of the invention as defined by the appended claims. For example, in some embodiments, the renderer 23 creates a plurality of shading grids for one or more primitives. Each primitive is used in conjunction with a specific shading process. For example, in one embodiment, separate shading grids are used when tracing rays from highly reflective objects such as mirrors and minimally reflective objects such as cardboard boxes. A mirror reproduces reflected objects much more clearly than a cardboard box, so objects reflected in a mirror require a more accurate representation. Similarly, a second shading grid may be used when intersecting primitives with secondary rays. As described above, rays cast from intersections of primitives and another ray may be thought of as secondary rays. Again, these rays have a more limited effect on a vertex being shaded than primary rays (e.g., rays that trigger secondary rays). The shading grids intersected by secondary rays may not, therefore, need the same level of detail as shading grids intersected by primary rays. Another example is the use of rays to compute object visibility instead of projecting primitives onto the image plane 110. Much like prior art ray tracing renderers, these embodiments of the present invention use rays cast through the image plane 110 to select positions o
RELATED APPLICATIONS
[0001] This application is related to, and incorporates herein by reference, a U.S. patent application bearing Ser. No. 09/865,990, identified by attorney docket number 10626-007-999, entitled “SYSTEM AND METHOD OF LINE SAMPLING OBJECT SCENE INFORMATION”, and commonly assigned with the present invention. This application is also related to, and incorporates herein by reference, a U.S. patent application identified by attorney docket number 10626-009-999, filed on May 28, 2002, entitled “SYSTEM AND METHOD RELATED TO DATA STRUCTURES IN THE CONTEXT OF A COMPUTER GRAPHICS SYSTEM”, and commonly assigned with the present invention.