WO2006095481A1 - テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法 - Google Patents

テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法 Download PDF

Info

Publication number
WO2006095481A1
WO2006095481A1 PCT/JP2005/022536 JP2005022536W WO2006095481A1 WO 2006095481 A1 WO2006095481 A1 WO 2006095481A1 JP 2005022536 W JP2005022536 W JP 2005022536W WO 2006095481 A1 WO2006095481 A1 WO 2006095481A1
Authority
WO
WIPO (PCT)
Prior art keywords
texture
parameter
dimensional
value
texel
Prior art date
Application number
PCT/JP2005/022536
Other languages
English (en)
French (fr)
Inventor
Takahiro Koguchi
Original Assignee
Sony Computer Entertainment Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Computer Entertainment Inc. filed Critical Sony Computer Entertainment Inc.
Publication of WO2006095481A1 publication Critical patent/WO2006095481A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Definitions

  • the present invention relates to a texture processing device, a drawing processing device, and a texture processing method for performing arithmetic processing on drawing data.
  • a polygon model that represents an object in a three-dimensional space with a large number of polygons is generally used.
  • shading is performed to shade the polygon surface in consideration of the light source, viewpoint position, and reflectance of the object surface.
  • texture mapping is performed by attaching a texture image to the surface of the polygon model in order to generate a highly realistic image.
  • the texture used for texture mapping is usually a volume texture with a texture in the depth direction to express the texture more than the force of a two-dimensional texture.
  • Volume texture is used to draw a cross-section of a drawing object, or to map a texture to a drawing object having a three-dimensional structure such as a cloud or a flame or a semi-transparent drawing object.
  • environment mapping may be performed in which the surrounding environment is reflected on the drawing surface as a texture.
  • environment mapping the environment texture is projected onto each surface of the virtual cube surrounding the drawing object, and the environment texture of each surface of the cube is mapped onto the drawing surface. It becomes a composition.
  • the present invention has been made in view of these problems, and an object of the present invention is to provide a drawing processing technique that is excellent in terms of resource management and can use various textures uniformly. Another object is to provide a drawing processing technology that can efficiently switch between and use a plurality of textures.
  • a texture processing apparatus includes a plurality of two-dimensional textures in which values relating to a texture are stored as texel values in association with two-dimensional parameter coordinates.
  • a texture storage unit for storing a texture structure in which a third parameter for designating at least one of the two-dimensional textures is provided separately from the first and second parameters in the two-dimensional parameter coordinates;
  • the two-dimensional corresponding to the designated third parameter in the texture structure Read texture from texture to read texel value corresponding to specified 2D parameter coordinate value And a filter that interpolates the read texel value and calculates a value related to the texture applied to the surface of the drawing object.
  • the third parameter a value corresponding to the relationship between the plurality of two-dimensional textures included in the texture structure is designated, so that different types of the texture structures are uniformly referred to.
  • the texture is applied to the surface of the drawing target in addition to the texture color value being mapped to the drawing surface, as well as a value related to the texture, such as a normal vector value, It is intended to include that a function value or the like is applied to the drawing surface.
  • Another aspect of the present invention is a drawing processing apparatus.
  • This apparatus is provided with a plurality of two-dimensional textures in which texture-related values are stored as texel values in association with two-dimensional parameter coordinates, and a third parameter for designating at least one of the plurality of two-dimensional textures is provided.
  • a texture storage unit that stores a texture structure that is provided separately from the first and second parameters in the two-dimensional parameter coordinates, and a texture that is applied to the surface of the drawing target.
  • the texture structure has a structure in which the number of environmental textures projected on the surface of a cube virtually provided in the space where the drawing object exists is provided.
  • the drawing processing unit obtains a surface number of an environmental texture mapped to the surface and a two-dimensional parameter coordinate value in the surface based on a reflection vector of the surface of the drawing object, and obtains the obtained surface.
  • a number is specified as the third parameter to the texture processing unit together with a two-dimensional parameter coordinate value, and the texture processing unit is used as the third parameter by the drawing processing unit in the texture structure.
  • a texel value corresponding to the two-dimensional parameter coordinate value specified by the drawing processing unit is read from the environmental texture corresponding to the specified surface number, and the texture applied to the surface of the drawing object Calculate the interpolation value.
  • the texture data structure is provided with a plurality of two-dimensional textures in which texture-related values are stored as texel values in association with two-dimensional parameter coordinates, and at least one of the plurality of two-dimensional textures is specified.
  • the third parameter of the above has a structure provided separately from the first and second parameters in the two-dimensional parameter coordinates, and reads out the texture specifying the two-dimensional parameter coordinate values and the third parameter.
  • the instruction is configured to enable sampling of the texel value corresponding to the specified two-dimensional parameter coordinate value from the two-dimensional texture corresponding to the specified third parameter, and the structure is used as the third parameter.
  • Yet another embodiment of the present invention is a texture processing method.
  • a texture value is stored as a texel value in association with a 2D parameter coordinate.
  • a plurality of checkers are provided, and a third parameter for designating at least one of the plurality of two-dimensional textures holds a texture structure provided separately from the first and second parameters in the two-dimensional parameter coordinates.
  • the texture memory is instructed by executing a texture read command specifying the third parameter and the two-dimensional parameter coordinate value on the surface for the texture applied to the surface of the drawing object.
  • the third parameter To the value corresponding to the association between the plurality of two-dimensional texture contained in the texture structure more that is specified, different types of the textured structure is referenced unified manner.
  • the convenience of texture mapping can be improved and the efficiency of texture processing can be improved.
  • FIG. 1 is a configuration diagram of a drawing processing apparatus according to an embodiment.
  • FIG. 2 is a diagram showing the configuration of the shader unit and texture unit of FIG. 1.
  • FIG. 3 is a diagram for explaining the data structure of the texture structure in FIG. 2.
  • FIG. 4 is a diagram for explaining bilinear sampling.
  • FIG. 5 is a diagram for explaining trilinear sampling between resolution levels of a map map.
  • FIG. 6 is a diagram for explaining monolinear sampling between layers.
  • FIG. 7 is a flowchart for explaining the procedure of texture mapping processing by the texture unit according to the embodiment.
  • FIG. 8 is a diagram showing a virtual cube surrounding a drawing object and its surface in cube mapping.
  • FIG. 9 is a diagram for explaining a correspondence relationship between the direction of each axis of texture coordinates and the direction of each axis of world coordinates in the developed view of the virtual cube of FIG. 8.
  • FIG. 10 is a diagram collectively showing the correspondence between the target surface, the texture coordinates on the target surface, and the measure component in cube mapping.
  • FIG. 11 is a diagram for explaining a method of using a texture structure as a cube map.
  • FIG. 12 is a flowchart for explaining a procedure of cube mapping processing by the drawing processing apparatus according to the embodiment.
  • FIG. 1 is a configuration diagram of a drawing processing apparatus 100 according to the embodiment.
  • the drawing processing apparatus 100 performs a rendering process for generating drawing data to be displayed on a 2D screen based on the 3D model information.
  • the rasterizer 10 acquires the vertex data of a primitive to be rendered, such as a memory or other processor or vertex shader, and converts it into pixel information corresponding to the screen to be rendered.
  • a drawing primitive is a drawing unit of a geometric figure such as a point, a line, a triangle, or a rectangle when a three-dimensional object is represented by a polygon model, and is data expressed in units of vertices.
  • the rasterizer 10 performs view transformation that converts drawing primitives in the three-dimensional space into graphics on the drawing plane by projection transformation, and then scans the drawing plane on the drawing plane along the horizontal direction of the drawing plane. Every time it is converted to a quantized pixel.
  • the rasterizer 10 expands the drawing primitive into pixels, and for each pixel, the color value represented by the RGB three primary colors, the alpha value indicating transparency, the Z value indicating depth, and the parameter coordinates for referring to the texture attribute. Pixel information including certain UV coordinate values is calculated. [0019]
  • the rasterizer 10 performs the above rasterization process in units of a pixel set of a predetermined size including one or more pixels, and buffers the pixel set after the rasterization process while performing a shader unit in units of pixel sets. Supply to 30 sequentially.
  • the set of pixels supplied to the shader unit 30 by 10 rasterizers is pipelined to the shader unit 30! /.
  • the pixel set is a collection of pixels processed by the rasterizer 10 every time, and is a unit of rasterization processing, and at the same time, a unit of drawing calculation processing in the seeder unit 30.
  • the shader unit 30 includes a plurality of pixel shaders that operate asynchronously, and performs pixel drawing processing in parallel by processing a set of pixels each of which is responsible.
  • the shader unit 30 obtains pixel color values by performing shading processing based on the pixel information distributed from the rasterizer 10 in units of pixel sets, and obtains texture values from the texture unit 70 when performing texture mapping.
  • the final color value of the pixel is calculated by combining the color values of the texture to be written, and the pixel data is written into the memory 50.
  • the texture unit 70 performs processing for mapping texture data to pixels processed in the shader unit 30.
  • the texture unit 70 uses a texture structure provided with a plurality of two-dimensional textures (hereinafter simply referred to as “texture structure”).
  • texture structure provided with a plurality of two-dimensional textures
  • attribute values such as texture color values are stored as texel values in association with 2D parameter coordinates (u, V).
  • the two-dimensional texture included in the texture structure may be a one-dimensional texture having only the first parameter u as the position coordinates of the text as a special case.
  • the 1D texture can be treated as a special case of a 2D texture by ignoring the V direction. Therefore, in the following description, the texture dimension is generally assumed to be two-dimensional in order to include a one-dimensional texture as a special case.
  • At least one of a plurality of 2D textures included in the texture structure At least one of the 2D textures included in the texture structure to refer to the force texel value.
  • a third parameter w for designating is provided separately from the first parameter u and the second parameter V in the two-dimensional parameter coordinates (u, V) for designating the texel position.
  • the texture mapped to the pixel on the polygonal surface is a 3D parameter coordinate (u, V, V) that combines the third parameter w and the 2D parameter coordinates (u, V) defined on the polygonal surface. specified by w).
  • the parameter coordinates are referred to as texel coordinates
  • the third parameter w is also referred to as the third texel coordinate w.
  • the third texel coordinate w is basically at least one of a plurality of two-dimensional textures included in the texture structure.
  • 2D texel coordinates are the force corresponding to the width and height of the texture.
  • the third texel coordinates do not necessarily correspond to the depth of the texture. This is because the third texel coordinate w is meaningful because it depends on the relationship between the two-dimensional textures contained in the texture structure.
  • the texture unit 70 obtains the three-dimensional texel coordinate value (u, V, w) of the texture structure mapped to the pixel from the shader unit 30, and the third texel coordinate w in the texture structure.
  • the texel value corresponding to the two-dimensional texel coordinate value (u, V) is read from the two-dimensional texture corresponding to, interpolated with the read texel value, and the interpolated value is supplied by 30 centimeters.
  • the seeder unit 30 further performs processing such as fogging and alpha blending on the drawing data held in the memory 50, obtains the final pixel color value, and updates the pixel data in the memory 50. To do.
  • the memory 50 has an area that functions as a frame buffer that stores pixel data generated by the cedar unit 30 in screen coordinates.
  • the pixel data stored in the frame buffer may be the final rendered image or an intermediate image in the process of shading.
  • the pixel data stored in the frame buffer is output to the display device and displayed.
  • FIG. 2 is a diagram showing the configuration of the sierra unit 30 and the texture unit 70.
  • Configuration information necessary for performing texture mapping is set in each of the register file 32 of the shader unit 30 and the register file 72 of the texture unit 70.
  • the configuration information includes the texture structure stored in memory 50.
  • Various parameters such as the base address for referring to the field 52 at once and the filtering mode for texture mapping are included.
  • the drawing calculation processing unit 34 of the shader unit 30 uses a three-dimensional texel coordinate value (u , V, w) is issued to the texture unit 70, and the texture interpolation value mapped to the pixel is acquired from the texture unit 70.
  • the drawing calculation processing unit 34 calculates the final pixel color value using the texture interpolation value obtained from the texture unit 70, and writes it as the drawing data 54 in the memory 50.
  • the texture reading unit 76 of the texture unit 70 receives the three-dimensional texel coordinate value (u, V, w) from the shader unit 30.
  • the texture reading unit 76 adds the offset value determined depending on the third texel coordinate value w to the base address of the texture structure 52 held in the register file 72, thereby specifying the specified third texel coordinate value.
  • the texture reading unit 76 reads the texel value corresponding to the two-dimensional texel coordinates (u, V) according to the filtering mode set in the register file 72 from the texture specified by the reference address.
  • the texture reading unit 76 gives the read texel value to the filter 74.
  • the texture read unit 76 refers to the texture structure 52 cached in the cache memory provided in the texture unit 70 without directly referring to the texture structure 52 stored in the memory 50. It may be configured as follows.
  • the drawing calculation processing unit 34 in addition to the three-dimensional texel coordinate values (u, V, w), is a texture command that specifies a LOD (level of detail) value indicating the drawing detail level of the drawing target object as a parameter. Can also be issued. In that case, the texture reading unit 76 has a resolution corresponding to the LOD value in the texture structure 52 having the structure of the mipmap texture.
  • the filter 74 performs interpolation of the texel value read by the texture reading unit 76 according to the filtering mode set in the register file 72, and provides the interpolation value to the drawing calculation processing unit 34 of the shader unit 30.
  • the filter 74 uses a multistage interpolator to perform tri-linear sampling that further interpolates the bi-linear interpolation result in the u and v2 directions in the direction of the w direction or the resolution level of the map map. be able to.
  • the filter 74 can also execute monolinear sampling and bilinear sampling by selectively causing a multistage interpolator to function.
  • the nearest texel at the specified texel coordinate (u, V) is sampled from each of the two neighboring textures corresponding to the third texel coordinate w, and interpolated between the two neighboring textures.
  • the nearest texel at the specified texel coordinate (u, V) is selected from each of the two resolution levels corresponding to the LOD value among the resolution levels of the map map. Sampled and interpolated between two neighboring resolution levels.
  • the texture force corresponding to the third texel coordinate w is also sampled at 4 neighboring texels at the specified texel coordinate (u, V) and interpolated in two directions u and V.
  • the texture power corresponding to LOD value is sampled from the resolution level of the map map, and 4 neighboring texels with specified texel coordinates (u, V) are sampled and interpolated in two directions u and v. Is done.
  • the filter 74 is executed by switching to either interpolation according to the filtering mode set in the register file 72. Note that the filter 74 can also perform point sampling in which the nearest texel of the designated texel coordinate (u, V) is sampled and output as it is without causing any of the interpolating units to function.
  • the filter 74 has a functional configuration of a difference unit, a multiplier, and an adder of the interpolation calculator.
  • a difference unit By appropriately diverting and modifying the calculation process to some extent, it is possible to perform calculations other than linear interpolation, and useful calculations other than nonlinear interpolation and trilinear interpolation can also be performed.
  • the filter 74 can execute a calculation for obtaining the LOD value of the drawing surface to which the texel coordinates (u, V) are mapped, after calculating the deviation of the texel coordinates (u, V) described later. .
  • FIG. 3 is a diagram for explaining the data structure of the texture structure 52 stored in the memory 50 of FIG.
  • the texture structure 52 is provided with a plurality of two-dimensional textures, and is configured so that any two-dimensional texture can be designated by the third parameter w.
  • a data structure for storing a plurality of 2D textures a configuration in which a plurality of 2D textures are arranged in the vertical direction in the figure will be described. As long as the texture can be addressed, the arrangement of multiple 2D textures in memory is not critical.
  • the term "layer” is used to describe the vertical direction of a plurality of two-dimensional testers arranged side by side in the vertical direction as shown in the figure. It does not mean that the two-dimensional texture is related in a layered manner; it simply points to the position of the vertical alignment!
  • the two-dimensional texture of each layer can have a structure of a set of mip map textures having different resolutions in stages.
  • the resolution level of the map map hereinafter simply referred to as “map level”! Is shown.
  • texture AO, texture Al, and texture A2 having the same height and width are arranged in the order of layer 0, layer 1, and layer 2.
  • texture BO, texture Bl, and texture B2 that have the same height and width are arranged in the order of layer 0, layer 1, and layer 2.
  • Map level 1 texture BO ⁇ The width and height of B2 are half of the width and height of the texture level 0 texture A0 ⁇ A2, respectively.
  • the widths and heights of textures C0 to C2 placed in layers 0 to 2 of the map level 2 are respectively half the width and height of the textures BO to the layers 0 to 2 of the map level 1.
  • layer 0 When viewed in the horizontal direction, layer 0 contains texture level AO of map level 0 and map level 1 Textures with different levels are arranged in the order of texture B0, texture level 2 texture CO. Similarly, textures with different levels are stored in layer 1 and layer 2 as well.
  • the number of layers and the number of map levels of the texture structure 52 can be changed by setting the register file 72. Whether or not to provide a map map texture structure in the texture structure 52 can also be selected by setting the register file 72. When the map map texture is not used, a 2D texture of the same size is provided for each layer. In FIG. 3, the texture structure 52 that does not use the map map texture is a data structure in which only the textures A0, Al, and A2 of the map level 0 exist.
  • Whether or not to provide a layer structure in the texture structure 52 can also be selected by setting the register file 72.
  • a structure is provided in which only one layer of textures of multiple levels is provided.
  • the texture structure 52 without a layer structure is a data structure in which only layer 0 textures AO, BO, and CO exist.
  • the texture structure 52 includes a texture having a single layer and a plurality of map levels as a special case. Furthermore, a normal single texture with one layer and no map level is treated as a special case of the texture structure 52.
  • the texture reading unit 76 refers to the texture of the specified map level M belonging to the specified layer N by specifying the layer number N and the map level M for the texture structure 52 stored in the memory 50. To do. For example, if layer 2 and map level 1 are specified, texture level B1 of layer 1 belonging to layer 2 can be referenced. The texture reading unit 76 samples the texel value of the texture by specifying the two-dimensional texel coordinates (u, V) within the texture of the specified layer and map level.
  • the texel value may be a color value of RGB three colors as a value related to the texture, or may be an index of a power error value. In the latter case, the index is converted to the actual color value by referring to the color lookup table.
  • bump mapping is performed as an example of texture mapping
  • a normal vector is stored in the texture.
  • the texel value is the value of the normal vector.
  • the texel value is a parameter value or a function value.
  • FIG. 4 is a diagram for explaining bilinear sampling.
  • the texture reading unit 76 obtains the reference layer N as the layer corresponding to the third texel coordinate w, and obtains the reference map level M as the map level corresponding to the specified L OD value.
  • the texture read unit 76 reads four texels 53a in the vicinity of the point represented by the texel coordinate value (u, V) from the texture 51a specified by the reference layer N and the reference map level M.
  • the filter 74 obtains an interpolated value corresponding to the texel coordinate value (u, V) by linearly interpolating the values of the four neighboring texels 53a in the u direction and the V direction.
  • FIG. 5 is a diagram for explaining trilinear sampling between map levels.
  • the texture reading unit 76 obtains the reference layer N as a layer corresponding to the third texel coordinate w, and obtains two reference map levels M and M + 1 as the map levels corresponding to the designated LOD value.
  • the texture read unit 76 reads four texels 53a in the vicinity of the point represented by the texel coordinate value (u, V) from the first texture 51a specified by the reference layer N and the first reference map level M. Further, the texture reading unit 76 obtains four texels 53b in the vicinity of the point represented by the texel coordinate value (u, V) from the second texture 5 la specified by the reference layer N and the second reference map level M + 1. read out.
  • the filter 74 linearly interpolates the values of the four neighboring texels 53a of the first reference map level M and the values of the four neighboring texels 53b of the second reference trip level M in the three directions u, v, and the map level. By performing trilinear interpolation, the interpolation value corresponding to the texel coordinate value (u, V) is calculated.
  • FIG. 6 is a diagram for explaining monolinear sampling between layers.
  • the texture reading unit 76 obtains two reference layers N and N + 1 as layers corresponding to the third texel coordinate w, and obtains a reference map level M as a map level for the specified LOD value.
  • the texture reading unit 76 starts from the first texture 51c specified by the first reference layer N and the map level M, and the texet nearest to the point represented by the texel coordinate value (u, V). Read 53c. Further, the texture reading unit 76 reads the texel 53d that is nearest to the point represented by the texel coordinate value (u, V) from the first texture 51d specified by the second reference layer N + 1 and the map level M. .
  • the filter 74 corresponds to the texel coordinate value (u, V, w) by linearly interpolating the value of the texel 53c of the first reference layer N and the value of the texel 53d of the second reference layer N + 1.
  • the interpolation value to be calculated is calculated.
  • FIG. 7 is a flowchart for explaining the procedure of the texture mapping process by the texture unit 70.
  • the shader unit 30 designates texel coordinate values (u, V, w) and LOD values for referring to the texture structure 52 to the texture unit 70 (S10).
  • the LOD value input from the shader unit 30 is called an external LOD value in order to distinguish it from an internal LOD value on the drawing surface determined by a deviation of texel coordinates described later.
  • the external LOD value is determined according to the Z value of the drawing object.
  • the cedar unit 30 issues a texture set command tset in which the external LOD value and the third texel coordinate value w are specified as parameters, and then the two-dimensional texel coordinate values (u, V ) Issue a texture load instruction tld with parameter specified.
  • the texture unit 70 starts the texture mapping operation.
  • the texture unit 70 converts the data type of the input parameter.
  • the shader unit 30 performs operations with floating-point numbers, but the texture unit 70 uses a fixed decimal number that can execute calculations quickly in order to efficiently use the texture mapping hardware. Therefore, the texture unit 70 converts the data type of parameters such as the input texel coordinates to a floating point force fixed point.
  • the filter 74 calculates a deviation indicating the inclination in the u direction and the V direction in the texel coordinates (u, V) as follows (S12). [0063] In the drawing area of 2 pixels vertically and horizontally, the texel coordinates of 4 pixels (X, y), (x + 1, y), (x, y + 1), (x + 1, y + 1) are (UO, VO) ), (Ul, VI), (U2, V2), (U 3, V3).
  • the filter 74 obtains the change amounts d uZdx, du / dy, dvZdx, and dvZdy of the texel coordinates (u, v) with respect to the change of the pixel coordinates (X, y) by the deviation of the following equation.
  • du / dx ((Ul— UO) + (U3-U2)) / 2
  • du / dy ((U2-U0) + (U3-Ul)) / 2
  • the filter 74 uses the texel coordinates as follows:
  • the LOD value at (u, V) is calculated (S14).
  • the LOD value of the texel coordinates (u, V) calculated in this way is referred to as an internal LOD value in a sense that distinguishes it from an external LOD value specified from the shader unit 30.
  • the filter 74 adds the external LOD value as an offset to the internal LOD value.
  • the LOD value offset by the external LOD value is called the bias LOD value.
  • the filter 74 selects a filter for rendering the texture according to the bias LOD value (S16).
  • the bias LOD value is less than or equal to a predetermined value, that is, if the drawing detail level is less than or equal to a predetermined level, select the enlargement filter that performs texture enlargement, otherwise In this case, that is, when the drawing detail level is higher than a predetermined level, a reduction filter for reducing the texture is selected.
  • the filter 74 performs correction processing at the map level (S18).
  • Texture unit 70 First, the map level is obtained from the bias LOD value obtained in step S14. When interpolation is not performed between the map levels, 0.5 is added to the noisy LOD value and rounded to an integer value to obtain the mix level M closest to the LOD value. When interpolating between map levels, the value obtained by rounding the bias LOD value to an integer value is obtained as the first mip level M, and the value obtained by adding 1 to the first mip level is obtained as the second mip level M + 1. This gives two map levels near the bias L OD value.
  • the filter 74 corrects the texel coordinate value (u, V) and the texture size based on the map level M thus obtained.
  • the texel coordinate value (u, V) is specified for the texture at the texture level 0, so when referring to the texture at the texture level M, it must be corrected to a value corresponding to the texture size at the texture level M.
  • the first and second texel coordinate values u and V corresponding to the mitsu level M are obtained by dividing the first and second texel coordinate values u and V at the original mip level 0 by 2 M , respectively. Since the w direction is independent of the map level, the third texel coordinate value w is not corrected.
  • the filter 74 corrects the texture size of the mix level 0 set in the register file 72 to a size corresponding to the mix level M. This is obtained by dividing the height and width of the original map level 0 texture by 2M each.
  • the texture reading unit 76 obtains a texel number that designates a texel in the two-dimensional texture of the texture structure 52 (S20).
  • the texel number is a two-dimensional array index that specifies the texels in the texture.
  • the texel coordinate value (u, V) is a real value, but the texel number is represented by a subscript (i, j) obtained by rounding the texel coordinate value (u, V) to an integer.
  • the texel number near the point indicated by the texel coordinate (u, V) is specified by the texel number, the texel number is (i, j), (i + 1, j), (i, j + l), ( i + 1, j + 1)).
  • a third index k that specifies the layer number and a fourth index m that specifies the map level are further added.
  • the texel number is represented by (i, j, k, m).
  • the texel number is represented by (i, j, k, m).
  • the filter 74 calculates an interpolation coefficient used for filtering (S22).
  • the interpolation coefficient is given by the fractional part of the first and second texel coordinate values u and V corrected to correspond to the map level M.
  • the interpolation factor in the u direction is the fractional part of the value of the first texel coordinate u at the map level M
  • 8 in the V direction is the fractional part of the value of the second texel coordinate V at the mapping level M.
  • the interpolation coefficient ⁇ in the w direction is given by the decimal part of the value of the third texel coordinate value w.
  • the interpolation factor ⁇ in the map level direction is given by the fractional part of the bias LOD value.
  • the texture reading unit 76 calculates a texture reference address (S24).
  • the texture readout unit 76 sets the texture size of each map level belonging to each layer to the base address of the texture structure 52 set in the register file 72 during configuration, with the layer number N and the map map level M. By adding until the address is reached, the address for referring to the texture of the specified layer number N and map level M is calculated.
  • the texture reading unit 76 samples the texel designated by the texel number obtained in step S20 based on the texture reference address obtained in step S24 (S26). In the case of point sampling, one texel is sampled. When bilinear interpolation is performed, four neighboring texels are sampled.
  • the filter 74 filters the sampled texels by bilinear interpolation, trilinear interpolation, or the like (S28).
  • the filter 74 converts the interpolation value obtained by the filtering into a floating point handled by the cedar unit 30 and outputs it (S30).
  • the force texel coordinates which are not described in the procedure of the texture mapping process, are performed as either a clamp process or a repeat process as a wrap mode when the texel coordinates are at a position where the texture is not sampled.
  • the texture image may cross the edge of the image, so wrap mode processing is required.
  • the clamping process the texel coordinates are clamped within a predetermined value range.
  • repeat processing texel numbers are circulated. By doing so, it is handled so that the same texture is repeated.
  • the texture structure 52 used by the drawing processing apparatus 100 of the present embodiment described above can be referred to in a unified manner using three-dimensional texel coordinates (u, V, w).
  • Force which is a collection of multiple 2D textures, can be freely used according to the application, regardless of the relationship between multiple 2D textures, or without any relationship. can do.
  • the texture structure 52 can be used as a so-called “layer texture”.
  • a layer texture is formed by layering multiple 2D textures in relation to each other.
  • the textures may be layered.
  • the third texel coordinate w is used to specify the layer number.
  • the “layer” t used in the description of the texture structure 52 in the above embodiment is “layer texture” and does not simply mean a layer in a narrow sense. This is used to identify the position of a plurality of two-dimensional textures arranged side by side in the texture structure 52.
  • the texture structure 52 may be used as a so-called “volume texture”.
  • a volume texture has a depth relationship between multiple 2D textures, and is configured as a texture with a depth dimension in addition to the width and height.
  • the third texel coordinate w is used to specify the depth value.
  • the layers of texture structure 52 correspond to depth, so interpolation between layers makes sense.
  • the maximum number of layers of the texture structure 52 is limited to 8, 16, 32, etc. depending on the implementation of the hardware.
  • the texture structure 52 is a volume texture. When using it, you may want to further increase the depth direction.
  • the noise generation algorithm by Perlin generates a number of noise textures and overlays them to create a texture.
  • Such a three-dimensional texture may require, for example, 64 layers as the depth direction.
  • the texel component of each texture of the texture structure 52 is By using it as a layer, the number of layers can be increased.
  • the cedar unit 30 executes a texture command specifying a value from 0 to 63 as the third texel coordinate value w.
  • the texture reading unit 76 calculates a quotient and a remainder obtained by dividing the third texel coordinate value w by 4, and the quotient 0 to 15 The layer number up to is obtained, and the component number is obtained by the remainder.
  • the texture reading unit 76 can sample the corresponding texel from the texture structure 52 by referring to the designated component in the texture of the designated layer using the acquired layer number and component number.
  • the texture structure 52 is generally described as a collection of a plurality of independent two-dimensional textures, and has been described as being usable as a so-called “layer texture” or “volume texture”.
  • the structure 52 can also be used to store six-sided environment textures used in cube environment mapping (hereinafter simply referred to as cube mapping).
  • cube mapping six-sided environment textures used in cube environment mapping
  • FIG. 8 is a diagram showing a virtual cube surrounding a drawing object in cube mapping and its surface.
  • cube mapping as shown in the figure, each plane is parallel to the xy, yz, and zx planes of the world coordinate system (X, y, z) defined in the field coordinate space where the drawing target exists.
  • a virtual cube is assumed.
  • the orientation of each face of the virtual cube has six directions: positive X, negative X, positive Y, negative ⁇ , positive ⁇ , and negative ⁇ . These six directions identify each face of the virtual cube.
  • the environmental texture that is mapped onto the object to be drawn is projected.
  • FIG. 9 is a development view of the virtual cube of FIG. 8, and each axis S, T of texture coordinates (S, ⁇ )
  • FIG. 6 is a diagram for explaining a correspondence relationship between the direction of each axis x, y, and z in the world coordinates (x, y, z).
  • the S and T axes of texture coordinates (S, T) are defined in the direction shown in the figure.
  • the texture coordinate S-axis is in the negative direction of the world coordinate z-axis (one z)
  • the texture coordinate T-axis is in the negative direction of the world coordinate y-axis (one y) .
  • the S-axis is in the positive z-axis direction of the world coordinate (z)
  • the T-axis is in the negative y-axis direction of the world coordinate (one y).
  • the S-axis and T-axis of the positive Y-plane are in the positive direction (X) of the X-axis of the world coordinate and the positive direction (z) of the z-axis, respectively,
  • the T axis is in the positive direction (X) of the X axis and the negative direction of the z axis (one z), respectively, in world coordinates.
  • the S axis and T axis of the positive Z plane are in the positive direction (X) of the X axis of the world coordinate and the negative direction of the y axis (one y), respectively, and the S axis and T axis of the negative Z plane Are in the negative direction of the world coordinate X-axis (one X) and in the negative y-axis direction (one y), respectively.
  • a reflection vector r on the drawing surface is calculated, and it is determined which surface of the virtual cube the direction of the reflection vector r intersects.
  • the surface of the virtual cuboid where the reflection vectors r intersect is called the target surface.
  • the target surface is the cube surface pointed to by the maximum component (referred to as the major component) of the reflection vector.
  • the major component of the reflection vector r and the major axis direction are determined.
  • the major axis direction is the positive direction of the X axis (this is denoted as + VX)
  • the major component is the X component vx of the reflection vector.
  • the major axis direction is the negative direction of the X axis (one VX), and the major component is the X component of the reflection vector.
  • the major axis direction is + VY and the major component is vy.
  • the major axis direction is VY and the major component is vy.
  • the major axis direction is + VZ and the major component is vz.
  • the major axis direction is 1 VZ and the major component is vz.
  • the point at which the end point (vx, vy, vz) of the reflection vector r is projected on the target surface in the major axis direction Is a texture point mapped to the drawing surface, and the texture coordinates (Sc, Tc) of the point are expressed using the component of the reflection vector.
  • the S-axis and T-axis of the texture coordinates on each cube plane may be opposite to the corresponding axes of the world coordinates.
  • the texture coordinates S-axis and T-axis are the -z direction and -y direction, respectively, as explained in Figure 9.
  • (Sc, Tc) is given by ( ⁇ vz, —vy) using the z and y components of the reflection vector.
  • the texture coordinates can be similarly expressed using the component of the reflection vector r.
  • FIG. 10 is a diagram collectively showing the correspondence between the target surface, the texture coordinates (Sc, Tc) on the target surface, and the major components.
  • the major axis direction is + VX
  • the target plane is positive X
  • Sc is vz
  • Tc is -V y
  • the major component is vx. If the major axis direction is VX, the target surface is negative X, Sc is vz, Tc is 1 vy, and the major component is vx.
  • the major axis direction is + VY
  • the target plane is positive Y
  • Sc is vx
  • Tc is ⁇
  • the major component is vy. If the major axis direction is —VY, the target surface is negative Y, Sc is vx, Tc is 1 vz, and the major component is vy.
  • the major axis direction is + VZ
  • the target plane is positive Z
  • Sc is vx
  • Tc is -vy
  • the major component is vz. If the major axis direction is -VZ, the target surface is negative Z, Sc is vx, Tc is 1 vy, and the major component is vz.
  • FIGS. 11A to 11D are diagrams illustrating a method of using the texture structure 52 as a cube map.
  • FIG. 11 (a) is a diagram showing a data structure of the texture structure 52 for cube maps.
  • the layer direction of the texture structure 52 is associated with a cube surface, and each layer stores a cube map that is an environmental texture of each surface of the virtual cube as a two-dimensional texture.
  • the number of layers of the texture structure 52 is 6 corresponding to the six faces of the virtual cube. Ray The number corresponds to the map ID that identifies the cube face.
  • the map ID corresponds to the major axis direction. If the major axis direction is determined, the cube map of each face can be selected by the corresponding map ID. As shown in the figure, the map axes + VX, —VX, + VY, —VY, + VZ, —VZ are associated with map IDO to 5 as shown in the figure. . Each map level is provided with a cube map with different resolutions. Here, examples of three levels of resolution of map levels 0 to 2 are shown.
  • FIG. 11 (b) is a diagram showing the correspondence between the texture of each layer of the map level 0 and each surface of the virtual cube.
  • the texture of the map IDO (referred to as map 0) in Fig. 11 (a) corresponds to the environmental texture of the positive X plane of the virtual cube in Fig. 11 (b).
  • the texture with map ID 1 (Map 1) corresponds to the environment texture of the negative X plane of the virtual cube.
  • Map 2, Map 3, Map 4, and Map 5 correspond to the environmental textures of the virtual cube's positive Y, negative Y, positive Z, and negative Z surfaces, respectively.
  • FIG. 11 (c) is a diagram showing the correspondence between the texture of each layer of the map level 1 whose resolution is 1Z2 compared to the map level 0 and each surface of the virtual cube.
  • Fig. 11 (d) is a diagram showing the correspondence between the texture of each layer of the map level 2 whose resolution is 1/4 compared to the map level 0 and each surface of the virtual cube. The correspondence between layers and cube surfaces is the same as in Fig. 11 (b).
  • the map ID can be specified by the third texel coordinate w as in the case of specifying the layer number. Therefore, cube mapping using a map map can be performed using a texture command that specifies 3D texel coordinates (u, V, w) and LOD values.
  • FIG. 12 is a flowchart for explaining the procedure of cube mapping processing by the drawing processing apparatus 100.
  • the drawing operation processing unit 34 of the cedar unit 30 calculates the reflection vector r of the drawing surface.
  • the drawing arithmetic processing unit 34 calculates the major axis direction corresponding to the map ID and the texture coordinates (Sc, Tc) on the target surface ( S42). This is as explained in FIG.
  • the drawing calculation processing unit 34 converts the texture coordinates (Sc, Tc) to texel coordinates (u, v).
  • the texel coordinates (u, V) are normalized by dividing the texture coordinates (Sc, Tc) by the absolute value I major
  • values that match the texture width and height values set in the register file 72 of the texture unit 70 are also set in the register file 32 of the shader unit 30, and the drawing operation processing unit is set. 34 can be referenced from register file 32.
  • the drawing calculation processing unit 34 obtains the three-dimensional texel coordinates (u, V, w) composed of the two-dimensional texel coordinates (u, V) thus obtained and the third texel coordinates w specifying the map ID.
  • the texture command specified in the parameter is issued to the texture unit 70.
  • the drawing operation processing unit 34 issues a texture set command tset in which the external LOD value and the third texel coordinate value w, which is a map ID, are specified as parameters, and then the secondary processing is performed. Issue texture load instruction tld with original texel coordinate value (u, V) as parameter. In response to the issue of the texture load instruction tld, the texture unit 70 starts the texture mapping operation.
  • the texture unit 70 performs cube mapping processing using the texture structure 52 based on the three-dimensional texel coordinates (u, V, w) and the external LOD value specified by the drawing operation processing unit 34. (S46).
  • This cube mapping process can be performed in the same manner as the texture mapping process shown in the flowchart of FIG. 7 except that the third texel coordinate w indicates the map ID. Note that in cube mapping, interpolation between layers does not make sense and is not performed.
  • the 3D texel coordinates (u, V, w) are designated and texels are sampled from the texture structure 52 and interpolated.
  • the third texel coordinate w is generally a plurality of coordinates included in the texture structure 52.
  • texture structure 52 is used as a layer texture
  • texture structure 52 is used as a volume texture to specify the layer number.
  • the texture structure 52 layer is associated with a cube surface, the texture structure 52 can also be handled as a texture containing a six-sided cube map, and the cube surface can be specified as the third texel coordinate. Then you can do cube mapping.
  • the texture structure 52 can be handled as a collection of a plurality of independent 2D textures, or a layer texture in which 2D textures are formed in layers. Can be handled as a volume texture with a dimension in the depth direction, or as a six-sided cube map texture, so the same hardware configuration for texture mapping that processes the texture structure 52
  • This interface can be used for both layer texture, volume texture, and cube map texture. Therefore, the circuit scale of the texture unit 70 can be kept small, and resource management such as registers, caches, and memories in the texture unit 70 can be facilitated. In addition, because the interface is unified, programming of the texture mapping process is easy.
  • various parameters such as address information for referring to the texture structure 52 and filtering mode of texture mapping using the texture structure 52 can be set in the register file by one configuration. . Even if the layer is switched and the two-dimensional texture in the texture structure 52 is referred to, texture mapping can be performed efficiently without register setting information, that is, without context switching overhead. In addition, since the texture structure 52 can use a plurality of textures, high rendering quality can be realized. Thus, according to the present embodiment, it is possible to improve the drawing quality by using a plurality of textures while maintaining the processing efficiency.
  • the calculation of the reflection vector and the calculation of the reflection vector force to obtain the texel coordinates is performed by the shader unit 30.
  • the texture unit 70 performs processing for sampling and interpolating the texel values with reference to the row and the cube map. Since the texture unit 70 has a hardware configuration dedicated to texture mapping by an interpolation calculator, it has high texture calculation capability.
  • the shader unit 30 has a capability of executing a complicated calculation process by a program, and can execute a complicated calculation such as calculation of a reflection vector at high speed.
  • processing that requires a high level of computing capability among cube mapping processing is performed by the shader unit 30, and processing related to texture calculation is performed by the dedicated texture unit 70.
  • the processing is shared and the efficiency of the drawing processing of the entire drawing processing apparatus 100 can be improved.
  • the inter-layer interpolation and the inter-map level interpolation may be performed by using two or more layers or a mix level between two layers and a force performed between two map levels. Good. Also, the number of texels to be sampled is not limited to four nearby texels. It is also possible to sample 8 neighboring texels and compensate between those texels.
  • force anisotropic filtering describing isotropic texel sampling may be performed.
  • Anisotropic texel sampling is particularly effective when the UV plane of texel coordinates is large relative to the XY plane of the screen.
  • anisotropic texel sampling the magnitude and direction of changes in the texel coordinates on the XY plane of the screen are obtained, and point sampling, bilinear sampling, trilinear sampling, etc. are repeated in the direction of the change according to the magnitude of the change. To maintain the drawing quality.
  • the present invention can be applied to the field of drawing processing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

 シェーダユニット30の描画演算処理部34は、テクスチャ構造体52を参照するための3次元テクセル座標値(u,v,w)を指定したテクスチャ命令をテクスチャユニット70に対して発行する。テクスチャユニット70のテクスチャ読み出し部76は、シェーダユニット30から3次元テクセル座標値(u,v,w)を受け取り、テクスチャ構造体52の内、第3テクセル座標値wに対応するテクスチャから2次元テクセル座標(u,v)に対応するテクセル値を読み出す。フィルタ74は、レジスタファイル72に設定されたフィルタリングモードにしたがって、テクスチャ読み出し部76により読み出されたテクセル値の補間を行い、補間値をシェーダユニット30の描画演算処理部34に与える。

