CN106204735A - Unity3D terrain data using method in Direct3D 11 environment - Google Patents

Unity3D terrain data using method in Direct3D 11 environment Download PDF

Info

Publication number
CN106204735A
CN106204735A CN201610567765.2A CN201610567765A CN106204735A CN 106204735 A CN106204735 A CN 106204735A CN 201610567765 A CN201610567765 A CN 201610567765A CN 106204735 A CN106204735 A CN 106204735A
Authority
CN
China
Prior art keywords
texture
landform
module
derives
array
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
CN201610567765.2A
Other languages
Chinese (zh)
Other versions
CN106204735B (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.)
PLA University of Science and Technology
Original Assignee
PLA University of Science and Technology
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 PLA University of Science and Technology filed Critical PLA University of Science and Technology
Priority to CN201610567765.2A priority Critical patent/CN106204735B/en
Publication of CN106204735A publication Critical patent/CN106204735A/en
Application granted granted Critical
Publication of CN106204735B publication Critical patent/CN106204735B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/04Indexing scheme for image data processing or generation, in general involving 3D image data

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

A kind of Unity3D terrain data using method in Direct3D 11 environment: the Unity3D landform of enhancing derives plug-in unit and includes that many height derive module.The position on landform summit and UV information generating module read and derive the landform vertex data that module derives, and build corresponding geometric triangulation face.Landform appearance texture array generation module, according to deriving the information of texture set in module, the landform appearance texture file needed for reading, generates the landform appearance texture array of Direct3D 11.Hybrid weight texture generation module, according to deriving the data that module derives, generates Direct3D 11 texture containing each texture blend weight information in texture set.The position of vegetation and scaling processing module are according to deriving the three dimensional space coordinate of plant in the vegetation information scene set that module derives, and the scaling carrying out plant patch dimensions adjusts.Pixel tinter, on the basis of three-dimensional rendering key element resource, calculates the illumination of each pixel on screen, hybrid texture sampling in landform appearance texture array, and shows the landform of derivation in the rendering contexts of Direct3D 11.

Description

