CN112802165A - Game scene snow accumulation rendering method, device and medium - Google Patents

Game scene snow accumulation rendering method, device and medium Download PDF

Info

Publication number
CN112802165A
CN112802165A CN202011641611.6A CN202011641611A CN112802165A CN 112802165 A CN112802165 A CN 112802165A CN 202011641611 A CN202011641611 A CN 202011641611A CN 112802165 A CN112802165 A CN 112802165A
Authority
CN
China
Prior art keywords
snow
model
scene
game
orientation angle
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
Application number
CN202011641611.6A
Other languages
Chinese (zh)
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.)
Zhuhai Jianxin Interactive Entertainment Co ltd
Original Assignee
Zhuhai Jianxin Interactive Entertainment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Jianxin Interactive Entertainment Co ltd filed Critical Zhuhai Jianxin Interactive Entertainment Co ltd
Priority to CN202011641611.6A priority Critical patent/CN112802165A/en
Publication of CN112802165A publication Critical patent/CN112802165A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/603D [Three Dimensional] animation of natural phenomena, e.g. rain, snow, water or plants
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features 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/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • A63F2300/663Methods for processing data by generating or executing the game program for rendering three dimensional images for simulating liquid objects, e.g. water, gas, fog, snow, clouds

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

The invention relates to a technical scheme of a method, a device and a medium for rendering accumulated snow of a game scene, which comprises the following steps: s100, building a basic scene model, and dividing more than one designated area into snow accumulation areas; s200, adding an additional model in the snow area, and setting the display state of the model to be hidden; s300, simulating a snowing scene of the game, and detecting the orientation angle of the surface of the basic scene model, wherein the orientation angle is the included angle between the surface of the model and the horizontal plane; s400, setting the snow cover area according to the orientation angle; s500, setting the display state of the additional model as display and setting the thickness of the additional model. The invention has the beneficial effects that: calculating the weight of the accumulated snow according to the orientation of the normal line of the model surface, so that the accumulated snow effect is closer to the real physical law; the snow weight calculated through the normal is randomly disturbed, so that randomness and differentiation are added to the snow effect; the effect of snow reaching a certain thickness is simulated by controlling the grid display hiding and the size of the snow model.

Description

