CN102890829A - Method for rendering terrain based on graphic processing unit (GPU) - Google Patents

Method for rendering terrain based on graphic processing unit (GPU) Download PDF

Info

Publication number
CN102890829A
CN102890829A CN2011103251436A CN201110325143A CN102890829A CN 102890829 A CN102890829 A CN 102890829A CN 2011103251436 A CN2011103251436 A CN 2011103251436A CN 201110325143 A CN201110325143 A CN 201110325143A CN 102890829 A CN102890829 A CN 102890829A
Authority
CN
China
Prior art keywords
data
texture
height
viewpoint
altitude information
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.)
Granted
Application number
CN2011103251436A
Other languages
Chinese (zh)
Other versions
CN102890829B (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.)
Red software Limited by Share Ltd
Original Assignee
KARAMAY HONGYOU SOFTWARE CO Ltd
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 KARAMAY HONGYOU SOFTWARE CO Ltd filed Critical KARAMAY HONGYOU SOFTWARE CO Ltd
Priority to CN201110325143.6A priority Critical patent/CN102890829B/en
Publication of CN102890829A publication Critical patent/CN102890829A/en
Application granted granted Critical
Publication of CN102890829B publication Critical patent/CN102890829B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method for rendering a terrain based on a graphic processing unit (GPU). The method comprises the following steps of: organizing elevation texture data, and arranging the elevation texture data with different resolutions stage by stage; acquiring an elevation value of the elevation texture organized data from the corresponding layer according to a vertex position; mixing vertex elevation data of transition zones to acquire elevation mixed data of multiple transition zones; calculating a normal vector and a detail texture in a pixel shader; rendering an image to a screen to achieve an image rendering effect displayed on the screen; and detecting whether a viewpoint is updated or not, and performing corresponding operation. By the method for quickly rendering the terrain, the acquired three-dimensional image is continuously displayed.

Description

