CN110163946A - The rendering method and device of vegetation in game - Google Patents
The rendering method and device of vegetation in game Download PDFInfo
- Publication number
- CN110163946A CN110163946A CN201910445074.9A CN201910445074A CN110163946A CN 110163946 A CN110163946 A CN 110163946A CN 201910445074 A CN201910445074 A CN 201910445074A CN 110163946 A CN110163946 A CN 110163946A
- Authority
- CN
- China
- Prior art keywords
- vegetation
- game
- digital asset
- water source
- environmental parameter
- 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.)
- Pending
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 46
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000007613 environmental effect Effects 0.000 claims abstract description 47
- 230000009605 growth rhythm Effects 0.000 claims abstract description 37
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims description 50
- 230000000873 masking effect Effects 0.000 claims description 44
- 239000002689 soil Substances 0.000 claims description 41
- 238000012545 processing Methods 0.000 claims description 20
- 238000009826 distribution Methods 0.000 claims description 10
- 238000004422 calculation algorithm Methods 0.000 claims description 7
- 238000005070 sampling Methods 0.000 claims description 7
- 238000003860 storage Methods 0.000 claims description 5
- 238000012800 visualization Methods 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 2
- 238000011161 development Methods 0.000 abstract description 8
- 239000000463 material Substances 0.000 abstract description 6
- 244000025254 Cannabis sativa Species 0.000 description 26
- 239000011159 matrix material Substances 0.000 description 12
- 230000009466 transformation Effects 0.000 description 10
- 230000000694 effects Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000004519 manufacturing process Methods 0.000 description 4
- 241000196324 Embryophyta Species 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/60—Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/60—Methods for processing data by generating or executing the game program
- A63F2300/66—Methods for processing data by generating or executing the game program for rendering three dimensional images
- A63F2300/6646—Methods for processing data by generating or executing the game program for rendering three dimensional images for the computation and display of the shadow of an object or character
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- General Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the present invention provides the rendering method and device of vegetation in a kind of game, this method comprises: the vegetation digital asset that will acquire is loaded onto game, vegetation digital asset is to be determined according to the growth rhythm of preset vegetation, according to vegetation digital asset game scene of game, adjust the environmental parameter of vegetation digital asset, according to environmental parameter adjusted, determine the attribute of vegetation digital asset, according to the attribute of vegetation digital asset, corresponding zone rendering goes out vegetation in the interface of game.In embodiments of the present invention, since vegetation digital asset is to be generated according to the natural law of vegetation, therefore the authenticity and randomness of vegetation can be improved, and the attribute of vegetation can be changed by adjusting environmental parameter, obtain the vegetation of fitting environment, without remaking model or adjustment material, therefore improve the development efficiency of vegetation.
Description
Technical field
The present embodiments relate to the rendering methods and device of vegetation in game technical field more particularly to a kind of game.
Background technique
The game of current high-level production, more and more to use seamless big map, wherein the distribution of vegetation is important
One of factor.In the prior art, it is common to use the grass rendering based on density map passes through graphics processor (Graphics
Processing Unit, GPU) mode of (Instancing) is instantiated to realize careless rendering.But the grass based on density map
Rendering due to masking mask precision the problem of, can adjacent edges generation error be distributed, effect is not true enough, is not achieved advanced
Not Zhi Zuo game standard.
Summary of the invention
The embodiment of the present invention provides the rendering method and device of vegetation in a kind of game, for making the vegetation in game,
The authenticity and randomness of vegetation are improved, while improving the development efficiency of vegetation.
In a first aspect, the embodiment of the present invention provides a kind of rendering method of vegetation in game, comprising:
The vegetation digital asset that will acquire is loaded onto the game, and the vegetation digital asset is according to preset vegetation
Growth rhythm determine;
According to the vegetation digital asset in the scene of game of the game, the environment ginseng of the vegetation digital asset is adjusted
Number;
According to the environmental parameter adjusted, the attribute of the vegetation digital asset is determined;
According to the attribute of the vegetation digital asset, corresponding zone rendering goes out described in the interface of the game
Vegetation.
Optionally, the environmental parameter includes at least one of the following:
The gradient, height above sea level, water source and soil dry are moist.
Optionally, the method also includes:
Obtain the growth rhythm of the vegetation;
According to the growth rhythm of the vegetation, the vegetation digital asset is obtained using film special efficacy magician Houduni.
Optionally, the growth rhythm of the vegetation includes at least one of the following:
The distribution of the vegetation is determined according to the gradient and/or height above sea level;
According to height above sea level, water source and at least one of the moist color for determining the vegetation and presenting of soil dry;
The direction of the vegetation is determined according to the gradient and/or water source.
Optionally, it is determining in the following way that the soil dry is moist:
According to hemisphere sampling and biggest advantage of light track algorithm, the environment light masking (Ambient of landform locating for the vegetation is calculated
Occlusion, AO);
Obtain the received intensity of sunshine of the vegetation;
AO and the intensity of sunshine are covered according to the environment light, determines the dry and wet of soil locating for the vegetation.
Optionally, described that AO and the intensity of sunshine are covered according to the environment light, determine soil locating for the vegetation
Dry and wet, comprising:
Visualization processing is carried out to environment light masking AO, obtains the corresponding masking figure of AO;
Obtain the corresponding masking figure of the intensity of sunshine;
Masking figure corresponding with the intensity of sunshine is schemed according to the corresponding masking of the AO, determines soil locating for the vegetation
Dry and wet.
Optionally, the direction that the vegetation is determined according to the gradient and/or water source, comprising:
If the vegetation is greater than preset value at a distance from the water source, the direction of the vegetation is determined according to the gradient;
If the vegetation is less than the preset value at a distance from the water source, the vegetation is determined according to the gradient and water source
Direction.
Second aspect, the embodiment of the present invention provide a kind of rendering device of vegetation in game, comprising:
Processing module, the vegetation digital asset for will acquire are loaded onto the game, and the vegetation digital asset is
It is determined according to the growth rhythm of preset vegetation;
The processing module, is also used to the scene of game according to the vegetation digital asset in the game, described in adjustment
The environmental parameter of vegetation digital asset;
Determining module, for determining the attribute of the vegetation digital asset according to the environmental parameter adjusted;
The processing module is also used to the attribute according to the vegetation digital asset, in the interface of the game
Corresponding zone rendering goes out the vegetation.
Optionally, the environmental parameter includes at least one of the following:
The gradient, height above sea level, water source and soil dry are moist.
Optionally, described device further include:
Module is obtained, for obtaining the growth rhythm of the vegetation;
According to the growth rhythm of the vegetation, the vegetation digital asset is obtained using film special efficacy magician Houduni.
Optionally, the growth rhythm of the vegetation includes at least one of the following:
The distribution of the vegetation is determined according to the gradient and/or height above sea level;
According to height above sea level, water source and at least one of the moist color for determining the vegetation and presenting of soil dry;
The direction of the vegetation is determined according to the gradient and/or water source.
Optionally, the processing module, is also used to:
According to hemisphere sampling and biggest advantage of light track algorithm, the environment light masking AO of landform locating for the vegetation is calculated;
The acquisition module is also used to obtain the received intensity of sunshine of the vegetation;
The determining module is also used to cover AO and the intensity of sunshine according to the environment light, determines the vegetation institute
Locate the dry and wet of soil.
Optionally, the determining module, is specifically used for:
Visualization processing is carried out to environment light masking AO, obtains the corresponding masking figure of AO;
Obtain the corresponding masking figure of the intensity of sunshine;
Masking figure corresponding with the intensity of sunshine is schemed according to the corresponding masking of the AO, determines soil locating for the vegetation
Dry and wet.
Optionally, the determining module, is specifically used for:
If the vegetation is greater than preset value at a distance from the water source, the direction of the vegetation is determined according to the gradient;
If the vegetation is less than the preset value at a distance from the water source, the vegetation is determined according to the gradient and water source
Direction.
The third aspect, the embodiment of the present invention provide a kind of terminal device, comprising: memory and processor;
The memory, for storing program code;
The processor, for calling said program code to execute in the game as described in the first aspect embodiment of the present invention
The rendering method of vegetation.
Fourth aspect, the embodiment of the present invention provide a kind of readable storage medium storing program for executing, meter are stored on the readable storage medium storing program for executing
Calculation machine program;The computer program when executed, realizes vegetation in the game as described in the first aspect embodiment of the present invention
Rendering method.
The embodiment of the present invention provides the rendering method and device of vegetation in a kind of game, and the vegetation digital asset that will acquire adds
It is loaded onto game, vegetation digital asset is to be determined according to the growth rhythm of preset vegetation, is being swum according to vegetation digital asset
The environmental parameter of the scene of game of play, adjustment vegetation digital asset determines vegetation digital asset according to environmental parameter adjusted
Attribute, according to the attribute of vegetation digital asset, corresponding zone rendering goes out vegetation in the interface of game.In the present invention
In embodiment, since vegetation digital asset is to generate according to the natural law of vegetation, the true of vegetation can be improved
Property and randomness, and the vegetation of fitting environment can be obtained by adjusting environmental parameter to change the attribute of vegetation, and nothing
Model or adjustment material need to be remake, therefore improves the development efficiency of vegetation.
Detailed description of the invention
The flow chart of the rendering method of vegetation in the game that Fig. 1 provides for one embodiment of the invention;
Fig. 2 is the schematic diagram for the scene of game that one embodiment of the invention provides;
Fig. 3 be another embodiment of the present invention provides game in vegetation rendering method flow chart;
Fig. 4 is the flow chart for the determination soil dry-wet method that one embodiment of the invention provides;
Fig. 5 a is that the environment light that one embodiment of the invention provides covers corresponding masking figure;
Fig. 5 b is the corresponding masking figure of intensity of sunshine that one embodiment of the invention provides;
Fig. 5 c is the masking figure after the corresponding overturning of intensity of sunshine that one embodiment of the invention provides;
The masking figure of soil locating for the vegetation that Fig. 5 d provides for one embodiment of the invention;
The structural schematic diagram of the rendering device of vegetation in the game that Fig. 6 provides for one embodiment of the invention;
Fig. 7 is the structural schematic diagram for the terminal that one embodiment of the invention provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
In existing game, in order to guarantee the visual effect of game, seamless big map is realized, the distribution of vegetation is one
Important factor.Currently, generalling use the grass rendering based on density map, careless wash with watercolours is realized using the mode of GPU Instancing
Dye.But the rendering of the grass based on density map can be distributed due to the problem of covering mask precision in adjacent edges generation error,
Effect is not true enough, and the standard of high-level production game is not achieved.
To solve the above-mentioned problems, the embodiment of the present invention provides a kind of rendering method of vegetation in game, this method comprises:
The vegetation digital asset that will acquire is loaded onto game, and vegetation digital asset is to be determined according to the growth rhythm of preset vegetation
, according to vegetation digital asset in the scene of game of game, the environmental parameter of vegetation digital asset is adjusted, according to ring adjusted
Border parameter determines the attribute of vegetation digital asset, corresponding in the interface of game according to the attribute of vegetation digital asset
Zone rendering goes out vegetation.
In the embodiment of the present invention, since vegetation digital asset is to be generated according to the natural law of vegetation, it can mention
The high authenticity and randomness of vegetation, and the attribute of vegetation can be changed by adjusting environmental parameter, it is bonded
The vegetation of environment without remaking model or adjustment material, therefore improves the development efficiency of vegetation.
It should be noted that the vegetation digital asset in the embodiment of the present invention can use film special efficacy magician
Houdini software is realized based on procedural language VEX.It should be noted that VEX language is similar with C language, it is a kind of
The language of procedure-oriented exploitation, the built-in Graphics parallel library abundant used for exploitation.
Houdini is a kind of three dimensional computer graphics software, and node can be created in Houdini, such as a blade of grass model
As a node, the node created in Houdini connects to form network, these networks can be encapsulated into entitled
In the node of Houdini Digital Assets (Houdini digital asset), these nodes are supported to share, that is, supporting will
HoudiniDigital Assets is loaded into application program, is loaded onto the HoudiniDigital Assets's of application program
Any parameter can be used in editing, to realize the effect presented in the application program, furthermore it is also possible in the window of application program
Formula operation is interacted using player interface (User Interface, UI) in mouthful.An also, HoudiniDigital
Assets can be used for multiple times in a scene of game or multiple scene of game, to HoudiniDigital Assets core
The change that the parent type of assets i.e. all HoudiniDigital Assets are done, will update HoudiniDigital
All instance objects of Assets.
The technical solution of the above embodiment of the present invention is described in detail using several specific embodiments below.
The flow chart of the rendering method of vegetation in the game that Fig. 1 provides for one embodiment of the invention, as shown in Figure 1, this reality
The method for applying example may include:
S101, the vegetation digital asset that will acquire are loaded onto game, and vegetation digital asset is according to preset vegetation
What growth rhythm determined.
Wherein, which can be any sort game application in online game and renders usually in game application
Seamless big map, can be improved game experiencing, wherein a key factor for realizing seamless big map is the distribution of vegetation.?
In the present embodiment, in making game when vegetation, the vegetation digital asset that will acquire first is loaded onto the game application,
In, vegetation digital asset is supported to carry out parameter editor after being loaded onto game application by Houdini software realization, therefore, load
To the game application vegetation digital asset can according to the demand of the game, such as: scene of game, carry out parameter editor, with
The vegetation of fitting environment is rendered in the game.
Wherein, vegetation digital asset is to be determined according to the growth rhythm of preset vegetation, the growth rule of preset vegetation
Rule includes the relationship between the growth chracteristic of vegetation and environmental parameter.Specifically, the growth rhythm of vegetation includes in following
At least one:
The distribution of vegetation is determined according to the gradient and/or height above sea level;
According to height above sea level, water source and at least one of the moist color for determining vegetation and presenting of soil dry;
The direction of vegetation is determined according to the gradient and/or water source.
In the present embodiment, vegetation digital asset can be a vegetation model, which is loaded onto game and is answered
With it is middle when, the environmental parameter of vegetation model can be adjusted according to the scene of game of the game application, environmental parameter includes in following
At least one: the gradient, height above sea level, water source and soil dry are moist, i.e., in the scene of game, environmental parameter includes locating for vegetation
The gradient and height above sea level, at a distance from water source and at least one of the dry and wet of locating soil.
Certainly, the vegetation in the present embodiment can be " grass ", " tree ", " flower " or other plants in nature, if such is careless,
The growth rhythm of tree and flower is identical, then can be made and be rendered by such grass, tree and flower as a kind of digital asset, if
The growth rhythm of such grass, tree and flower is different, then is made grass, tree and flower respectively as different classes of digital asset
And rendering.
S102, the scene of game according to vegetation digital asset in game, the environmental parameter of adjustment vegetation digital asset.
In the present embodiment, usually with the movement of virtual objects in game application, the scene of game for being presented to player is
Different.Vegetation can be for example only included in the scene of game of game, can also include vegetation, water source, high mountain etc., and the present invention is real
Example is applied to scene of game with no restrictions.
Specifically, the environmental parameter of vegetation digital asset is adjusted in the scene of game of game according to vegetation digital asset, with
Rendering obtains the vegetation for being bonded the scene of game, without remaking model or adjustment material, improves the development efficiency of vegetation.
It should be noted that the initial value of the environmental parameter of vegetation digital asset can be default value, vegetation number is provided
Production is loaded onto game, can be adjusted the environmental parameter of vegetation digital asset according to the scene of game of game, be pasted with rendering
Close the vegetation of current game scene.
S103, according to environmental parameter adjusted, determine the attribute of vegetation digital asset.
S104, according to the attribute of vegetation digital asset, corresponding zone rendering goes out the plant in the interface of game
Quilt.
Wherein, the attribute of vegetation digital asset includes growing height, distribution, growth direction, color, stand density etc.
Natural quality, the parameters such as environmental parameter, growth duration, the kind of the natural quality of vegetation natural environment locating for vegetation determine.
In the present embodiment, according to the scene of game of game, after the environmental parameter of vegetation digital asset is adjusted, according to preset
The growth rhythm of vegetation determines the attribute of vegetation digital asset, can be in game then according to the attribute of vegetation digital asset
Corresponding zone rendering goes out vegetation in interface.Those skilled in the art can swum using the realization of existing any embodiment
Corresponding zone rendering goes out vegetation in play interface, and details are not described herein for the embodiment of the present invention.
Fig. 2 is the schematic diagram for the scene of game that one embodiment of the invention provides, as shown in Fig. 2, including in the scene of game
Vegetation, high mountain.In order to render vegetation shown in Fig. 2, in the development phase, can scene of game according to Fig.2, obtain Fig. 2
Height above sea level locating for vegetation and the gradient in shown scene of game, so as to adjust the height above sea level and the gradient of vegetation digital asset, for example,
Vegetation digital asset is loaded onto game, if the gradient locating for vegetation is A in Fig. 2, height above sea level B, game application will be loaded onto
Vegetation digital asset environmental parameter in the gradient be adjusted to A, height above sea level is adjusted to B, so that it is determined that vegetation digital asset
Attribute renders the vegetation then according to the attribute of vegetation digital asset, the vegetation fitting current game scene and symbol rendered
Objective law is closed, the authenticity of vegetation is improved.
The rendering method of vegetation in game provided in this embodiment, the vegetation digital asset that will acquire are loaded onto game,
Vegetation digital asset be according to the growth rhythm of preset vegetation determine, according to vegetation digital asset game sports ground
The environmental parameter of scape, adjustment vegetation digital asset determines the attribute of vegetation digital asset, root according to environmental parameter adjusted
According to the attribute of vegetation digital asset, corresponding zone rendering goes out vegetation in the interface of game.In embodiments of the present invention,
Since vegetation digital asset is to generate according to the natural law of vegetation, the authenticity of vegetation and random can be improved
Property, and the attribute of vegetation can be changed by adjusting environmental parameter, the vegetation of fitting environment is obtained, without making again
Make model or adjustment material, therefore improves the development efficiency of vegetation.
On the basis of the above embodiments, the method also includes obtaining the growth rhythm of vegetation, according to the growth of vegetation
Rule obtains vegetation digital asset using Houduni.It is specifically described below with reference to Fig. 3 embodiment.
Fig. 3 be another embodiment of the present invention provides game in vegetation rendering method flow chart, as shown in figure 3, this
The method of embodiment may include:
S201, the growth rhythm for obtaining vegetation.
In the present embodiment, in order to obtain vegetation digital asset, need to obtain the growth rhythm of vegetation, wherein vegetation
Growth rhythm includes: that the distribution of the vegetation is determined according to the gradient and/or height above sea level, and specifically, the gradient determines soil stream
Situation is lost, the gradient is bigger, and vegetation growth density is smaller;Height above sea level determines that temperature, temperature influence the growth of vegetation.
The growth rhythm of vegetation can also include: according to height above sea level, water source and soil dry is at least one of moist determines institute
The color of vegetation presentation is stated, only height above sea level, water source and soil dry is moist in a certain range, and the color of vegetation is just able to maintain just
Often, for example, green, once any factor is more than certain range, the color of vegetation may be in exception, for example, turning yellow.
The growth rhythm of vegetation can also include: that the direction of the vegetation is determined according to the gradient and/or water source, specifically,
If vegetation is greater than preset value at a distance from water source, the direction of vegetation is influenced by the gradient;If vegetation is less than pre- at a distance from water source
If value, the direction of vegetation is influenced by the gradient and water source.Wherein, preset value can be chosen according to the actual situation, the present invention
Embodiment is without limitation.
S202, the growth rhythm according to vegetation obtain vegetation digital asset using Houduni.
In the present embodiment, vegetation digital asset is to be obtained according to the growth rhythm of vegetation, can be by using
VEX language built in Houduni is realized.Then, after obtaining vegetation digital asset, vegetation can also be made using Houduni
The relevant user interface (User Interface, UI) of digital asset.
S203, the vegetation digital asset that will acquire are loaded onto game, and vegetation digital asset is according to preset vegetation
What growth rhythm determined.
In the present embodiment, the vegetation digital asset that will acquire is loaded onto game application, so as to according to the game of game
Scene adjusts the environmental parameter of vegetation digital asset, the attribute of vegetation digital asset is determined, to render on interface
Carry out the vegetation.
S204, the scene of game according to vegetation digital asset in game, the environmental parameter of adjustment vegetation digital asset.
Wherein, environmental parameter includes at least one of the following: the gradient, height above sea level, water source and soil dry are moist.In this reality
It applies in example, the effect that the environmental parameter of vegetation digital asset and vegetation are presented in the interface of game has mapping relations,
According to the scene of game of game, the environmental parameter of vegetation digital asset is adjusted, so that interface corresponding region be made to render
Vegetation more meets objective law.
Specifically, the gradient in environmental parameter and height above sea level can be directly determined according to the scene of game of game.Environmental parameter
In water source indicate at a distance from water source, for that can be determined as follows at a distance from water source:
By taking " grass " as an example, it is with the calculation method at a distance from water source: is spread at flow layers (water flow layers of the label in landform)
Lower high density dot matrix searches distance " grass " point apart from nearest point in flow layers, calculates the distance between two o'clock, which can
With the color for calculating " grass ".
Wherein, " grass " point to the point found direction vector can be used for calculate " grass " put direction, while use away from
From judgement " grass " point direction, specifically, if vegetation at a distance from water source be greater than preset value, vegetation direction by the gradient shadow
It rings, i.e., determines the direction of vegetation according to the gradient;If vegetation is less than preset value at a distance from water source, the direction of vegetation is by the gradient and water
The influence in source determines the direction of vegetation according to the gradient and water source.
Certainly, the acquisition modes of " grass " point direction are including but not limited to upper type, in a kind of possible design, in order to
The direction for calculating grass needs to obtain final transformation matrix, and final transformation matrix is determined by transformation matrix 1 and transformation matrix 2,
In, transformation matrix 1, the top for grass allows the model patch ground of grass to grow upward towards earth's surface vertex normal direction;Convert square
Battle array 2, it is careless towards water source for allowing.It is main to realize that code is as follows:
Wherein, it is illustrated in above-mentioned code with preset value for 30, it in practical applications, can be according to practical trip
Play scene determines preset value, and the present embodiment is with no restrictions." grass " point model is when creation, in the model space of oneself,
First have to the upwardly direction for the head of grass being arrived by matrix conversion world space, that is, the growing point normal that " grass " is put
Direction needs to obtain transformation matrix 1;The face orientation of " grass " point is calculated later, that is, entirety is grown towards which direction,
Since the direction of growth of grass is directed towards water source, so passing through the direction vector for calculating the growing point of " grass " point to water source, to obtain
Take transformation matrix 2;Then transformation matrix 1 is multiplied with transformation matrix 2, obtains final transformation matrix.
In addition, soil dry is moist can to determine that details are not described herein according to Fig. 4 embodiment.
S205, according to environmental parameter adjusted, determine the attribute of vegetation digital asset.
S206, according to the attribute of vegetation digital asset, corresponding zone rendering goes out vegetation in the interface of game.
In the present embodiment, the specific implementation process of S205-S206 may refer to the associated description in embodiment illustrated in fig. 2,
Details are not described herein again.
The rendering method of vegetation in game provided in this embodiment, obtains the growth rhythm of vegetation, according to the growth of vegetation
Rule obtains vegetation digital asset using Houduni, and the vegetation digital asset that will acquire is loaded onto game, vegetation number money
It produces to be determined according to the growth rhythm of preset vegetation, according to vegetation digital asset in the scene of game of game, adjusts vegetation
The environmental parameter of digital asset determines the attribute of vegetation digital asset according to environmental parameter adjusted, is provided according to vegetation number
The attribute of production, corresponding zone rendering goes out vegetation in the interface of game.Since vegetation digital asset is according to vegetation
What the natural law generated, therefore the authenticity and randomness of vegetation can be improved, and can by adjusting environmental parameter from
And change the attribute of vegetation, the vegetation of fitting environment is obtained, without remaking model or adjustment material, therefore improves plant
The development efficiency of quilt.
Fig. 4 is the flow chart for the determination soil dry-wet method that one embodiment of the invention provides, as shown in figure 4, this method
Include:
S301, according to hemisphere sampling and biggest advantage of light track algorithm, calculate obtain vegetation locating for landform environment light cover AO.
Wherein, environment light masking AO describes object and object intersects or block when close the effect of diffusing reflection light around
Fruit, typically represent other than indirect light light irradiation less than probability, that is, become wet soil a possibility that increase, moisture steam
It sends out slower.
In the present embodiment, specifically, using certain point in landform locating for the vegetation as the center of circle, with pre-set radius to hemisphere
Whether the light of preset quantity is projected in direction, and calculate and intersect on light path of light with other vegetation models, if intersection, explanation
There are blocking between model, the number of rays of all intersections and the ratio of total number of rays are then calculated, it, can be with according to reversibility of optical path
Obtain the probability that this is blocked in optical path, i.e. AO value.It is main to realize that code is as follows:
S302, the received intensity of sunshine of vegetation is obtained.
In the above-described embodiments, after the environment light masking AO for obtaining landform locating for vegetation, also determined that vegetation is blocked
Probability, then obtain the directly received intensity of sunshine of vegetation, so as to combine intensity of sunshine and environment light to cover AO, determine
The dry and wet of landform locating for vegetation.
S303, AO and intensity of sunshine are covered according to environment light, determines the dry and wet of soil locating for vegetation.
In the present embodiment, visualization processing is carried out to environment light masking AO first, obtains the corresponding masking figure of AO;Fig. 5 a
Corresponding masking figure is covered for the environment light that one embodiment of the invention provides, as shown in Figure 5 a, is chased after by hemisphere sampling and light
Track algorithm calculates the AO of landform, and masking figure mask, the masking are assigned to after then AO value is normalized in (0,1) section
In figure, darker regions indicate visual AO value.The core of present embodiment is, for certain point in landform, in the entire of it
In hemi-sphere range, several light are projected outward, carry out that friendship is asked to calculate in its sample radius, then antinode is asked
With finally with entire and just to have obtained the AO percent value of this point divided by total sampled light line number, that is, this point is all
The probability of the object or terrain shading that enclose.
Then, the corresponding masking figure of intensity of sunshine is obtained;Fig. 5 b is that the intensity of sunshine that one embodiment of the invention provides is corresponding
Masking figure, as shown in Figure 5 b, in the masking figure, darker regions indicate sunlight generate shadow information.
Then, masking corresponding with intensity of sunshine is schemed according to the corresponding masking of AO to scheme, determine the dry and wet of soil locating for vegetation
Property.Specifically, shade overturning processing is carried out to Fig. 5 b, Fig. 5 c is the corresponding overturning of intensity of sunshine that one embodiment of the invention provides
Masking figure afterwards, as shown in Figure 5 c, after 5b is carried out shade overturning processing, light areas indicates the shade letter that sunlight generates
Breath, darker regions are the region shined upon, then subtract Fig. 5 c using Fig. 5 a, i.e. in darker regions and Fig. 5 b in Fig. 5 a
Darker regions subtract each other, obtain covering due to environment and the region arrived of sunlight little irradiation, that is, be determined that wet soil layer, Fig. 5 d are
The masking figure of soil locating for the vegetation that one embodiment of the invention provides, darker regions indicate wet soil layer, light areas table in Fig. 5 d
Show dry ground layer, so that it is determined that the dry and wet of soil locating for vegetation.
In addition, being determined for the growth size of grass by season, can be adjusted in game application.
The moist method of determining soil dry provided in this embodiment is calculated and is obtained according to hemisphere sampling and biggest advantage of light track algorithm
The environment light of landform locating for vegetation covers AO, obtains the received intensity of sunshine of vegetation, covers AO and intensity of sunshine according to environment light,
Determine the dry and wet of soil locating for vegetation.The dry and wet that soil locating for vegetation is determined by this method, can be improved vegetation
Authenticity and randomness can obtain the vegetation of fitting environment.
The structural schematic diagram of the rendering device of vegetation in the game that Fig. 6 provides for one embodiment of the invention, as shown in fig. 6,
The rendering device 60 of vegetation may include: processing module 601, determining module 602 in the game of the present embodiment.
Processing module 601, the vegetation digital asset for will acquire are loaded onto the game, the vegetation digital asset
For what is determined according to the growth rhythm of preset vegetation;
The processing module 601 is also used to the scene of game according to the vegetation digital asset in the game, adjusts institute
State the environmental parameter of vegetation digital asset;
Determining module 602, for determining the attribute of the vegetation digital asset according to the environmental parameter adjusted;
The processing module 601 is also used to the attribute according to the vegetation digital asset, in the interface of the game
In corresponding zone rendering go out the vegetation.
Optionally, the environmental parameter includes at least one of the following:
The gradient, height above sea level, water source and soil dry are moist.
Optionally, described device 60 further include:
Module 602 is obtained, for obtaining the growth rhythm of the vegetation;
According to the growth rhythm of the vegetation, the vegetation digital asset is obtained using film special efficacy magician Houduni.
Optionally, the growth rhythm of the vegetation includes at least one of the following:
The distribution of the vegetation is determined according to the gradient and/or height above sea level;
According to height above sea level, water source and at least one of the moist color for determining the vegetation and presenting of soil dry;
The direction of the vegetation is determined according to the gradient and/or water source.
Optionally, the processing module 601, is also used to:
According to hemisphere sampling and biggest advantage of light track algorithm, the environment light masking AO of landform locating for the vegetation is calculated;
The acquisition module 603, is also used to obtain the received intensity of sunshine of the vegetation;
The determining module 602 is also used to cover AO and the intensity of sunshine according to the environment light, determines the vegetation
The dry and wet of locating soil.
Optionally, the determining module 602, is specifically used for:
Visualization processing is carried out to environment light masking AO, obtains the corresponding masking figure of AO;
Obtain the corresponding masking figure of the intensity of sunshine;
Masking figure corresponding with the intensity of sunshine is schemed according to the corresponding masking of the AO, determines soil locating for the vegetation
Dry and wet.
Optionally, the determining module 602, is specifically used for:
If the vegetation is greater than preset value at a distance from the water source, the direction of the vegetation is determined according to the gradient;
If the vegetation is less than the preset value at a distance from the water source, the vegetation is determined according to the gradient and water source
Direction.
The terminal device of the present embodiment can be used for executing the technical solution of above-mentioned each method embodiment, realization principle
Similar with technical effect, details are not described herein again.
Fig. 7 is the structural schematic diagram for the terminal that one embodiment of the invention provides, as shown in fig. 7, the terminal of the present embodiment is set
Standby 70 may include: memory 701 and processor 702.Wherein, memory 701 can for example be connected with processor 702 by bus
It connects.
The memory 701, for storing program code;
The processor 702, for calling said program code to execute the technical solution of above-mentioned each method embodiment, in fact
Existing principle is similar with technical effect, and details are not described herein again.Those of ordinary skill in the art will appreciate that: realize that above-mentioned each method is real
Applying all or part of the steps of example, this can be accomplished by hardware associated with program instructions.Program above-mentioned can store Yu Yiji
In calculation machine read/write memory medium.When being executed, execution includes the steps that above-mentioned each method embodiment to the program;And it above-mentioned deposits
Storage media includes: read-only memory (Read-Only Memory, ROM), random access memory (Random Access
Memory, RAM), the various media that can store program code such as magnetic or disk.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (10)
1. the rendering method of vegetation in a kind of game, which is characterized in that be applied to terminal device, comprising:
The vegetation digital asset that will acquire is loaded onto the game, and the vegetation digital asset is the life according to preset vegetation
What long rule determined;
According to the vegetation digital asset in the scene of game of the game, the environmental parameter of the vegetation digital asset is adjusted;
According to the environmental parameter adjusted, the attribute of the vegetation digital asset is determined;
According to the attribute of the vegetation digital asset, corresponding zone rendering goes out the plant in the interface of the game
Quilt.
2. the method according to claim 1, wherein the environmental parameter includes at least one of the following:
The gradient, height above sea level, water source and soil dry are moist.
3. the method according to claim 1, wherein the method also includes:
Obtain the growth rhythm of the vegetation;
According to the growth rhythm of the vegetation, the vegetation digital asset is obtained using film special efficacy magician Houduni.
4. according to the method described in claim 2, it is characterized in that, the growth rhythm of the vegetation includes at least one in following
It is a:
The distribution of the vegetation is determined according to the gradient and/or height above sea level;
According to height above sea level, water source and at least one of the moist color for determining the vegetation and presenting of soil dry;
The direction of the vegetation is determined according to the gradient and/or water source.
5. according to the method described in claim 4, it is characterized in that, the soil dry it is moist be determining in the following way:
According to hemisphere sampling and biggest advantage of light track algorithm, the environment light masking AO of landform locating for the vegetation is calculated;
Obtain the received intensity of sunshine of the vegetation;
AO and the intensity of sunshine are covered according to the environment light, determines the dry and wet of soil locating for the vegetation.
6. according to the method described in claim 5, it is characterized in that, described strong according to environment light masking AO and the sunshine
Degree, determines the dry and wet of soil locating for the vegetation, comprising:
Visualization processing is carried out to environment light masking AO, obtains the corresponding masking figure of AO;
Obtain the corresponding masking figure of the intensity of sunshine;
Masking figure corresponding with the intensity of sunshine is schemed according to the corresponding masking of the AO, determines the dry of soil locating for the vegetation
It is moist.
7. according to the method described in claim 4, it is characterized in that, described determine the vegetation according to the gradient and/or water source
Direction, comprising:
If the vegetation is greater than preset value at a distance from the water source, the direction of the vegetation is determined according to the gradient;
If the vegetation is less than the preset value at a distance from the water source, the court of the vegetation is determined according to the gradient and water source
To.
8. the rendering device of vegetation in a kind of game characterized by comprising
Processing module, the vegetation digital asset for will acquire are loaded onto the game, according to the vegetation digital asset
What the growth rhythm of preset vegetation determined;
The processing module is also used to adjust the vegetation in the scene of game of the game according to the vegetation digital asset
The environmental parameter of digital asset;
Determining module, for determining the attribute of the vegetation digital asset according to the environmental parameter adjusted;
The processing module is also used to the attribute according to the vegetation digital asset, corresponding in the interface of the game
Zone rendering go out the vegetation.
9. a kind of terminal device characterized by comprising memory and processor;
The memory, for storing program code;
The processor, for calling said program code to execute vegetation in game as described in claim 1-7 any one
Rendering method.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program on the readable storage medium storing program for executing;The meter
Calculation machine program when executed, realizes the rendering method of vegetation in the game as described in claim 1-7 any one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910445074.9A CN110163946A (en) | 2019-05-27 | 2019-05-27 | The rendering method and device of vegetation in game |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910445074.9A CN110163946A (en) | 2019-05-27 | 2019-05-27 | The rendering method and device of vegetation in game |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110163946A true CN110163946A (en) | 2019-08-23 |
Family
ID=67629032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910445074.9A Pending CN110163946A (en) | 2019-05-27 | 2019-05-27 | The rendering method and device of vegetation in game |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110163946A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111402383A (en) * | 2020-03-23 | 2020-07-10 | 中建八局科技建设有限公司 | Revit model processing method applied to Houdini |
CN111888763A (en) * | 2020-08-26 | 2020-11-06 | 网易(杭州)网络有限公司 | Method and device for generating obstacles in game scene |
CN112206534A (en) * | 2020-11-04 | 2021-01-12 | 网易(杭州)网络有限公司 | Vegetation object processing method, device, equipment and storage medium |
CN113989423A (en) * | 2021-09-27 | 2022-01-28 | 广州三七网络科技有限公司 | Digital asset manufacturing method, apparatus, computer device and storage medium |
WO2023273134A1 (en) * | 2021-06-29 | 2023-01-05 | 完美世界(北京)软件科技发展有限公司 | Game animation generation method and apparatus, storage medium, and computer device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120276993A1 (en) * | 2011-04-29 | 2012-11-01 | Sony Computer Entertainment America Llc | Social interactive content creator development |
CN106485776A (en) * | 2016-11-23 | 2017-03-08 | 北京三体高创科技有限公司 | A kind of method and system of 3D game real-time rendering large scale scene |
CN109603156A (en) * | 2018-12-12 | 2019-04-12 | 北京像素软件科技股份有限公司 | Rendering method and device |
-
2019
- 2019-05-27 CN CN201910445074.9A patent/CN110163946A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120276993A1 (en) * | 2011-04-29 | 2012-11-01 | Sony Computer Entertainment America Llc | Social interactive content creator development |
CN106485776A (en) * | 2016-11-23 | 2017-03-08 | 北京三体高创科技有限公司 | A kind of method and system of 3D game real-time rendering large scale scene |
CN109603156A (en) * | 2018-12-12 | 2019-04-12 | 北京像素软件科技股份有限公司 | Rendering method and device |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111402383A (en) * | 2020-03-23 | 2020-07-10 | 中建八局科技建设有限公司 | Revit model processing method applied to Houdini |
CN111402383B (en) * | 2020-03-23 | 2024-02-13 | 中建八局科技建设有限公司 | Revit model processing method applied to Houdini |
CN111888763A (en) * | 2020-08-26 | 2020-11-06 | 网易(杭州)网络有限公司 | Method and device for generating obstacles in game scene |
CN111888763B (en) * | 2020-08-26 | 2024-02-02 | 网易(杭州)网络有限公司 | Method and device for generating obstacle in game scene |
CN112206534A (en) * | 2020-11-04 | 2021-01-12 | 网易(杭州)网络有限公司 | Vegetation object processing method, device, equipment and storage medium |
WO2023273134A1 (en) * | 2021-06-29 | 2023-01-05 | 完美世界(北京)软件科技发展有限公司 | Game animation generation method and apparatus, storage medium, and computer device |
CN113989423A (en) * | 2021-09-27 | 2022-01-28 | 广州三七网络科技有限公司 | Digital asset manufacturing method, apparatus, computer device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110163946A (en) | The rendering method and device of vegetation in game | |
Xu et al. | Knowledge and heuristic-based modeling of laser-scanned trees | |
CN104778744B (en) | Extensive three-dimensional forest Visual Scene method for building up based on Lidar data | |
CN111784833A (en) | WebGL-based flood evolution situation three-dimensional dynamic visualization display method | |
CN106485776A (en) | A kind of method and system of 3D game real-time rendering large scale scene | |
CN108057245B (en) | Map generation method and device, storage medium and terminal | |
CN111617485B (en) | Virtual terrain scene manufacturing method and device | |
CN104091363A (en) | Real-time size cloud computing method based on screen space | |
Li et al. | Three-dimensional dynamic simulation system for forest surface fire spreading prediction | |
CN109745704A (en) | A kind of management method of voxel landform | |
CN109872390A (en) | A kind of method for organizing of magnanimity threedimensional model | |
CN111524214B (en) | Method and device for manufacturing vegetation biological community | |
Jia et al. | Forest cover changes in the Three-North Shelter Forest Region of China during 1990 to 2005 | |
Bao et al. | Realistic real-time rendering for large-scale forest scenes | |
CN111784817A (en) | Shadow display method and device, storage medium and electronic device | |
Frasson et al. | Efficient screen-space rendering of vector features on virtual terrains | |
Andersson | Terrain rendering in frostbite using procedural shader splatting | |
CN111957046B (en) | Game scene resource generation method and device and computer equipment | |
Kohek et al. | Interactive Large‐Scale Procedural Forest Construction and Visualization Based on Particle Flow Simulation | |
Ebner | Coevolution and the red queen effect shape virtual plants | |
Widmark | Terrain in battlefield 3: A modern, complete and scalable system | |
Bevilacqua et al. | Charack: Tool for real-time generation of pseudo-infinite virtual worlds for 3d games | |
Hawley | Grome Terrain Modeling with Ogre3D, UDK, and Unity3D | |
Field | GIS-based analyses of agricultural production and habitation in the Sigatoka Valley, Fiji | |
Kim | A growth model for root systems of virtual plants with soil and moisture control |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190823 |
|
RJ01 | Rejection of invention patent application after publication |