CN1275202C - Texture mapping method based on pyramid quad tree - Google Patents

Texture mapping method based on pyramid quad tree Download PDF

Info

Publication number
CN1275202C
CN1275202C CN 200310109176 CN200310109176A CN1275202C CN 1275202 C CN1275202 C CN 1275202C CN 200310109176 CN200310109176 CN 200310109176 CN 200310109176 A CN200310109176 A CN 200310109176A CN 1275202 C CN1275202 C CN 1275202C
Authority
CN
China
Prior art keywords
texture
pyramid
data
quaternary tree
memory
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
CN 200310109176
Other languages
Chinese (zh)
Other versions
CN1547162A (en
Inventor
华炜
陆艳青
周栋
鲍虎军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN 200310109176 priority Critical patent/CN1275202C/en
Publication of CN1547162A publication Critical patent/CN1547162A/en
Application granted granted Critical
Publication of CN1275202C publication Critical patent/CN1275202C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present invention discloses a texture mapping method based on a pyramid quad tree. The method comprises the four steps of the representation of a texture pyramid quad tree, the compression of nodes of the texture pyramid quad tree, the selection of the nodes of the texture pyramid quad tree, and the loading of the nodes of the texture pyramid quad tree. The present invention is preferably combined with the advantages of a texture quad tree and a texture pyramid; meanwhile, texture data is compressed so that a limited texture memory can be effectively used for realizing the data scheduling of large scale terrain texture data from a hard disk to a system memory and from the system memory to the texture memory; because the texture data is compressed, and the system memory and the texture memory are scheduled in the least recently used mode, the transmission amount between the memories is decreased. As a result, the method can map the texture data onto corresponding terrains in real time, improve the quality of displayed pictures during large scale terrain roaming, and solve the problem of deformation generation during large texture mapping through the pyramid deformation resistant technology of hardware.

Description

A kind of texture mapping method based on the pyramid quaternary tree
Technical field
The present invention relates to general view data and handle or produce, relate in particular to a kind of texture mapping method based on the pyramid quaternary tree.
Background technology
In drawing system, texture can not passed through the complicacy of increment body, and makes the scene details seem abundanter, makes scene truer.For the drafting of large-scale terrain, need a good texture mode, realize the real-time mapping of texture, solve the technical matters of the real time roaming of large-scale terrain scene, comprise the storage and the transmission problem that solve data texturing, the texture problem of losing shape improves the quality of rendered frame.
David Cline adopts the texture quaternary tree to represent extensive texture, can be with reference to [Cline1998] DavidCline and Parris K.Egbert, " Interactive Display Of Very Large Textures; " inProceedings of IEEE Visualization ' 98, October 1998, pp.343-350, each texture adopts fixed resolution to represent, the texture of different levels represents that the zone that covers is different, when drawing for how much, need choose texture suitable in the quaternary tree according to the polygonal size of drawing.If there is not suitable texture, then choose coarse texture temporarily, and this texture is inserted a formation, carry out unified scheduling.Like this,, possibly can't satisfy current needed display precision, influence display quality though utilized the continuity of the ken.And to each texture node, do not adopt the mode of Mipmap,, thereby cause the texture phenomenon of losing shape because polygon can not be just corresponding to certain level in the texture quaternary tree.In the scheduling of data, this method is not utilized the duplicate message between the quaternary tree father and son node yet, carries out the progression scheduling of data.
Dollner adopts in terrain rendering how much and many resolutions of texture are drawn, can be with reference to [Dollner2000] Jurgen Dollner, Konstantin Baumann, and Klaus Hinrichs, " Texturing Techniques forTerrain Visualization ", IEEE Visualization 2000,207-234, Oct.2000, on how much, adopt discrete level of detail tree, equally texture is also set up hierarchical tree, when drawing, according to the display requirement of screen, choose the geometry and the texture of different levels and draw.
Blow also adopts the texture quaternary tree in the terrain rendering of high details, can be with reference to [Blow2000] Jonathan Blow, " Terrain Rendering at High Levels of Detail ", Proceedings of the2000 Game Developers Conference, Mar.2000, and represent in conjunction with how much binary tree, carry out the selection of texture.This method need be chosen needed texture based on each leg-of-mutton geometry, might switch between a plurality of textures, and cause the decline of system performance.
Summary of the invention
At the deficiencies in the prior art, the object of the present invention is to provide a kind of texture mapping method based on the pyramid quaternary tree.This method can be mapped to data texturing on the corresponding landform in real time, the display frame quality when improving the large-scale terrain roaming, and can also utilize the anti-aliasing technology of pyramid of hardware, produce the problem of the phenomenon of losing shape when solving the large texture mapping.
For achieving the above object, the technical solution used in the present invention is as follows:
Comprise following four steps:
1) texture pyramid quaternary tree is represented: the texture image tables of data is shown as the texture quaternary tree, and the data texturing that each node of texture quaternary tree is represented is organized into the texture pyramid, has set up the texture pyramid quaternary tree of texture image data and has represented;
2) compression of texture pyramid quaternary tree node: g m(i j) is the original texture image, and resolution is 2 m* 2 m, f m(i j) is g mBy the image as a result that a filter operator generates, the image that filtering is produced carries out resampling then, and sample frequency is original 1/2, produces the visual g of next level M-1(i, j), this conversion process is the process that reduces resolution, by to visual g m(i j) constantly carries out this process, until the last resolution that generates is 1 * 1 visual g 0, (i j) forms the texture pyramid to this a series of g, and the texture pyramid is compressed, and wherein m is the total number of plies of texture pyramid;
3) choosing of texture pyramid quaternary tree node: determine corresponding texture pyramid quaternary tree node according to the projected area of triangle on screen for each terrain mesh;
4) loading of texture pyramid quaternary tree node: in the process of texture, when the selected texture pyramid of landform triangular mesh quaternary tree node during not at texture memory, upwards search for texture pyramid quaternary tree and obtain its father node in texture memory, carry out texture, and this node is put into a data dispatch formation, from hard disk and Installed System Memory data dispatching, when data texturing when hard disk is loaded into the internal memory, need decode to compressed texture, when the storage space of loading data overshoot, the partial data that needs the storage of releasing memory and texture memory Central Plains, the least recently used strategy of The data in Installed System Memory, the i.e. time release of using according to last data dispatch data earlier the earliest, and to the data in the texture memory, use improved least recently used strategy, thereby finish the drafting of landform scene.
The present invention compares with background technology, and its advantage is:
The present invention adopts texture pyramid quaternary tree mapping method, can effectively utilize limited texture memory, reduce the transmission quantity of data texturing, realization is from the hard disk to the Installed System Memory, data dispatch from the Installed System Memory to the texture memory again, can improve the image quality that large-scale terrain band texture is drawn effectively, and can utilize the anti-aliasing technology of pyramid of hardware, solve the problem that the large texture mapping produces the phenomenon of losing shape.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples.
Fig. 1 is the process flow diagram of the inventive method;
Fig. 2 is that the texture quaternary tree is represented;
Fig. 3 is that the texture pyramid is represented;
Fig. 4 is the reduction resolution procedural representation of texture;
Fig. 5 is the raising resolution procedural representation of texture;
Fig. 6 is that the regional vector quantization of texture is represented.
Embodiment
As shown in Figure 1, a kind of texture mapping method that the present invention proposes based on the pyramid quaternary tree, comprise that the pyramid quaternary tree of texture is represented, the compression of texture pyramid quaternary tree node, texture pyramid quaternary tree node choose four steps of loading with texture pyramid quaternary tree node.Flow process such as Fig. 1 are represented: at first read data texturing, data texturing is expressed as the pyramid quaternary tree of texture, then texture pyramid quaternary tree node is compressed; Choose corresponding texture pyramid quaternary tree node for each ground l network, texture node data in texture memory not are loaded into texture memory, finish the drafting of the landform scene of being with texture at last.
Now specifically introduce four steps of this method:
1) the pyramid quaternary tree of texture is represented
For extensive texture image, its image size can be defined as 2 n* 2 n, wherein n is a positive integer.At first extensive texture image is expressed as the texture quaternary tree.The building process of texture quaternary tree is as follows:
The whole landform square region of the corresponding covering of the root node of texture quaternary tree, its size is 2 n* 2 n, its four child nodes are represented its 1/4th regions respectively, its size is 2 N-1* 2 N-1, and the resolution of these four child nodes is identical with root node, root node is the father node of four child nodes.These four child nodes are carried out same operation, and each node all produces four child nodes, and this process is constantly carried out, and up to the fine-resolution of original texture, promptly the size of node is 1 * 1.So in the texture quaternary tree, the landform region overlapping that father and son's node covers, the region that each node and its four child nodes cover is identical.Fig. 2 has provided the quaternary tree node of junior three layer, and Fig. 2 a has represented original texture image (0,0), carries out the quaternary tree subdivision by it, as Fig. 2 b four child nodes (0 is arranged, 0), (0,1), (1,0), (1,1), these four child nodes are identical with the zone that Fig. 2 a covers; Each child node is carried out subdivision again, just obtained Fig. 2 c.
Texture for each node of the texture quaternary tree that produces with top method is stored is organized into the texture pyramid again.
The pyramidal organizational form of texture is as follows:
Suppose that texture quaternary tree node texture image size is fixed size 2 m* 2 m, m is a nonnegative integer.Texture is constantly got a plurality of pixels and is asked the average of its texture color value from raw image from high-resolution picture, generate a pixel of low resolution image, constitutes resolution set of diagrams from high to low and resembles.Original resolution image and low resolution images at different levels are stored in a plurality of tables.This texture quaternary tree node is being stored same texture image like this, and resolution is 1 * 1 to 2 m* 2 mThe texture pyramid of data texturing.Texture pyramid as shown in Figure 3, the resolution of image is 8 * 8,4 * 4,2 * 2,1 * 1, resolution constantly descends, and texture image is more and more fuzzyyer.
According to as above method, just can realize that the pyramid quaternary tree of the texture of texture image is represented.
1) compression of texture pyramid quaternary tree node
For the processing of extensive data texturing, the memory space that reduces texture is very important.It by the represented texture pyramid data volume of step 1 16/9 times of former data texturing.
Owing to have certain continuity between the adjacent texture elements of texture image, reduce data redundancy effectively so can compress to the texture pyramid, make that the expression of texture is more compact.
Suppose that texture pyramid quaternary tree node storage resolution is 1 * 1 to 2 m* 2 mA series of data texturings.To these data texturings, resolution is that 1 * 1 to 32 * 32 data are not compressed, to 64 * 64 to 2 m* 2 mData texturing carry out vector quantization compression, the method for compression is as described below:
As shown in Figure 4, g m(i j) is the original texture image, and resolution is 2 m* 2 m, f m(i j) is g mImage as a result by filter operator generation.The image that filtering is produced carries out resampling then, and sample frequency is original 1/2, produces the visual g of next level M-1(i, j), this conversion process is the process that reduces resolution.By to visual g m(i j) constantly carries out this process, until the last resolution that generates is 1 * 1 visual g 0, (i j) forms the texture pyramid to this a series of g.Iterative process can be in order to the following formula subrepresentation:
g l-1=REDUCE(g 1)
The number of plies 0<l≤m wherein, m is the total number of plies of texture pyramid, REDUCE is for reducing the process of resolution.Fig. 4 provides a diagram of this process, g mCarried out the process that reduces resolution for twice, from g mBecome g M-1, again by g M-1Become g M-2, resolution has become 1/4 of former figure.
As shown in Figure 5, the inverse process of this operation generates the image of 2M * 2N for improving the process EXPAND of resolution to the image effect of M * N.Fig. 5 has provided a process that improves resolution, g mCarried out the process that improves resolution for twice, from g mBecome g M+1, again by g M+1Become g M+2, resolution is brought up to 4 times of former figure.But high-resolution picture is reduced to the loss of part grain details is arranged in the low resolution image process carrying out the REDUCE conversion, the texture that generates with the EXPAND function is difficult to return to fully original information, have error between it and the original high class resolution ratio texture, the error between them is defined as:
L l=g l-EXPAND(g l-1)
0<1<m wherein, the visual g of last one deck 1 * 1 0, owing to do not have the image of coarse resolution, note L 0=g 0
Suppose that the texture pyramid that this texture pyramid quaternary tree node was stored is (g before aforesaid operations 0, g 1..., g m), the texture pyramid of storage can be expressed as (g after having carried out aforesaid operations 0, g 1, g 2, g 3, g 4, g 5, L 6..., L m).
The present invention is further to error image l kCarry out compressed encoding, can adopt any image compression method.We use LBG vector quantization compression method to error image l kCarry out compressed encoding.The LBG algorithm is a method commonly used, can be with reference to [Linde1980] Y.Linde, A.Buzo, and R.M.Gray, " An Algorithmfor Vector Quantizer Design " .IEEE Transactions on Communications, 1:702--710,1980, this method can be applied to multidimensional data, LBG vector quantization algorithm is from initial code book, initial encoded radio is that all need coded data mean value, small sample perturbations of this encoded radio plus-minus splits into two initial encoded radios, raw data set is trained to generate new encoded radio again, adopts this iterative manner, coded data each time doubles, and reaches specified number up to the coding number.
The visual subregion of getting a certain size carries out vector quantization, and these visual subregions use identical code index.As shown in Figure 6, choose the RGB texture of 4 * 4 visual subregion coding 512 * 512, each pixel RGB of subregion has 4 * 4 * 3=48bytes.Adopt the code book of 256 different values, each pixel of subregion of getting same code value uses same index value, and each index value represents that with 1byte the index value that then needs altogether is 512 * 512/ (4 * 4), can reach 48: 1 compressibility.Owing to also need record coding information originally, need the value of 4 * 4 * 256 RGB altogether, actual compressibility is 27.4: 1, this is the compressed value to single texture.It for fine-resolution 512 * 512 texture pyramid, each pixel is represented with RGB, need take texture space is 512 * 512 * 3 * 4/3=1024K, by the pyramid texture being carried out recurrence vector quantization successively, just can compress needed texture space effectively, in order to prevent the accumulation of progression compression time error, the method for error of calculation image of the present invention is that the image that EXPAND recovers is made difference operation with the correct corresponding pixel of texture image.When texture resolution less than 32 * 32 the time, the vector quantization compression method is invalid, therefore, this method is that 32 * 32 to 1 * 1 texture does not carry out vector quantization to texture pyramid intermediate-resolution.The data total amount of compression back texture is 74K like this, and compressibility can reach 13.8: 1.
When image decoding,, import the data texturing g of high one deck resolution when needs for the texture of level multiresolution k, can be by the data texturing g of low one deck K-1Be stretched to visual f k, passing through g k=f k+ codebook (index) comes restore data.Codebook is meant error image l kColor value behind the vector quantization.
2) texture pyramid quaternary tree node chooses
When carrying out the drafting of landform triangular mesh, need determine texture resolution according to the projected area of landform triangular mesh on screen, determine corresponding texture pyramid quaternary tree node then.In order to guarantee the quality of texture, according to the strategy that pyramid is drawn, the screen pixel of being got and the ratio of texture elements were near 1: 1.The radius that calculates screen space by formula is r s = λ × r cos φ d , Wherein
Figure C20031010917600082
W is the pixel number of ken wide-angle , and r is the encirclement radius of a ball of object space, and d is the minimum distance that viewpoint arrives enclosure body, and φ is normal direction and the viewpoint angle of direction to the limit.
In order to improve the efficient of texture, when the landform triangular mesh of phase near field when the pixel of screen space is close with the texture elements ratio, can use same texture quaternary tree node to shine upon.These landform triangular mesh are called the landform triangular mesh with gang, and they pass through following formula in the maximum radius of screen space r s = λ × r cos ( max ( 0 , φ - v ) ) d Calculate.Calculate the radius r of landform triangular mesh at texture space t, available following formula r t 2=Area (T)/Area (Q) * r Q 2Wherein Area (T) is the area of landform triangle T, and Area (Q) is the area of texture pyramid quaternary tree node Q overlay area, r QPixel resolution for texture pyramid quaternary tree node.Work as r t≤ r sAnd 2r t>r sThe time, this texture pyramid quaternary tree node just is needed texture, otherwise need up travel through father node (if r t>r s), perhaps down travel through child node (if 2r t<r s), seek suitable texture pyramid quaternary tree node.
3) loading of texture pyramid quaternary tree node
In order to guarantee to obtain in real time texture, the root node of texture pyramid quaternary tree is kept in the texture memory all the time.In the process of texture, when the selected texture pyramid of landform triangular mesh quaternary tree node during not at texture memory, upwards search for texture pyramid quaternary tree and obtain its father node in texture memory, carry out texture, and this node is put into a data dispatch formation, from hard disk and Installed System Memory data dispatching.When data texturing when hard disk is loaded into the internal memory, need decode to compressed texture.When the storage space of loading data overshoot, the partial data that needs the storage of releasing memory and texture memory Central Plains, the least recently used strategy of The data in Installed System Memory, the i.e. time release of using according to last data dispatch data earlier the earliest, and to the data in the texture memory, use improved least recently used strategy, the priority of texture pyramid quaternary tree node is provided by following formula:
p d=f/(l+1)
Wherein, f is the frame number that calls texture pyramid quaternary tree node the last time, and l is the number of plies of texture pyramid quaternary tree node, p dThe data of more little texture node are rejected at first.
When implementing, Installed System Memory and texture memory are opened up the capacity of fixed size, and the texture memory size is made as total graphic hardware and supports 1/2 of size, and Installed System Memory is opened up size and is total 1/3.

