A method for real-time shadow rendering in a 3-D graphics scene uses an inverted z-test to mark a shadow area in a stencil buffer. Front and back facing shadow volume polygons are rendered subsequent to rendering the scene and corresponding stencil buffer entries are incremented for pixels viewing the back facing polygon when the new z-test is passed and decremented for pixels viewing the front facing polygons when the new z-test is passed. The new z-test is passed for pixels having depth (z) values greater than the corresponding depth value stored z-buffer. |
Citations|
| US5163126 | May 10, 1990 | Nov 10, 1992 | International Business Machines Corporation | Method for adaptively providing near Phong grade shading for patterns in a graphics display system | | US5617322 | Jan 30, 1995 | Apr 1, 1997 | NEC Corporation | Mesh generator and generating method | | US5659671 | Apr 25, 1996 | Aug 19, 1997 | International Business Machines Corporation | Method and apparatus for shading graphical images in a data processing system | | US5808617 | Jun 27, 1996 | Sep 15, 1998 | Microsoft Corporation | Method and system for depth complexity reduction in a graphics rendering system | | US5825369 | Jul 30, 1996 | Oct 20, 1998 | International Business Machines Corporation | Compression of simple geometric models using spanning trees | | US5864342 | Jun 27, 1996 | Jan 26, 1999 | Microsoft Corporation | Method and system for rendering graphical objects to image chunks | | US5867166 | Jun 27, 1996 | Feb 2, 1999 | Microsoft Corporation | Method and system for generating images using Gsprites | | US5870097 | Jun 27, 1996 | Feb 9, 1999 | Microsoft Corporation | Method and system for improving shadowing in a graphics rendering system | | US5999187 | Jun 27, 1997 | Dec 7, 1999 | Resolution Technologies, Inc. | Fly-through computer aided design method and apparatus | | US6252608 | Oct 22, 1998 | Jun 26, 2001 | Microsoft Corporation | Method and system for improving shadowing in a graphics rendering system | | US6326964 | Nov 6, 1998 | Dec 4, 2001 | Microsoft Corporation | Method for sorting 3D object geometry among image chunks for rendering in a layered graphics rendering system |
Referenced by|
| US6853965 | Nov 16, 2001 | Feb 8, 2005 | Massachusetts Institute of Technology | Force reflecting haptic interface | | US6867770 | Dec 14, 2001 | Mar 15, 2005 | SensAble Technologies, Inc. | Systems and methods for voxel warping | | US6888547 | Aug 23, 2001 | May 3, 2005 | Konami Corporation | Three-dimensional image processing method and apparatus, readable storage medium storing three-dimensional image processing program and video game system | | US6958752 | Dec 14, 2001 | Oct 25, 2005 | SensAble Technologies, Inc. | Systems and methods for three-dimensional modeling | | US6967662 | Feb 8, 2002 | Nov 22, 2005 | Imagination Technologies Limited | Volume clipping in computer 3D graphics | | US7030878 | Mar 19, 2004 | Apr 18, 2006 | VIA Technologies, Inc. | Method and apparatus for generating a shadow effect using shadow volumes | | US7102635 | May 12, 2004 | Sep 5, 2006 | SensAble Technologies, Inc. | Systems and methods for sculpting virtual objects in a haptic virtual reality environment | | US7103499 | Aug 28, 2003 | Sep 5, 2006 | SensAble Technologies, Inc. | 3-D selection and manipulation with a multiple dimension haptic interface | | US7104891 | Nov 6, 2002 | Sep 12, 2006 | Nintendo Co., Ltd. | Game machine and game program for displaying a first object casting a shadow formed by light from a light source on a second object on a virtual game space | | US7113183 | Apr 25, 2002 | Sep 26, 2006 | Anark Corporation | Methods and systems for real-time, interactive image composition | | US7145565 | May 23, 2003 | Dec 5, 2006 | NVIDIA Corporation | Depth bounds testing | | US7149596 | May 28, 2004 | Dec 12, 2006 | SensAble Technologies, Inc. | Apparatus and methods for modifying a model of an object to enforce compliance with a manufacturing constraint | | US7212203 | Feb 8, 2005 | May 1, 2007 | SensAble Technologies, Inc. | Systems and methods for voxel warping | | US7225404 | Oct 26, 2001 | May 29, 2007 | Massachusetts Institute of Technology | Method and apparatus for determining forces to be applied to a user through a haptic interface | | US7259761 | Jul 17, 2006 | Aug 21, 2007 | SensAble Technologies, Inc. | Systems and methods for sculpting virtual objects in a haptic virtual reality environment | | US7277098 | Aug 23, 2004 | Oct 2, 2007 | VIA Technologies, Inc. | Apparatus and method of an improved stencil shadow volume operation | | US7286129 | May 24, 2004 | Oct 23, 2007 | Nvidia Corporation | Two-sided stencil testing system and method | | US7286134 | Dec 17, 2003 | Oct 23, 2007 | NVIDIA Corporation | System and method for packing data in a tiled graphics memory | | US7319466 | May 18, 2000 | Jan 15, 2008 | SensAble Technologies, Inc. | Method and apparatus for generating and interfacing with a haptic virtual reality environment | | US7420568 | Dec 14, 2005 | Sep 2, 2008 | Nvidia Corporation | System and method for packing data in different formats in a tiled graphics memory | | US7480600 | Nov 16, 2004 | Jan 20, 2009 | The Massachusetts Institute of Technology | Force reflecting haptic interface | | US7626589 | Dec 10, 2003 | Dec 1, 2009 | SensAble Technologies, Inc. | Haptic graphical user interface for adjusting mapped texture | | US7710415 | Jul 11, 2005 | May 4, 2010 | Sensable Technologies, Inc. | Systems and methods for three-dimensional modeling | | US7800609 | Jan 2, 2008 | Sep 21, 2010 | SensAble Technologies, Inc. | Method and apparatus for generating and interfacing with a haptic virtual reality environment | | US7864173 | Jul 27, 2004 | Jan 4, 2011 | SensAble Technologies, Inc. | Systems and methods for creating virtual objects in a sketch mode in a haptic virtual reality environment | | US7889209 | Dec 10, 2003 | Feb 15, 2011 | Sensable Technologies, Inc. | Apparatus and methods for wrapping texture onto the surface of a virtual object | | US7978194 | Mar 2, 2004 | Jul 12, 2011 | ATI Technologies ULC | Method and apparatus for hierarchical Z buffering and stenciling | | US8059131 | Jul 18, 2008 | Nov 15, 2011 | NVIDIA Corporation | System and method for packing data in different formats in a tiled graphics memory | | US8174535 | Feb 14, 2011 | May 8, 2012 | SensAble Technologies, Inc. | Apparatus and methods for wrapping texture onto the surface of a virtual object |
Claims1. A 3-D graphics method performed by a computer for real-time rendering of shadows in 3-D scenes to be displayed on a computer monitor, with the method using a shadow volume, calculated for a first object in a 3-D scene and defined as a region of space in the 3-D scene bounded by transparent shadow volume polygons in which the first scene object will cast a shadow on any part of another scene object included with in the shadow volume, and the method using a stencil buffer and a depth buffer, with both the stencil buffer and depth buffer having an entry for each pixel in a bit map for displaying the 3-D scene on a computer monitor, said method comprising the steps of: - drawing the 3-D scene without the transparent shadow volume polygons and rendering depth into the depth buffer;
- enabling an inverted depth buffer comparison test where a current pixel having a depth value greater than a depth value stored in a corresponding entry of the depth buffer passes the test;
- disabling writes to the depth buffer;
- initializing the stencil buffer by resetting all stencil buffer entries;
- for a current viewpoint, rendering transparent shadow polygons facing away from the current viewpoint and incrementing corresponding stencil buffer entries only for pixels which pass the inverted depth buffer comparison test; and
- for the current viewpoint, rendering transparent shadow polygons facing toward the current viewpoint and decrementing corresponding stencil buffer entries only for pixels which pass the inverted depth buffer comparison test so that the stencil buffer marks out an area of the 3-D scene included in the shadow cast by the first object.
2. The method of claim 1 further comprising the steps of: - filling the area marked out by the stencil buffer with a transparent gray polygon to cause a shadow to appear.
3. The method of claim 1 further comprising the steps of: - dimming the light falling in the area marked out by the stencil buffer to cause a shadow to appear.
4. The method of claim 1 further comprising the steps of: - calculating the dot product of an outward normal of each transparent shadow volume polygon with a vector pointing from the current viewpoint to the transparent shadow polygon;
- identifying transparent shadow volume polygons as facing toward the viewpoint if a value of the dot product is negative;
- identifying transparent shadow volume polygons as facing away from the viewpoint if the value of the dot product is positive.
5. A computer program product for real-time rendering of shadows in 3-D scenes to be displayed on a computer monitor, with the method using a shadow volume, calculated for a first object in a 3-D scene and defined as a region of space in the 3-D scene bounded by transparent shadow volume polygons in which the first scene object will cast a shadow on any part of another scene object included with in the shadow volume, and with the computer program product using a stencil buffer and a depth buffer, with both the stencil buffer and depth buffer having an entry for each pixel in a bit map for displaying the 3-D scene on a computer monitor, said computer program product comprising: - a computer readable medium for storing computer program code therein, with said computer program code including;
- computer program code for drawing the 3-D scene without the transparent shadow volume polygons and rendering depth into the depth buffer;
- computer program code enabling an inverted depth buffer comparison test where a current pixel having a depth value greater than a depth value stored in a corresponding entry of the depth buffer passes the test;
- computer program code disabling writes to the depth buffer;
- computer program code initializing the stencil buffer by resetting all stencil buffer entries;
- for a current viewpoint, computer program code rendering transparent shadow polygons facing away from the current viewpoint and incrementing corresponding stencil buffer entries only for pixels which pass the inverted depth buffer comparison test; and
- for the current viewpoint, computer program code rendering transparent shadow polygons facing toward the current viewpoint and decrementing corresponding stencil buffer entries only for pixels which pass the inverted depth buffer comparison test so that the stencil buffer marks out an area of the 3-D scene included in the shadow cast by the first object.
|