Claims
- 1. A method for shadow mapping while rendering a primitive in a graphics pipeline, comprising:
(a) performing an offset operation to generate a depth value while rendering a primitive; (b) identifying a value of a slope associated with a primitive; and (c) conditionally clamping the depth value based on the value of the slope.
- 2. The method as recited in claim 1, wherein the shadow mapping process includes rendering the primitive from a light space perspective.
- 3. The method as recited in claim 1, wherein the depth value is clamped if the value of the slope is greater than a predetermined amount.
- 4. The method as recited in claim 1, wherein the clamping includes the steps of:
identifying vertex depth values of vertices of the primitive; comparing at least one of the vertex depth values with the depth value generated by the offset operation; and clamping the depth value generated by the offset operation based on the comparison.
- 5. The method as recited in claim 4, wherein the depth value generated by the offset operation is clamped to the depth value generated by the offset operation if the depth value generated by the offset operation is less than the maximum vertex depth value.
- 6. The method as recited in claim 4, wherein the depth value generated by the offset operation is clamped to the greatest vertex depth value if the greatest vertex depth value is less than the depth value generated by the offset operation.
- 7. The method as recited in claim 4, wherein the depth value generated by the offset operation is clamped to the depth value generated by the offset operation if the depth value generated by the offset operation is greater than the least one of the vertex depth values.
- 8. The method as recited in claim 4, wherein the depth value generated by the offset operation is clamped to the least one of the vertex depth values if the least one of the vertex depth values is greater than the depth value generated by the offset operation.
- 9. The method as recited in claim 1, wherein the offset operation includes a polygon offset operation in accordance with the OpenGL® programming language.
- 10. A computer program embodied on a computer readable medium for shadow mapping while rendering a primitive in a graphics pipeline, comprising:
(a) a code segment for performing an offset operation to generate a depth value while rendering a primitive; (b) a code segment for identifying a value of a slope associated with a slope of the primitive; and (c) a code segment for conditionally clamping the depth value based on the value of the slope.
- 11. The computer program as recited in claim 10, wherein the depth value is clamped if the value of the slope is greater than a predetermined amount.
- 12. The computer program as recited in claim 10, wherein the clamping includes:
identifying vertex depth values of vertices of the primitive; comparing at least one of the vertex depth values with the depth value generated by the offset operation; and clamping the depth value generated by the offset operation based on the comparison.
- 13. The computer program as recited in claim 12, wherein the depth value generated by the offset operation is clamped to the depth value generated by the offset operation if the depth value generated by the offset operation is less than the maximum vertex depth value, and wherein the depth value generated by the offset operation is clamped to the greatest vertex depth value if the greatest vertex depth value is less than the depth value generated by the offset operation.
- 14. The computer program as recited in claim 12, wherein the depth value generated by the offset operation is clamped to the depth value generated by the offset operation if the depth value generated by the offset operation is greater than the least one of the vertex depth values, and wherein the depth value generated by the offset operation is clamped to the least one of the vertex depth values if the least one of the vertex depth values is greater than the depth value generated by the offset operation.
- 15. A system for shadow mapping while rendering a primitive in a graphics pipeline, comprising:
(a) logic for performing an offset operation to generate a depth value while rendering a primitive; (b) logic for calculating and identifying a value of a slope associated with the primitive; and (c) logic for conditionally clamping the depth value based on the value of the slope.
- 16. A method for performing shading calculations in a graphics pipeline, comprising:
(a) performing a first shading calculation in order to generate output; (b) saving the output; and (c) performing a second shading calculation using the output in order to generate further output.
- 17. The method as recited in claim 16, wherein the first shading calculation includes [(1−s)*(Color_diff+Color_spec)] for generating an output A, and the second shading calculation includes [Color_amb+A], where s is a shadow variable, Color_diff is a diffuse color variable, Color_spec is a specular color variable, and Color_amb is an ambient color variable.
- 18. The method as recited in claim 16, wherein the first shading calculation includes [((1−s)*Color_diff)+Color_amb] for generating an output A, and the second shading calculation includes [A*Texture_det+(1−s)*Color_spec], where s is a shadow variable, Color_diff is a diffuse color variable, Color_spec is a specular color variable, Color_amb is an ambient color variable, and Texture_det is a detail texture variable.
- 19. The method as recited in claim 16, wherein the first and second shading calculations together include a diffuse color variable, a specular color variable, and an ambient color variable.
- 20. The method as recited in claim 19, wherein the variables are decoupled.
- 21. The method as recited in claim 16, wherein the method is carried out with a system comprising:
(a) a shading module for performing the first shading calculation in order to generate the output; (b) a texture look-up module coupled to the shading module for retrieving texture information using texture coordinates associated with the output; (c) a feedback loop coupled between an input and an output of the shading module for performing the second shading calculation using the texture information from the texture look-up module in order to generate further output; and (d) a combiner module coupled to the output of the shading module for combining the output generated by the shading module.
- 22. A computer program embodied on a computer readable medium for performing shading calculations in a graphics pipeline, comprising:
(a) a code segment for performing a first shading calculation in order to generate output; (b) a code segment for saving the output; and (c) a code segment for performing a second shading calculation using the output in order to generate further output.
- 23. The computer program as recited in claim 22, wherein the first shading calculation includes [(1−s)*(Color_diff+Color_spec)] for generating an output A, and the second shading calculation includes [Color_amb+A], where s is a shadow variable, Color_diff is a diffuse color variable, Color_spec is a specular color variable, and Color_amb is an ambient color variable.
- 24. The computer program as recited in claim 22, wherein the first shading calculation includes [((1−s)*Color_diff)+Color_amb] for generating an output A, and the second shading calculation includes [A*Texture_det+(1−s)*Color_spec], where s is a shadow variable, Color_diff is a diffuse color variable, Color_spec is a specular color variable, Color_amb is an ambient color variable, and Texture_det is a texture detail variable.
- 25. The computer program as recited in claim 22, wherein the first and second shading calculations together include a diffuse color variable, a specular color variable, and an ambient color variable.
- 26. The computer program as recited in claim 25, wherein the variables are decoupled.
- 27. The computer program as recited in claim 22, wherein the code segments are carried out with a system comprising:
(a) a shading module for performing the first shading calculation in order to generate the output; (b) a texture look-up module coupled to the shading module for retrieving texture information using texture coordinates associated with the output; (c) a feedback loop coupled between an input and an output of the shading module for performing the second shading calculation using the texture information from the texture look-up module in order to generate further output; and (d) a combiner module coupled to the output of the shading module for combining the output generated by the shading module.
- 28. A system for performing shading calculations in a graphics pipeline, comprising:
(a) logic for performing a first shading calculation in order to generate output; (b) logic for saving the output; and (c) logic for performing a second shading calculation using the output in order to generate further output.
RELATED APPLICATION(S)
[0001] This application is a continuation-in-part application of a co-pending applications entitled “SYSTEM, METHOD AND ARTICLE OF MANUFACTURE FOR SHADOW MAPPING” filed Aug. 16, 2000 under Ser. No. 09/640,505; and “SYSTEM, METHOD AND ARTICLE OF MANUFACTURE FOR PIXEL SHADERS FOR PROGRAMMABLE SHADING” filed May 31, 2000 under Ser. No. 09/585,809 which are both incorporated herein by reference in its entirety. This application is also related to a co-pending application entitled “IMPROVED GRAPHICS PIPELINE INCLUDING COMBINER STAGES” filed Mar. 20, 1999 naming David B. Kirk, Matthew Papakipos, Shaun Ho, Walter Donovan, and Curtis Priem as inventors, and which is incorporated herein by reference in its entirety.
Continuation in Parts (2)
|
Number |
Date |
Country |
Parent |
09640505 |
Aug 2000 |
US |
Child |
09730639 |
Dec 2000 |
US |
Parent |
09585809 |
May 2000 |
US |
Child |
09730639 |
Dec 2000 |
US |