Unity3D terrain data using method in Direct3D 11 environment
[invention field]
The present invention relates to computer software technical field, the data of a kind of Direct3D 11 process and display side Method.
[technical background]
In prior art, it is frequently necessary to load landform mould developing 3d gaming or design three-dimensional artificial software when Type renders in scene.As a example by engine based on Direct3D technology low level development, these engines load the normal of landform Rule way is, first uses 3DMax such 3D modelling software to carry out the modeling of landform, generates the vertex data of landform, And stick texture bitmap;Derive Direct3D again and can identify that (Direct3D 9 or version before use for the data that use It is the file of X form, begins to use the file of sdkmesh form from Direct3D 10).
When using 3DMax software to build landform, except the position on each summit in relief model to be adjusted, also need The PaintShops such as PS to be used carry out the multiple graphics process such as tone, fusion to the texture of landform, and workload is the biggest.And There is a drawback in this processing mode, it is simply that the when that terrain scene being bigger, in order to improve the details of terrain texture, often Being also sized to of texture correspondingly increases.The texture dimensions of main flow video card support at present is the size of 4096 × 4096 (pixels), But using such large texture, often in some large-scale scenes, a texture remains not enough, needs multiple stricture of vaginas Manage the display that is stitched together, the most just occupy great video card video memory resource.
Unity3D is a commercial software development engine, can be used for development of games, and its built-in terrain editor device can be square Just the relief model of nature is built.The instrument provided in this terrain editor device is provided, just can adjust the height of landform easily Low fluctuating, arranges the texture blend effect in relief model somewhere, planting plants etc..Untiy3D employs a kind of dynamic texture Hybrid technology: the data texturing in display landform somewhere be the moment rendered by pre-loaded texture resource set in different stricture of vaginas The weight of reason carries out that hybrid obtains rather than imports the high definition large texture that multiple pretreatment are good in advance, the most just avoids A large amount of high definition textures occupy system resource.The relief model that so efficiently easily terrain editor device is made can only be Unity3D environment uses, although existing plug-in unit can be used to derive the vertex position information of relief model, but only push up Dot position information is far from being enough, and these data can only see the height of landform in the environment of Direct3D and rise and fall, all Texture information all lost.
If in the engine of non-Unity3D, also can normally demonstrate the landform using Unity3D terrain editor device to generate Model, the most just can save resource for computer system in a large number.
[summary of the invention]
The customer service of the present invention deficiency of above-mentioned technology, to the most existing Untiy3D landform vertex data of can only deriving Plug-in unit has carried out strengthening functionally, adds the data type of derivation;Devise a data preprocessing module, effect be by The terrain data derived is converted in the rendering contexts of Direct3D 11 required data resource;Devise a pixel Point Coloring device so that the data resource after process finally normally can be shown in the environment of Direct3D 11.
For achieving the above object, present invention employs following technical proposal:
The Unity3D landform strengthened derives plug-in unit: include that landform summary info derives module 101;Vertex position information is led Go out module 102;Each layer texture hybrid weight derives module 103;Vegetation information derives module 104.
Derive data preprocessing module: include position and the UV information generating module 201 on landform summit, read vertex position Information derives the landform vertex data that module 102 derives, and builds corresponding geometric triangulation face.
Landform appearance texture array generation module 202, derives the letter of texture set in module 101 according to landform summary info Breath, the landform appearance texture file needed for reading, generate the landform appearance texture array of Direct3D 11.Hybrid weight texture Generation module 203, derives, according to each layer texture hybrid weight, the data that module 103 derives, and generates in texture set containing each Direct3D 11 texture of texture blend weight information.The position of vegetation and scaling processing module 204, lead according to vegetation information Go out the three dimensional space coordinate of plant in the vegetation information scene set that module 104 derives, and carry out the scaling of plant patch dimensions Adjust.
Pixel tinter based on Direct3D 11: effect is at the summit that above-mentioned pretreatment module generates, texture etc. On the basis of three-dimensional rendering key element resource, calculate the illumination of each pixel on screen, according to the information of weight texture in landform Appearance texture array carries out the mixing of texture sampling, and finally correctly demonstrates in the rendering contexts of Direct3D 11 The landform that Unity3D derives.
Specifically:
A kind of Unity3D terrain data using method in Direct3D 11 environment: the Unity3D ground that design strengthens Shape derives plug-in unit, derives data preprocessing module and pixel tinter;
Step 1) derived plug-in unit derivation terrain data by the Unity3D landform strengthened;
Step 2) by deriving data preprocessing module by described step 1) data that obtain are converted to Direct3D11's Data resource required in rendering contexts;
Step 3) processed further by pixel tinter, make step 2) obtaining data resource finally can be at Direct3D The rendering contexts of 11 normally shows;
Described step 1) in, the Unity3D landform of enhancing derives plug-in unit and includes following submodule:
Landform summary info derives module 101: derive landform summary info data;
Vertex position information derives module 102: derive landform vertex data;
Each layer texture hybrid weight derives module 103: derive each layer texture weighted value in texture set;
Vegetation information derives module 104: derive the three dimensional space coordinate of plant in vegetation information scene set;
Described step 2) in, derive data preprocessing module and include following submodule:
The position on landform summit and UV information generating module 201: read described landform vertex data, and build the most several What triangular facet;
Landform appearance texture array generation module 202: according to landform summary info data, in the Unity3D needed for reading Landform appearance texture file, generate Direct3D 11 landform appearance texture array 212;
The raw array of hybrid weight texture becomes module 203: according to layer texture weighted value each in described texture set, generate Direct3D 11 texture, contains the hybrid weight information of each layer texture in the texture set of these textures;
Term illustrates: the hybrid weight of each layer texture is exponential quantity, is a two-dimentional array.Weight texture is texture, Essence is a kind of resource object in Direct3D11.In the present invention, after generating weight texture, by the content pair of hybrid weight Its assignment.
The position of vegetation and scaling processing module 204: according to the three dimensional space coordinate of plant in vegetation information scene set, Scaling adjusts plant patch dimensions;
Described step 3) in, pixel tinter is according to step 2) the three-dimensional rendering factor data resource that obtains, first calculate The illumination value of each pixel on screen;
Then, the information according to hybrid weight texture carries out the mixing of texture sampling in landform appearance texture array 212;
Finally, in the rendering contexts of Direct3D 11, correctly demonstrate the landform derived by Unity3D.
Described step 1) in:
The landform summary info data that landform summary info is derived module 101 and derived include: landform is X in XYZ coordinate system Axle and the size of Z axis, the coordinate of the most left front lattice point of terrain mesh, the size of weight texture, the sub-stricture of vagina of landform appearance texture set The control step-length that reason number and each sub-texture UV in the x and z directions repeat;
Illustrating: landform is regarded as the ground in a room, we to paste the patterned of multilamellar on the ground Glass block.The size of the glass block of every layer is different, and the number that so every layer glass block arranges in the x and z directions also differs Sample, if the length of side that certain layer of glass block is in the X direction is the biggest, that number arranged in the X direction is the least;The control that UV repeats Step-length is it can be understood as the glass block length of side in the x and z directions.
Vertex position information derives module 102 and presses the access order of terrain mesh behavior master, derives successively in terrain mesh The three-dimensional coordinate on each summit;
The data that each layer texture hybrid weight is derived module 103 and derived are the two dimensions of each layer texture weighted value in texture set Array;The size arranging this two-dimensional array is identical with the weight texture dimensions derived by landform summary info derivation module 101;Lead When going out, many layer texture, as one group, derive according to the form of bitmap, and not enough figure layer passage all uses 0 to fill;
The module 104 that derives vegetation information derives the trees or the intersection dough sheet of flowers and plants constituted in Unity3D scene;For Each intersection dough sheet, derives its three-dimensional coordinate and the zoom factor on tri-direction of principal axis of X, Y, Z respectively.
Described step 2) in:
Landform appearance texture array generation module 202 reads each stricture of vagina in the landform appearance texture set in Unity3D Reason file, builds landform appearance texture array 212 required in Direct3D 11 rendering contexts, for pixel tinter Texture sampler sampling;
Here structure refers to create the object of an ID3D11Texture2D, and this object comprises many sub-texture layers, son The number of texture layer is equal to different texture number in landform appearance texture set.Then the texture file that equivalent layer is corresponding is read The content of (picture file that BMP, JPG etc. are common) gives every sub-texture layer assignment of this object.Mixing below the most soluble Close the structure of weight texture permutation.
Hybrid weight texture array generation module 203 reads the bitmap derived, and builds in Direct3D 11 rendering contexts Required hybrid weight texture array 213, the Texture sampler for pixel tinter samples;
The position on landform summit and UV information generating module 201 generate in Direct3D 11 rendering contexts required The vertex data stream 211 of triangular facet;The vertex data stream of triangular facet includes the position on the summit of triangular facet, normal and UV information.
Described step 3) in, by the vertex data stream of triangular facet, it is handled as follows:
301) illumination calculation: needed to render picture by the reciprocal direction vector dot product of illumination in scene in pixel tinter The direction vector of the triangular facet normal at vegetarian refreshments place, just draws the intensity of illumination of this pixel;
302) hybrid weight texture array sampling: hybrid weight texture array 213 is sampled;The UV parameter of sampling can Obtained by the position calculation on summit, the result sampled obtain respective pixel point difference in landform appearance texture array 212 The weighted value of texture layer;
Or with above paving glass block example explanation, weighted value be glass block on ground certain point transparency, On ground, the weighted value of each layer glass block that any point the is corresponding sum that adds up is constantly equal to 1 (this is that Unity3D terrain editor device is fixed The specification of justice).Weighted value is 1, represents the opaquest, the color of certain point on ground, is that certain glass block of this layer is corresponding The decorative pattern of this point of landing ground.Weighted value is 0, represents fully transparent, and glass block is fully transparent on this aspect of ground.
The UV parameter of sampling appearance texture (glass block) certain layer, and the UV parameter of sampling hybrid weight texture, be different 's.The value of the former U is to be deducted the difference that the X of landform left margin is worth to, then divided by this layer of appearance texture by the X value of landform point U controls step-length, and the business calculated takes what fractional part obtained, (describes that with paving glass block the integer part of business is ground There are how many blocks of complete glass blocks on the left side of certain point, and fractional part, is in the X-direction of that block glass block at ground point place Position, such as: 0.5 is the position in the middle of this glass block, 0.25, be this glass block position of starting 1/4 from the left side.) with Reason can also calculate the value of V.
The calculation of hybrid weight texture UV, illustrates vide infra.
303) landform appearance texture array sampling: calculate the position of pixel distance point of observation, by the far and near setting of distance Corresponding detail LOD rank;
Then to step 302) weighted value that obtains judges: weighted value is 0 do not processes;
If weighted value is more than 0, just combines LOD parameter information and texture layer corresponding in landform appearance texture array is carried out Texture samples;The sampling result of cumulative each layer, obtains the ARGB value that each layer texture of landform appearance is total;
The computational methods of the UV sampling parameters of each texture layer are: first calculate pixel in landform X-axis and Z-direction and The distance of landform left front grid;Then this distance value repeats step-length divided by the UV of each texture layer, and the business obtained is taken decimal Part, this fractional part is the UV sampling parameters value of each layer texture in landform appearance texture array 212;
304) comprehensively add up: integrating step 302) the ARGB value that obtains and step 301) illumination value that obtains, finally calculate Go out the ARGB value that this pixel is final.
The illumination value that (by 301) obtains is multiplied by step 302) the ARGB value that obtains calculates the ARGB value that pixel is final)
Described step 1) in, described each layer texture hybrid weight is derived module 103 and is derived the two dimension of each layer texture weighted value During array, every 4 layer texture, as one group, derive according to the form of 32 bitmaps, and not enough figure layer passage all uses 0 to fill out Fill.
Described step 2) landform appearance texture array generation module 202 in, being dimensioned to of each texture is identical Size;Texture array describes the profiling information of landform.
Described step 2) the position on landform summit and UV information generating module 201 in, the position letter on the summit of triangular facet Breath is to be derived the three-dimensional coordinate on each summit in the terrain mesh that module 102 derives successively by vertex position information to provide;Normal It is that the locus on three summits of triangular facet according to composition calculates;
What UV represented is position that mesh point samples in hybrid weight texture, the computational methods of UV are: terrain mesh is The U value of left end lattice point is 0, and the U value of low order end lattice point is 1, and the U value of middle lattice point is according in high order end lattice point X-direction Distance linear change;The V-value of forefront lattice point is 0, and the V-value of rearmost lattice point is 1, and the V-value of middle lattice point is according to away from forefront Distance linear change in lattice point Z-direction.
Beneficial effects of the present invention is as follows:
1, terrain editor device powerful for Unity3D is used to design and produce relief model easily and efficiently, after model completes The terrain data file derived can normally show in the environment of Direct3D 11, solves and uses the 3D moulds such as 3DMax in the past Type Software for producing designs and produces the drawback that relief model is comparatively laborious.
2, solve in the past during rendering large scale terrain high definition texture resource take big defect, and use LOD scheme, it is ensured that the definition of landform close shot texture is undistorted, and the texture of landform distant view is reduced step by step according to the change of distance Display details.The space-saving of video memory resource and the efficiency optimization of real-time rendering all achieve good effect.
3, the design of pixel tinter is rational in infrastructure, given full play to Direct3D 11 powerful render function, software Efficiency is high.
[accompanying drawing explanation]
Fig. 1 is that the present invention strengthens the functional block diagram deriving plug-in unit.
Fig. 2 is the functional block diagram of terrain data pretreatment of the present invention.
Fig. 3 is the workflow diagram of present invention pixel Point Coloring device.
[detailed description of the invention]
It is described in further detail with embodiments of the present invention below in conjunction with the accompanying drawings:
First explanation " the access order of terrain mesh behavior master " this concept.Unity3D uses right-handed scale (R.H.scale) System, stand in the center of landform by us as a example by, the direction of X-axis is to the right, and the direction of Y-axis is upwards, and the direction of Z axis is backward. Access terrain mesh by " the access order of terrain mesh behavior master ", be from the beginning of a line terrain mesh that front is farthest, by Left-to-right accesses successively, then visits again secondary remote a line, and such a line a line, from front to back, until having accessed the most farthest A line.
It is described in detail below and derives the work that plug-in unit modules is done:
Summary info derives module 101: the data of derivation include that landform is the most left front at X-axis and the size of Z axis, terrain mesh The coordinate of lattice point, the size of weight texture, the sub-texture number of landform appearance texture set and each sub-texture are in X and Z-direction The control step-length that upper UV repeats.
Vertex position information derives module 102: derive successively in terrain mesh by the access order of terrain mesh behavior master The three-dimensional coordinate on each summit.
Each layer texture hybrid weight derives module 103: the data of derivation are in texture set the two of each layer texture weighted value Dimension group, the weight texture dimensions that the size of this two-dimensional array is derived module 101 by summary info and derives determines.This weighted value The data type of each element of two-dimensional array is single byte, and scope is from 0 to 255.During derivation, every 4 layer texture, as one group, are pressed Form according to 32 bitmaps is derived, not enough figure layer passage all use and 0 fill (such as texture set has 10 layer texture, that When we build the 3rd 32 bitmap, the passage of G and B all uses 0 to fill).Advantage of this is that our power each layer Weight two-dimensional array regards some channel information of 32 bitmaps as, and those 4 layer texture data just constitute the bitmap of 32, The data so derived we both can visually see its weight information, be also convenient for later stage Direct3D 11 weight texture Create.
Vegetation information derives module 104: derive the trees or flowers and plants being made up of in Unity3D scene intersection dough sheet, often Individual intersection dough sheet derives its three-dimensional coordinate and the zoom factor on tri-direction of principal axis of XYZ respectively.
By the operation of above-mentioned derivation module, we just obtain normally showing in Direct3D 11 rendering contexts The necessary data of Unity3D landform, below in conjunction with the workflow diagram of pixel tinter and the data prediction of Fig. 2 of Fig. 3 Function structure chart illustrates the scheme the most how terrain data derived normally shows in the rendering contexts of Direct3D 11.
Use data preprocessing module that the data deriving module derivation are changed into institute in Direct3D 11 rendering contexts The vertex data stream needed and Direct3D 11 texture array.
Landform appearance texture array generation module 202: read each texture literary composition in the terrain texture set in Unity3D Part, builds texture array required in Direct3D 11 rendering contexts, and the Texture sampler for pixel tinter takes Sample.In the present invention, the size of each texture should be set to identical size.This texture array describe landform meadow, The profiling information such as rock, soil.
Hybrid weight texture array generation module 203: read 32 bitmaps derived, builds and renders at Direct3D 11 Hybrid weight texture array required in environment, the Texture sampler for pixel tinter samples.
The position on landform summit and UV information generating module 201: required for generating in Direct3D 11 rendering contexts The vertex data stream 211 of triangular facet, this vertex data stream is made up of the position on summit, normal, UV information.The positional information on summit Being derived the three-dimensional coordinate on each summit in the terrain mesh that module 102 derives successively by vertex position information to provide, normal can root Calculate according to the locus on three summits of the triangular facet of composition.What UV represented is that mesh point takes in hybrid weight texture The position of sample: the U value of terrain mesh high order end lattice point is 0, the U value of low order end lattice point is 1, and the U value of middle lattice point is according to away from Distance linear change in left end lattice point X-direction.The V-value of forefront lattice point is 0, and the V-value of rearmost lattice point is 1, middle layout The V-value of point is according to the distance linear change in forefront lattice point Z-direction.
In each frame that relief model renders, vertex data stream first passes around vertex shader and processes, and completes three-dimensional space Between summit to the conversion in two-dimensional screen coordinates space, below in conjunction with Fig. 3, the work of the pixel tinter that the present invention builds is described Make flow process:
Illumination calculation unit 301: by the direction of illumination in scene with need rendered pixel point place in pixel tinter The direction of triangular facet normal, calculate the intensity of illumination of this pixel.
Hybrid weight texture array sampling unit 302: to by deriving the hybrid weight texture that data preprocessing module generates Array is sampled, and the position of sampling is determined by the UV value on summit, and the result of sampling obtains this pixel at landform appearance texture In array, the weighted value of different texture layers.
Landform appearance texture sampling unit 303: calculate the position of pixel distance point of observation, the distance of distance phase is set The LOD rank answered.Then the weighted value obtained last step judges, weighted value is 0 do not processes, if greater than 0, just In conjunction with LOD parameter information, texture layer corresponding in landform appearance texture array is carried out texture sampling, the sampling knot of cumulative each layer Really, obtain each layer texture of landform appearance total ARGB value.The UV sampling parameters of each texture layer is calculated by following method: first count Calculate pixel in landform X-axis and Z-direction with the distance of landform left front grid, then the UV divided by each texture layer repeats Step-length, it is the UV sampling parameters value of each layer texture in landform appearance texture array that the business obtained takes fractional part.
Comprehensive summing elements 304: combine the ARGB value that previous step obtains and the illumination obtained by illumination calculation unit 301 Value, finally calculates the ARGB value that this pixel is final.
Intersect in the rendering of dough sheet in vegetation, carry out the adjustment of dough sheet vertex position according to the position of vegetation and zooming parameter Processing, we just complete the normal display in Direct3D 11 rendering contexts of the Unity3D terrain data.
In prior art:
ARGB (rgba) is to represent that Red is red, Green is green, Blue is blue and Alpha transparency.
Two important coordinate systems in threedimensional model, one is position (X, Y, the Z) coordinate on summit, and another is that UV sits Mark.In general, UV is u, and the abbreviation of v Texture Coordinates it provides the positional information that summit samples in texture.

