|Publication number||US7262777 B2|
|Application number||US 10/784,113|
|Publication date||Aug 28, 2007|
|Filing date||Feb 20, 2004|
|Priority date||Feb 20, 2003|
|Also published as||CN1310191C, CN1624722A, US20050017983|
|Publication number||10784113, 784113, US 7262777 B2, US 7262777B2, US-B2-7262777, US7262777 B2, US7262777B2|
|Inventors||Qun Feng (Fred) Liao, Zhou (Mike) Hong|
|Original Assignee||Via Technologies, Inc.|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (12), Non-Patent Citations (4), Classifications (13), Legal Events (3)|
|External Links: USPTO, USPTO Assignment, Espacenet|
This application claims priority to U.S. Provisional Application Ser. No. 60/449,123, filed Feb. 20, 2003, and entitled “APPROXIMATION OF LEVEL OF DETAIL CALCULATION IN CUBIC MAPPING WITHOUT ATTRIBUTE DELTA FUNCTION,” which application is incorporated herein by reference.
The present invention relates generally to environmental mapping in a computer graphics system and more particularly to environmental mapping and mip-mapping in a computer graphics system.
Cubic mapping is a form of reflection mapping in which a cubic environmental map is used, as illustrated in
of the texture coordinates (u, v) with respect to the screen coordinates (x, y). For example, according to Williams1, the LOD is calculated as
Although the derivatives can be obtained through the slope function of attributes and perspective division, for multipass texture rendering, these slope functions are too expensive to compute. Thus, an approximation of the derivative is used instead, by taking the delta difference of neighboring pixels' texture coordinates, where the screen coordinates differ by one. For example, if pixels p0 and p1 are adjacent in the x-direction, and p0 and p2 are adjacent in the y-direction, then
where u0 is the u-coordinate for pixel p0, u1 is the u-coordinate for pixel p1 and u2 is the u-coordinate for pixel p2. A problem occurs, however, in cubic mapping. There is no guarantee that the neighboring coordinates are mathematically continuous, which is required if the delta differences are to be a reasonable approximation of the derivative. This is true because u and v have been mapped according to certain rules to determine which face of the cube applies to a particular view vector and because the cubic face of neighboring pixels may not be the same.
The mapping rules are illustrated by the code fragment in
The derivative is computed in accordance with the following approximation:
Therefore, after cross-multiplying and simplifying:
where dU/dx=U1−U0 and dMajor/dx=Major1−Major0.
The above computation, however, has the problem that, in using the normalized delta, the continuity of normals of the pixels at different faces is assumed, but may not be true. Also, for each pixel, the computation requires three multiplications, two additions, and one division, all in floating point. The cost of this kind of computation is high and the precision is subject to the approximation of the normal delta. Thus, an improved computation, that avoids the continuity problem at the faces is desired.
A method in accordance with the present invention is a method of performing cubic mapping with texturing. The method includes selecting neighboring pixels to be mapped, computing normals of the neighboring pixels, and mapping the normals of the pixels to faces of a cube, where neighboring pixels are mapped to adjacent faces of the cube and each face has an identifying number, and a LOD and a pair of texture coordinates for defining a mip-map for the face. The method further includes computing a level of detail (LOD) parameter for the texture coordinates of the neighboring pixels based on continuity-adjusted derivatives of the texture coordinates.
One advantage of the present invention is that the same LOD can be maintained for texture maps used on different faces of the cube.
Another advantage is that fewer computations are required to determine the LOD.
These and other features, aspects and advantages of the present invention will become better understood with regard to the following description, appended claims, and accompanying drawings where:
Because cubic mapping is topologically similar to spherical mapping, shown in
In making the continuity adjustments, there are three cases to consider. In the first case, neighboring pixels have different u values, but these values differ only in sign. For example, u1=Nx/Nz but u0=−Nx/Nz. Therefore, du/dx=u1−(−u0) is a good approximation. Alternatively, there can be a jump in the value between the faces. In this case, du/dx=1+u1−(−u0).
In the second case, neighboring pixels have u and v swapped; the value of u1=Nx/Nz is changed to Ny/Nz. In this case, du/dx=u1−v0 is a good approximation.
In the third case, neighboring pixels have v and Major swapped; the value of u1=Nx/Nz is changed to Nx/Ny. Because at the boundary of the faces, Nz=Ny, du=u1−u0 is a good approximation.
All other cases involving face changes are combinations of the above cases. Therefore, the texture coordinate adjustment across face boundaries involve combinations of a negation and a u/v swap. In practice, the u/v values are first computed, then normalized to the [0,1]range, and then the delta is computed. A texture coordinate adjustment may also have a third operation, add/subtract, to compensate for the normalization process.
To simplify a hardware implementation of the present invention, the operations needed for texture delta coordinate adjustment across face boundaries are tabulated. If two adjacent pixels have different faces, the table has an operation code for the delta adjustment.
The table is shown in
The table in
The code fragment, shown in
Although the present invention has been described in considerable detail with reference to certain preferred versions thereof, other versions are possible. Therefore, the spirit and scope of the appended claims should not be limited to the description of the preferred versions contained herein.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US5912670 *||Sep 27, 1996||Jun 15, 1999||International Business Machines Corporation||Method and apparatus for overlaying a bit map image on an environment map|
|US5923334 *||Sep 27, 1996||Jul 13, 1999||International Business Machines Corporation||Polyhedral environment map utilizing a triangular data structure|
|US6034691 *||Jul 29, 1997||Mar 7, 2000||International Business Machines Corporation||Rendering method and apparatus|
|US6236405 *||Jun 27, 1997||May 22, 2001||S3 Graphics Co., Ltd.||System and method for mapping textures onto surfaces of computer-generated objects|
|US6246422 *||Sep 1, 1998||Jun 12, 2001||Sun Microsystems, Inc.||Efficient method for storing texture maps in multi-bank memory|
|US6424351 *||Apr 21, 1999||Jul 23, 2002||The University Of North Carolina At Chapel Hill||Methods and systems for producing three-dimensional images using relief textures|
|US6664963 *||Oct 12, 2001||Dec 16, 2003||Nvidia Corporation||System, method and computer program product for programmable shading using pixel shaders|
|US6744430 *||Jul 20, 2000||Jun 1, 2004||Sega Enterprises, Ltd.||Image processing method and its apparatus|
|US6765584 *||Mar 14, 2002||Jul 20, 2004||Nvidia Corporation||System and method for creating a vector map in a hardware graphics pipeline|
|US6768492 *||Oct 5, 2001||Jul 27, 2004||Microsoft Corporation||Texture tiling with adjacency information|
|US6850242 *||Sep 7, 2000||Feb 1, 2005||Namco Ltd.||Image generating system and program|
|US6975319 *||Mar 24, 2000||Dec 13, 2005||Nvidia Corporation||System, method and article of manufacture for calculating a level of detail (LOD) during computer graphics processing|
|1||*||"Cube Maps," NVIDIA Corporation, 200a. http://developer.nvidia.com/object/cube<SUB>-</SUB>maps.html.|
|2||*||"OpenGL Cube Map Texturing," NVIDIA Corporation, 1999. http://developer.nvidia.com/object/cube<SUB>-</SUB>map<SUB>-</SUB>ogl<SUB>-</SUB>tutorial.html.|
|3||*||"Per-Pixel Lighting Intro," NVIDIA Corporation, 2000. http://developer.nvidia.com/object/perpixel<SUB>-</SUB>lighting<SUB>-</SUB>intro.html.|
|4||*||NVIDIA document listing including publication dates for documents cited herein. http://developer.nvidia.com/object/all<SUB>-</SUB>docs<SUB>-</SUB>by<SUB>-</SUB>date.html.|
|U.S. Classification||345/582, 382/284, 345/587, 382/293, 345/420, 345/630, 345/608|
|International Classification||G06K9/56, G06F15/80, G09G5/00, G06T15/20|
|Jul 1, 2004||AS||Assignment|
Owner name: VIA TECHNOLOGIES, INC., TAIWAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:LIAO, QUN FENG (FRED);REEL/FRAME:014813/0906
Effective date: 20040217
|Feb 28, 2011||FPAY||Fee payment|
Year of fee payment: 4
|Feb 11, 2015||FPAY||Fee payment|
Year of fee payment: 8