Depth based blending for 3D graphics systems
First Claim
1. An apparatus for shading a three-dimensional computer graphic image comprising:
- a) means for supplying data defining objects to be inserted into the image for each pixel in the image, the data including depth data relating to the object;
b) means for storing depth data for objects already inserted into the image for each pixel in the image;
c) means for comparing the depth data for an object to be inserted with currently stored depth data for a pixel, at each pixel covered by the object to be inserted into the image;
d) means for selecting a depth operation to be applied to the depth data for the object and the stored depth data in dependence on the result of the comparison;
e) means for applying the selected depth operation to the depth data for the object and to the stored depth data;
f) means for selecting a blending value, for each pixel for combining the object with the image, in dependence on the result of the comparison between the depth data for the object and the stored depth data for the pixel;
g) means for combining the selected blending value with a blending value for the object to be inserted into the image for each pixel to produce a combined blending value; and
h) means for combining the object with the image in proportions dependent upon the combined blending value for each pixel.
0 Assignments
0 Petitions
Accused Products
Abstract
Three dimensional computer graphic images are shaded by first supplying data which defines the objects to be inserted into the image, this data including depth data relating to the objects. A depth store (4) includes data for objects already inserted into the image and a depth comparison unit (6) compares the depth of an object to be inserted with the currently stored depth data for a particular pixel. The result of this is used to determine which of a number of depth operations is to be applied to the depth store (4). A blending value is selected for each pixel for combining the object with the image in dependence on the selected depth operation. A combining unit then combines the object with the image in proportions dependent upon the selecting blending value.
28 Citations
14 Claims
-
1. An apparatus for shading a three-dimensional computer graphic image comprising:
-
a) means for supplying data defining objects to be inserted into the image for each pixel in the image, the data including depth data relating to the object;
b) means for storing depth data for objects already inserted into the image for each pixel in the image;
c) means for comparing the depth data for an object to be inserted with currently stored depth data for a pixel, at each pixel covered by the object to be inserted into the image;
d) means for selecting a depth operation to be applied to the depth data for the object and the stored depth data in dependence on the result of the comparison;
e) means for applying the selected depth operation to the depth data for the object and to the stored depth data;
f) means for selecting a blending value, for each pixel for combining the object with the image, in dependence on the result of the comparison between the depth data for the object and the stored depth data for the pixel;
g) means for combining the selected blending value with a blending value for the object to be inserted into the image for each pixel to produce a combined blending value; and
h) means for combining the object with the image in proportions dependent upon the combined blending value for each pixel. - View Dependent Claims (2, 3, 4, 5, 6, 7)
the translucent object for which said means for selecting a blending value selects the blending value is first divided into front and rear facing portions;
the rear facing portion is initially supplied to said depth comparison means and said depth operation selecting means updates the depth data in said depth storing means if the rear facing surface is closer to the eye than a currently stored surface in said depth storage means;
the front facing surface is then supplied to said depth storing means and said depth operation selection means updates the depth data in said depth store means again with the result of a subtraction of the currently stored depth from the depth of the front facing surface; and
said means for selecting a blending valve, as a function of the updated depth data in said depth store means, generates the selected blending value.
-
-
4. The apparatus of claim 3, wherein said means for selecting a blending value is configured to generate said selected blending value so that the blending value is proportional to the updated depth data in said depth store means.
-
5. The apparatus of claim 1, further including means to apply an offset and a scaling function to the selected blending value.
-
6. The apparatus of claim 1, wherein:
-
a means for comparing a stencil buffer value for a pixel with a stencil value for the object is provided;
a means for selecting a stencil operation in dependence on the result of the comparison performed by said means for comparing the stencil buffer value is provided; and
said means for selecting a depth operation to be applied on the depth data determines the depth operation to be performed on the object and the stored depth data as a function of both the comparison performed by both said means for comparing depth data for the object with the stored depth data for the pixel and the comparison performed by said means for comparing a stencil buffer value for the pixel with a stencil value for the object.
-
-
7. The apparatus of claim 1, further including a secondary depth buffer to return the original depth buffer values for use in further operations.
-
8. A method for shading a three-dimensional computer graphic image, said method comprising the steps of:
-
a) supplying data defining an object to be inserted into the image for each pixel in the image, the data including depth data relating to the object;
b) storing depth data for objects already inserted into the image for each pixel in the image;
c) comparing the depth data for the object to be inserted into the image with the currently stored depth data for a pixel, at each pixel covered by the object to be inserted into the image;
d) selecting a depth operation to be applied to the depth data for the object and the stored depth data for the pixel as a result of said depth data comparison;
e) performing the selected depth operation to the depth data for the object and to the stored depth data for the pixel;
f) selecting a blending value for the pixel for combining the object with the image as a result of the depth data comparison;
g) combining the selected blending value with a blending value for the object to be inserted into the image for each pixel to produce a combined blending value for the pixel; and
h) at the pixel, combining the object with the image in a proportion that is a function of the combined blending value for the pixel.
-
-
9. A method for shading and texturing three-dimensional computer graphic images comprising the steps of:
-
providing a depth buffer in which a depth value for each pixel in the image is stored;
supplying data defining an object to be shaded and textured into a scene;
performing a depth comparison for each pixel covered by the object with existing objects in the scene;
performing a stencil buffer comparison with a current stencil buffer value for each pixel covered by each object;
selecting a depth operation to perform on the data defining the object to be inserted into the scene in dependence on the result of said depth comparison; and
performing the selected depth operation on the depth value for each pixel stored in the depth buffer covered by the object to update the depth value for the pixel. - View Dependent Claims (10, 11, 12, 13, 14)
after said step of performing the selected depth operation on the depth value stored for the pixel covered by the object is performed, generating an alpha value for the object at the pixel based on the depth value; and
combining colour or texture for the object at with a current colour or texture for the image at the pixel based on the alpha value.
-
-
11. The method for shading and texturing a three-dimensional computer graphics image of claim 10, wherein, in said step of selecting a depth operation to perform on the data defining the object to be inserted into the scene, said selection is further dependent on the result of said stencil buffer comparison.
-
12. The method for shading and texturing a three-dimensional computer graphics image of claim 9, wherein:
-
an object is defined as a polygon having front and back facing faces;
a first said step of performing a depth comparison is performed on the back facing face of the object-defining polygon;
a first said step of selecting the depth operation to perform on the data defining the object to be inserted into the scene is performed in dependence of the result of said step of performing a depth comparison on the back facing face of the object-defining polygon, wherein the selected depth operation is from a first set of possible depth operations;
a first said step of performing the selected depth operation on the data defining the object to be inserted in the scene is performed using the depth operation selected in said first step of selecting the depth operation;
a second said step of performing a depth comparison is performed on the front facing face of the object-defining polygon;
a second said step of selecting the depth operation to perform on the data defining the object to be inserted into the scene is performed in dependence of the result of said step of performing a depth comparison on the front facing face of the object-defining polygon, wherein the selected depth operation comes from a second set of possible depth operations, the second set of possible depth operations being different from the first set of possible depth operations; and
a second said step of performing the selected depth operation on the data defining the object to be inserted in the scene is performed using the depth operation selected in said second step of selecting the depth operation.
-
-
13. The method for shading and texturing a three-dimensional computer graphics image of claim 12, wherein, in said step of selecting a depth operation to perform on the data defining the object to be inserted into the scene, said selection is further dependent on the result of said stencil buffer comparison.
-
14. The method for shading and texturing a three-dimensional computer graphics image of claim 9, wherein, in said step of selecting a depth operation to perform on the data defining the object to be inserted into the scene, said selection is further dependent on the result of said stencil buffer comparison.
Specification