Claims (7)

1. a Unity3D terrain data using method in Direct3D 11 environment, is characterized in that what design strengthened Unity3D landform derives plug-in unit, derives data preprocessing module and pixel tinter;
Step 1) derived plug-in unit derivation terrain data by the Unity3D landform strengthened;
Step 2) by deriving data preprocessing module by described step 1) data that obtain are converted to rendering at Direct3D11 Data resource required in environment;
Step 3) processed further by pixel tinter, make step 2) obtaining data resource finally can be Direct3D's 11 Rendering contexts normally shows;
Described step 1) in, the Unity3D landform of enhancing derives plug-in unit and includes following submodule:
Landform summary info derives module: derive landform summary info data;
Vertex position information derives module: derive landform vertex data;
Each layer texture hybrid weight derives module: derive each layer texture weighted value in texture set;
Vegetation information derives module: derive the three dimensional space coordinate of plant in vegetation information scene set;
Described step 2) in, derive data preprocessing module and include following submodule:
The position on landform summit and UV information generating module: read described landform vertex data, and build corresponding geometric triangulation Face;
Landform appearance texture array generation module: according to landform summary info data, outside the landform in Unity3D needed for reading Looks texture file, generates the landform appearance texture array 212 of Direct3D 11;
The raw array of hybrid weight texture becomes module: according to layer texture weighted value each in described texture set, generate Direct3D 11 Texture, contains the hybrid weight information of each layer texture in the texture set of these textures;
The position of vegetation and scaling processing module: according to the three dimensional space coordinate of plant in vegetation information scene set, scaling is adjusted Whole plant patch dimensions;
Described step 3) in, pixel tinter is according to step 2) the three-dimensional rendering factor data resource that obtains, first calculate screen The illumination value of each pixel upper;
Then, the information according to hybrid weight texture carries out the mixing of texture sampling in landform appearance texture array;
Finally, in the rendering contexts of Direct3D 11, correctly demonstrate the landform derived by Unity3D.
Using method the most according to claim 1, is characterized in that described step 1) in:
The landform summary info data that landform summary info is derived module and derived include: landform is X-axis and Z axis in XYZ coordinate system Size, the coordinate of the most left front lattice point of terrain mesh, the size of weight texture, the sub-texture number of landform appearance texture set and The control step-length that each sub-texture UV in the x and z directions repeats;
Vertex position information derives module and presses the access order of terrain mesh behavior master, derives each summit in terrain mesh successively Three-dimensional coordinate;
The data that each layer texture hybrid weight is derived module and derived are the two-dimensional arrays of each layer texture weighted value in texture set;If The size putting this two-dimensional array is identical with the weight texture dimensions being derived module derivation by landform summary info;During derivation, multilamellar Texture, as one group, is derived according to the form of bitmap, and not enough figure layer passage all uses 0 to fill;
The module that derives vegetation information derives the trees or the intersection dough sheet of flowers and plants constituted in Unity3D scene;For each friendship Fork dough sheet, derives its three-dimensional coordinate and the zoom factor on tri-direction of principal axis of X, Y, Z respectively.
Using method the most according to claim 1, is characterized in that described step 2) in:
Landform appearance texture array generation module reads each texture file in the landform appearance texture set in Unity3D, Building landform appearance texture array required in Direct3D 11 rendering contexts, the texture for pixel tinter samples Device samples;
Hybrid weight texture array generation module reads the bitmap derived, and builds in Direct3D 11 rendering contexts required Hybrid weight texture array, for pixel tinter Texture sampler sample;
The position on landform summit and UV information generating module generate triangular facet required in Direct3D 11 rendering contexts Vertex data stream;The vertex data stream of triangular facet includes the position on the summit of triangular facet, normal and UV information.
Using method the most according to claim 1, is characterized in that described step 3) in, by the vertex data stream of triangular facet, It is handled as follows:
301) illumination calculation: needed rendered pixel point in pixel tinter by the reciprocal direction vector dot product of illumination in scene The direction vector of the triangular facet normal at place, just draws the intensity of illumination of this pixel;
302) hybrid weight texture array sampling: hybrid weight texture array is sampled;The UV parameter of sampling is then by top The position calculation of point obtains, the result sampled obtain the texture that respective pixel point is different in landform appearance texture array 212 The weighted value of layer;
303) landform appearance texture array sampling: calculate the position of pixel distance point of observation, the distance of distance arrange accordingly Detail LOD rank;
Then to step 302) weighted value that obtains judges: weighted value is 0 do not processes;
If weighted value is more than 0, just combines LOD parameter information and texture layer corresponding in landform appearance texture array is carried out texture Sampling;The sampling result of cumulative each layer, obtains the ARGB value that each layer texture of landform appearance is total;
The computational methods of the UV sampling parameters of each texture layer are: first calculate pixel in landform X-axis and Z-direction and landform The distance of left front grid;Then this distance value repeats step-length divided by the UV of each texture layer, and the business obtained is taken fractional part, This fractional part is the UV sampling parameters value of each layer texture in landform appearance texture array;
304) comprehensively add up: integrating step 302) the ARGB value that obtains and step 301) illumination value that obtains, finally calculate this The ARGB value that pixel is final.
Using method the most according to claim 2, is characterized in that described step 1) in, described each layer texture hybrid weight is led When going out the two-dimensional array that module derives each layer texture weighted value, every 4 layer texture, as one group, are carried out according to the form of 32 bitmaps Deriving, not enough figure layer passage all uses 0 to fill.
Using method the most according to claim 3, is characterized in that described step 2) landform appearance texture array generate mould In block, each texture be dimensioned to identical size;Texture array describes the profiling information of landform.
Using method the most according to claim 3, is characterized in that described step 2) the position on landform summit and UV information In generation module, the positional information on the summit of triangular facet is to be derived in the terrain mesh that module derives successively by vertex position information The three-dimensional coordinate on each summit provides;Normal is that the locus on three summits of the triangular facet according to composition calculates;
What UV represented is position that mesh point samples in hybrid weight texture;The computational methods of UV are: terrain mesh high order end The U value of lattice point is 0, and the U value of low order end lattice point is 1, and the U value of middle lattice point is according to the distance in high order end lattice point X-direction Linear change;The V-value of forefront lattice point is 0, and the V-value of rearmost lattice point is 1, and the V-value of middle lattice point is according to away from forefront lattice point Z Distance linear change on direction of principal axis.
CN201610567765.2A 2016-07-18 2016-07-18 Application method of the Unity3D terrain datas in 11 environment of Direct3D Active CN106204735B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610567765.2A CN106204735B (en) 2016-07-18 2016-07-18 Application method of the Unity3D terrain datas in 11 environment of Direct3D

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610567765.2A CN106204735B (en) 2016-07-18 2016-07-18 Application method of the Unity3D terrain datas in 11 environment of Direct3D