Claims (1)

1. texture mapping method based on the pyramid quaternary tree is characterized in that comprising following four steps:
1) texture pyramid quaternary tree is represented: the texture image tables of data is shown as the texture quaternary tree, and the data texturing that each node of texture quaternary tree is represented is organized into the texture pyramid, has set up the texture pyramid quaternary tree of texture image data and has represented;
2) compression of texture pyramid quaternary tree node: g m(i j) is the original texture image, and resolution is 2 m* 2 m, f m(i j) is g mBy the image as a result that a filter operator generates, the image that filtering is produced carries out resampling then, and sample frequency is original 1/2, produces the visual g of next level M-1(i, j), this conversion process is the process that reduces resolution, by to visual g m(i j) constantly carries out this process, until the last resolution that generates is 1 * 1 visual g 0, (i j) forms the texture pyramid to this a series of g, and the texture pyramid is compressed, and wherein m is the total number of plies of texture pyramid;
3) choosing of texture pyramid quaternary tree node: determine corresponding texture pyramid quaternary tree node according to the projected area of triangle on screen for each terrain mesh;
4) loading of texture pyramid quaternary tree node: in the process of texture, when the selected texture pyramid of landform triangular mesh quaternary tree node during not at texture memory, upwards search for texture pyramid quaternary tree and obtain its father node in texture memory, carry out texture, and this node is put into a data dispatch formation, from hard disk and Installed System Memory data dispatching, when data texturing when hard disk is loaded into the internal memory, need decode to compressed texture, when the storage space of loading data overshoot, the partial data that needs the storage of releasing memory and texture memory Central Plains, the least recently used strategy of The data in Installed System Memory, the i.e. time release of using according to last data dispatch data earlier the earliest, and to the data in the texture memory, use improved least recently used strategy, thereby finish the drafting of landform scene.
CN 200310109176 2003-12-05 2003-12-05 Texture mapping method based on pyramid quad tree Expired - Fee Related CN1275202C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200310109176 CN1275202C (en) 2003-12-05 2003-12-05 Texture mapping method based on pyramid quad tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200310109176 CN1275202C (en) 2003-12-05 2003-12-05 Texture mapping method based on pyramid quad tree