A kind of method of playing up landform based on GPU
Technical field
The present invention relates to field of Computer Graphics, particularly relate to the method that a kind of GeometryClipmap based on GPU plays up landform.
Background technology
Along with the fast development of infotech, the real time roaming technology of large-scale complex scene becomes increasingly important.Utilize computer technology, with the form of three-dimensional visualization the magnanimity contextual data being showed is the inexorable trend of a development, but with respect in disorder lteral data, adopts the three-dimensional scenic form to show user's quantity of information very huge.The tradition large scale scene is played up the realization of algorithm will carry out the data structure maintenance of complicated deblocking, complexity and the complicated operations such as meticulous level screening calculating at CPU usually, has caused computation burden heavier.And playing up of huge data access and huge data is two factors that cause computation burden heavier.
1) huge data access
Infinitely-great scenario simulation needs the contextual data of magnanimity.It is exactly playing up of outdoor terrain that a typical large scale scene is played up example, and the size of terrain data has determined again the size of scene, and therefore how preserving these underground datas has become primary problem.Because data volume is huge, these data can't all leave in the calculator memory, and in order to reduce the requirement of playing up computer hardware, data will be placed in the hard disk at ordinary times.Therefore, on algorithm, just need a kind of strategy of looking ahead and discharging, reduce the degree of susceptibility of performance of system memory as far as possible.
2) huge data plays up
When the large regional landform of real time roaming, all be unlimited in a lot of situations in the visual field, and the unlimited visual field just mean and will play up unlimited pel, be impossible realize for existing computer resource.Pel quantity is the speed increment with the large small square of scene, only considers terrain data, a 2048x2048 topomap, if do not consider to lower level of detail and cutting, it will play up the triangle of 8M, and allocation of computer is difficult to realize interactive frame per second at present.Therefore, the pel number that minimizing will be played up landform is the key problem that this field solves, and in the quality error scope, all work all are to play up data volume in order to reduce.
For the problem that solves the mass data access and play up, method commonly used is that terrain data is carried out piecemeal according to the meticulous level of difference, in internal memory, safeguard the data structure (normally kd tree) of a complexity, then when viewpoint moves, according to other error requirements of screen pixels level, choose the data of different meticulous levels in this tree, the terrain block with different detailed levels is stitched together at last.This traditional algorithm can cause the CPU computational load excessive, and it is discontinuous to cause 3-D view to show.
In a word, the existing method of playing up landform exists computing complexity in the process of playing up landform, slow-footed defective.
Thereby, need at present the urgent technical matters that solves of those skilled in the art to be exactly: how to find a kind of novel method of playing up fast landform.
Summary of the invention
A technical matters to be solved by this invention provides the method that a kind of GeometryClipmap based on GPU plays up landform, and the method is a kind of method of playing up fast landform, and the 3-D view that obtains shows continuously.
In order to address the above problem, the invention discloses the method that a kind of GeometryClipmap based on GPU plays up landform, comprising:
The height texture data are organized the height texture data of the different resolution of arranging step by step;
Obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data;
Transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of many transitional zones;
Computing method vector and detail textures in pixel coloring device obtain normal vector and detail textures;
Image rendering to screen, is obtained the image rendering effect that shows at screen;
Detect viewpoint and whether upgrade, make corresponding operation.
Preferably, described the height texture data are organized, the step of the height texture data of the different resolution of arranging step by step comprises:
Obtain the height texture data in the current view point scope, obtain the height texture data in the current view point scope;
Obtain the height texture data of different resolution, obtain the height texture data of different resolution;
The height texture data of different resolution are arranged according to the mode of Clipmap, obtain the step by step height texture data of the different resolution of arrangement.
Preferably, the described step that the height texture data are organized comprises:
Altitude information to the height texture data is organized, the altitude information of the height texture data after obtaining to synthesize;
Horizontal data to the height texture data is organized, and obtains the horizontal data of height texture data;
Terrain data to the height texture data merges, and obtains the terrain data of height texture data.
Preferably, described altitude information to the height texture data is organized, and the step of the altitude information of the height texture data after obtaining to synthesize comprises:
The altitude information of height data texturing is created, obtain the texture altitude information of 32 float precision;
Be saved in two layer texture altitude informations in the texture and be transferred to GPU;
The texture altitude information of current layer is saved as the integral part of the texture altitude information of 32 float precision;
Next adjacent layer texture altitude information is saved as the fraction part of the texture altitude information of 32 float precision;
Two layer texture altitude informations are synthesized;
Adopt formula I to come two layer texture altitude informations are calculated, the altitude information of the height texture data after obtaining to synthesize;
V dest(u,v)=V LevelN(u,v)+V LevelN+1(u,v)*0.001 (I)
Wherein, Vdest (u, v) is the texture altitude information after synthesizing, and VLevelN (u, v) is the texture altitude information of relative detailed level, and VLevelN+1 (u, v) is the texture altitude information of relative rough layer.
Preferably, described terrain data to the height texture data merges, and obtains the step of the terrain data of height texture data, comprising:
Utilize altitude information to create the FMT_R32 texture, obtain data texturing;
Data texturing is imported into the constant table of Vertex Shader;
Height Z data are passed into GPU, obtain the one dimension height Z data in the GPU;
X, y 2-D data transmit into GPU by the summit buffering method, obtain x, y 2-D data in the GPU;
One dimension height Z data in the above-mentioned GPU and the x in the GPU, y 2-D data is synthetic, obtain the terrain data of height texture data.
Preferably, whether described detection viewpoint is upgraded, and makes the step of corresponding operation, comprising:
Detect viewpoint and whether upgrade, obtain the analysis result whether viewpoint is upgraded;
Upgrade if analysis result is viewpoint, then carry out the corresponding operating that viewpoint is upgraded;
Do not upgrade if analysis result is viewpoint, the overall process that landform is played up is finished in then receiving algorithm ending request instruction.
Preferably, upgrade if described analysis result is viewpoint, then carry out the step of the corresponding operating of viewpoint renewal, comprising:
Upgrade if analysis result is viewpoint, obtain the data that viewpoint is upgraded;
Calculate the numerical value change that viewpoint moves according to the data that viewpoint is upgraded, obtain the viewpoint movement value;
Come the height texture data are upgraded the height texture data after obtaining to upgrade according to the viewpoint movement value;
Obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data;
Transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of transitional zone;
Computing method vector and detail textures in pixel coloring device obtain normal vector and detail textures;
Image rendering to screen, is obtained the image rendering effect that shows at screen;
Finish aforesaid operations, carry out one and take turns the corresponding operating that viewpoint is upgraded;
Carry out the corresponding operating that many wheel viewpoints are upgraded;
The result whether the detection viewpoint is upgraded is that viewpoint is not upgraded, and the overall process that landform is played up is finished in then receiving algorithm ending request instruction.
Preferably, the mode that eliminate in described crack is for by adding a transitional zone between two terrain block so that be same fineness in the brim height data of transitional zone and the altitude information of lower one deck collection, then so that the crack eliminate.
Preferably, described mode by GeometryClipmap is played up landform, obtains the design sketch of terrain rendering.
Preferably, described mode by GeometryClipmap is played up landform, obtains the step of the design sketch of terrain rendering, comprising:
Terrain data is buffered in one group of nested specification grid;
When observation point moves, by upgrading terrain data, the terrain data after obtaining to upgrade;
Regular grid utilizes vertex Texture technology that altitude information is sampled in GPU, obtains altitude information;
Altitude information and two dimensional surface data are made up, obtain three-dimensional space data;
According to three-dimensional space data landform is played up, obtained the design sketch of terrain rendering.
Remarkable advantage of the present invention is:
Cpu load when reducing terrain rendering to greatest extent.It is not only playing up of terrain mesh that large-scale terrain is played up, and also needs some earth's surface object is carried out special processing, and such as the earth's surface derivant in field such as trees, weeds, landforms etc., simulating these effects needs very high cost equally.So, in order to improve the quality of playing up of outdoor large-scale terrain, need to reduce as far as possible calculated amount at basic grid, to reduce the load of CPU, realize other special-effect that play up on the earth's surface at limited computational resource.
In a word, the invention provides the method that a kind of GeometryClipmap based on GPU plays up landform, the method is a kind of method of playing up fast landform, and the 3-D view that obtains shows continuously.
Description of drawings
Fig. 1 is the flow chart of steps of the embodiment of a kind of GeometryClipmap based on GPU of the present invention method of playing up landform;
Fig. 2 is the generation flow chart of steps of the dimensional topography data among the present invention;
Fig. 3 is the flow chart of steps that a kind of GeometryClipmap based on GPU among the present invention plays up the method for landform.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
One of core concept of the present invention provides that a kind of (Graphic Processing Unit translator of Chinese is for " GPU " based on GPU, GPU is a concept with respect to CPU, because in the computing machine in modern times, domestic system particularly, the fan of game, the processing of figure becomes more and more important, the core processor that needs a special figure) GeometryClipmap plays up the method for landform, comprise: the height texture data are organized the height texture data of the different resolution of arranging step by step; Obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data; Transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of many transitional zones; Computing method vector and detail textures in pixel coloring device obtain normal vector and detail textures; Image rendering to screen, is obtained the image rendering effect that shows at screen; Detect viewpoint and whether upgrade, make corresponding operation; The method is a kind of method of playing up fast landform, and the 3-D view that obtains shows continuously.
Clipmap adopts pyramidal layer time mode organising data, and the resolution of each layer data is half of last detailed level.It is very fast that GPU processes data texturing speed, can first altitude information be stored in the texture, passes to GPU after creating mipmap; Then the Vertex Texture technology of utilizing Shader model3.0 to support, height of sampling data texturing in Vertex Shader.Along with view distance is more and more far away, when texture sampling, chooses the lower texture layer of meticulous depth and sample.Each only the need just can be constructed whole earth's surface grid data to the identical data fritter of GPU importing, greatly reduces the burden of GPU data access.When viewpoint moved, data can successively be upgraded, and remained that viewpoint is in the center of data, successively roughening.
With reference to Fig. 1, show the flow chart of steps of embodiment that a kind of GeometryClipmap based on GPU of the present invention plays up the method for landform, specifically can comprise:
Step 101, the height texture data are organized the height texture data of the different resolution of arranging step by step.
The terrain mesh of cutting apart is regular, so have high consistency (such as Fig. 1) cutting apart of terrain block.Each Clipmap is comprised of several banded data as shown in the figure, and each ring is comprised of the piece of similar number, and difference only is that position and the convergent-divergent of each piece is different.Because the characteristics of 2D (x, y) data and altitude information are different, so the processing mode of these two classes data is also different.
Those skilled in the art understands the present invention better, and in a preferred embodiment of the invention, described step 101 specifically can comprise:
Substep A1, obtain the height texture data in the current view point scope, obtain the height texture data in the current view point scope.
Substep A2, obtain the height texture data of different resolution, obtain the height texture data of different resolution.
Substep A3, the height texture data of different resolution are arranged according to the mode of Clipmap, obtain the height texture data of the different resolution arranged step by step.
Wherein, the described step that the height texture data are organized comprises:
Substep B1, the altitude information of height texture data is organized, obtained the altitude information of the height texture data after synthetic.
Wherein, described substep B1 specifically can comprise:
The altitude information of substep C1, general's height data texturing creates, and obtains the texture altitude information of 32 float precision.
Substep C2, be saved in two layer texture altitude informations in the texture and be transferred to GPU.
Substep C3, the texture altitude information of current layer saved as the integral part of the texture altitude information of 32 float precision.
Substep C4, next adjacent layer texture altitude information saved as the fraction part of the texture altitude information of 32 float precision.
Substep C5, two layer texture altitude informations are synthesized.
Substep C6, employing formula I come two layer texture altitude informations are calculated, the altitude information of the height texture data after obtaining to synthesize;
Vdest(u,v)=VLevelN(u,v)+VLevelN+1(u,v)*0.001 (I)
Wherein, Vdest (u, v) is the texture altitude information after synthesizing, and VLevelN (u, v) is the texture altitude information of relative detailed level, and VLevelN+1 (u, v) is the texture altitude information of relative rough layer.
In order to make those skilled in the art understand better the present invention, below introduce in detail the tissue of the altitude information of height data texturing, specific as follows described:
Traditional method is that Organization of Data is become summit buffering or index buffering, passes to GPU again, but revises summit buffering and index buffering because the GPU of Shadermodel3.0 is not supported in the GPU the inside, and these operations are all carried out in CPU, and cost is very large.In order to overcome above-mentioned shortcoming, the present invention adopts the vertex texture technology to store these data.Vertex Texture (vertex texture sampling) is the GPU characteristic that Shader model3.0 supports, it allow Vertex Shader as PixelShader from texture reading out data.Developing GPU technology also is that the form that computational data is organized into texture is input among the GPU in fact.6800 support to use the texture format of D3DFMT_R32F and D3DFMT_A32B32G32R32F to realize Vertex Texture.Because the video card that this research work is used is nVidiaGeForce7400Go, only supports the D3DFMT_R32F form, so adopt this format memory data when realizing.At first altitude information is created the texture of 32 float precision, when realizing, for pick up speed, two layer data can be existed a texture the inside to pass among the GPU.Then the integral part that the altitude information of current layer is existed the float data is stored in fraction part to next adjacent layer height data, so once just two layer data can be passed in GPU, and this is extremely important when solving the landform crack problem.
Vdest(u,v)=VLevelN(u,v)+VLevelN+1(u,v)*0.001 (1)
Wherein Vdest (u, v) is synthetic data texturing afterwards, and VLevelN (u, v) is the data of relative detailed level, and VLevelN+1 (u, v) is relatively more coarse data Layer.
Need some time costs in the time of with data importing GPU, through just reducing the transmission burden of GPU after the above-mentioned processing, improve performance.Altitude information has arrived after the GPU, can be sampled out in Vertex Shader the inside, and then each sampled point just can be isolated corresponding two-layer data value.
Substep B2, the horizontal data of height texture data is organized, obtained the horizontal data of height texture data.
In order to make those of ordinary skill understand better the present invention, the below introduces the structure of the horizontal data tissue of the height texture data among the present invention in detail.
1) partition data of Clipmap landform is a-circle-by-a-circle ring-type data centered by viewpoint, and each circle has represented plot shape zone, and except that middle piece is complete rectangle, other all are ring-types.
2) the data acquisition sampling point of each ring-type is the same, but the zone of representative is different.The area of outer ring rectangle is the twice of adjacent nexine.Along with view distance is more and more far away, the fineness of each shape of enclosing the land descends in 1/2 ratio.Because the degree of depth, the size differences of each tri patch screen space is little, and therefore the tissue based on these more regular data has reduced unnecessary tri patch.Finally, whole terrain block all is to splice in the manner described above, and each circle is combined into by 12 sub-blocks again, and the basic composition unit on earth's surface is exactly these fritters.
Substep B3, the terrain data of height texture data is merged, obtain the terrain data of height texture data.
Wherein, described substep B3 specifically can comprise:
Substep D1, utilize altitude information create to create the FMT_R32 texture, obtain data texturing.
Substep D2, data texturing imported into the constant table of Vertex Shader.
Substep D3, height Z data are passed into GPU, obtain the one dimension height Z data in the GPU.
Substep D4, x, y 2-D data transmit into GPU by the summit buffering method, obtain x, y 2-D data in the GPU.
Substep D5, the one dimension height Z data in the above-mentioned GPU and the x in the GPU, y 2-D data is synthetic obtains the terrain data of height texture data.
In order to make those skilled in the art understand better the present invention, the below introduces the merging process of terrain data in detail, and is specific as follows described:
After utilizing altitude information to create the FMT_R32 texture, import texture the constant table of Vertex Shader into, Z data are highly passed into GPU.
(x, y) 2-D data transmits into GPU by summit buffering form.
Because these two parts data are separately storages, need to height one-dimensional data and two-dimensional level data is synthetic.
With reference to Fig. 2, show the generation flow chart of steps of the dimensional topography data among the present invention.
The as can be seen from Figure 2 overall process of the generation of the dimensional topography data among the present invention.
In order to make those skilled in the art understand better the present invention, the below introduces the structure that the fritter apex coordinate among the present invention calculates in detail, and is specific as follows described:
Each fritter represents a ground table section, and the area size of setting the fritter representative is S, and the hits of fritter is to M*N, take the fritter center as true origin.
Its coordinate figure can adopt formula 2 to calculate in fritter each sampled point so:
Px,y(row,col)=(-S/2,S/2)+(col/(M-1))*S,-row/(M-1)*S)(2)
Px wherein, y (row, col) are (x, y) coordinate figure of capable, the corresponding sampled point of col of row in the fritter; S is the sample coordinate block size; M is line number, and N is columns.That piece of bosom and back to back first ring block do not need outside the convergent-divergent, and ensuing each piece will carry out amplifying according to the multiple of Zn-2, in fact in n be one take the center sequence number as 0 layer of beginning.Data block is carried out first convergent-divergent after being sent to GPU, moves to the relevant position of suitable layers again.Next according to plane (x, the y) data that obtain at last, be converted to (u, v) coordinate, as shown in Equation 3:
(U,V)=(x,y)/S (3)
Wherein S is the size of current sample coordinate piece place terrain block.Then use again U, the V coordinate is at detailed level and the rough layer altitude information of sampling out respectively, mix, the purpose of doing like this is also to eliminate the crack so that meticulous variation toggle edges changes milder whiles of ground, and the details of this part content is in the careful description of this joint the inside of elimination in crack.
Step 102, obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data.
Step 103, transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of many transitional zones.
Step 104, in pixel coloring device computing method vector and detail textures, obtain normal vector and detail textures.
Step 105, with image rendering to screen, obtain the image rendering effect that shows at screen.
Whether step 106, detection viewpoint are upgraded, and make corresponding operation.
In order to make those skilled in the art understand better the present invention, in another preferred embodiment of the present invention, described step 106 specifically can comprise:
Whether substep E1, detection viewpoint are upgraded, and obtain the analysis result whether viewpoint is upgraded.
If substep E2 analysis result is that viewpoint is upgraded, then carry out the corresponding operating that viewpoint is upgraded.
Wherein, described substep E2 specifically can comprise:
If substep F1 analysis result is that viewpoint is upgraded, obtain the data that viewpoint is upgraded.
Substep F2, the data of upgrading according to viewpoint are calculated the numerical value change that viewpoint moves, and obtain the viewpoint movement value.
Substep F3, come the height texture data are upgraded the height texture data after obtaining to upgrade according to the viewpoint movement value.
Substep F4, obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data.
Substep F5, transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of transitional zone.
Substep F6, in pixel coloring device computing method vector and detail textures, obtain normal vector and detail textures.
Substep F7, with image rendering to screen, obtain the image rendering effect that shows at screen.
Substep F8, finish aforesaid operations, carry out one and take turns the corresponding operating that viewpoint is upgraded.
The corresponding operatings that substep F9, the many wheels of execution viewpoints are upgraded.
The result whether substep F10, detection viewpoint are upgraded is that viewpoint is not upgraded, and the overall process that landform is played up is finished in then receiving algorithm ending request instruction.
If substep E3 analysis result is that viewpoint is not upgraded, the overall process that landform is played up is finished in then receiving algorithm ending request instruction.
Wherein, play up in the method for landform at a kind of GeometryClipmap based on GPU, the mode that eliminate in described crack is added a transitional zone for passing through between two terrain block, so that be same fineness in the brim height data of transitional zone and the altitude information of lower one deck collection, then so that the crack eliminate.
Described mode by GeometryClipmap is played up landform, obtains the design sketch of terrain rendering.
Described mode by GeometryClipmap is played up landform, obtains the step of the design sketch of terrain rendering, comprising:
Substep G1, terrain data is buffered in one group of nested specification grid.
Substep G2, when observation point moves, by upgrading terrain data, the terrain data after obtaining to upgrade.
Substep G3, regular grid utilize vertex Texture technology that altitude information is sampled in GPU, obtain altitude information.
Substep G4, altitude information and two dimensional surface data are made up, obtain three-dimensional space data.
Substep G5, according to three-dimensional space data landform is played up, obtained the design sketch of terrain rendering.
Relate in the present invention the renewal of data, can understand better the present invention in order to make those of ordinary skill in the art, the below introduces the related content of the renewal of data in detail, and is specific as follows described:
In the time of roaming scence, that pyramid storehouse that keeps in internal memory just need to according to the position of viewpoint, go to read the data that need in corresponding memory buffer.Each Clipmap needs to keep viewpoint in the center, generally has the window area of a very little L shaped shape to need to upgrade when viewpoint moves.Because relative motion is the index time decline with e in user window, so the coarse level of periphery seldom needs to upgrade when upgrading.
In order to make those skilled in the art understand better the present invention, the below introduces the process that the data block among the present invention is upgraded in detail, and is specific as follows described:
The overall process that data block is upgraded: according to the level that from coarse to meticulous, activates Clipmap new data more, use the mode height of sampling data texturing around addressing when upgrading, data texturing can be stored according to the shape data block mode, so only by changing addressing mode, thereby avoided moving a large amount of valid data, improved data-handling efficiency.When viewpoint moved towards a direction, the rectangular area of viewpoint will be filled into new data dorsad.
In order to make those skilled in the art understand better the present invention, the below introduces Clipmap and the buffer strip among the present invention in detail, and is specific as follows described:
Zone of transition between each Clipmap adjacent two layers all can have a data buffer strip.
In the practical operation, the zone of transition between each Clipmap adjacent two layers all can have a data buffer strip.Viewpoint is in the time of roaming, data need to be done the paging scheduling, the data of looking ahead can be placed on the excessive edge circle of the every one deck of Clipmap, be also referred to as inactive area, in playing up, these regional data can not directly be accessed, when viewpoint moves to the effective coverage, system can extract data from effective district and be played up, and inactive area is exactly the area of a store data buffering.
Relate in the present invention the crack and eliminate, can understand better the present invention in order to make those of ordinary skill in the art, the below introduces the related content of the renewal of data in detail, and is specific as follows described:
The method that eliminate in the crack is: add a transitional zone between two terrain block.
The process of the terrain block transition among the present invention is as described below:
Adopt a transitional zone in the edge zone that the meticulous level of terrain block changes.In this transitional zone, the height value of current point is the mixed number of this level height map collection height and next coarse level altitude information, along with more and more keeping to the side a little, the proportion that the height number of next level accounts for increases gradually, do like this that can to make in the brim height data of transitional zone and the altitude information of lower one deck collection be same fineness, the crack can be eliminated.
The concrete scheme that adopts is as follows:
Sampling logic in Vertex Shader the inside is:
The non-edge sample point of if
The current meticulous altitude information of Height=Direct Sampling
Else if even number of samples point
Next rough layer relevant position altitude information of Heigt=Direct Sampling
else
Heigt1=is with the next rough layer corresponding height of his previous even number of samples point sampling data
Heig2=is with the next rough layer corresponding height of his rear even number of samples point sampling data
Heigt=(Heigt1+Height2)/2
endif
Through after the top sampling logic, oneself eliminates the crack through thorough.
Among the rendering effect figure before the elimination crack from the present invention, can obtain conclusion: the crack between the transitional zone is relatively obvious.
Among the rendering effect figure in the elimination crack from the present invention, can obtain conclusion: eliminate in the crack between the transitional zone, and it is more smooth to play up the design sketch that obtains.
Relate in the present invention the GeometryClipmap method, can understand better the present invention in order to make those of ordinary skill in the art, the below introduces the related content of the renewal of data in detail, and is specific as follows described:
GeometryClipmap is be used to the new method of playing up Terrain LOD.It is buffered in landform in one group of nested regular grid, when observation point moves, constantly updates these data simultaneously.Contrast irregular grid (irregular mesh) technology, the grid of rule has many good qualities: succinct data structure, level and smooth visual effect, stable play up speed, suitable classification.Regular grid utilizes vertex Texture technology to carry out the sampling of altitude information in GPU, again in conjunction with the two dimensional surface data, be combined into together new three-dimensional space data, the benefit of doing like this is, a large amount of calculating is placed among the GPU to be carried out, alleviated CPU (Central Processing Unit, translator of Chinese is central processing unit, arithmetic core and the control core of a computing machine, its function mainly is the data in interpretive machine instruction and the process computer software, and CPU is by arithmetical unit, the data that controller and register and realizing contacts between them, the bus formation of control and state) burden.Synthetic in the GPU of data simultaneously, reduced the transmission pressure of internal memory to the AGP video memory, also further improved the performance of system.
With reference to Fig. 3, show the flow chart of steps that a kind of GeometryClipmap based on GPU among the present invention plays up the method for landform.
As can be seen from Figure 3: the overall process that the method that adopts a kind of GeometryClipmap based on GPU to play up landform is played up landform.
In a word, the invention provides the method that a kind of GeometryClipmap based on GPU plays up landform, the method is a kind of method of playing up fast landform, and the 3-D view that obtains shows continuously.
More than a kind of GeometryClipmap based on GPU provided by the present invention is played up landform method be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. the GeometryClipmap based on GPU plays up the method for landform, it is characterized in that, comprising:
The height texture data are organized the height texture data of the different resolution of arranging step by step;
Obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data;
Transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of many transitional zones;
Computing method vector and detail textures in pixel coloring device obtain normal vector and detail textures;
Image rendering to screen, is obtained the image rendering effect that shows at screen;
Detect viewpoint and whether upgrade, make corresponding operation.
2. the method for claim 1 is characterized in that, described the height texture data is organized, and the step of the height texture data of the different resolution of arranging step by step comprises:
Obtain the height texture data in the current view point scope, obtain the height texture data in the current view point scope;
Obtain the height texture data of different resolution, obtain the height texture data of different resolution;
The height texture data of different resolution are arranged according to the mode of Clipmap, obtain the step by step height texture data of the different resolution of arrangement.
3. the method for claim 1 is characterized in that, the described step that the height texture data are organized comprises:
Altitude information to the height texture data is organized, the altitude information of the height texture data after obtaining to synthesize;
Horizontal data to the height texture data is organized, and obtains the horizontal data of height texture data;
Terrain data to the height texture data merges, and obtains the terrain data of height texture data.
4. method as claimed in claim 3 is characterized in that, described altitude information to the height texture data is organized, and the step of the altitude information of the height texture data after obtaining to synthesize comprises:
The altitude information of height data texturing is created, obtain the texture altitude information of 32 float precision;
Be saved in two layer texture altitude informations in the texture and be transferred to GPU;
The texture altitude information of current layer is saved as the integral part of the texture altitude information of 32 float precision;
Next adjacent layer texture altitude information is saved as the fraction part of the texture altitude information of 32 float precision;
Two layer texture altitude informations are synthesized;
Adopt formula I to come two layer texture altitude informations are calculated, the altitude information of the height texture data after obtaining to synthesize;
V dest(u,v)=V LevelN(u,v)+V LevelN+1(u,v)*0.001(I)
Wherein, Vdest (u, v) is the texture altitude information after synthesizing, and VLevelN (u, v) is the texture altitude information of relative detailed level, and VLevelN+1 (u, v) is the texture altitude information of relative rough layer.
5. method as claimed in claim 3 is characterized in that, described terrain data to the height texture data merges, and obtains the step of the terrain data of height texture data, comprising:
Utilize altitude information to create the FMT_R32 texture, obtain data texturing;
Data texturing is imported into the constant table of Vertex Shader;
Height Z data are passed into GPU, obtain the one dimension height Z data in the GPU;
X, y 2-D data transmit into GPU by the summit buffering method, obtain x, y 2-D data in the GPU;
One dimension height Z data in the above-mentioned GPU and the x in the GPU, y 2-D data is synthetic, obtain the terrain data of height texture data.
6. the method for claim 1 is characterized in that, whether described detection viewpoint is upgraded, and makes the step of corresponding operation, comprising:
Detect viewpoint and whether upgrade, obtain the analysis result whether viewpoint is upgraded;
Upgrade if analysis result is viewpoint, then carry out the corresponding operating that viewpoint is upgraded;
Do not upgrade if analysis result is viewpoint, the overall process that landform is played up is finished in then receiving algorithm ending request instruction.
7. method as claimed in claim 6 is characterized in that, upgrades if described analysis result is viewpoint, then carries out the step of the corresponding operating of viewpoint renewal, comprising:
Upgrade if analysis result is viewpoint, obtain the data that viewpoint is upgraded;
Calculate the numerical value change that viewpoint moves according to the data that viewpoint is upgraded, obtain the viewpoint movement value;
Come the height texture data are upgraded the height texture data after obtaining to upgrade according to the viewpoint movement value;
Obtain the height value of height texture organising data according to vertex position from equivalent layer, obtain the height value of height texture organising data;
Transitional zone is carried out the mixing of summit altitude figures, obtain the elevation blended data of transitional zone;
Computing method vector and detail textures in pixel coloring device obtain normal vector and detail textures;
Image rendering to screen, is obtained the image rendering effect that shows at screen;
Finish aforesaid operations, carry out one and take turns the corresponding operating that viewpoint is upgraded;
Carry out the corresponding operating that many wheel viewpoints are upgraded;
The result whether the detection viewpoint is upgraded is that viewpoint is not upgraded, and the overall process that landform is played up is finished in then receiving algorithm ending request instruction.
8. the method for claim 1 is characterized in that:
The mode that eliminate in described crack is for by adding a transitional zone between two terrain block so that be same fineness in the brim height data of transitional zone and the altitude information of lower one deck collection, then so that the crack eliminate.
9. the method for claim 1 is characterized in that:
Described mode by GeometryClipmap is played up landform, obtains the design sketch of terrain rendering.
10. the method for claim 1 is characterized in that, described mode by GeometryClipmap is played up landform, obtains the step of the design sketch of terrain rendering, comprising:
Terrain data is buffered in one group of nested specification grid;
When observation point moves, by upgrading terrain data, the terrain data after obtaining to upgrade;
Regular grid utilizes vertex Texture technology that altitude information is sampled in GPU, obtains altitude information;
Altitude information and two dimensional surface data are made up, obtain three-dimensional space data;
According to three-dimensional space data landform is played up, obtained the design sketch of terrain rendering.
CN201110325143.6A 2011-10-24 2011-10-24 Method for rendering terrain based on graphic processing unit (GPU) Active CN102890829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110325143.6A CN102890829B (en) 2011-10-24 2011-10-24 Method for rendering terrain based on graphic processing unit (GPU)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110325143.6A CN102890829B (en) 2011-10-24 2011-10-24 Method for rendering terrain based on graphic processing unit (GPU)