Publications (2)

Publication Number Publication Date
CN106204735A true CN106204735A (en) 2016-12-07
CN106204735B CN106204735B (en) 2018-11-09

Family

ID=57493177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610567765.2A Active CN106204735B (en) 2016-07-18 2016-07-18 Application method of the Unity3D terrain datas in 11 environment of Direct3D

Country Status (1)

Country Link
CN (1) CN106204735B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107358649A (en) * 2017-06-07 2017-11-17 腾讯科技(深圳)有限公司 The treating method and apparatus of terrain file
CN107610233A (en) * 2017-09-15 2018-01-19 中国人民解放军63816部队 A kind of simulating scenes construction method based on outdoor scene
CN107998659A (en) * 2017-12-05 2018-05-08 北京像素软件科技股份有限公司 Scene environment construction method and device
CN108159693A (en) * 2017-12-05 2018-06-15 北京像素软件科技股份有限公司 Scene of game construction method and device
CN109242967A (en) * 2018-08-07 2019-01-18 云南电网有限责任公司曲靖供电局 A kind of dimensional topography rendering method and device
CN109427088A (en) * 2017-08-18 2019-03-05 腾讯科技(深圳)有限公司 A kind of rendering method and terminal of illumination simulation
CN109529342A (en) * 2018-11-27 2019-03-29 北京像素软件科技股份有限公司 A kind of data rendering method and device
CN110827407A (en) * 2019-10-29 2020-02-21 广州西山居世游网络科技有限公司 Method and system for automatically outputting mesh resource triangle appropriateness
CN113599818A (en) * 2021-08-16 2021-11-05 北京字跳网络技术有限公司 Vegetation rendering method and device, electronic equipment and readable storage medium
CN114332397A (en) * 2021-12-30 2022-04-12 北京发现角科技有限公司 Method and device for realizing excessive effect of adjacent terrains at same level

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060045469A (en) * 2004-04-05 2006-05-17 소니 가부시끼 가이샤 Navigation apparatus, data processing method and computer program used therewith
JP2007280157A (en) * 2006-04-10 2007-10-25 Kimoto & Co Ltd Three-dimensional terrain model production system
CN103035023A (en) * 2012-11-29 2013-04-10 广东电网公司电力科学研究院 Method and system of three-dimensional geographic information system (GIS) terrain rendering
CN105701103A (en) * 2014-11-28 2016-06-22 星际空间(天津)科技发展有限公司 Geographic information based three-dimensional application system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060045469A (en) * 2004-04-05 2006-05-17 소니 가부시끼 가이샤 Navigation apparatus, data processing method and computer program used therewith
JP2007280157A (en) * 2006-04-10 2007-10-25 Kimoto & Co Ltd Three-dimensional terrain model production system
CN103035023A (en) * 2012-11-29 2013-04-10 广东电网公司电力科学研究院 Method and system of three-dimensional geographic information system (GIS) terrain rendering
CN105701103A (en) * 2014-11-28 2016-06-22 星际空间(天津)科技发展有限公司 Geographic information based three-dimensional application system

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107358649A (en) * 2017-06-07 2017-11-17 腾讯科技(深圳)有限公司 The treating method and apparatus of terrain file
CN109427088A (en) * 2017-08-18 2019-03-05 腾讯科技(深圳)有限公司 A kind of rendering method and terminal of illumination simulation
CN109427088B (en) * 2017-08-18 2023-02-03 腾讯科技(深圳)有限公司 Rendering method for simulating illumination and terminal
CN107610233A (en) * 2017-09-15 2018-01-19 中国人民解放军63816部队 A kind of simulating scenes construction method based on outdoor scene
CN108159693B (en) * 2017-12-05 2020-11-13 北京像素软件科技股份有限公司 Game scene construction method and device
CN107998659A (en) * 2017-12-05 2018-05-08 北京像素软件科技股份有限公司 Scene environment construction method and device
CN108159693A (en) * 2017-12-05 2018-06-15 北京像素软件科技股份有限公司 Scene of game construction method and device
CN109242967A (en) * 2018-08-07 2019-01-18 云南电网有限责任公司曲靖供电局 A kind of dimensional topography rendering method and device
CN109242967B (en) * 2018-08-07 2023-04-21 云南电网有限责任公司曲靖供电局 Three-dimensional terrain rendering method and device
CN109529342B (en) * 2018-11-27 2022-03-04 北京像素软件科技股份有限公司 Data rendering method and device
CN109529342A (en) * 2018-11-27 2019-03-29 北京像素软件科技股份有限公司 A kind of data rendering method and device
CN110827407A (en) * 2019-10-29 2020-02-21 广州西山居世游网络科技有限公司 Method and system for automatically outputting mesh resource triangle appropriateness
CN110827407B (en) * 2019-10-29 2023-08-29 广州西山居网络科技有限公司 Method and system for automatically outputting meshing resource triangle fit degree
CN113599818A (en) * 2021-08-16 2021-11-05 北京字跳网络技术有限公司 Vegetation rendering method and device, electronic equipment and readable storage medium
CN113599818B (en) * 2021-08-16 2023-07-21 北京字跳网络技术有限公司 Vegetation rendering method and device, electronic equipment and readable storage medium
CN114332397A (en) * 2021-12-30 2022-04-12 北京发现角科技有限公司 Method and device for realizing excessive effect of adjacent terrains at same level
CN114332397B (en) * 2021-12-30 2022-10-28 北京发现角科技有限公司 Method and device for realizing same-level adjacent terrain transition effect