Publications (2)

Publication Number Publication Date
CN1547162A CN1547162A (en) 2004-11-17
CN1275202C true CN1275202C (en) 2006-09-13

Family

ID=34335073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200310109176 Expired - Fee Related CN1275202C (en) 2003-12-05 2003-12-05 Texture mapping method based on pyramid quad tree

Country Status (1)

Country Link
CN (1) CN1275202C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000651B (en) * 2006-12-28 2010-05-19 上海电力学院 Method for recognizing multiple texture image

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100428280C (en) * 2006-09-18 2008-10-22 武汉大学 DMC color composition image radiation re-handling method
GB2503691B (en) * 2012-07-04 2019-08-14 Advanced Risc Mach Ltd Methods of and apparatus for encoding and decoding data
CN102867331A (en) * 2012-08-31 2013-01-09 电子科技大学 Graphics processing unit (GPU)-orientated large-scale terrain fast drawing method
CN110310223B (en) * 2019-07-03 2023-04-07 云南电网有限责任公司电力科学研究院 Fusion method of ultraviolet light and visible light image

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000651B (en) * 2006-12-28 2010-05-19 上海电力学院 Method for recognizing multiple texture image

Also Published As

Publication number Publication date
CN1547162A (en) 2004-11-17

Similar Documents

Publication Publication Date Title
US11743479B2 (en) Methods and apparatuses for encoding and decoding a bytestream
US5300949A (en) Scalable digital video decompressor
Beers et al. Rendering from compressed textures
US5586200A (en) Segmentation based image compression system
US6236762B1 (en) System and method for unified DCT and wavelet data coding
CN111402380B (en) GPU compressed texture processing method
CN105933708B (en) A kind of method and apparatus of data compression and decompression
US20040151372A1 (en) Color distribution for texture and image compression
CN100524452C (en) Digital image storage, displaying method and device
US7412104B2 (en) Optimized lossless data compression methods
US6978048B1 (en) Encoding method and apparatus
Hwa et al. Adaptive 4-8 texture hierarchies
KR20030043638A (en) Node structure for representing 3-dimensional objects using depth image
CN1741066A (en) Subdividing geometry images in graphics hardware
CN103024393B (en) A kind of compression for single image and decompressing method
CN113284250A (en) Geometric encoding method and decoding method and device for point cloud
CN113170140A (en) Bit plane encoding of data arrays
US8514932B2 (en) Content adaptive and art directable scalable video coding
Lefebvre et al. Compressed random-access trees for spatially coherent data
US6845130B1 (en) Motion estimation and compensation for video compression
JPH06232764A (en) Apparatus and method for data compression
CN1275202C (en) Texture mapping method based on pyramid quad tree
CN118350984A (en) Image style migration method based on multi-level cascade structure
US6606416B1 (en) Encoding method and apparatus for representing a digital image
CN1605088A (en) Computer graphics system and method for rendering an image for display

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20060913

Termination date: 20131205