Publications (2)

Publication Number Publication Date
CN102890829A true CN102890829A (en) 2013-01-23
CN102890829B CN102890829B (en) 2015-05-27

Family

ID=47534321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110325143.6A Active CN102890829B (en) 2011-10-24 2011-10-24 Method for rendering terrain based on graphic processing unit (GPU)

Country Status (1)

Country Link
CN (1) CN102890829B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103745448A (en) * 2013-12-24 2014-04-23 四川大学 Rapid generating method for ultrahigh-resolution composite image in raster 3D displaying
CN104318605A (en) * 2014-10-23 2015-01-28 南京大学 Parallel lamination rendering method of vector solid line and three-dimensional terrain
CN106327557A (en) * 2015-06-18 2017-01-11 中国石油化工股份有限公司 Quick rendering method of large-scale data
CN106997612A (en) * 2016-01-13 2017-08-01 索尼互动娱乐股份有限公司 The apparatus and method of image rendering
CN107742317A (en) * 2017-09-27 2018-02-27 杭州群核信息技术有限公司 A kind of acquisition methods for rendering image, device, rendering system and storage medium
CN107818069A (en) * 2016-09-12 2018-03-20 阿里巴巴集团控股有限公司 Data processing method and system
CN108305315A (en) * 2018-01-24 2018-07-20 珠江水利委员会珠江水利科学研究院 A kind of efficient gradual change color method of dimensional topography based on WPF
CN108986212A (en) * 2018-06-21 2018-12-11 东南大学 Three-dimensional virtual terrain L OD model generation method based on crack elimination
CN110852952A (en) * 2019-11-08 2020-02-28 四川大学 GPU-based large-scale terrain real-time rendering method
CN110866964A (en) * 2019-11-08 2020-03-06 四川大学 GPU accelerated ellipsoid clipping map terrain rendering method
CN111494944A (en) * 2020-04-22 2020-08-07 浙江无端科技股份有限公司 Terrain texture loading method and related device
CN111506680A (en) * 2019-01-31 2020-08-07 阿里巴巴集团控股有限公司 Terrain data generation method, terrain data rendering method, terrain data generation device, terrain data rendering device, medium, server and terminal
CN111729307A (en) * 2020-07-30 2020-10-02 腾讯科技(深圳)有限公司 Virtual scene display method, device, equipment and storage medium
CN111882640A (en) * 2020-07-24 2020-11-03 上海米哈游天命科技有限公司 Rendering parameter determination method, device, equipment and storage medium
CN111882634A (en) * 2020-07-24 2020-11-03 上海米哈游天命科技有限公司 Image rendering method, device and equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261743A (en) * 2007-10-19 2008-09-10 北京航空航天大学 A simulation method for large-scale terrain roam based on rule grid
CN101694726A (en) * 2009-10-20 2010-04-14 北京航空航天大学 Fusing and drawing method based on multi-source terrain data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261743A (en) * 2007-10-19 2008-09-10 北京航空航天大学 A simulation method for large-scale terrain roam based on rule grid
CN101694726A (en) * 2009-10-20 2010-04-14 北京航空航天大学 Fusing and drawing method based on multi-source terrain data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ARUL ASIRVATHAM AND HUGUES HOPPE: "Terrain rendering using GPU-based geometry clipmaps", 《GPU GEMS 2》 *
蒲昌吉: "基于GPU的超大规模地形实时绘制技术", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103745448B (en) * 2013-12-24 2016-08-17 四川大学 Grating 3D show in the rapid generation of ultrahigh resolution composograph
CN103745448A (en) * 2013-12-24 2014-04-23 四川大学 Rapid generating method for ultrahigh-resolution composite image in raster 3D displaying
CN104318605A (en) * 2014-10-23 2015-01-28 南京大学 Parallel lamination rendering method of vector solid line and three-dimensional terrain
CN104318605B (en) * 2014-10-23 2017-03-22 南京大学 Parallel lamination rendering method of vector solid line and three-dimensional terrain
CN106327557B (en) * 2015-06-18 2019-11-08 中国石油化工股份有限公司 A kind of Fast rendering method of large-scale data
CN106327557A (en) * 2015-06-18 2017-01-11 中国石油化工股份有限公司 Quick rendering method of large-scale data
CN106997612A (en) * 2016-01-13 2017-08-01 索尼互动娱乐股份有限公司 The apparatus and method of image rendering
CN106997612B (en) * 2016-01-13 2022-08-30 索尼互动娱乐股份有限公司 Image rendering apparatus and method
CN107818069A (en) * 2016-09-12 2018-03-20 阿里巴巴集团控股有限公司 Data processing method and system
TWI739828B (en) * 2016-09-12 2021-09-21 香港商阿里巴巴集團服務有限公司 Data processing method and system
CN107742317A (en) * 2017-09-27 2018-02-27 杭州群核信息技术有限公司 A kind of acquisition methods for rendering image, device, rendering system and storage medium
CN108305315A (en) * 2018-01-24 2018-07-20 珠江水利委员会珠江水利科学研究院 A kind of efficient gradual change color method of dimensional topography based on WPF
CN108986212A (en) * 2018-06-21 2018-12-11 东南大学 Three-dimensional virtual terrain L OD model generation method based on crack elimination
CN108986212B (en) * 2018-06-21 2022-05-13 东南大学 Three-dimensional virtual terrain LOD model generation method based on crack elimination
CN111506680A (en) * 2019-01-31 2020-08-07 阿里巴巴集团控股有限公司 Terrain data generation method, terrain data rendering method, terrain data generation device, terrain data rendering device, medium, server and terminal
CN111506680B (en) * 2019-01-31 2023-05-26 阿里巴巴集团控股有限公司 Terrain data generation and rendering method and device, medium, server and terminal
CN110852952A (en) * 2019-11-08 2020-02-28 四川大学 GPU-based large-scale terrain real-time rendering method
CN110866964A (en) * 2019-11-08 2020-03-06 四川大学 GPU accelerated ellipsoid clipping map terrain rendering method
CN111494944A (en) * 2020-04-22 2020-08-07 浙江无端科技股份有限公司 Terrain texture loading method and related device
CN111882640A (en) * 2020-07-24 2020-11-03 上海米哈游天命科技有限公司 Rendering parameter determination method, device, equipment and storage medium
CN111882634A (en) * 2020-07-24 2020-11-03 上海米哈游天命科技有限公司 Image rendering method, device and equipment and storage medium
CN111882640B (en) * 2020-07-24 2023-03-14 上海米哈游天命科技有限公司 Rendering parameter determination method, device, equipment and storage medium
CN111882634B (en) * 2020-07-24 2024-02-06 上海米哈游天命科技有限公司 Image rendering method, device, equipment and storage medium
CN111729307A (en) * 2020-07-30 2020-10-02 腾讯科技(深圳)有限公司 Virtual scene display method, device, equipment and storage medium
CN111729307B (en) * 2020-07-30 2023-08-22 腾讯科技(深圳)有限公司 Virtual scene display method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN102890829B (en) 2015-05-27

