Interactive horizon mapping
AssigneeMicrosoft Corporation
InventorsPeter-Pike Sloan, Michael F. Cohen
Life of this patent
Estimating the term…
Abstract
Shadows, which play an important role in perceiving the shape and texture of an object, are simulated interactively in a real time, self-shadowing of a bump mapped surface for a computer rendered object. A computer graphics textured object function defines a horizon map over an orientation in a tangent space of the object using different textures or basis functions. The implementation can be performed using commodity graphics hardware by precomputing the horizon map for limited visibility for each point on the bump mapped surface given light in each of a plurality of radial directions. The horizon map is used to produce self-shadowing of the bump mapped surface of the object.
Claims10
A computer system configured for determining shadowing cast onto a bump mapped surface by one or more bumps thereon, where the bump mapped surface is represented by a plurality of polygons each having a plurality of vertices, each vertex defining a point in a tangent plane of the bump mapped surface, where a normal vector at each said vertex is perturbed to define a bump map of the bump mapped surface that includes a plurality of bumps on the surface, the computer system comprising:
- means for defining a horizon map of the surface including, for each of a plurality of radial directions in the tangent plane around each said vertex, the largest angle between the normal vector and any direct ray of light to the vertex;
- means for storing the horizon map as a set of texture maps corresponding to the surface on the three-dimensional graphical object;
- and
- wherein for each said vertex, each said texture map has a plurality of color channels, each said color channel having encoded therein the largest angle between the normal vector and any direct ray of light to the vertex that does not contact any of the bumps on the surface.
A computer system configured for rendering a frame in a frame buffer represented by a plurality of pixels, the frame depicting a three dimensional graphical object that is defined by surfaces each having a surface geometry defined by a parameterization of a plurality of polygons, each polygon being defined by vertices, each vertex (u,v) having a bump map scalar value F(u,v) defining a bump, each vertex (u,v) having a perturbed normal map vector value N′(u,v) from the bump map scalar value F(u,v), each vertex (u,v) having M basis maps (Bk=1 . . . M (s, t)), each vertex (u,v) having M horizon maps for each of M radial directions (θk=1 . . . M) in the tangent plane of the vertex (u, v), wherein each of the M horizon maps includes the largest angle Φ(u,v,θk=1 . . . M) between the perturbed normal map vector value N′(u, v) and any direct ray to the vertex (u, v), the computer system comprising:
- (i) means for defining a light vector (L) having a direction defined by:
- the angle θL between the light vector (L) and the plane formed by coordinates (u,v);
- and
- the angle ΦL between the light vector (L) and the perturbed normal map vector value N′(u,v);
- (ii) means for inverting a local tangent frame by [Pu, Pv, N]−1=[ST, TT, NT] to obtain an inverted tangent frame (S,T);
- (iii) means for taking the dot product of the light vector (L):
- with the first two components of the inverted frame (S,T) to obtain the projection of the light vector (L) into the coordinate space in the tangent plane at a coordinate pair (s,t);
- and
- with the perturbed normal map vector value N′(u, v) at the vertex to obtain cosine (ΦL);
- (iv) means for setting the camera angle of the rendering to a point of view to be rendered for the frame to write into the space of a texture map;
- (v) means for computing first and second texture effects on each pixel in the frame buffer, respectively, from first and second sets of the M directions stored as texture maps, wherein each said largest angle Φ(u,v,θk) is in one of a plurality of color channels of a texture map, wherein one of the M directions corresponds to each said color channel of the texture map, and wherein the first and second texture effects are defined, respectively by:
- a basis map B1 (s, t) of said M basis maps (Bk=1 . . . M (s, t)), and a horizon map, Φ1 (u, v) of said M horizon maps;
- and
- a basis map B2 (s, t) of said M basis maps (Bk=1 . . . M (s, t)), and a horizon map, Φ2 (u, v) of said M horizon maps;
- (vi) means for storing the first and second texture effects for each pixel in the frame buffer in a texture map Φ(θLIGHT);
- (vii) for a given camera perspective view:
- on a first operation, means for rendering a model of the three dimensional graphical object with an ambient low level lighting term only;
- on a second operation:
- means for setting an alpha test and a stencil function to accept only those pixels in the frame buffer that have a non-zero alpha test result;
- means for setting a color mask upon the frame buffer, wherein the color mask will not write to the color channels of the texture maps, whereby the ambient low level lighting term previously rendered is preserved;
- means for drawing, using multi-texturing, for the angle (ΦL) and the angle to the horizon (θL), the first and second texture effects on each pixel in the frame buffer, which are, respectively, cosine(ΦL) that is greater than ΦL, and Φ(θLIGHT);
- on a third operation:
- means for setting the alpha test off;
- means for setting the color mask upon the frame buffer to allow writing to the color channels of the texture maps;
- means for setting the stencil function to only draw pixels in the frame buffer that have a non-zero alpha test result;
- means for setting a blending function to accumulate into the frame buffer with the ambient low level lighting term;
- means for drawing the vector valued perturbed normal map N′(u,v);
- and
- means for displaying the three dimensional graphical object defined by pixels in the frame buffer, wherein the displayed object has an ambient only term in shadowed regions and normal bump mapping in non-shadowed regions.
A computer system configured for determining shadowing cast onto a bump mapped surface by one or more bumps thereon, where the bump mapped surface is represented by a plurality of polygons each having a plurality of vertices, each vertex defining a point in a tangent plane of the bump mapped surface, where a normal vector at each said vertex is perturbed to define a bump map of the bump mapped surface that includes a plurality of bumps on the surface, the computer system comprising logic configured for:
- defining a horizon map of the surface including, for each of a plurality of radial directions in the tangent plane around each said vertex, the largest angle between the normal vector and any direct ray of light to the vertex;
- storing the horizon map as a set of texture maps corresponding to the surface on the three-dimensional graphical object;
- and
- wherein for each said vertex, each said texture map has a plurality of color channels, each said color channel having encoded therein the largest angle between the normal vector and any direct ray of light to the vertex that does not contact any of the bumps on the surface.
A computer system configured for rendering a frame in a frame buffer represented by a plurality of pixels, the frame depicting a three dimensional graphical object that is defined by surfaces each having a surface geometry defined by a parameterization of a plurality of polygons, each polygon being defined by vertices, each vertex (u,v) having a bump map scalar value F(u,v) defining a bump, each vertex (u,v) having a perturbed normal map vector value N′(u,v) from the bump map scalar value F(u,v), each vertex (u,v) having M basis maps (Bk=1 . . . M (s, t)), each vertex (u,v) having M horizon maps for each of M radial directions (θk=1 . . . M) in the tangent plane of the vertex (u, v), wherein each of the M horizon maps includes the largest angle Φ(u,v,θk=1 . . . M) between the perturbed normal map vector value N′(u, v) and any direct ray to the vertex (u, v), the computer system comprising logic configured for:
- (i) defining a light vector (L) having a direction defined by:
- the angle θL between the light vector (L) and the plane formed by coordinates (u,v);
- and
- the angle ΦL between the light vector (L) and the perturbed normal map vector value N′(u,v);
- (ii) inverting a local tangent frame by [Pu, Pv, N]−1=[ST, TT, NT] to obtain an inverted tangent frame (S,T);
- (iii) taking the dot product of the light vector(L):
- with the first two components of the inverted frame (S,T) to obtain the projection of the light vector (L) into the coordinate space in the tangent plane at a coordinate pair (s,t);
- and
- with the perturbed normal map vector value N′(u, v) at the vertex to obtain cosine (ΦL);
- (iv) setting the camera angle of the rendering to a point of view to be rendered for the frame to write into the space of a texture map;
- (v) computing first and second texture effects on each pixel in the frame buffer, respectively, from first and second sets of the M directions stored as texture maps, wherein each said largest angle Φ(u,v,θk) is in one of a plurality of color channels of a texture map, wherein one of the M directions corresponds to each said color channel of the texture map, and wherein the first and second texture effects are defined, respectively by:
- a basis map B1 (s, t) of said M basis maps (Bk=1 . . . M(s, t)), and a horizon map, Φ1(u, v) of said M horizon maps;
- and
- a basis map B2 (s, t) of said M basis maps (Bk=1 . . . M (s, t)), and a horizon map, Φ2 (u, v) of said M horizon maps;
- (vi) storing the first and second texture effects for each pixel in the frame buffer in a texture map Φ(θLIGHT);
- (vii) for a given camera perspective view:
- on a first operation, rendering a model of the three dimensional graphical object with an ambient low level lighting term only;
- on a second operation:
- setting an alpha test and a stencil function to accept only those pixels in the frame buffer that have a non-zero alpha test result;
- setting a color mask upon the frame buffer, wherein the color mask will not write to the color channels of the texture maps, whereby the ambient low level lighting term previously rendered is preserved;
- drawing, using multi-texturing, for the angle (ΦL) and the angle to the horizon (θL), the first and second texture effects on each pixel in the frame buffer, which are, respectively, cosine(ΦL) that is greater than ΦL, and Φ(θLIGHT);
- on a third operation:
- setting the alpha test off;
- setting the color mask upon the frame buffer to allow writing to the color channels of the texture maps;
- setting the stencil function to only draw pixels in the frame buffer that have a non-zero alpha test result;
- setting a blending function to accumulate into the frame buffer with the ambient low level lighting term;
- drawing the vector valued perturbed normal map N′(u,v);
- and
- displaying the three dimensional graphical object defined by pixels in the frame buffer, wherein the displayed object has an ambient only term in shadowed regions and normal bump mapping in non-shadowed regions.
Dependencies are inferred from the claim text.