Description

明 細 書
テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法 技術分野
[0001] この発明は、描画データを演算処理するテクスチャ処理装置、描画処理装置、およ びテクスチャ処理方法に関する。
背景技術
[0002] 3次元コンピュータグラフィックスでは、一般的に 3次元空間のオブジェクトを多数の ポリゴンにより表現するポリゴンモデルが利用される。ポリゴンモデルの描画処理にお いて、光源、視点位置、物体表面の反射率などを考慮してポリゴン表面に陰影をつ けるシェーディングが行われる。また、写実性の高い画像を生成するために、ポリゴン モデルの表面にテクスチャ画像を貼り付けるテクスチャマッピングが行われる。
[0003] テクスチャマッピングに使われるテクスチャは、通常は 2次元テクスチャである力 よ り質感の高 、表現をするために、奥行き方向にもテクスチャをもたせたボリュームテク スチヤが使われることがある。ボリュームテクスチャは、描画対象物の断面を描画した り、雲や炎のような 3次元構造をもつ描画対象物や半透明の描画対象物にテクスチャ をマッピングするために用いられる。
[0004] また、周囲の環境をテクスチャとして描画表面に映り込ませる環境マッピングが行わ れることがある。描画対象物を囲む仮想立方体の各面に環境テクスチャをあら力じめ 投影しておき、立方体の各面の環境テクスチャを描画表面に写像するキューブ環境 マッピングでは、環境テクスチャは 6面のキューブマップの構成になる。
発明の開示
発明が解決しょうとする課題
[0005] このように、テクスチャマッピングの手法によってテクスチャにはいろいろな種類があ り、その手法に特有のテクスチャ演算を専用に実行できるハードウェアを設けると、描 画処理装置の回路規模が大きくなり、装置コストが高くなる。また、テクスチャマツピン グ手法に応じてハードウェアを構成すると、レジスタやメモリなどの資源管理も複雑に なる。また、各種テクスチャを利用するために特有のパラメータを設定したり、特有の 命令を実行するなど、プログラミングの手間も力かる。
[0006] 本発明はこうした課題に鑑みてなされたものであり、その目的は、各種テクスチャを 統一的に利用することができるリソース管理の面で優れた描画処理技術を提供する ことにある。また、別の目的は、複数のテクスチャを効率良く切り替えて利用すること のできる描画処理技術を提供することにある。
課題を解決するための手段
[0007] 上記課題を解決するために、本発明のある態様のテクスチャ処理装置は、テクスチ ャに関する値を 2次元パラメータ座標に対応づけてテクセル値として格納した 2次元 テクスチャが複数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを指定する ための第 3パラメータが前記 2次元パラメータ座標における第 1および第 2パラメータ とは別に設けられたテクスチャ構造体を格納するテクスチャ記憶部と、描画対象物の 表面に適用されるテクスチャについて前記第 3パラメータの指定と前記表面上の 2次 元パラメータ座標値の指定とを受け、前記テクスチャ構造体の内、指定された前記第 3パラメータに対応する前記 2次元テクスチャから、指定された前記 2次元パラメータ 座標値に対応するテクセル値を読み出すテクスチャ読み出し部と、読み出された前 記テクセル値を補間して、前記描画対象物の表面に適用されるテクスチャに関する 値を算出するフィルタとを含む。前記第 3パラメータとして、前記テクスチャ構造体に 含まれる前記複数の 2次元テクスチャ間の関連性に応じた値が指定されることにより、 異なる種類の前記テクスチャ構造体が統一的に参照される。
[0008] ここで、テクスチャが描画対象物の表面に適用されるとは、テクスチャのカラー値な どが描画面にマッピングされることの他、テクスチャに関する値、たとえば法線べタト ルの値や関数値などが描画面に適用されることも含む趣旨である。
[0009] 本発明の別の態様は、描画処理装置である。この装置は、テクスチャに関する値を 2次元パラメータ座標に対応づけてテクセル値として格納した 2次元テクスチャが複 数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを指定するための第 3パラ メータが前記 2次元パラメータ座標における第 1および第 2パラメータとは別に設けら れたテクスチャ構造体を格納するテクスチャ構造体を格納するテクスチャ記憶部と、 描画対象物の表面に適用されるテクスチャについて前記第 3パラメータの指定と前記 表面上の 2次元パラメータ座標値の指定とを受け、前記テクスチャ構造体の内、指定 された前記第 3パラメータに対応する前記 2次元テクスチャから、指定された前記 2次 元パラメータ座標値に対応するテクセル値を読み出して、前記描画対象物の表面に 適用されるテクスチャに関する補間値を算出するテクスチャ処理部と、前記テクスチャ 処理部から出力される前記テクスチャに関する補間値を用いて、前記描画対象物の 描画演算処理を行う描画処理部とを含む。前記テクスチャ構造体は、前記描画対象 物の存在する空間内に仮想的に設けられた立方体の面に投影された環境テクスチ ャを面数だけ設けた構造を有する。前記描画処理部は、前記描画対象物の表面の 反射ベクトルにもとづ 、て、前記表面に写像される環境テクスチャの面番号とその面 内における 2次元パラメータ座標値とを求め、求めた面番号を前記第 3パラメータとし て 2次元パラメータ座標値とともに前記テクスチャ処理部に対して指定し、前記テクス チヤ処理部は、前記テクスチャ構造体の内、前記描画処理部により前記第 3パラメ一 タとして指定された前記面番号に対応する環境テクスチャから、前記描画処理部によ り指定された前記 2次元パラメータ座標値に対応するテクセル値を読み出し、前記描 画対象物の表面に適用されるテクスチャに関する補間値を算出する。
[0010] 本発明のさらに別の態様は、テクスチャのデータ構造である。このテクスチャのデー タ構造は、テクスチャに関する値を 2次元パラメータ座標に対応づけてテクセル値とし て格納した 2次元テクスチャが複数設けられ、前記複数の 2次元テクスチャの少なくと も 1つを指定するための第 3パラメータが前記 2次元パラメータ座標における第 1およ び第 2パラメータとは別に設けられた構造体を有し、前記 2次元パラメータ座標値およ び前記第 3パラメータを指定したテクスチャの読み出し命令により、指定された第 3パ ラメータに対応する前記 2次元テクスチャから、指定された前記 2次元パラメータ座標 値に対応する前記テクセル値のサンプリングが可能に構成され、前記第 3パラメータ として、前記構造体に含まれる前記複数の 2次元テクスチャ間の関連性に応じた値が 指定されることにより、異なる種類の前記構造体の統一的な参照が可能に構成され てなる。
[0011] 本発明のさらに別の態様は、テクスチャ処理方法である。この方法は、テクスチャに 関する値を 2次元パラメータ座標に対応づけてテクセル値として格納した 2次元テクス チヤが複数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを指定するための 第 3パラメータが前記 2次元パラメータ座標における第 1および第 2パラメータとは別 に設けられたテクスチャ構造体を保持したテクスチャメモリに対して、描画対象物の 表面に適用されるテクスチャについて前記第 3パラメータと前記表面上の 2次元パラ メータ座標値を指定したテクスチャの読み出し命令を実行することにより、指定された 前記第 3パラメータに対応する前記 2次元テクスチャから、指定された前記 2次元パラ メータ座標値に対応するテクセル値をサンプリングするステップと、サンプリングされ た前記テクセル値を補間して、前記描画対象物の表面に適用されるテクスチャに関 する値を算出するステップとを含み、前記第 3パラメータとして、前記テクスチャ構造 体に含まれる前記複数の 2次元テクスチャ間の関連性に応じた値が指定されることに より、異なる種類の前記テクスチャ構造体が統一的に参照される。
[0012] なお、以上の構成要素の任意の組合せ、本発明の表現を方法、装置、システム、コ ンピュータプログラム、データ構造などの間で変換したものもまた、本発明の態様とし て有効である。
発明の効果
[0013] 本発明によれば、テクスチャマッピングの利便性を高めるとともに、テクスチャ処理 の効率を向上させることができる。
図面の簡単な説明
[0014] [図 1]実施の形態に係る描画処理装置の構成図である。
[図 2]図 1のシエーダユニットおよびテクスチャユニットの構成を示す図である。
[図 3]図 2のテクスチャ構造体のデータ構造を説明する図である。
[図 4]バイリニアサンプリングを説明する図である。
[図 5]ミツプマップの解像度レベル間のトライリニアサンプリングを説明する図である。
[図 6]レイヤ間のモノリニアサンプリングを説明する図である。
[図 7]実施の形態に係るテクスチャユニットによるテクスチャマッピング処理の手順を 説明するフローチャートである。
[図 8]キューブマッピングにおける描画対象物を囲む仮想的な立方体とその面を示す 図である。 [図 9]図 8の仮想立方体の展開図において、テクスチャ座標の各軸の方向とワールド 座標の各軸の方向の対応関係を説明する図である。
[図 10]キューブマッピングにおけるターゲット面、ターゲット面上のテクスチャ座標、お よびメジャー成分の対応関係をまとめて示す図である。
[図 11]テクスチャ構造体をキューブマップとして用いる方法を説明する図である。
[図 12]実施の形態に係る描画処理装置によるキューブマッピング処理の手順を説明 するフローチャートである。
符号の説明
[0015] 10 ラスタライザ、 30 シエーダユニット、 32 レジスタファイル、 34 描画演算 処理部、 50 メモリ、 52 テクスチャ構造体、 54 描画データ、 70 テクスチャ ユニット、 72 レジスタファイル、 74 フィルタ、 76 テクスチャ読み出し部、 10 0 描画処理装置。
発明を実施するための最良の形態
[0016] 図 1は、実施の形態に係る描画処理装置 100の構成図である。描画処理装置 100 は、 3次元モデル情報にもとづ 、て 2次元画面に表示するための描画データを生成 するレンダリング処理を行う。
[0017] ラスタライザ 10は、メモリもしくは他のプロセッサや頂点シエーダなど力も描画対象と なるプリミティブの頂点データを取得し、描画するスクリーンに対応したピクセル情報 に変換する。描画プリミティブは、 3次元オブジェクトをポリゴンモデルで表した場合の 点、線、三角形、四角形などの幾何学図形の描画単位であり、頂点単位で表される データである。ラスタライザ 10は、 3次元空間上の描画プリミティブを投影変換により 描画平面上の図形に変換するビュー変換を行い、さらに、描画平面上の図形を描画 平面の水平方向に沿ってスキャンしながら、 1列毎に量子化されたピクセルに変換す る。
[0018] ラスタライザ 10により、描画プリミティブがピクセル展開され、各ピクセルについて、 RGB3原色で表されるカラー値、透明度を示すアルファ値、奥行きを示す Z値、テク スチヤ属性を参照するためのパラメータ座標である UV座標値などを含むピクセル情 報が算出される。 [0019] ラスタライザ 10は、 1つ以上のピクセルを含む所定サイズのピクセル集合の単位で 上記のラスタライズ処理を行 ヽ、ラスタライズ処理後のピクセル集合をバッファリングし ながら、ピクセル集合の単位でシエーダユニット 30に順次供給する。ラスタライザ 10 カもシエーダユニット 30に供給されたピクセル集合は、シエーダユニット 30にお!/、て パイプライン処理される。ピクセル集合は、ラスタライザ 10がー度に処理するピクセル をまとめたものであり、ラスタライズ処理の単位であり、また同時に、シヱーダユニット 3 0における描画演算処理の単位にもなつている。
[0020] シエーダユニット 30は、非同期動作する複数のピクセルシエーダを含み、それぞれ が担当するピクセル集合を処理することでピクセルの描画処理を並列に実行する。シ エーダユニット 30は、ラスタライザ 10からピクセル集合単位で分配されるピクセル情 報をもとに、シェーディング処理を行ってピクセルのカラー値を求め、さらに、テクスチ ャマッピングを行う場合は、テクスチャユニット 70から得られるテクスチャのカラー値を 合成して最終的なピクセルのカラー値を算出し、メモリ 50にピクセルデータを書き込 む。
[0021] テクスチャユニット 70は、シエーダユニット 30において処理されるピクセルにテクス チヤデータをマッピングする処理を行う。本実施の形態では、テクスチャユニット 70は 、複数の 2次元テクスチャを設けたテクスチャ構造体 (以下、単に「テクスチャ構造体」 と呼ぶ)を利用する。テクスチャ構造体に含まれる 2次元テクスチャには、テクスチャの カラー値などの属性値が 2次元パラメータ座標 (u, V)に対応づけてテクセル値として 格納される。
[0022] なお、テクスチャ構造体に含まれる 2次元テクスチャは、特別な場合として、テクセ ルの位置座標として第 1パラメータ uだけをもたせた 1次元テクスチャであってもよい。 2次元テクスチャにおいて、第 2パラメータ Vが常に 0であるとして、 V方向を無視するこ とで、 1次元テクスチャを 2次元テクスチャの特殊な場合として扱うことができる。そこで 、以下では、特殊な場合として 1次元テクスチャも含める趣旨でテクスチャの次元を一 般的に 2次元として説明する。
[0023] テクスチャ構造体に含まれる複数の 2次元テクスチャの少なくとも 1つ力 テクセル 値を参照するために、テクスチャ構造体に含まれる 2次元テクスチャの少なくとも 1つ を指定するための第 3パラメータ wが、テクセル位置を指定する 2次元パラメータ座標 (u, V)における第 1パラメータ uおよび第 2パラメータ Vとは別に設けられる。
[0024] ポリゴン面上のピクセルにマッピングされるテクスチャは、第 3パラメータ wとポリゴン 面上に定義される 2次元パラメータ座標 (u, V)との組み合わせた 3次元パラメータ座 標 (u, V, w)によって指定される。以下、パラメータ座標をテクセル座標と呼び、第 3 ノ ラメータ wも第 3テクセル座標 wと呼ぶ力 第 3テクセル座標 wは、基本的に、テクス チヤ構造体に含まれる複数の 2次元テクスチャの少なくとも 1つを指定するために使 われる値であり、 2次元テクセル座標は、テクスチャの幅と高さに対応する力 第 3テク セル座標は、必ずしもテクスチャの奥行きに対応するものではないことに留意する。 第 3テクセル座標 wがどのように意味づけられるかは、テクスチャ構造体に含まれる複 数の 2次元テクスチャ間の関連性に依存するからである。
[0025] テクスチャユニット 70は、シエーダユニット 30からピクセルにマッピングされるテクス チヤ構造体の 3次元テクセル座標値 (u, V, w)を取得し、テクスチャ構造体の内、第 3 テクセル座標 wに対応する 2次元テクスチャから 2次元テクセル座標値 (u, V)に対応 するテクセル値を読み出し、読み出したテクセル値を補間し、シエーダユニット 30〖こ その補間値を供給する。
[0026] シヱーダユニット 30は、さらに、メモリ 50に保持された描画データに対して、フオギ ング、アルファブレンデイング等の処理を行い、最終的なピクセルのカラー値を求め、 メモリ 50のピクセルデータを更新する。
[0027] メモリ 50は、シエーダユニット 30により生成されたピクセルデータをスクリーン座標で 格納するフレームバッファとして機能する領域をもつ。フレームバッファに格納された ピクセルデータは、最終描画画像であることも、シェーディング処理過程にある中間 画像であることもある。フレームバッファに記憶されたピクセルデータは、表示装置に 出力されて表示される。
[0028] 図 2は、シエーダユニット 30およびテクスチャユニット 70の構成を示す図である。
[0029] シエーダユニット 30のレジスタファイル 32、テクスチャユニット 70のレジスタファイル 72にはそれぞれ、テクスチャマッピングを行うために必要なコンフィグレーション情報 が設定される。コンフィグレーション情報には、メモリ 50に格納されたテクスチャ構造 体 52を一括して参照するためのベースアドレス、テクスチャマッピングの際のフィルタ リングモードなどの各種パラメータが含まれる。
[0030] シエーダユニット 30の描画演算処理部 34は、レジスタファイル 32に設定されたコン フィグレーシヨン情報にもとづいて、テクスチャ構造体 52からテクスチャを参照するた めの 3次元テクセル座標値 (u, V, w)を指定したテクスチャ命令をテクスチャユニット 70に対して発行することにより、テクスチャユニット 70からピクセルにマッピングされる テクスチャの補間値を取得する。描画演算処理部 34は、テクスチャユニット 70から取 得したテクスチャの補間値をもち 、て最終的なピクセルのカラー値を算出し、描画デ ータ 54としてメモリ 50に書き込む。
[0031] テクスチャユニット 70のテクスチャ読み出し部 76は、シエーダユニット 30から 3次元 テクセル座標値 (u, V, w)を受け取る。テクスチャ読み出し部 76は、レジスタファイル 72に保持されたテクスチャ構造体 52のベースアドレスに、第 3テクセル座標値 wに依 存して決まるオフセット値を加算することにより、指定された第 3テクセル座標値 wに 対応するテクスチャの参照アドレスを生成する。テクスチャ読み出し部 76は、その参 照アドレスで指定されるテクスチャから、レジスタファイル 72に設定されたフィルタリン グモードのしたがって、 2次元テクセル座標 (u, V)に対応するテクセル値を読み出す 。テクスチャ読み出し部 76は、読み出したテクセル値をフィルタ 74に与える。
[0032] なお、テクスチャ読み出し部 76は、メモリ 50に格納されたテクスチャ構造体 52を直 接参照せずに、テクスチャユニット 70内に設けられたキャッシュメモリにキャッシュされ たテクスチャ構造体 52を参照するように構成してもよ 、。
[0033] 描画演算処理部 34は、 3次元テクセル座標値 (u, V, w)以外に、描画対象ォブジ ヱタトの描画詳細度を示す LOD (level of detail)値をパラメータとして指定したテクス チヤ命令を発行することもできる。その場合、テクスチャ読み出し部 76は、ミツプマツ プテクスチャの構造をもつテクスチャ構造体 52にお 、て、 LOD値に対応する解像度
[0034] フィルタ 74は、レジスタファイル 72に設定されたフィルタリングモードにしたがって、 テクスチャ読み出し部 76により読み出されたテクセル値の補間を行い、補間値をシェ ーダユニット 30の描画演算処理部 34に与える。 [0035] フィルタ 74は、多段構成の内挿演算器を用いて、 u、 v2方向のバイリニア補間結果 に対して、さらに w方向またはミツプマップの解像度レベルの方向に補間を行うトライ リニアサンプリングを実行することができる。また、フィルタ 74は、多段構成の内挿演 算器を選択的に機能させることにより、トライリニアサンプリング以外に、モノリニアサ ンプリングやバイリニアサンプリングも実行することができる。
[0036] モノリニアサンプリングでは、第 3テクセル座標 wに対応する 2つの近傍テクスチャの それぞれから、指定テクセル座標 (u, V)の最近傍テクセルがサンプリングされ、 2つ の近傍テクスチャ間で補間される。また、 LOD値が指定された場合は、ミツプマップ の解像度レベルの内、 LOD値に対応する 2つの近傍解像度レベルのテクスチャのそ れぞれから、指定テクセル座標 (u, V)の最近傍テクセルがサンプリングされ、 2つの 近傍解像度レベル間で補間される。
[0037] ノイリ-アサンプリングでは、第 3テクセル座標 wに対応するテクスチャ力も指定テク セル座標 (u, V)の 4近傍テクセルがサンプリングされ、 u、 Vの 2方向に補間される。ま た、 LOD値が指定された場合は、ミツプマップの解像度レベルの内、 LOD値に対応 するテクスチャ力も指定テクセル座標 (u, V)の 4近傍テクセルがサンプリングされ、 u 、vの 2方向に補間される。
[0038] トライリニアサンプリングでは、第 3テクセル座標 wに対応する 2つの近傍テクスチャ のそれぞれから、指定テクセル座標 (u, V)の 4近傍テクセルがサンプリングされ、各 テクスチャで u、 Vの 2方向に補間された上で、 2つの近傍テクスチャ間でさらに補間さ れる。また、 LOD値が指定された場合は、ミツプマップの解像度レベルの内、 LOD 値に対応する 2つの近傍解像度レベルのテクスチャのそれぞれから、指定テクセル 座標(u, V)の 4近傍テクセルがサンプリングされ、各解像度レベルで u、 Vの 2方向に 補間された上で、 2つの近傍解像度レベル間でさらに補間される。
[0039] フィルタ 74は、レジスタファイル 72に設定されたフィルタリングモードによっていず れかの補間に切り替えて実行する。なお、フィルタ 74は、いずれの内挿演算器も機 能させずに、指定テクセル座標 (u, V)の最近傍テクセルをサンプリングしてそのまま 出力するポイントサンプリングも実行することができる。
[0040] さらに、フィルタ 74は、内挿演算器の差分器、乗算器、および加算器の機能構成を 適宜流用して、演算処理に多少の変形を加えることにより、線形補間以外の演算を 行うことも可能であり、ノ ィリニア補間やトライリニア補間以外の有用な演算を行うこと もできる。これにより、フィルタ 74は、後述のテクセル座標 (u, V)の偏差分を求める計 算ゃ、テクセル座標 (u, V)がマッピングされる描画面の LOD値を求める計算を実行 することができる。
[0041] 図 3は、図 2のメモリ 50に格納されたテクスチャ構造体 52のデータ構造を説明する 図である。テクスチャ構造体 52は、既に説明したように、 2次元テクスチャを複数設け たものであり、第 3パラメータ wによりいずれかの 2次元テクスチャを指定できるように 構成されている。ここでは、複数の 2次元テクスチャを格納するデータ構造の一例とし て、複数の 2次元テクスチャが同図の縦方向に配置された構成を説明するが、第 3パ ラメータ wによっていずれかの 2次元テクスチャをアドレス指定できる構成であれば、 複数の 2次元テクスチャのメモリ上での配置の形態は問わない。
[0042] また、以下では、便宜上、同図のように縦方向に並べて配置された複数の 2次元テ タスチヤの縦方向について述べる場合に、「レイヤ」という言葉を使うが、これは、複数 の 2次元テクスチャが層状に関連性をもつことを意味するものではなぐ単に縦方向 の並びの位置を指して!/、るだけである。
[0043] さらに、各レイヤの 2次元テクスチャは、段階的に解像度を異ならせた一組のミツプ マップテクスチャの構造をもつことができる。同図の横方向にはミツプマップの解像度 レベル(以下、単に「ミツプレベル」と!、う)が図示されて!、る。
[0044] ミツプレベル 0について、縦方向に見た場合、レイヤ 0、レイヤ 1、レイヤ 2の順に、高 さと幅が共通するテクスチャ AO、テクスチャ Al、テクスチャ A2が配置される。ミツプレ ベル 1についても、レイヤ 0、レイヤ 1、レイヤ 2の順に、高さと幅が共通するテクスチャ BO、テクスチャ Bl、テクスチャ B2が配置される。ミツプレベル 1のテクスチャ BO〜: B2 の幅と高さはそれぞれ、ミツプレベル 0のテクスチャ A0〜A2の幅と高さの半分である 。同様に、ミツプレベル 2のレイヤ 0〜2に配置されるテクスチャ C0〜C2の幅と高さは それぞれ、ミツプレベル 1のレイヤ 0〜2のテクスチャ BO〜: B2の幅と高さのさらに半分 である。
[0045] 横方向に見た場合、レイヤ 0には、ミツプレベル 0のテクスチャ AO、ミツプレベル 1の テクスチャ B0、ミツプレベル 2のテクスチャ COの順にミツプレベルの異なるテクスチャ が配置されている。同様に、レイヤ 1、レイヤ 2にもミツプレベルの異なるテクスチャが 格納されている。
[0046] テクスチャ構造体 52のレイヤ数およびミツプレベル数は、レジスタファイル 72の設 定により変更可能である。テクスチャ構造体 52にミツプマップテクスチャの構造を設け るかどうかもレジスタファイル 72の設定により選択することができる。ミツプマップテクス チヤを用いな 、場合は、同一サイズの 2次元テクスチャが各レイヤに一つずつ設けら れた構成となる。図 3で言えば、ミツプマップテクスチャを用いないテクスチャ構造体 5 2は、ミツプレベル 0のテクスチャ A0、 Al、 A2だけが存在するデータ構造となる。
[0047] また、テクスチャ構造体 52に、レイヤの構造を設けるかどうかもレジスタファイル 72 の設定により選択可能である。レイヤの構造を設けない場合は、複数のミツプレベル のテクスチャが 1レイヤ分だけ設けられた構成となる。図 3で言えば、レイヤ構造を設 けないテクスチャ構造体 52は、レイヤ 0のテクスチャ AO、 BO、 COだけが存在するデ ータ構造となる。テクスチャ構造体 52には、このようなレイヤが一つでミツプレベルが 複数のテクスチャも特別な場合として含まれる。さらにレイヤが 1つでミツプレベルを設 けない通常の 1枚のテクスチャもテクスチャ構造体 52の特別な場合として扱う。
[0048] テクスチャ読み出し部 76は、メモリ 50に格納されたテクスチャ構造体 52に対して、 レイヤ番号 Nとミツプレベル Mを指定することにより、指定したレイヤ Nに属する指定し たミツプレベル Mのテクスチャを参照する。たとえば、レイヤ 2、ミツプレベル 1を指定 すると、レイヤ 2に属するミツプレベル 1のテクスチャ B1を参照することができる。テク スチヤ読み出し部 76は、指定したレイヤおよびミツプレベルのテクスチャ内において 、 2次元テクセル座標 (u, V)を指定することで、テクスチャのテクセル値をサンプリン グする。
[0049] テクセル値は、テクスチャに関する値として、 RGB3色のカラー値であってもよぐ力 ラー値のインデックスであってもよい。後者の場合は、カラールックアップテーブルを 参照してインデックスが実際のカラー値に変換される。また、テクスチャマッピングの 一例としてバンプマッピングを行う場合は、テクスチャに法線ベクトルを格納すること になり、その場合、テクセル値は法線ベクトルの値である。また、ノ ラメータにもとづい てプログラムによってテクスチャを生成するプロシージャルテクスチャ(procedural text ure)を利用する場合は、テクセル値はパラメータ値や関数値となる。
[0050] 図 4〜図 6を参照して、テクスチャ構造体 52からのテクセル値のサンプリングのいく つかの例を説明する。
[0051] 図 4は、バイリニアサンプリングを説明する図である。テクスチャ読み出し部 76は、 第 3テクセル座標 wに対応するレイヤとして参照レイヤ Nを求め、また、指定された L OD値に対応するミツプレベルとして参照ミツプレベル Mを求める。テクスチャ読み出 し部 76は、参照レイヤ Nと参照ミツプレベル Mにより指定されるテクスチャ 51aから、 テクセル座標値 (u, V)で表される点の近傍にある 4つのテクセル 53aを読み出す。
[0052] フィルタ 74は、この 4近傍のテクセル 53aの値を u方向および V方向に線形補間する ことにより、テクセル座標値 (u, V)に対応する補間値を求める。
[0053] 図 5は、ミツプレベル間のトライリニアサンプリングを説明する図である。テクスチャ読 み出し部 76は、第 3テクセル座標 wに対応するレイヤとして参照レイヤ Nを求め、また 、指定された LOD値に対応するミツプレベルとして、 2つの参照ミツプレベル M、 M + 1を求める。テクスチャ読み出し部 76は、参照レイヤ Nと第 1参照ミツプレベル Mにより 指定される第 1テクスチャ 51aから、テクセル座標値 (u, V)で表される点の近傍にある 4つのテクセル 53aを読み出す。また、テクスチャ読み出し部 76は、参照レイヤ Nと第 2参照ミツプレベル M+ 1により指定される第 2テクスチャ 5 laから、テクセル座標値 (u , V)で表される点の近傍の 4つのテクセル 53bを読み出す。
[0054] フィルタ 74は、第 1参照ミツプレベル Mの 4近傍のテクセル 53aの値と、第 2参照ミツ プレベルの 4近傍のテクセル 53bの値を、 u、 v、ミツプレベルの 3方向に線形に補間 するトライリニア補間を行うことにより、テクセル座標値 (u, V)に対応する補間値を算 出する。
[0055] 図 6は、レイヤ間のモノリニアサンプリングを説明する図である。テクスチャ読み出し 部 76は、第 3テクセル座標 wに対応するレイヤとして、 2つの参照レイヤ N、 N+ 1を 求め、また、指定された LOD値に対するミツプレベルとして参照ミツプレベル Mを求 める。テクスチャ読み出し部 76は、第 1参照レイヤ Nとミツプレベル Mにより指定され る第 1テクスチャ 51cから、テクセル座標値 (u, V)で表される点の最近傍にあるテクセ ル 53cを読み出す。また、テクスチャ読み出し部 76は、第 2参照レイヤ N+ 1とミツプ レベル Mにより指定される第 1テクスチャ 51dから、テクセル座標値 (u, V)で表される 点の最近傍にあるテクセル 53dを読み出す。
[0056] フィルタ 74は、第 1参照レイヤ Nのテクセル 53cの値と、第 2参照レイヤ N+ 1のテク セル 53dの値を線形補間することにより、テクセル座標値 (u, V, w)に対応する補間 値を算出する。
[0057] 図 6において、 2つの参照レイヤ N、 N+ 1の各々において、テクセル座標値(u, v) で表される点の近傍にある 4つのテクセルをサンプリングし、 2つの参照レイヤ N、 N + 1間で11、 v、 wの 3方向に線形補間するトライリニア補間を行うこともできる。
[0058] 図 7は、テクスチャユニット 70によるテクスチャマッピング処理の手順を説明するフロ 一チャートである。
[0059] シエーダユニット 30は、テクスチャユニット 70に対して、テクスチャ構造体 52を参照 するためのテクセル座標値(u, V, w)と LOD値を指定する(S10)。ここで、シェーダ ユニット 30から入力される LOD値は、後述のテクセル座標の偏差分により決まる描 画表面上の内部的な LOD値と区別する意味で、外部 LOD値と呼ぶ。外部 LOD値 は、描画対象物の Z値などに応じて決められる。
[0060] より具体的には、シエーダユニット 30は、外部 LOD値と第 3テクセル座標値 wをパラ メータに指定したテクスチャセット命令 tsetを発行し、その後、 2次元テクセル座標値 ( u, V)をパラメータに指定したテクスチャロード命令 tldを発行する。テクスチャユニット 70は、テクスチャロード命令 tldの発行を受けて、テクスチャマッピングの動作を開始 する。
[0061] テクスチャユニット 70は、入力されたパラメータのデータ型の変換を行う。シエーダ ユニット 30は、浮動小数点数で演算を行うが、テクスチャユニット 70は、テクスチャマ ッビングのハードウェアを効率良く利用するために、計算を速く実行できる固定小数 点数を用いる。そこで、テクスチャユニット 70は、入力されたテクセル座標などのパラ メータのデータ型を浮動小数点力 固定小数点に変換する。
[0062] フィルタ 74は、テクセル座標 (u, V)における u方向、 V方向の傾きを示す偏差分を 次のように算出する(S12)。 [0063] 縦横 2ピクセルの描画領域において、 4ピクセル (X, y)、 (x+ 1, y)、 (x, y+ 1) , ( x+ 1, y+ 1)のそれぞれのテクセル座標が(UO, VO)、 (Ul, VI)、 (U2, V2)、 (U 3, V3)であるとする。
[0064] フィルタ 74は、ピクセル座標(X, y)の変化に対するテクセル座標(u, v)の変化量 d uZdx、 du/dy, dvZdx、 dvZdyを次式の偏差分により求める。
du/dx= ( (Ul— UO) + (U3-U2) ) /2
dv/dx= ( (VI -VO) + (V3 V2) ) /2
du/dy= ( (U2-U0) + (U3-Ul) ) /2
dv/dy= ( (V2-V0) + (V3-Vl) ) /2
[0065] これらの偏差分は、テクセル座標力 Sスクリーンの X方向、 y方向に局所的に変化する 量を示すものであり、テクスチャがマッピングされる曲面の LOD値を求めるために利 用される。
[0066] フィルタ 74は、テクセル座標(u, V)の偏差分にもとづ 、て、次のようにテクセル座標
(u, V)における LOD値を算出する(S14)。
[0067] Px= [ (du/dx) 2+ (dv/dx) 2] 1/2
Py= [ (du/dy) 2+ (dv/dy) 2] 1/2
LOD = log (max (Px、 Py) )
2
[0068] このようにして計算されるテクセル座標(u, V)の LOD値を、シエーダユニット 30から 指定される外部 LOD値と区別する意味で内部 LOD値と呼ぶ。フィルタ 74は、内部 L OD値に外部 LOD値をオフセットとして加算する。外部 LOD値によりオフセットされ た LOD値をバイアス LOD値と呼ぶ。
[0069] フィルタ 74は、バイアス LOD値に応じてそのテクスチャを描画する際のフィルタを 選択する(S16)。フィルタには、縮小フィルタと拡大フィルタがあり、バイアス LOD値 が所定の値以下の場合、すなわち描画詳細度が所定のレベル以下である場合は、 テクスチャの拡大を行う拡大フィルタを選択し、そうでない場合、すなわち描画詳細 度が所定のレベルよりも高 ヽ場合は、テクスチャの縮小を行う縮小フィルタを選択す る。
[0070] フィルタ 74は、ミツプレベルにおける補正処理を行う(S18)。テクスチャユニット 70 は、まずステップ S 14で求めたバイアス LOD値によってミツプレベルを求める。ミツプ レベル間の補間を行わない場合は、ノ ィァス LOD値に 0. 5を加算し、整数値に丸め ることにより LOD値に最も近いミツプレベル Mを求める。ミツプレベル間の補間を行う 場合は、バイアス LOD値を整数値に丸めた値を第 1ミツプレベル Mとして求め、第 1ミ ップレベルに 1を加えた値を第 2ミツプレベル M+ 1として求める。これによりバイアス L OD値の近傍の 2つのミツプレベルが得られる。
[0071] 次に、フィルタ 74は、こうして求めたミツプレベル Mにもとづいてテクセル座標値(u , V)とテクスチャサイズを補正する。テクセル座標値 (u, V)は、ミツプレベル 0のテクス チヤについて指定されたものであるから、ミツプレベル Mのテクスチャを参照するとき は、ミツプレベル Mのテクスチャサイズに対応した値に補正する必要がある。ミツプレ ベル Mに対応した第 1、第 2テクセル座標値 u、 Vは、元のミツプレベル 0における第 1 、第 2テクセル座標値 u、 Vをそれぞれ 2Mで除算することにより得られる。なお、 w方向 はミツプレベルとは無関係であるから、第 3テクセル座標値 wは補正されな 、。
[0072] また、フィルタ 74は、レジスタファイル 72に設定されているミツプレベル 0のテクスチ ャサイズをミツプレベル Mに対応するサイズに補正する。これは元のミツプレベル 0の テクスチャの高さおよび幅をそれぞれ 2Mで除算することにより得られる。
[0073] テクスチャ読み出し部 76は、テクスチャ構造体 52の 2次元テクスチャ内でテクセル を指定するテクセル番号を求める(S20)。テクスチャ内に格納されたテクセルを 2次 元配列とみなしたとき、テクセル番号は、テクスチャ内のテクセルを指定する 2次元配 列のインデックスである。
[0074] テクセル座標値 (u, V)は実数値であるが、テクセル番号は、テクセル座標値 (u, V) を整数に丸めた添え字 (i, j)で表される。テクセル座標 (u, V)で示される点の 4近傍 のテクセルをテクセル番号で指定する場合は、テクセル番号は (i, j)、 (i+ 1, j)、 (i, j + l)、(i+ 1, j + 1)の 4つになる。
[0075] テクスチャ構造体 52の場合、 2次元テクスチャがレイヤ方向とミツプレベル方向に複 数設けられているため、レイヤ番号を指定する第 3インデックス k、ミツプレベルを指定 する第 4インデックス mをさらに追カ卩して、テクセル番号を (i, j, k, m)で表す。たとえ ば、 2つのレイヤ N、 N+ 1の間で内挿を行う場合は、テクセル番号を (i, j, N, M)、( i, j, N+ l, M)と指定する。また、 2つのミツプレベル M、 M+ 1の間で内挿を行う場 合は、テクセル番号を (i, j, N, M)、 (i, j, N, M+ 1)と指定する。
[0076] フィルタ 74は、フィルタリングに使用する内挿係数を算出する(S22)。内挿係数は 、ミツプレベル Mに対応するように補正された第 1、第 2テクセル座標値 u、 Vの小数部 で与えられる。 u方向の内挿係数ひはミツプレベル Mにおける第 1テクセル座標 uの 値の小数部、 V方向の内挿係数 |8はミツプレベル Mにおける第 2テクセル座標 Vの値 の小数部である。また、 w方向の補間、すなわちレイヤ間の内挿を行う場合は、 w方 向の内挿係数 γは、第 3テクセル座標値 wの値の小数部で与えられる。 LOD値に応 じた補間、すなわちミツプレベル間で内挿を行う場合は、ミツプレベル方向の内挿係 数 δは、バイアス LOD値の小数部で与えられる。
[0077] テクスチャ読み出し部 76は、テクスチャの参照アドレスを算出する(S24)。テクスチ ャ読み出し部 76は、コンフィグレーション時にレジスタファイル 72に設定されたテクス チヤ構造体 52のベースアドレスに、各レイヤに属する各ミツプレベルのテクスチャの サイズをレイヤ番号が N、ミツプマップレベルが Mになるまで加算していくことで、指定 されたレイヤ番号 Nおよびミツプレベル Mのテクスチャを参照するためのアドレスを算 出する。
[0078] テクスチャ読み出し部 76は、ステップ S24で得たテクスチャの参照アドレスを基準に して、ステップ S20で得たテクセル番号で指定されたテクセルをサンプリングする(S2 6)。ポイントサンプリングの場合は、 1つのテクセルがサンプリングされる力 バイリニ ァ補間をする場合は、 4近傍テクセルがサンプリングされる。
[0079] フィルタ 74は、サンプリングされたテクセルをバイリニア補間、トライリニア補間など によりフィルタリングする(S28)。フィルタ 74は、フィルタリングにより得られた補間値 をシエーダユニット 30で扱う浮動小数点にフォーマット変換して出力する(S30)。
[0080] 上記のテクスチャマッピング処理の手順では説明を省略した力 テクセル座標がテ タスチヤをサンプルしない位置にあるときのラップモードとして、クランプ処理、リピート 処理のいずれかが行われる。テクセルをサンプリングする際、テクスチャ画像のエッジ をまたがることがあるため、ラップモードの処理が必要となる。クランプ処理では、テク セル座標を所定の値の範囲にクランプする。リピート処理では、テクセル番号を循環 させることで、同じテクスチャが繰り返されるように扱う。
[0081] 以上で述べた本実施の形態の描画処理装置 100が利用するテクスチャ構造体 52 は、一般的には、 3次元テクセル座標 (u, V, w)で統一的に参照できるようにした複 数の 2次元テクスチャの集まりである力 構成上は、複数の 2次元テクスチャ間にいか なる関連性をもたせても、あるいは、何ら関連性をもたせなくてもよぐ用途に合わせ て自由に利用することができる。
[0082] たとえば、テクスチャ構造体 52は、 、わゆる「レイヤテクスチャ」として利用することが できる。レイヤテクスチャは、複数の 2次元テクスチャが互いに関連性をもって層をな して形成されたものであり、アプリケーションによってはテクスチャを層状に重ね合わ せることを前提とすることもある。この場合、第 3テクセル座標 wは、レイヤ番号を指定 するために用いられる。なお、上記の実施の形態でテクスチャ構造体 52を説明する 際に用いた「レイヤ」 t 、う言葉は、「レイヤテクスチャ」で 、うところの狭義の意味での レイヤを意味するものではなぐ単にテクスチャ構造体 52内に並べて配置された複数 の 2次元テクスチャの位置を特定する意味で用いた。
[0083] また、テクスチャ構造体 52は、 、わゆる「ボリュームテクスチャ」として利用することも ある。ボリュームテクスチャは、複数の 2次元テクスチャの間に奥行き方向の関連性を もたせ、幅と高さの他、奥行きの次元をもつテクスチャとして構成される。この場合、第 3テクセル座標 wは、奥行き値を指定するために用いられる。ボリュームテクスチャで は、テクスチャ構造体 52のレイヤは奥行きに対応するため、レイヤ間の補間が意味を なす。
[0084] なお、上記の実施の形態では、テクスチャ構造体 52の最大レイヤ数は、ハードゥエ ァの実装によって、 8、 16、 32などに制限されることになる力 テクスチャ構造体 52を ボリュームテクスチャとして利用する場合、奥行き方向をさらに増やしたいことがある。 たとえば、プロシージャルテクスチャを利用する場合、パーリン (Perlin)によるノイズ生 成アルゴリズムにより、ノイズテクスチャをいくつも生成し、それらを何層にも重ね合わ せることで質感をもたせる。このような 3次元構造のテクスチャでは、奥行き方向として 、たとえば 64レイヤを必要とすることもある。
[0085] このような場合、テクスチャ構造体 52の各テクスチャのテクセルのコンポーネントを レイヤとして利用することで、レイヤ数を増やすことが可能である。テクスチャの各テク セルは、一般には RGB値とアルファ値を格納するために 4コンポーネントをもつ。この コンポーネントをレイヤに対応づけて、各テクセルを 4レイヤの値のセットとして扱うこと にすれば、仮にテクスチャ構造体 52の最大レイヤ数が 16であっても、 16 X 4 = 64レ ィャとして扱うことができる。これにより、ノイズテクスチャとして、 64レイヤの多重化が 可會 になる。
[0086] シエーダユニット 30は、ノイズテクスチャを生成するために、第 3テクセル座標値 wと して、 0から 63までの値を指定したテクスチャ命令を実行することになる。しかし、テク スチヤユニット 70では、あくまでも 16レイヤのテクスチャ構造体 52を処理するため、テ タスチヤ読み出し部 76は、第 3テクセル座標値 wを 4で除算した商と余りを求め、商に よって 0から 15までのレイヤ番号を取得し、余りによつてコンポーネント番号を取得す る。テクスチャ読み出し部 76は、取得したレイヤ番号とコンポーネント番号を用いて、 指定レイヤのテクスチャ内で指定コンポーネントを参照することで、テクスチャ構造体 52から該当するテクセルをサンプリングすることができる。
[0087] 以上、テクスチャ構造体 52を、一般的に、複数の独立した 2次元テクスチャの集まり として説明し、いわゆる「レイヤテクスチャ」や「ボリュームテクスチャ」としても利用でき ることを説明したが、テクスチャ構造体 52は、さらに、キューブ環境マッピング (以下、 単にキューブマッピングという)において使用する 6面の環境テクスチャを格納するた めに用いることもできる。以下、テクスチャ構造体 52を用いて、本実施の形態の描画 処理装置 100によりキューブマッピング処理を行う方法を説明する。
[0088] 図 8は、キューブマッピングにおける描画対象物を囲む仮想的な立方体とその面を 示す図である。キューブマッピングでは、同図のように、描画対象物の存在するヮー ルド座標空間に定義されたワールド座標系(X, y, z)の xy面、 yz面、 zx面に対して各 面が平行である仮想立方体を想定する。仮想立方体の各面の向きは、ポジティブ X、 ネガティブ X、ポジティブ Y、ネガティブ Υ、ポジティブ Ζ、ネガティブ Ζの 6方向であり、 この 6方向により仮想立方体の各面を識別する。立方体の各面には描画対象物に写 像される環境テクスチャがあら力じめ投影されて 、る。
[0089] 図 9は、図 8の仮想立方体の展開図において、テクスチャ座標(S, Τ)の各軸 S、 T の方向とワールド座標 (x, y, z)の各軸 x、 y、 zの方向の対応関係を説明する図であ る。テクスチャ座標(S, T)の S軸、 T軸は、同図に示す方向に定義されている。ポジ ティブ X面については、テクスチャ座標の S軸はワールド座標の z軸の負の方向(一 z) にあり、テクスチャ座標の T軸はワールド座標の y軸の負の方向(一y)にある。ネガテ イブ X面については、 S軸はワールド座標の z軸の正の方向(z)、 T軸はワールド座標 の y軸の負の方向(一 y)にある。
[0090] 同様に、ポジティブ Y面の S軸、 T軸は、それぞれワールド座標の X軸の正の方向(X )、 z軸の正の方向(z)にあり、ネガティブ Y面の S軸、 T軸は、それぞれワールド座標 の X軸の正の方向(X)、 z軸の負の方向(一 z)にある。また、ポジティブ Z面の S軸、 T 軸は、それぞれワールド座標の X軸の正の方向(X)、 y軸の負の方向(一 y)にあり、ネ ガティブ Z面の S軸、 T軸は、それぞれワールド座標の X軸の負の方向(一 X)、 y軸の 負の方向(一 y)にある。
[0091] キューブマッピングでは、描画表面上の反射ベクトル rを算出し、反射ベクトル rの方 向が仮想立方体のいずれの面と交わるかを判定する。反射ベクトル rが交わる仮想立 方体の面をターゲット面と呼ぶ。ターゲット面は、反射ベクトルの最大成分 (メジャー 成分という)が指し示すキューブ面である。
[0092] ターゲット面が決まると、反射ベクトル rのメジャー成分とメジャー軸方向が決まる。
反射ベクトル rの成分を (vx, vy, vz)とおくと、反射ベクトル rに対するターゲット面が ポジティブ Xであるとき、メジャー軸方向は X軸の正の方向(これを +VXと記す)であり 、メジャー成分は反射ベクトルの X成分 vxである。ターゲット面がネガティブ Xであると き、メジャー軸方向は X軸の負の方向(一 VX)、メジャー成分は反射ベクトルの X成分
VXである。
[0093] 同様に、ターゲット面がポジティブ Yのとき、メジャー軸方向は +VY、メジャー成分 は vyであり、ターゲット面がネガティブ Yのとき、メジャー軸方向は VY、メジャー成 分は vyである。また、ターゲット面がポジティブ Zのとき、メジャー軸方向は +VZ、メジ ヤー成分は vzであり、ターゲット面がネガティブ Zのとき、メジャー軸方向は一 VZ、メ ジャー成分は vzである。
[0094] 反射ベクトル rの終点 (vx, vy, vz)をターゲット面上にメジャー軸方向に射影した点 は、描画表面に写像されるテクスチャの点であり、その点のテクスチャ座標(Sc, Tc) は、反射ベクトルの成分を用いて表される。ここで、図 9で説明したように、各キューブ 面でテクスチャ座標の S軸および T軸は、ワールド座標の対応する軸と方向が正負反 対〖こなることもある。たとえば、ターゲット面がポジティブ Xである場合は、テクスチャ座 標の S軸、 T軸は、図 9で説明したように、それぞれ—z方向、—y方向であったから、 ポジティブ X面上のテクスチャ座標(Sc, Tc)は、反射ベクトルの z成分と y成分を用い て(― vz, —vy)で与えられる。他のターゲット面の場合も同様にテクスチャ座標を反 射ベクトル rの成分を用いて表すことができる。
[0095] 図 10は、ターゲット面、ターゲット面上のテクスチャ座標(Sc, Tc)、およびメジャー 成分の対応関係をまとめて示す図である。
[0096] メジャー軸方向が +VXの場合、ターゲット面はポジティブ X、 Scは vz、 Tcは— V y、メジャー成分は vxである。メジャー軸方向が— VXの場合、ターゲット面はネガティ ブ X、 Scは vz、 Tcは一 vy、メジャー成分は vxである。
[0097] メジャー軸方向が +VYの場合、ターゲット面はポジティブ Y、 Scは vx、 Tcは νζ、メ ジャー成分は vyである。メジャー軸方向が— VYの場合、ターゲット面はネガティブ Y 、 Scは vx、 Tcは一 vz、メジャー成分は vyである。
[0098] メジャー軸方向が +VZの場合、ターゲット面はポジティブ Z、 Scは vx、 Tcは—vy、 メジャー成分は vzである。メジャー軸方向が—VZの場合、ターゲット面はネガティブ Z、 Scは vx、 Tcは一 vy、メジャー成分は vzである。
[0099] 図 10に示すように、ターゲット面、テクスチャ座標(Sc, Tc)、メジャー成分の対応関 係は、メジャー軸方向によって一意に決まるため、キューブマップを指定するには、メ ジャー軸方向を指定すればょ 、。
[0100] 図 11 (a)〜(d)は、テクスチャ構造体 52をキューブマップとして用いる方法を説明 する図である。
[0101] 図 11 (a)は、キューブマップ用のテクスチャ構造体 52のデータ構造を示す図である 。テクスチャ構造体 52のレイヤ方向はキューブ面に対応づけられ、各レイヤには仮想 立方体の各面の環境テクスチャであるキューブマップが 2次元テクスチャとして格納さ れる。仮想立方体の 6面に対応してテクスチャ構造体 52のレイヤ数は 6である。レイ ャ番号はキューブ面を識別するマップ IDに対応している。
[0102] マップ IDは、メジャー軸方向に対応しており、メジャー軸方向が決まれば、それに 対応するマップ IDにより各面のキューブマップを選択することができる。マップ IDとメ ジャー軸方向の対応関係については、同図のように、マップ IDO〜5のそれぞれにメ ジャー軸 +VX、— VX、 +VY、— VY、 +VZ、—VZが対応づけられる。また、各ミツ プレベルには解像度の異なるキューブマップが設けられており、ここではミツプレベル 0〜2の 3段階の解像度の例が示されて 、る。
[0103] 図 11 (b)は、ミツプレベル 0の各レイヤのテクスチャと仮想立方体の各面の対応関 係を示す図である。図 11 (a)のマップ IDOのテクスチャ(マップ 0と呼ぶ)は、図 11 (b) の仮想立方体のポジティブ X面の環境テクスチャに対応する。マップ ID 1のテクスチ ャ(マップ 1)は、仮想立方体のネガティブ X面の環境テクスチャに対応する。以下、同 様にマップ 2、マップ 3、マップ 4、マップ 5は、仮想立方体のポジティブ Y面、ネガティ ブ Y面、ポジティブ Z面、ネガティブ Z面の環境テクスチャにそれぞれ対応する。
[0104] 図 11 (c)は、ミツプレベル 0に比べて解像度が 1Z2になったミツプレベル 1の各レイ ャのテクスチャと仮想立方体の各面の対応関係を示す図である。図 11 (d)は、ミツプ レベル 0に比べて解像度が 1/4になったミツプレベル 2の各レイヤのテクスチャと仮 想立方体の各面の対応関係を示す図である。レイヤとキューブ面の対応関係は、図 11 (b)と同じである。
[0105] マップ IDは、レイヤ番号を指定するときと同様、第 3テクセル座標 wにより指定する ことができる。したがって、 3次元テクセル座標 (u, V, w)と LOD値を指定するテクス チヤ命令を用いて、ミツプマップを用いたキューブマッピングを行うことができる。
[0106] 図 12は、描画処理装置 100によるキューブマッピング処理の手順を説明するフロ 一チャートである。
[0107] シヱーダユニット 30の描画演算処理部 34は、描画表面の反射ベクトル rを算出する
(S40)。反射ベクトル rは、視線ベクトル eと描画表面の法線ベクトル nを用いて、計算 式 r= 2 (n'e) n—eにより求めることができる。
[0108] 描画演算処理部 34は、反射ベクトル rのメジャー成分にもとづいて、マップ IDに対 応するメジャー軸方向と、ターゲット面におけるテクスチャ座標(Sc, Tc)を算出する( S42)。これは図 10で説明した通りである。
[0109] 描画演算処理部 34は、テクスチャ座標 (Sc, Tc)をテクセル座標 (u, v)に変換する
(S44)。テクセル座標(u, V)は、テクスチャの幅、高さをそれぞれ width、 heightと すると、テクスチャ座標(Sc, Tc)をメジャー成分の絶対値 I major |で除算して正 規化することにより、次式のように求めることができる。
[0110] u= (width/2) · (Sc/ | major | + 1)
v= (height/ 2) · (Tc/ | major | + 1)
[0111] ここで、テクスチャユニット 70のレジスタファイル 72に設定されたテクスチャの幅と高 さの値と一致する値をシエーダユニット 30のレジスタファイル 32にも設定しておき、描 画演算処理部 34がレジスタファイル 32から参照できるようにする。
[0112] 描画演算処理部 34は、こうして求めた 2次元テクセル座標 (u, V)と、マップ IDを指 定する第 3テクセル座標 wとからなる 3次元テクセル座標 (u, V, w)をパラメータに指 定したテクスチャ命令をテクスチャユニット 70に発行する。ミツプマップを用いる場合 は、テクスチャ命令にさらに外部 LOD値をパラメータとして指定する。
[0113] より具体的には、描画演算処理部 34は、外部 LOD値と、マップ IDである第 3テクセ ル座標値 wとをパラメータに指定したテクスチャセット命令 tsetを発行し、その後、 2次 元テクセル座標値 (u, V)をパラメータに指定したテクスチャロード命令 tldを発行する 。テクスチャユニット 70は、テクスチャロード命令 tldの発行を受けて、テクスチャマツピ ングの動作を開始する。
[0114] テクスチャユニット 70は、描画演算処理部 34から指定された 3次元テクセル座標 (u , V, w)と外部 LOD値にもとづいて、テクスチャ構造体 52を用いたキューブマツピン グ処理を行う(S46)。このキューブマッピング処理は、第 3テクセル座標 wがマップ ID を示す以外は、図 7のフローチャートで示したテクスチャマッピング処理と同様にして 行うことができる。なお、キューブマッピングでは、レイヤ間の補間は意味をなさないた め行われない。
[0115] 以上述べたように、本実施の形態の描画処理装置 100によれば、 3次元テクセル座 標 (u, V, w)を指定してテクスチャ構造体 52からテクセルをサンプリングして補間す ることができる。第 3テクセル座標 wは、一般にはテクスチャ構造体 52に含まれる複数 の 2次元テクスチャの少なくとも 1つを指定するために用いられるが、テクスチャ構造 体 52がレイヤテクスチャとして用いられる場合は、レイヤ番号を指定するために、テク スチヤ構造体 52がボリュームテクスチャとして用いられる場合は、奥行きに関するパラ メータを指定するためにも用いることができる。さらに、テクスチャ構造体 52のレイヤを キューブ面に対応づければ、テクスチャ構造体 52は、 6面のキューブマップを格納し たテクスチャとして扱うこともでき、第 3テクセル座標としてキューブ面を指定すること で、キューブマッピングを行うことができる。
[0116] このように、テクスチャ構造体 52は、第 3テクセル座標 wの意味づけ次第で、複数の 独立した 2次元テクスチャの集まりとして扱うことも、 2次元テクスチャが層状に形成さ れたレイヤテクスチャとして扱うことも、奥行き方向の次元をもつボリュームテクスチャ として扱うことも、 6面のキューブマップテクスチャとして扱うこともできるため、テクスチ ャ構造体 52を処理するテクスチャマッピング用の同一のハードウェア構成、同一のィ ンタフェースをレイヤテクスチャ、ボリュームテクスチャ、キューブマップテクスチャのい ずれの用途にも兼用して用いることができる。したがって、テクスチャユニット 70の回 路規模を小さく抑えることができ、テクスチャユニット 70内のレジスタやキャッシュ、メ モリなどの資源管理も容易になる。また、インタフェースが統一されているため、テクス チヤマッピング処理のプログラミングも容易である。
[0117] また、テクスチャ構造体 52を参照するためのアドレス情報や、テクスチャ構造体 52 を利用したテクスチャマッピングのフィルタリングモードなどの各種パラメータは、 1回 のコンフィグレーションによりレジスタファイルに設定することができる。レイヤを切り替 えてテクスチャ構造体 52内の 2次元テクスチャを参照しても、レジスタの設定情報す なわちコンテキストを変更する必要がなぐコンテキスト切り替えのオーバーヘッドなし で、効率良くテクスチャマッピングを行うことができる。また、テクスチャ構造体 52では 、複数のテクスチャを用いることができるため、高い描画品質を実現することができる 。このように、本実施の形態によれば、処理効率を維持しながら、複数のテクスチャを 使い分けて描画品質の向上を図ることができる。
[0118] また、本実施の形態の描画処理装置 100によるキューブマッピング処理では、反射 ベクトルを算出し、反射ベクトル力もテクセル座標を求める計算をシエーダユニット 30 の描画演算処理部 34にお 、て行 、、キューブマップを参照してテクセル値をサンプ リングして補間する処理はテクスチャユニット 70において行う。テクスチャユニット 70 は、内挿演算器によるテクスチャマッピング専用のハードウェア構成をもっため、テク スチヤ演算能力が高い。一方、シエーダユニット 30は、プログラムによって複雑な演 算処理を実行する能力があり、反射ベクトルの算出のような複雑な演算も高速に実行 できる。本実施の形態の描画処理装置 100では、キューブマッピング処理の内、高 度な演算能力を必要とする処理は、シエーダユニット 30で行い、テクスチャ演算に係 る処理は、専用のテクスチャユニット 70で行うことにより、処理を分担して、描画処理 装置 100全体の描画処理の効率化が図られて ヽる。
[0119] 以上、本発明を実施の形態をもとに説明した。実施の形態は例示であり、それらの 各構成要素や各処理プロセスの組合せに 、ろ 、ろな変形例が可能なこと、またそうし た変形例も本発明の範囲にあることは当業者に理解されるところである。そのような変 形例を説明する。
[0120] 上記の説明では、レイヤ間の補間およびミツプレベル間の補間は、 2つのレイヤ間、 2つのミツプレベル間で行われた力 3つ以上のレイヤもしくはミツプレベルを用いて 補間を行うようにしてもよい。また、サンプリングするテクセルの個数についても、 4近 傍テクセルに限られな ヽ。 8近傍テクセルをサンプリングしてそれらのテクセル間で補 間をしてもよい。
[0121] また、上記の説明では、等方性 (isotropic)テクセルサンプリングを説明した力 異 方性(anisotropic)フィルタリングを行ってもよい。異方性テクセルサンプリングは、スク リーンの XY面に対してテクセル座標の UV面の傾きが大きい場合に特に有効である 。異方性テクセルサンプリングでは、スクリーンの XY面におけるテクセル座標の変化 の大きさと方向を求め、その変化の方向に変化の大きさに応じた回数のポイントサン プリング、バイリニアサンプリング、トライリニアサンプリングなどを繰り返すことで描画 品質を維持する。
産業上の利用可能性
[0122] 本発明は、描画処理の分野に適用することができる。

Claims

請求の範囲
[1] テクスチャに関する値を 2次元パラメータ座標に対応づけてテクセル値として格納し た 2次元テクスチャが複数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを 指定するための第 3パラメータが前記 2次元パラメータ座標における第 1および第 2パ ラメータとは別に設けられたテクスチャ構造体を格納するテクスチャ記憶部と、 描画対象物の表面に適用されるテクスチャについて前記第 3パラメータの指定と前 記表面上の 2次元パラメータ座標値の指定とを受け、前記テクスチャ構造体の内、指 定された前記第 3パラメータに対応する前記 2次元テクスチャから、指定された前記 2 次元パラメータ座標値に対応するテクセル値を読み出すテクスチャ読み出し部と、 読み出された前記テクセル値を補間して、前記描画対象物の表面に適用されるテ タスチヤに関する値を算出するフィルタとを含み、
前記第 3パラメータとして、前記テクスチャ構造体に含まれる前記複数の 2次元テク スチヤ間の関連性に応じた値が指定されることにより、異なる種類の前記テクスチャ 構造体が統一的に参照されることを特徴とするテクスチャ処理装置。
[2] 前記テクスチャ構造体は、レイヤ単位で規定される 2次元テクスチャをレイヤ数だけ 設けたレイヤ構造を有し、前記第 3パラメータは、前記レイヤを指定する番号であるこ とを特徴とする請求項 1に記載のテクスチャ処理装置。
[3] 前記テクスチャ構造体は、奥行きレベルの異なる 2次元テクスチャを奥行き方向に 複数並べたボリュームテクスチャの構造を有し、前記第 3パラメータは、前記奥行きに 関するパラメータであることを特徴とする請求項 1に記載のテクスチャ処理装置。
[4] 前記テクスチャ読み出し部は、前記第 3パラメータとして指定された奥行きに関する ノ ラメータに対応する 2つの異なる奥行きレベルの 2次元テクスチャを選択し、選択さ れた 2つの異なる奥行きレベルの 2次元テクスチャの各々から、指定された前記 2次 元パラメータ座標に対応するテクセル値を読み出し、
前記フィルタは、前記 2つの異なる奥行きレベルの 2次元テクスチャ間で前記テクセ ル値を補間することにより、前記描画対象物の表面に適用されるテクスチャに関する 値を算出することを特徴とする請求項 3に記載のテクスチャ処理装置。
[5] 前記テクスチャ構造体は、前記描画対象物の存在する空間内に仮想的に設けられ た立方体の面に投影された環境テクスチャを面数だけ設けた構造を有し、前記第 3 ノ メータは、前記面を指定する番号であることを特徴とする請求項 1に記載のテクス チヤ処理装置。
[6] 前記テクスチャ構造体を一括して参照するためのベースアドレスを格納するレジス タをさらに設け、
前記テクスチャ読み出し部は、前記レジスタに格納された前記ベースアドレスに対 して、指定された第 3パラメータに依存するオフセット値を加算することにより、指定さ れた第 3パラメータに対応する前記 2次元テクスチャの参照アドレスを生成し、前記参 照アドレスを基準にして、指定された 2次元パラメータ座標値に対応するテクセル値 を読み出すことを特徴とする請求項 1から 5のいずれかに記載のテクスチャ処理装置
[7] 前記テクスチャ構造体に含まれる複数の 2次元テクスチャの各々は、段階的に解像 度を異ならせた一組のミツプマップテクスチャであり、
前記テクスチャ読み出し部は、前記描画対象物の表面に適用されるテクスチャの描 画詳細度の指定も受け、指定された第 3パラメータに対応する一組のミツプマップテ タスチヤの内、指定された描画詳細度に対応する解像度のミツプマップテクスチャを 選択し、選択されたミツプマップテクスチャから、指定された前記 2次元パラメータ座 標値に対応するテクセル値を読み出すことを特徴とする請求項 1から 6のいずれかに 記載のテクスチャ処理装置。
[8] 前記テクスチャ読み出し部は、指定された第 3パラメータに対応する一組のミツプマ ップテクスチャの内、指定された描画詳細度に対応する 2つの異なる解像度のミツプ マップテクスチャを選択し、選択された 2つの異なる解像度のミツプマップテクスチャ の各々から、指定された前記 2次元パラメータ座標値に対応するテクセル値を読み出 し、
前記フィルタは、前記 2つの異なる解像度のミツプマップテクスチャ間で前記テクセ ル値を補間することにより、前記描画対象物の表面に適用されるテクスチャに関する 値を算出することを特徴とする請求項 7に記載のテクスチャ処理装置。
[9] テクスチャに関する値を 2次元パラメータ座標に対応づけてテクセル値として格納し た 2次元テクスチャが複数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを 指定するための第 3パラメータが前記 2次元パラメータ座標における第 1および第 2パ ラメータとは別に設けられたテクスチャ構造体を格納するテクスチャ構造体を格納す るテクスチャ記憶部と、
描画対象物の表面に適用されるテクスチャについて前記第 3パラメータの指定と前 記表面上の 2次元パラメータ座標値の指定とを受け、前記テクスチャ構造体の内、指 定された前記第 3パラメータに対応する前記 2次元テクスチャから、指定された前記 2 次元パラメータ座標値に対応するテクセル値を読み出して、前記描画対象物の表面 に適用されるテクスチャに関する補間値を算出するテクスチャ処理部と、
前記テクスチャ処理部から出力される前記テクスチャに関する補間値を用いて、前 記描画対象物の描画演算処理を行う描画処理部とを含み、
前記テクスチャ構造体は、前記描画対象物の存在する空間内に仮想的に設けられ た立方体の面に投影された環境テクスチャを面数だけ設けた構造を有し、
前記描画処理部は、前記描画対象物の表面の反射ベクトルにもとづいて、前記表 面に写像される環境テクスチャの面番号とその面内における 2次元パラメータ座標値 とを求め、求めた面番号を前記第 3パラメータとして 2次元パラメータ座標値とともに 前記テクスチャ処理部に対して指定し、
前記テクスチャ処理部は、前記テクスチャ構造体の内、前記描画処理部により前記 第 3パラメータとして指定された前記面番号に対応する環境テクスチャから、前記描 画処理部により指定された前記 2次元パラメータ座標値に対応するテクセル値を読 み出し、前記描画対象物の表面に適用されるテクスチャに関する補間値を算出する ことを特徴とする描画処理装置。
前記テクスチャ構造体を一括して参照するためのベースアドレスを格納するレジス タをさらに設け、
前記テクスチャ読み出し部は、前記レジスタに格納された前記ベースアドレスに対 して、指定された第 3パラメータに依存するオフセット値を加算することにより、指定さ れた第 3パラメータに対応する前記 2次元テクスチャの参照アドレスを生成し、前記参 照アドレスを基準にして、指定された 2次元パラメータ座標値に対応するテクセル値 を読み出すことを特徴とする請求項 9に記載の描画処理装置。
[11] テクスチャに関する値を 2次元パラメータ座標に対応づけてテクセル値として格納し た 2次元テクスチャが複数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを 指定するための第 3パラメータが前記 2次元パラメータ座標における第 1および第 2パ ラメータとは別に設けられた構造体を有し、前記 2次元パラメータ座標値および前記 第 3パラメータを指定したテクスチャの読み出し命令により、指定された第 3パラメータ に対応する前記 2次元テクスチャから、指定された前記 2次元パラメータ座標値に対 応する前記テクセル値のサンプリングが可能に構成され、前記第 3パラメータとして、 前記構造体に含まれる前記複数の 2次元テクスチャ間の関連性に応じた値が指定さ れることにより、異なる種類の前記構造体の統一的な参照が可能に構成されたことを 特徴とするテクスチャのデータ構造。
[12] 前記テクスチャ構造体は、レイヤ単位で規定される 2次元テクスチャをレイヤ数だけ 設けたレイヤ構造を有し、前記第 3パラメータは、前記レイヤを指定する番号であるこ とを特徴とする請求項 11に記載のテクスチャのデータ構造。
[13] 前記テクスチャ構造体は、奥行きレベルの異なる 2次元テクスチャを奥行き方向に 複数並べたボリュームテクスチャの構造を有し、前記第 3パラメータは、前記奥行きに 関するパラメータであることを特徴とする請求項 11に記載のテクスチャのデータ構造
[14] 前記テクスチャ構造体は、前記描画対象物の存在する空間内に仮想的に設けられ た立方体の面に投影された環境テクスチャを面数だけ設けた構造を有し、前記第 3 ノ メータは、前記面を指定する番号であることを特徴とする請求項 11に記載のテク スチヤのデータ構造。
[15] テクスチャに関する値を 2次元パラメータ座標に対応づけてテクセル値として格納し た 2次元テクスチャが複数設けられ、前記複数の 2次元テクスチャの少なくとも 1つを 指定するための第 3パラメータが前記 2次元パラメータ座標における第 1および第 2パ ラメータとは別に設けられたテクスチャ構造体を保持したテクスチャメモリに対して、描 画対象物の表面に適用されるテクスチャについて前記第 3パラメータと前記表面上の 2次元パラメータ座標値を指定したテクスチャの読み出し命令を実行することにより、 指定された前記第 3パラメータに対応する前記 2次元テクスチャから、指定された前 記 2次元パラメータ座標値に対応するテクセル値をサンプリングするステップと、 サンプリングされた前記テクセル値を補間して、前記描画対象物の表面に適用され るテクスチャに関する値を算出するステップとを含み、
前記第 3パラメータとして、前記テクスチャ構造体に含まれる前記複数の 2次元テク スチヤ間の関連性に応じた値が指定されることにより、異なる種類の前記テクスチャ 構造体が統一的に参照されることを特徴とするテクスチャ処理方法。
PCT/JP2005/022536 2005-03-07 2005-12-08 テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法 WO2006095481A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2005063113A JP2006244426A (ja) 2005-03-07 2005-03-07 テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法
JP2005-063113 2005-03-07

Publications (1)

Publication Number Publication Date
WO2006095481A1 true WO2006095481A1 (ja) 2006-09-14

Family

ID=36953087

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2005/022536 WO2006095481A1 (ja) 2005-03-07 2005-12-08 テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法

Country Status (2)

Country Link
JP (1) JP2006244426A (ja)
WO (1) WO2006095481A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016151790A1 (ja) * 2015-03-25 2016-09-29 三菱電機株式会社 テクスチャマッピング装置、テクスチャマッピング方法及びプログラム
CN113643414A (zh) * 2020-05-11 2021-11-12 北京达佳互联信息技术有限公司 一种三维图像生成方法、装置、电子设备及存储介质
CN113658064A (zh) * 2021-08-03 2021-11-16 网易(杭州)网络有限公司 纹理图像的生成方法、装置和电子设备

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080284798A1 (en) * 2007-05-07 2008-11-20 Qualcomm Incorporated Post-render graphics overlays
US7944453B1 (en) 2007-06-07 2011-05-17 Nvidia Corporation Extrapolation texture filtering for nonresident mipmaps
US7948500B2 (en) * 2007-06-07 2011-05-24 Nvidia Corporation Extrapolation of nonresident mipmap data using resident mipmap data
US9177368B2 (en) * 2007-12-17 2015-11-03 Nvidia Corporation Image distortion correction
KR101427408B1 (ko) * 2008-05-30 2014-08-07 어드밴스드 마이크로 디바이시즈, 인코포레이티드 스케일링가능하고 통합된 컴퓨팅 시스템
US9367948B2 (en) * 2013-11-14 2016-06-14 Intel Corporation Flexible filter logic for multi-mode filtering of graphical texture data
KR20180048081A (ko) * 2016-11-02 2018-05-10 삼성전자주식회사 텍스쳐 처리 방법 및 장치
KR20180071767A (ko) * 2016-12-20 2018-06-28 삼성전자주식회사 큐브 맵을 텍스쳐링하기 위한 LOD(level of detail)를 결정하는 방법 및 장치
CN112070651A (zh) * 2019-06-10 2020-12-11 华夏芯(北京)通用处理器技术有限公司 一种基于双Buffer架构下的纹理贴图硬件加速器

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11510940A (ja) * 1996-06-07 1999-09-21 フィリップス エレクトロニクス ネムローゼ フェンノートシャップ 3次元画像テクスチュアマッピング
JP2001236523A (ja) * 1999-12-16 2001-08-31 Sega Corp 画像生成方法及びこれを用いた画像生成装置
JP2003079942A (ja) * 2001-09-17 2003-03-18 Namco Ltd ゲーム情報、情報記憶媒体、及びゲーム装置
JP2003263651A (ja) * 2002-03-12 2003-09-19 Inst Of Physical & Chemical Res ボリュームレンダリング方法とそのプログラム
JP2004164308A (ja) * 2002-11-13 2004-06-10 Toshiba Denpa Products Kk コンピュータグラフィックスによる海面表現方法
JP2005025254A (ja) * 2003-06-30 2005-01-27 Toshiba Corp コンピュータグラフィックス描画装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11510940A (ja) * 1996-06-07 1999-09-21 フィリップス エレクトロニクス ネムローゼ フェンノートシャップ 3次元画像テクスチュアマッピング
JP2001236523A (ja) * 1999-12-16 2001-08-31 Sega Corp 画像生成方法及びこれを用いた画像生成装置
JP2003079942A (ja) * 2001-09-17 2003-03-18 Namco Ltd ゲーム情報、情報記憶媒体、及びゲーム装置
JP2003263651A (ja) * 2002-03-12 2003-09-19 Inst Of Physical & Chemical Res ボリュームレンダリング方法とそのプログラム
JP2004164308A (ja) * 2002-11-13 2004-06-10 Toshiba Denpa Products Kk コンピュータグラフィックスによる海面表現方法
JP2005025254A (ja) * 2003-06-30 2005-01-27 Toshiba Corp コンピュータグラフィックス描画装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016151790A1 (ja) * 2015-03-25 2016-09-29 三菱電機株式会社 テクスチャマッピング装置、テクスチャマッピング方法及びプログラム
JPWO2016151790A1 (ja) * 2015-03-25 2017-06-15 三菱電機株式会社 テクスチャマッピング装置、テクスチャマッピング方法及びプログラム
CN113643414A (zh) * 2020-05-11 2021-11-12 北京达佳互联信息技术有限公司 一种三维图像生成方法、装置、电子设备及存储介质
CN113643414B (zh) * 2020-05-11 2024-02-06 北京达佳互联信息技术有限公司 一种三维图像生成方法、装置、电子设备及存储介质
CN113658064A (zh) * 2021-08-03 2021-11-16 网易(杭州)网络有限公司 纹理图像的生成方法、装置和电子设备

Also Published As

Publication number Publication date
JP2006244426A (ja) 2006-09-14

Similar Documents

Publication Publication Date Title
WO2006095481A1 (ja) テクスチャ処理装置、描画処理装置、およびテクスチャ処理方法
US6518974B2 (en) Pixel engine
US5704024A (en) Method and an apparatus for generating reflection vectors which can be unnormalized and for using these reflection vectors to index locations on an environment map
US5224208A (en) Gradient calculation for texture mapping
US7508394B1 (en) Systems and methods of multi-pass data processing
US7576751B2 (en) Pixel center position displacement
US7742060B2 (en) Sampling methods suited for graphics hardware acceleration
JP2018156666A (ja) 曲面ビューポート上に頂点の投影を近似することによる、グラフィックス処理における画面位置に基づく有効解像度の変化
US10140750B2 (en) Method, display adapter and computer program product for improved graphics performance by using a replaceable culling program
US20050243101A1 (en) Image generation apparatus and image generation method
US7038678B2 (en) Dependent texture shadow antialiasing
JP7096661B2 (ja) キューブマップをテクスチャリングするためのlodを決定する方法、装置、コンピュータプログラム及び記録媒体
US20080094409A1 (en) Image Generation Device and Image Generation Method
US7405735B2 (en) Texture unit, image rendering apparatus and texel transfer method for transferring texels in a batch
WO1999067748A2 (en) An improved method and apparatus for per pixel mip mapping and trilinear filtering
US7525553B2 (en) Computer graphics processor and method for generating a computer graphics image
US20050219256A1 (en) Shorter footprints for anisotropic texture filtering
US20060202990A1 (en) Computer graphics system and method for rendering a computer graphic image
US20100302259A1 (en) Drawing data processing method, graphics drawing system and graphics drawing data generation program
JP4060375B2 (ja) スポットライト特性形成方法及びこれを用いた画像処理装置
US7256796B1 (en) Per-fragment control for writing an output buffer
US6570575B1 (en) Associated color texture processor for high fidelity 3-D graphics rendering
US7091983B1 (en) Coordinate wrapping for anisotropic filtering of non-power of two textures
JP4308367B2 (ja) 3次元画像生成装置および環境マップの生成方法
JP3712015B2 (ja) 画像作成装置および方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

NENP Non-entry into the national phase

Ref country code: RU

WWW Wipo information: withdrawn in national office

Country of ref document: RU

122 Ep: pct application non-entry in european phase

Ref document number: 05814709

Country of ref document: EP

Kind code of ref document: A1

WWW Wipo information: withdrawn in national office

Ref document number: 5814709

Country of ref document: EP