Similar Documents

Publication Publication Date Title
CN102890829B (en) Method for rendering terrain based on graphic processing unit (GPU)
CN107423445B (en) A kind of map data processing method, device and storage medium
US8570322B2 (en) Method, system, and computer program product for efficient ray tracing of micropolygon geometry
CN104183005B (en) Graphics processing unit and rendering intent based on segment
CN100468461C (en) Real time drawing method of vivid three dimensional land form geograpical model
CN102750725B (en) The terrain rendering method that graphic based processor accelerates
CN106485776A (en) A kind of method and system of 3D game real-time rendering large scale scene
CN106446351A (en) Real-time drawing-oriented large-scale scene organization and scheduling technology and simulation system
CN110738721A (en) Three-dimensional scene rendering acceleration method and system based on video geometric analysis
EP2209092A1 (en) Method for unified visualisation of heterogeneous datasets
CN102074049A (en) Wide-range terrain scheduling simplifying method based on movement of viewpoint
CN104835202A (en) Quick three-dimensional virtual scene constructing method
CN102768765A (en) Real-time soft shadow rendering method for point light sources
CN105956165B (en) A kind of big file storage organization method of the tile type of three-dimensional modeling data
CN102117497A (en) Method and system for three-dimensional terrain modeling
CN102651141A (en) Method for automatically superposing and rendering vector map and high-resolution digital elevation models in large scene
Livnat et al. Interactive point-based isosurface extraction
WO2023231537A1 (en) Topographic image rendering method and apparatus, device, computer readable storage medium and computer program product
CN102915563A (en) Method and system for transparently drawing three-dimensional grid model
CN112860839A (en) Water environment quality real-time monitoring method and device based on Unity3D
CN102509344B (en) Real-time drawing method based on nonuniform sampling three-dimensional object reflection
Frasson et al. Efficient screen-space rendering of vector features on virtual terrains
CN113129420A (en) Ray tracing rendering method based on depth buffer acceleration
CN103793935B (en) A kind of urban dynamic scene generation method based on BRLO Tree mixing tree constructions
Dick et al. GPU-aware hybrid terrain rendering

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
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 834000 Karamay Road, the Xinjiang Uygur Autonomous Region, No. 22

Patentee after: Red software Limited by Share Ltd

Address before: 834000 Karamay Road, the Xinjiang Uygur Autonomous Region, No. 22

Patentee before: Karamay Hongyou Software Co., Ltd.