Game scene snow accumulation rendering method, device and medium
Technical Field
The invention relates to the field of computer three-dimensional animation, in particular to a method, a device and a medium for rendering accumulated snow of a game scene.
Background
Different scene models are often built for each weather environment in the game scene design, in order to enrich the weather and climate effect in the game, the earth surface and the objects on the scene are required to show corresponding feedback in snowy days, and the expressive force and the simulation reality of game pictures are improved.
Generally, corresponding scene models are built for various environments, for example, snow scenes are additionally built when snow falls, the method for developing one by one has low efficiency, real physical representation of snow effect cannot be realized, and real disturbance effect cannot be realized.
Disclosure of Invention
The invention aims to at least solve one of the technical problems in the prior art, and provides a game scene snow accumulation rendering method, a game scene snow accumulation rendering device and a game scene snow accumulation rendering medium, so that the project type working efficiency is realized, the snow accumulation effect is closer to the real physical law, and the better visual effect display is provided.
The technical scheme of the invention comprises a method for rendering a game snow scene, which is characterized by comprising the following steps of: s100, building a basic scene model, and dividing more than one designated area into snow accumulation areas; s200, adding an additional model in the snow accumulation area, and setting the display state of the model to be hidden; s300, simulating a snowing scene of a game, and detecting the orientation angle of the surface of the basic scene model, wherein the orientation angle is the included angle between the surface of the model and the horizontal plane; s400, setting the size of the snow cover area according to the orientation angle; s500, setting the display state of the additional model as display, and setting the thickness of the additional model.
The method for rendering the game snow scene, wherein the step S300 comprises: s310, detecting each triangular surface of the basic scene model; and S320, acquiring an included angle between the normal of each triangular surface and the horizontal plane, namely the orientation angle of the surface of the basic scene model.
According to the game snow scene rendering method, the value range of the orientation angle is 0-90 degrees, corresponding snow color display weight distribution and dynamic display are executed for the additional model of the snow through the orientation angle and the shader, the orientation angle obtains a cosine value of an included angle between a pixel normal and an upward direction of the world through the point multiplication pixel normal of the additional model of the snow and the upward direction of the world through the shader, and the orientation angle is calculated according to the cosine value.
The method for rendering the game snow scene, wherein the size of the snow coverage area is positively correlated with the orientation angle, and the larger the orientation angle is, the larger the snow coverage area is.
According to the method for rendering the game snow scene, S400 further includes: s410, setting corresponding snow cover area according to the orientation angle of each model; and S420, generating a corresponding snow cover shape according to the snow cover area based on a random rule.
According to the game snow scene rendering method, the random rule is that layer disturbance is added in snow generation, the layer disturbance is obtained by adding a noise map in a shader, a corresponding snow color value is generated through the product of a sampling numerical value and a display weight of each pixel of the noise map, and corresponding disturbance display is carried out on an additional model of snow according to the noise map.
According to the method for rendering the game snow scene, S500 further includes: s51, setting the display state of the additional model as display, and setting the thickness of the additional model according to the snowing time and/or the snowing amount in the game system; s52, adjusting the thickness of the additional model in the shader.
The technical solution of the present invention also includes a device for rendering a game snow scene, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the method steps when executing the computer program.
The present invention also includes a computer-readable storage medium, in which a computer program is stored, wherein the computer program, when executed by a processor, implements any of the method steps.
The invention has the beneficial effects that: calculating the weight of the accumulated snow according to the orientation of the normal line of the model surface, so that the accumulated snow effect is closer to the real physical law; the snow weight calculated through the normal is randomly disturbed, so that randomness and differentiation are added to the snow effect; the effect of snow after reaching a certain thickness is simulated by controlling the display hiding and the size of the snow model grids.
Drawings
The invention is further described below with reference to the accompanying drawings and examples;
FIG. 1 shows a general flow diagram according to an embodiment of the invention.
Fig. 2a and 2b are schematic views showing the snow weight according to the embodiment of the present invention.
FIG. 3 is a schematic diagram of disturbance noise according to an embodiment of the present invention.
FIG. 4 shows a medium diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the present preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number.
In the description of the present invention, the consecutive reference numbers of the method steps are for convenience of examination and understanding, and the implementation order between the steps is adjusted without affecting the technical effect achieved by the technical solution of the present invention by combining the whole technical solution of the present invention and the logical relationship between the steps.
In the description of the present invention, unless otherwise explicitly defined, terms such as set, etc. should be broadly construed, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the detailed contents of the technical solutions.
Interpretation of terms:
shader: and a shader.
FIG. 1 shows a general flow diagram according to an embodiment of the invention. The process comprises the following steps: s100, building a basic scene model, and dividing more than one designated area into snow accumulation areas; s200, adding an additional model in the snow area, and setting the display state of the model to be hidden; s300, simulating a snowing scene of the game, and detecting the orientation angle of the surface of the basic scene model, wherein the orientation angle is the included angle between the surface of the model and the horizontal plane; s400, setting the snow cover area according to the orientation angle; s500, setting the display state of the additional model as display and setting the thickness of the additional model. Wherein S300 includes: detecting each triangular surface of the basic scene model; and obtaining the included angle between the normal of each triangular surface and the horizontal plane, namely the orientation angle of the surface of the basic scene model. The orientation angle ranges from 0 ° to 90 °. The size of the snow cover area is positively correlated with the orientation angle, and the larger the orientation angle is, the larger the snow cover area is. S400 further includes: setting corresponding snow cover area according to the orientation angle of each model; and generating a corresponding snow cover shape according to the snow cover area based on a random rule. The random rule is that layer disturbance is added in snow generation, and is used for increasing irregularity of snow distribution. S500 further includes: setting the display state of the additional model as display, and setting the thickness of the additional model according to the snowing time and/or the snowing amount in the game system; the thickness of the additional model is adjusted in Shader.
Fig. 2a and 2b are schematic views showing the snow weight according to the embodiment of the present invention. The 3D model created by the artist using the 3D modeling tool includes vertex information of the model mesh, normal information of the vertices, texture coordinate information of the vertices, and the like. This information is organized into the GPU as the graphics engine renders the models. By writing Shader code, this information may be obtained at execution time.
Shader performs two main stages, the vertex processing stage and the pixel processing stage. The coloring of the snow effect is performed at the pixel stage. In the pixel processing stage, the GPU may obtain the normal information of all pixels on the entire triangular surface through internal interpolation operation according to the normal information of the three vertices of one triangular surface, and transmit the normal information to the pixel processing stage, so that the normal direction of each pixel may be obtained in the pixel processing stage, referring to fig. 2 a.
The normal direction is a three-dimensional vector, and the cosine value of the included angle between the normal of the pixel and the world direction can be obtained by dot-multiplying the normal of the pixel and the world direction. The angle of the included angle can be found from the cosine value, see fig. 2 b. The included angle of 0 degree indicates that the plane where the pixel is located is the heaviest snow position, and the included angle of 90 degrees indicates that the plane where the pixel is located is the vertical plane and the lightest snow position. Therefore, the angle may be converted from 90 degrees to 0 degrees to a snow weight value of 0 to 1.0, (e.g., 45 degrees for 0.5). The weight values are used to control the superposition of the snow color on the pixels.
For fig. 2a, the GPU interpolates the normals of all pixels on a complete triangle surface, such as the pixel p normal n in fig. 2a, according to the 3 vertex normal information (n0, n1, n2) of the triangle surface; for fig. 2b, the cosine value of the angle between n and u is obtained by dot-multiplying the normal n of the pixel and the upward direction u of the world, and then the angle θ between n and u is obtained by the inverse trigonometric function.
For example, a large flat upward-facing plane would be the same color (a large white) after snow is superimposed by normal calculation, with no thickness randomness.
By sampling this noise map, the snow color calculated previously is perturbed. For example, for a pixel, the snow weight calculated from the normal is 0.7, and after perturbation (multiplication by the value sampled from the noise map, e.g., 0.9), the final snow weight is 0.7 x 0.9 — 0.63.
The same normally oriented pixel will have a difference in snow color through the perturbation of the noise map, and will not be the same color for a large upward facing plane. By increasing differentiation, the snow accumulation effect is more real.
Fig. 4 shows a schematic view of an apparatus according to an embodiment of the invention. The apparatus comprises a memory 100 and a processor 200, wherein the processor 200 stores a computer program for performing: building a basic scene model, and dividing more than one designated area into snow areas; adding an additional model in the snow accumulation area, and setting the display state of the model to be hidden; simulating a snowing scene of a game, and detecting the orientation angle of the surface of the model of the basic scene, wherein the orientation angle is the included angle between the surface of the model and the horizontal plane; setting the size of the snow cover area according to the orientation angle; the display state of the additional model is set to display, and the thickness of the additional model is set. Wherein the memory 100 is used for storing data.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (9)