Also Published As

Publication number Publication date
CN106204735B (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN106204735B (en) Application method of the Unity3D terrain datas in 11 environment of Direct3D
CN105069020B (en) Natural resources data three-dimensional visual method and system
CN104915986B (en) A kind of solid threedimensional model method for automatic modeling
CN100547616C (en) A kind of forest rendering method based on classified hierarchical deep mesh
CN103714167B (en) A kind of online 3 D displaying method of disaster information space-time data
Muhar Three-dimensional modelling and visualisation of vegetation for landscape simulation
CN108648269A (en) The monomerization approach and system of three-dimensional building object model
CN109427088A (en) A kind of rendering method and terminal of illumination simulation
CN107564087B (en) A kind of Three-D linear symbol rendering method based on screen
CN107341853A (en) Super large virtual scene and dynamic take the photograph the virtual reality fusion method and system of screen
CN105354872A (en) Rendering engine, implementation method and producing tools for 3D web game
CN111784833A (en) WebGL-based flood evolution situation three-dimensional dynamic visualization display method
CN113436308B (en) Three-dimensional environment air quality dynamic rendering method
CN104392479B (en) Method of carrying out illumination coloring on pixel by using light index number
CN104463954B (en) A kind of analogy method and system of 3-D view surface details
TW200945253A (en) Geospatial modeling system providing simulated tree trunks and branches for groups of tree crown vegetation points and related methods
CN114219902A (en) Volume rendering method and device for meteorological data and computer equipment
CN109979002A (en) Scenario building system and method based on WebGL three-dimensional visualization
Lu et al. Design and implementation of virtual interactive scene based on unity 3D
CN102243769B (en) 3D (three-dimensional) volume light dynamic implementation method and device
CN110443877A (en) Method, apparatus, terminal device and the storage medium of model rendering
US20170287201A1 (en) Texture generation system
CN102819855A (en) Method and device for generating two-dimensional images
CN109671161A (en) Immersion terra cotta warriors and horses burning makes process virtual experiencing system
CN103021025B (en) Utilize the method for generating pattern of computer program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant