TEXTURE MAPPING IN 3-D COMPUTER GRAPHICS

Abstract: A texture mapping process for computer graphics includes the steps of determining an image to be displayed as a series of destination polygons, identifying the or each image object to be displayed as one or more textured source polygons, sub-dividing the or each textured source polygon of an object along planes of constant distance from a viewing position, and rendering the resulting sub-polygons onto the destination polygons of the image by simple warp mapping. The technique substantially reduces the volume of mathematical processing, particularly division.

Description: Texture Mapping in 3-D Computer Graphics This invention relates to Texture Mapping in 3-D Computer Graphics. In order to present a screen image actually in two dimensions (2-D) which will be taken as a correct view of a three dimensional (3-D) object, the object is first defined by a programmer as a series of coordinates (x,y,z) in space. The object as seen at any instant is then derived by algorithms in the computer in the form of a series of 2-D coordinates (x,y), such that any point of that image is a projection of a point in space with x, y and z coordinates. Since an object surface is defined by a series of vertices which locate the outermost limits of the image of that surface, a computer would draw such an image as an outline only, which for realism has to be filled in, i.e. given a 'texture' representing surface detail, colour and illumination. In practice this is done by transferring a pre-stored image of the texture to the outline. This is called 'texture mapping'. Since the surface for realism has to appear to recede in the z direction, so must the texture. The task is thus to map the texture from a textured source, i.e. the envisaged 3-D object, onto a 2-D perspective projection of a 3-D polygon (the general term used for a specified area of surface on the object). Texture mapping is usually performed pixel-by-pixel along a scan line of the screen. The mapping of source texture to bitmap pixels needs to be done in such a way that the image looks to be in true perspective. Current scan-line texture mapping techniques are: True perspective texture mapping, which requires 2 mathematical divides per pixel to calculate source texture coordinates. Quadratic interpolation of source texture coordinates across destination polygon. The quadratic coefficients are calculated from the correct texture coordinates at the mid point of the scan line or edge. Quadratic interpolation on subdivided polygons. Simple warp mapping, which involves linear interpolation of source texture coordinates across destination polygon. Warp mapping with subdivision of source polygon into equal parts before projection. The problem is that the above techniques are too slow for use on home micro-computers at real time frame rates (i.e. high enough rates to give near-smooth movement of animated 3-D images), or do not give enough perspective effect. Such computers, used extensively for computer games for example, have limited memory, processor power and graphics performance. Accordingly, the present invention proposes a texture mapping process for computer graphics which involves subdividing the textured source polygon along planes of constant z (constant distance from the projection plane), and then rendering the resulting sub-polygons onto the destination polygons of the image by simple warp mapping. The invention also extends to an imaging system for applying texture to a displayed object by the process herein described. The apparatus includes the means necessary to carry out the described process steps and may be in hardware or software form or in any combination thereof. These means will be apparent to the skilled reader from the teachings herein. In order that the invention shall be clearly understood, an exemplary embodiment of the technique will now be described. This starts with a texture map polygon defined in 3-D view space by: Header: N Number of vertices P Pointer to texture map image data Vertices: X,Y,Z,U,V z-distance from view plane U,V are texture coordinates x,Y, z,U,V The above data format and subroutines to work on it are shared with the 3-D texture map clipper. Stage 1: Scan the vertex list to calculate the ratio of far to near z, then compare the result with a set threshold. When this ratio approaches 3, the system performs a subdivision but this figure is a compromise between speed and image quality and this threshold could be adjusted to help maintain a constant frame rate. If the threshold is not exceeded then proceed to draw polygon using simple scan line warp mapping, or quadratic mapping. Stage 2: Calculate z plane use, to subdivide polygon into 2 new polygons. The simplest case is to sub-divide at one quarter of way from near z to far z. This will be near to half way across the projected polygon when the ratio of near to far z is approaching 3. Stage 3: Call 3-D clipper to clip view of space polygon into 2 new polygons at specified plane of constant z. Stage 4: Draw the far polygon and pass the near polygon back to stage 1 to check ratio of z etc. and iterate stages 2 to 4. In practice it would be possible at stage 2 to subdivide into more than 2 polygons, and at stage 4 to pass more than one polygon back to stage 1. The practical effect of this technique is that the new edge generated between any two new polygons is parallel to the view projection plane. So along this edge, the texture coordinates change linearly in the projected polygon. This makes simple warp mapping correct along these new edges. This gives a large amount of perspective correction for each subdivision of the polygon. Thus, a smaller number of subdivisions need to be done producing a smaller number of polygons. As overheads can be a large proportion of the time taken to draw a polygon, this can give a speed improvement over normal subdivision. This technique does not require the texture to be the same shape as the source polygon because we are just improving the perspective effect on warp mapping. The threshold for subdivision can be adjusted in real time to give fairly smooth changes of image quality and frame rate. The technique according to the invention produces a substantially improved perspective rendering of surfaces using limited processing power. It allows better moving images in real time than heretofore, and is particularly useful in computer games programs intended to run on hardware of restricted speed, memory, etc. The technique substantially reduces the volume of mathematical processing, particularly division, which is required. The disclosures in British patent application no. 9406512.5, from which this application claims priority, and in the abstract accompanying this application are incorporated herein by reference.

Claims: CLAIMS 1. A texture mapping process for computer graphics including the steps of determining an image to be displayed as a series of destination polygons, identifying the or each image object to be displayed as one or more textured source polygons, sub-dividing the or each textured source polygon of an object along planes of constant distance from a viewing position, and rendering the resulting sub-polygons onto the destination polygons of the image by simple warp mapping. 2. A process according to claim 1, comprising the steps of scanning the vertices of a polygon, determining from the list a vertex distance ratio as the ratio of the furthest distance from the viewing position to the closest distance, comparing the ratio with a predetermined threshold, when the ratio exceeds the predetermined threshold subdividing the polygon into one or more sub-polygons. 3. A process according to claim 2, wherein the threshold level is approximately 3. 4. A process according to claim 2 or 3, wherein the polygon is subdivided at one quarter of way from the closest to the furthest distance from the viewing position. 5. A process according to claim 2, 3 or 4, wherein the polygon is subdivided by calling a 3-D clipper algorithm to clip the polygon into two or more new sub-polygons, at least one of the new subpolygons being disposed in a specified plane of substantially constant distance from the viewing position. 6. A process according to claim 5, comprising the step of rendering the subpolygon or subpolygons of substantial ly constant distance from the viewing position and recalculating the vertex distance ratio for the or each other subpolygon to determine whether division thereof is required. 7. A process according to claim 5 or 6, wherein the subpolygon furthest from the viewing position is drawn first and the vertex distance ratio for the or each other subpolygon is recalculated. 8. A process according to any one of claims 5 to 7, wherein each polygon and subpolygon is divided until the vertex distance ratio of each subpolygon is less than the threshold level. 9. A process according to any one of claims 2 to 8, wherein when the ratio does not exceed the threshold level, the polygon is drawn using simple scan line warp mapping, or quadratic mapping. 10. An imaging system adapted to apply texture to objects to be displayed by a process according to any preceding claim.

Inventors: DAY MICHAEL ROBIN, GRAHAM CARL, DAY, MICHAEL, ROBIN, GRAHAM, CARL
Applicants: ARGONAUT TECHN LTD, DAY MICHAEL ROBIN, GRAHAM CARL, ARGONAUT TECHNOLOGIES LIMITED, DAY, MICHAEL, ROBIN, GRAHAM, CARL
Application year: 1995
Main classification: G06T15
IPC codes: G06T11, G06T15