1. A method for rendering a game snow scene is characterized by comprising the following steps:
s100, building a basic scene model, and dividing more than one designated area into snow accumulation areas;
s200, adding an additional model in the snow accumulation area, and setting the display state of the model to be hidden;
s300, simulating a snowing scene of a game, and detecting the orientation angle of the surface of the basic scene model, wherein the orientation angle is the included angle between the surface of the model and the horizontal plane;
s400, setting the size of the snow cover area according to the orientation angle;
s500, setting the display state of the additional model as display, and setting the thickness of the additional model.
2. The game snow scene rendering method of claim 1, wherein the S300 comprises:
s310, detecting each triangular surface of the basic scene model;
and S320, acquiring an included angle between the normal of each triangular surface and the horizontal plane, namely the orientation angle of the surface of the basic scene model.
3. The method for rendering a game snow scene according to claim 2, wherein the orientation angle ranges from 0 ° to 90 °, and the corresponding snow display weight distribution and dynamic display are performed for the additional model of snow through the orientation angle and the shader, wherein the orientation angle obtains cosine values of an included angle between a pixel normal and an upper world direction by multiplying a pixel normal of the additional model of snow by a pixel normal and the upper world direction through the shader, and the orientation angle is calculated according to the cosine values.
4. The game snow scene rendering method of claim 3, wherein the magnitude of the snow-covered area is positively correlated with the orientation angle, and the larger the orientation angle, the larger the snow-covered area.
5. The game snow scene rendering method of claim 4, wherein the S400 further comprises:
s410, setting corresponding snow cover area according to the orientation angle of each model;
and S420, generating a corresponding snow cover shape according to the snow cover area based on a random rule.
6. The method for rendering a game snow scene according to claim 5, wherein the random rule is to add layer perturbation to the snow generation, wherein the layer perturbation is generated by adding a noise map in a shader, generating a corresponding snow color value through a product of a sampling value and a display weight of each pixel of the noise map, and performing corresponding perturbation display on an additional model of snow according to the noise map.
7. The game snow scene rendering method of claim 1, wherein the S500 further comprises:
s51, setting the display state of the additional model as display, and setting the thickness of the additional model according to the snowing time and/or the snowing amount in the game system;
s52, adjusting the thickness of the additional model in the shader.
8. An apparatus for game snow scene rendering, the apparatus comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method steps of any of claims 1-7 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202011641611.6A 2020-12-31 2020-12-31 Game scene snow accumulation rendering method, device and medium Pending CN112802165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011641611.6A CN112802165A (en) 2020-12-31 2020-12-31 Game scene snow accumulation rendering method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011641611.6A CN112802165A (en) 2020-12-31 2020-12-31 Game scene snow accumulation rendering method, device and medium

