Claims
- 1. A method for rendering a volume within a scene, comprising:
rendering a set of pixels of the scene to fill a depth buffer with depth values associated with the set of pixels; setting a depth bounds associated with the volume; defining a fragment associated with the volume, having a volume depth, and covering at least one subset of pixels of the scene, wherein each subset of pixels has a subset depth value; for each subset of pixels, discarding at least a portion of the fragment covering the subset of pixels in response to the corresponding subset depth value being outside of the depth bounds associated with the volume; and for each subset of pixels, processing at least a portion of the fragment covering the subset of pixels in response to the corresponding subset depth value being inside of the depth bounds associated with the volume.
- 2. The method of claim 1, wherein processing at least a portion of the fragment comprises storing a value in a stencil buffer.
- 3. The method of claim 2, wherein processing at least a portion of the fragment comprises storing a value in a stencil buffer in response to a comparison between the subset depth value and the volume depth.
- 4. The method of claim 1, wherein the subset of pixels is a single pixel.
- 5. The method of claim 1, wherein the subset of pixels includes a group of adjacent pixels.
- 6. The method of claim 5, wherein the subset depth value includes the minimum and maximum depth values of the pixels in the group, and wherein the depth bounds includes a minimum depth bounds value and a maximum depth bounds value.
- 7. The method of claim 6, wherein discarding further comprises:
discarding the portion of the fragment covering the group of adjacent pixels in response to either the minimum depth value of the pixels in the group being greater than the maximum depth bounds value or the maximum depth value of the pixels in the group being less than the minimum depth bounds value.
- 8. The method of claim 1, wherein the volume is a portion of a constructive solid geometry model.
- 9. The method of claim 1, wherein the volume is a shadow volume associated with a light source.
- 10. The method of claim 9, wherein the depth bounds includes a minimum depth bounds value and a maximum depth bounds value outside of which the light source cannot potentially illuminate an object in the scene.
- 11. The method of claim 10, wherein at least one of the depth bounds values is determined by an attenuation of the light source.
- 12. The method of claim 10, wherein at least one of the depth bounds values is determined by a view frustum.
- 13. The method of claim 10, wherein at least one of the depth bounds values is determined by an object in the scene.
- 14. The method of claim 10, further comprising: determining a horizontal bounds and a vertical bounds associated with the volume;
for each subset of pixels further including a subset horizontal value, discarding at least a portion of the fragment covering the subset of pixels in response to the corresponding subset horizontal value being outside of the horizontal bounds associated with the volume; and for each subset of pixels further including a subset vertical value, discarding at least a portion of the fragment covering the subset of pixels in response to the corresponding subset vertical value being outside of the vertical bounds associated with the volume;
- 15. The method of claim 1, wherein setting a depth bounds associated with the volume further comprises receiving depth bounds values from a rendering application via a function in an API.
- 16. The method of claim 15, wherein the API is OpenGL™.
- 17. The method of claim 2, wherein storing at least one value in a stencil buffer includes incrementing a stencil value previously stored in the stencil buffer and overwriting the previously stored stencil value with the incremented stencil value.
- 18. The method of claim 2, wherein storing at least one value in a stencil buffer includes decrementing a stencil value previously stored in the stencil buffer and overwriting the previously stored stencil value with the decremented stencil value.
- 19. The method of claim 9, further comprising the steps of:
defining at least one scene fragment associated with the set of pixels of the scene and; for each scene fragment, discarding at least a portion of the scene fragment associated with a subset of pixels having a subset depth value in response to the subset depth value being outside of the depth bounds associated with the volume; and for each scene fragment, storing at least one value in a color buffer in response to the subset depth value associated with the scene fragment being inside the depth bounds.
- 20. The method of claim 19, wherein the value stored in the color buffer is an illumination contribution from a light source associated with the volume.
- 21. A graphics processing system, comprising:
a depth buffer configured to store depth values associated with a set of pixels in a scene; a stencil buffer configured to store stencil values associated with the set of pixels in the scene; a depth bounds register configured to define a range of depths associated with a volume; and a graphics pipeline adapted to process a fragment associated with the volume and covering a subset of the pixels in the scene, wherein the graphics pipeline is configured to discard the fragment in response to a depth value associated with the subset of pixels being outside the range of depths defined by the depth bounds register, and further configured to store a value in the stencil buffer in response to the depth value associated with a further subset of the subset of pixels being inside the range of depths defined by the depth bounds register.
- 22. The graphics processing system of claim 21, wherein the subset of pixels is a single pixel, and the depth value associated with the subset of pixels is the depth value associated with the pixel.
- 23. The graphics processing system of claim 21, wherein the depth bounds register is adapted to store a minimum depth bounds value and a maximum depth bounds value.
- 24. The graphics processing system of claim 23, wherein the subset of pixels includes a group of adjacent pixels, and the depth value associated with the subset of pixels includes the minimum and maximum pixel depth values for the group of pixels.
- 25. The graphics processing system of claim 21, wherein the graphics pipeline is further adapted to process a scene fragment associated with a scene, wherein the graphics pipeline is configured to discard at least a portion of the scene fragment associated with a subset of pixels and having a subset depth value in response to the subset depth value being outside the range of depths defined by the depth bounds register, and further configured to store at least one value in a color buffer in response to the subset depth value associated with the scene fragment being inside the range of depths defined by the depth bounds register and not discarded by other fragment tests.
- 26. The graphics processing system of claim 21, further comprising:
a depth bounds testing unit adapted to compare the range of depths defined by the depth bounds register with a depth value from the depth buffer and associated with at least one pixel in the scene; and a read-only data connection between the depth bounds testing unit and the depth buffer, such that the depth bounds testing unit can read a depth value from the depth buffer.
- 27. An application programming interface adapted to allow a rendering application to configure the operation of a graphics processing system, the application programming interface comprising:
a function adapted to allow a rendering application to set at least one depth bound value for the graphics processing system.
- 28. The application programming interface of claim of 27, further comprising:
a second function adapted to allow a rendering application to instruct the graphics processing system to discard a fragment in response to a depth value for a subset of pixels being outside of the depth bound value, and to instruct the graphics processing system to perform an alternate operation in response to the depth value for a subset of pixels being inside the depth bound value.
- 29. The application programming interface of claim 27, wherein the alternate operation is a stencil buffer operation.
- 30. The application programming interface of claim 27, wherein the alternate operation includes storing a value in a color buffer.
- 31. The application programming interface of claim 27, wherein the depth bound value is associated with a constructive solid geometry model.
- 32. The application programming interface of claim 27, wherein the depth bound value is associated with a light source.
- 33. The application programming interface of claim 32, wherein the depth bound value is determined by an attenuation of the light source.
- 34. The application programming interface of claim 32, wherein the depth bound value is determined by a view frustum.
- 35. The application programming interface of claim 32, wherein the depth bound value is determined by an object in a scene.
CROSS-REFERENCES TO RELATED APPLICATIONS
[0001] This application claims priority to U.S. Provisional Patent Application No. 60/451,311, filed Feb. 27, 2003, which is incorporated herein by reference for all purposes.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60451311 |
Feb 2003 |
US |