The invention relates to a method of computing a pixel value for a pixel in a texture mapped computer graphics image.
Texture mapping and bump mapping are mapping techniques for increasing the realism of computer graphics images. These mapping techniques are used to create color patterns and visual effects of unevenness in an image part that shows a surface, which is modeled as a flat polygon in three-dimensional space. These mapping techniques use an approximation to compute the image. A two-dimensional map (the texture map or the bump map) is provided, for example as an array of values stored in computer memory. Each location on the surface is assigned to a location in the map. When the pixel value of a pixel in the image is computed, one computes which location on the surface is visible in the pixies and determines the pixel value from the value stored in the two dimensional map for the location in the map which is assigned to that location on the surface. In case of a texture map, a color value (e.g. RGB combination) from the map is used to compute a surface color. In case of a bump map, a local surface orientation is determined from the bump map and this orientation is used to compute visible reflections from the surface.
Texture mapping and bump mapping increase the sense of realism that is experienced when viewing the image. A further increase can be realized by including parallax effects. This is realized for example in PCT patent application Ser. No. 98/92911 (by the same inventor) which creates a parallax effects by combining information from two texture maps for one surface, where the two texture maps are offset to one another in a direction normal to the surface.
It is an object of the invention to provide a method and apparatus for generating computer graphics images with additional realism.
The method according to the invention is set forth in claim 1. According to the invention, the surface texture in a pixel is determined from the content of the texture map at a texture map location. The texture map location is determined by applying an offset to a location in the texture map that is assigned to the surface location which is visible in the pixel. The offset is determined from a surface height for the surface location, as determined from a displacement map. Thus, a parallax in the texture is simulated. The parallax corresponds to unevenness of the surface as described by the displacement map.
The parallax also depends on the current viewing direction relative to the local normal vector. So in order to compute the offset, both the surface height and the viewing parameters are taken into account.
Preferably, the computation of parallax from the displacement map is combined with computation of angular dependence of reflections (specular and/or diffuse reflections) and/or shadows cast from the unevenness described by the displacement map. The computation of parallax effect will automatically account for some effects of occlusion: hiding of certain surface details by other surface details.
The invention also relates to an apparatus with computer graphics capability that is structured and/or programmed to perform the method according to the invention.