Publications (1)

Publication Number Publication Date
CN112802165A true CN112802165A (en) 2021-05-14

Family

ID=75809204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011641611.6A Pending CN112802165A (en) 2020-12-31 2020-12-31 Game scene snow accumulation rendering method, device and medium

Country Status (1)

Country Link
CN (1) CN112802165A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113470169A (en) * 2021-06-30 2021-10-01 完美世界(北京)软件科技发展有限公司 Game scene generation method and device, computer equipment and readable storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997006512A2 (en) * 1995-08-04 1997-02-20 Microsoft Corporation Method and system for rendering graphical objects to image chunks and combining image layers into a display image
CA2314333A1 (en) * 2000-07-21 2002-01-21 University Of British Columbia Computer modelling of fallen snow
JP2002251625A (en) * 2001-02-22 2002-09-06 Sega Corp Device and method for processing image, recording medium for recording program for processing image operating on computer
US20150187116A1 (en) * 2013-12-31 2015-07-02 Disney Enterprises, Inc. Material point method for simulation of granular materials
CN105279782A (en) * 2015-07-02 2016-01-27 苏州蜗牛数字科技股份有限公司 Simulation and rendering method of real-time sea system
CN106023300A (en) * 2016-05-09 2016-10-12 深圳市瑞恩宁电子技术有限公司 Body rendering method and system of semitransparent material
CN106599770A (en) * 2016-10-20 2017-04-26 江苏清投视讯科技有限公司 Skiing scene display method based on body feeling motion identification and image matting
CN108487099A (en) * 2018-02-11 2018-09-04 四川大学 A method of expressway surface accumulated snow is reduced by air conducting
US20190302259A1 (en) * 2018-03-27 2019-10-03 The Mathworks, Inc. Systems and methods for generating synthetic sensor data
CN110455720A (en) * 2019-08-19 2019-11-15 电子科技大学 A kind of infrared sensor wave band optimization method overflow based on mirror than model
CN110706324A (en) * 2019-10-18 2020-01-17 网易(杭州)网络有限公司 Method and device for rendering weather particles
CN110992456A (en) * 2019-11-19 2020-04-10 浙江大学 Avalanche simulation method based on position dynamics
CN111354061A (en) * 2020-03-26 2020-06-30 西安震有信通科技有限公司 Method and device for processing snowing scene simulation in GIS system based on graphics
CN111489412A (en) * 2019-01-25 2020-08-04 辉达公司 Semantic image synthesis for generating substantially realistic images using neural networks
CN111583381A (en) * 2020-05-06 2020-08-25 网易(杭州)网络有限公司 Rendering method and device of game resource map and electronic equipment

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997006512A2 (en) * 1995-08-04 1997-02-20 Microsoft Corporation Method and system for rendering graphical objects to image chunks and combining image layers into a display image
CA2314333A1 (en) * 2000-07-21 2002-01-21 University Of British Columbia Computer modelling of fallen snow
JP2002251625A (en) * 2001-02-22 2002-09-06 Sega Corp Device and method for processing image, recording medium for recording program for processing image operating on computer
US20150187116A1 (en) * 2013-12-31 2015-07-02 Disney Enterprises, Inc. Material point method for simulation of granular materials
CN105279782A (en) * 2015-07-02 2016-01-27 苏州蜗牛数字科技股份有限公司 Simulation and rendering method of real-time sea system
CN106023300A (en) * 2016-05-09 2016-10-12 深圳市瑞恩宁电子技术有限公司 Body rendering method and system of semitransparent material
CN106599770A (en) * 2016-10-20 2017-04-26 江苏清投视讯科技有限公司 Skiing scene display method based on body feeling motion identification and image matting
CN108487099A (en) * 2018-02-11 2018-09-04 四川大学 A method of expressway surface accumulated snow is reduced by air conducting
US20190302259A1 (en) * 2018-03-27 2019-10-03 The Mathworks, Inc. Systems and methods for generating synthetic sensor data
CN111489412A (en) * 2019-01-25 2020-08-04 辉达公司 Semantic image synthesis for generating substantially realistic images using neural networks
CN110455720A (en) * 2019-08-19 2019-11-15 电子科技大学 A kind of infrared sensor wave band optimization method overflow based on mirror than model
CN110706324A (en) * 2019-10-18 2020-01-17 网易(杭州)网络有限公司 Method and device for rendering weather particles
CN110992456A (en) * 2019-11-19 2020-04-10 浙江大学 Avalanche simulation method based on position dynamics
CN111354061A (en) * 2020-03-26 2020-06-30 西安震有信通科技有限公司 Method and device for processing snowing scene simulation in GIS system based on graphics
CN111583381A (en) * 2020-05-06 2020-08-25 网易(杭州)网络有限公司 Rendering method and device of game resource map and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113470169A (en) * 2021-06-30 2021-10-01 完美世界(北京)软件科技发展有限公司 Game scene generation method and device, computer equipment and readable storage medium
CN113470169B (en) * 2021-06-30 2022-04-29 完美世界(北京)软件科技发展有限公司 Game scene generation method and device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11010509B2 (en) Systems and methods for computer simulation of detailed waves for large-scale water simulation
US9589386B2 (en) System and method for display of a repeating texture stored in a texture atlas
US11410372B2 (en) Artificial intelligence based virtual object aging
CN102117497B (en) Method and system for three-dimensional terrain modeling
US20050212800A1 (en) Volumetric hair simulation
CN102426691A (en) Real-time fire effect simulation method based on GPU
McLaren et al. Visualisation of digital terrain models: techniques and applications
KR20080055581A (en) Apparatus, method, application program and computer readable medium thereof capable of pre-storing data for generating self-shadow of a 3d object
Peytavie et al. Procedural generation of rock piles using aperiodic tiling
CN107170040A (en) A kind of three-dimensional bridge scenario building method and apparatus
CN104299259A (en) Dynamic interpolation method and sea surface scene generation method
US6897863B2 (en) System and method for hidden object removal
CN110400366B (en) Real-time flood disaster visualization simulation method based on OpenGL
Kang et al. Terrain rendering with unlimited detail and resolution
CN113129420B (en) Ray tracing rendering method based on depth buffer acceleration
CN112802165A (en) Game scene snow accumulation rendering method, device and medium
Li et al. GPU accelerated marine data visualization method
JPH08190639A (en) Cloud phenomenon visualizing device
Hempe et al. Generation and rendering of interactive ground vegetation for real-time testing and validation of computer vision algorithms
Li et al. Astrogen–procedural generation of highly detailed asteroid models
CN117036560B (en) Wind field simulation method, medium and equipment suitable for virtual scene
CN111354081A (en) Large-scale three-dimensional forest drawing method
CN115423917B (en) Real-time drawing method and system for global three-dimensional wind field
Ding et al. Real-time rain and snow rendering
Leach A GPU-Based level of detail system for the real-time simulation and rendering of large-scale granular terrain

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