Patent ID: 8339397
Filing Date: 2012-12-25
Classification: G06T

Abstract:
1. A graphic processing apparatus having a Z-buffer memory storing a Z value representing a depth of a display object when seen from a visual point per pixel and a pixel memory storing color data on each pixel for creating an image of a shadowed three-dimensional object having a shadow produced by obstructing a ray of light from a light source by the three dimensional object, comprising: a visual-point coordinate conversion processing section for upon input of graphic data on normal polygons constituting each object including the three-dimensional object and on shadow polygons constituting a shadow volume that defines a shadow space produced by obstructing the ray of light from the light source by the three-dimensional object, converting the graphic data to visual-point coordinates consisting x-coordinates and y-coordinates and depth values, and outputting the obtained visual-point coordinates and depth values in a state of being sorted into those of front-facing shadow polygons that face front, those of back-facing shadow polygons that face back when seen from the visual point, and those of the normal polygons; and a hidden surface removal and shadowing processing section for obtaining a coordinate region that is positioned behind the front-facing shadow polygons and in front of the back-facing shadow polygons when seen from the visual point based on the visual-point coordinates, obtaining Z-buffer memory Z values after hidden surface removal processing by Z-buffer method performed on the normal polygons to remove hidden surfaces of the normal polygons, wherein the Z-buffer memory Z values are depth values of un-hidden surfaces of the normal polygons that have been converted into the visual-point coordinates, and updating color data on selected pixels in the pixel memory corresponding to the obtained coordinate region and the un-hidden surfaces of the normal polygons to shadow color data, wherein the selected pixels correspond to a flagged region of a shadow flag memory, and wherein the shadow flag memory stores a shadow flag for use in determining whether each pixel is inside or outside a shadow, processing of the back-facing shadow polygons includes obtaining the depth value of each pixel of the back-facing shadow polygons, and performing a Z test in which the depth value is compared with a corresponding Z value obtained from the Z-buffer memory, and if the depth value is equal to or greater than the corresponding Z value, then the pixel is processed as belonging to a Z-test failed region of the back-facing shadow polygons, wherein a greater depth value means greater distance from the visual point, wherein a region of the shadow flag memory is flagged with shadow flags to represent the Z-test failed region of the back-facing shadow polygons, and wherein each shadow flag corresponds to a pixel, processing of the front-facing shadow polygons includes obtaining the depth value of each pixel of the front-facing shadow polygons, and performing a Z test in which the depth value is compared with a corresponding Z value obtained from the Z-buffer memory, and if the depth value is smaller than the corresponding Z value, then the pixel is processed as belonging to a Z-test passed region of the front-facing shadow polygons, wherein a smaller depth value means a closer distance to the visual point, and wherein during an iteration of each pixel in the Z-test passed region of the front-facing shadow polygons, an intersection pixel is located after finding a shadow flag in the shadow flag memory for a corresponding iterated pixel in the Z-test passed region of the front-facing shadow polygons, wherein the shadow flag in the shadow flag memory for the corresponding iterated pixel has been set by the processing of the back-facing shadow polygons, wherein the intersection pixel belongs to an intersection of the Z-test failed region of the back-facing shadow polygons and the Z-test passed region of the front-facing shadow polygons, and wherein the intersection pixel is one of the selected pixels, obtaining the intersection of the Z-test failed region of the back-facing shadow polygons and the Z-test passed region of the front-facing shadow polygons, and determining that pixels contained in the intersection are within a shadow to provide the pixels with color representing the shadow.