Method and apparatus for shadow generation through depth mapping
First Claim
1. In a computer controlled display system for displaying three dimensional scenes, each of said three dimensional scenes comprised of a plurality of graphical primitives, said graphical primitives represented by pixels on a display screen, a method for displaying shadows in a scene caused by a light source, said method comprising the steps of:
- a) generating a depth map in a light coordinate system and storing said depth map in a texture map storage, said light coordinate system having said light source as an origin, said depth map storing in said texture map storage a plurality of depth map sample values, wherein each depth map sample value identifies a distance from a pixel location in one of said graphical primitives to said light source;
b) rendering said scene from the viewpoint of a viewer by processing each of said graphical primitives of said scene, said processing comprising the steps of;
1) identifying pixels corresponding to each of said graphical primitives;
2) for each pixel, determining if it is visible from said viewer'"'"'s viewpoint;
3) ignoring pixels that are not visible;
4) for each pixel that is visible, generating a shadow coefficient, indicating the degree to which a pixel is in shadow, wherein each pixels shadow coefficient is used to shade said pixel, wherein said shadow coefficient for said pixel is generated by performing the steps of;
generating light system coordinates for said pixel using a projective texture mapping technique, said light system coordinates comprising a pixel depth map index for indexing said texture map storage and a pixel depth value;
retrieving a predetermined number of depth map sample values from said texture map storage based on said pixel depth map index;
comparing each of said predetermined number of depth map sample values to said pixel depth value; and
using results of said comparison between said predetermined number of depth map sample values, and said pixel depth value to generate said shadow coefficient for said pixel and using said shadow coefficient to generate shading values for said pixel and displaying said pixel.
3 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for creating shadowed scenes for interactive image generation. Shadowing is effected by generation of a shadowing coefficient for each pixel, which is then used when the scene is rendered. The present invention utilizes z-buffer and projective texture mapping facilities of an image generation system. Generation of the shadow coefficient is achieved by the steps of: rendering the scene from the viewpoint of a light source using z-buffering to create a two dimensional depth map from said z-buffer; storing the depth map in texture mapping storage; rendering the scene from the viewpoint of the viewer; for every pixel in view creating an index info said depth map and a iterated depth value; retrieving a predetermined number of depth map samples from the depth map based on the position of a depth map index; comparing said iterated depth value with each of the depth map samples to determine which of the depth map samples are in shadow; creating a weighted average shadow coefficient from the results of the comparisons; and using the shadow coefficient for rendering. Optionally, the values in the depth map are offset by an amount dependent on the slope of the distance function relative to the depth map indices. The scene is then rendered utilizing surfaces and/or shading information. The shadow coefficient is used to calculate the pixel intensity thus creating realistic shadow effect.
-
Citations
26 Claims
-
1. In a computer controlled display system for displaying three dimensional scenes, each of said three dimensional scenes comprised of a plurality of graphical primitives, said graphical primitives represented by pixels on a display screen, a method for displaying shadows in a scene caused by a light source, said method comprising the steps of:
-
a) generating a depth map in a light coordinate system and storing said depth map in a texture map storage, said light coordinate system having said light source as an origin, said depth map storing in said texture map storage a plurality of depth map sample values, wherein each depth map sample value identifies a distance from a pixel location in one of said graphical primitives to said light source; b) rendering said scene from the viewpoint of a viewer by processing each of said graphical primitives of said scene, said processing comprising the steps of; 1) identifying pixels corresponding to each of said graphical primitives; 2) for each pixel, determining if it is visible from said viewer'"'"'s viewpoint; 3) ignoring pixels that are not visible; 4) for each pixel that is visible, generating a shadow coefficient, indicating the degree to which a pixel is in shadow, wherein each pixels shadow coefficient is used to shade said pixel, wherein said shadow coefficient for said pixel is generated by performing the steps of; generating light system coordinates for said pixel using a projective texture mapping technique, said light system coordinates comprising a pixel depth map index for indexing said texture map storage and a pixel depth value; retrieving a predetermined number of depth map sample values from said texture map storage based on said pixel depth map index; comparing each of said predetermined number of depth map sample values to said pixel depth value; and using results of said comparison between said predetermined number of depth map sample values, and said pixel depth value to generate said shadow coefficient for said pixel and using said shadow coefficient to generate shading values for said pixel and displaying said pixel. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. In a computer controlled display system comprising interactive projective texture mapping means, said projective texture mapping means operating in a three dimensional (x, y, z) light coordinate system with a variably defined light source origin point, said projective texture mapping means for projecting a two dimensional texture map onto a three dimensional scene being rendered, said texture map indexed by (x, y) coordinates of said light coordinate system, said three dimensional scene comprising a plurality of graphics primitives, a method for rendering of scenes having shadows using said projective texture mapping means, said method comprising the steps of:
-
a) determining a position of a light source as the origin of said light coordinate system; b) generating a depth map in said light coordinate system, said depth map storing a plurality of depth map sample values, wherein each depth map sample value identifies a distance from a pixel location in one of said graphics primitives to said light source; c) storing said depth map for access as a texture map in a texture map storage; d) for ail pixels corresponding to one of said graphics primitives performing the steps of; 1) determining that a particular pixel is visible from a viewer'"'"'s viewpoint; 2) performing a texture map look-up on said depth map for said particular pixel, said texture map look-up including generation of coordinates in said light coordinate system for said particular pixel using said projective texture mapping means;
wherein said coordinates in said light coordinate system for said particular pixel comprise a pixel depth map index and a pixel depth value;3) retrieving a plurality of depth map sample values from said depth map based on said pixel depth map index; 4) assigning a first binary value to each of said retrieved depth map sample values that is in shadow and a second binary value to each of said retrieved depth map sample values that is not in shadow based on a comparison with the pixel depth value; 5) generating a shadow coefficient for said particular pixel from said binary values, said shadow coefficient indicating the degree to which said particular pixel is in shadow; 6) using said shadow coefficient to generate shading values for said particular pixel and displaying said pixel using said shading values. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
-
-
23. A computer controlled display system for interactive generation of shadowed scenes comprising:
-
a texture map storage; a projective texture mapping means for generating a texture map index and a pixel depth value; a z-buffering means for identifying surface points of a plurality of graphics primitives which are closest to a viewpoint; a display means; rendering means for rendering pixels based on a shadow coefficient, said shadow coefficient identifying the amount a pixel is in shadow, said display means coupled to rendering means to display said pixel; shadow coefficient generation means coupled to said projective texture mapping means and said z-buffering means and to said rendering means, said shadow coefficient generation means for calculating said shadow coefficient, said shadow coefficient generation means further comprised of; means for generating a depth map utilizing said z-buffering means, said depth map storing a plurality of depth map sample values, wherein each depth map sample value identifies a distance from a pixel location of a graphics primitive to a light source; means for storing said depth map as a texture in said texture map storage; means for utilizing said projective texture mapping means for accessing said depth map stored in said texture map storage; means for identifying a predetermined number of depth map sample values based on said texture map index; and means for generating a weighted average from said predetermined number of depth map sample values said weighted average representing said shadow coefficient; means for generating a shading value for said pixel, said means for generating being coupled to said display means for displaying said pixel. - View Dependent Claims (24, 25)
-
-
26. In a computer controlled display system for interactively displaying three dimensional scenes, each of said three dimensional scenes comprised of a plurality of graphical primitives, said graphical primitives represented by pixels on a display screen, a method for displaying shadows in a scene caused by a light source, said method comprising the steps of:
-
A) generating a depth map in a light coordinate system and storing said depth map in a texture map storage, said light coordinate system having said light source as an origin, said depth map storing in said texture map storage a plurality of depth map sample values each identifying a distance from a pixel location in one of said graphical primitives to said light source; B) biasing each depth map sample value by an offset, said offset being proportional to the rate of change of the depth map sample value in a predetermined direction across said depth map; C) rendering said scene from the viewpoint of a viewer by processing each of said graphical primitives of said scene, said processing comprising the steps of; 1) identifying pixels corresponding to each of said graphical primitives; 2) for each pixel, determining if it is visible from said viewer'"'"'s viewpoint; 3) ignoring pixels that are not visible; 4) for each pixel that is visible, generating a shadow coefficient indicating the degree to which a pixel is in shadow, wherein each pixel'"'"'s shadow coefficient is used to shade said pixel, wherein said shadow coefficient for said pixel is generated by performing the steps of; a) generating coordinates in said light coordinate system for said pixel texture mapping techniques, said coordinates comprising a pixel depth map index for indexing said texture map storage and a pixel depth value; b) retrieving a predetermined number of depth map sample values from said texture map storage based on said pixel depth map index; c) comparing each of said predetermined number of depth map sample values to said pixel depth value; and d) using the results of the comparing step to generate a shadow coefficient for said pixel and using said shadow coefficient to generate shading values for said pixel and displaying said pixel using said shading values.
-
Specification