Game grassland real-time rendering method and device, computer equipment and storage medium

By generating a dynamic parameter database and matching real-time environmental parameters, the basic morphology of the grassland is adjusted for rendering, which solves the problems of unnatural rendering effects and high consumption caused by existing rendering methods, and achieves efficient grassland rendering effects.

CN121102880APending Publication Date: 2025-12-12SHANGHAI MANJU NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511537103.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing rendering methods based on planar grass patterns result in issues such as abrupt transitions in the color and spatial continuity of the rendered grass, unsmooth visuals, unnatural grass edge transitions, and excessive memory and rendering consumption.

Method used

By simulating the state of grassland under various environmental parameters, a dynamic parameter database is generated. Real-time environmental parameter data in the game is collected, and the optimal basic form of grassland is set according to the actual environmental parameter data. The optimal basic form of grassland is adjusted to generate a real-time grassland rendering model. The physical engine is used to calculate the state of the grass blade physical model under various environmental parameters, generate dynamic deformation data of grassland, and perform parallel rendering through the GPU driver interface.

Benefits of technology

It achieves realistic dynamic effect simulation and unique artistic style rendering, and solves the problems of stiff transition between grass color and spatial continuity, insufficient screen smoothness, unnatural grass edge transition, and excessive memory and rendering consumption. It improves the amount of dynamic detail and reduces performance fluctuations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121102880A_ABST
    Figure CN121102880A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of games, in particular to a game grassland real-time rendering method and device, computer equipment and a storage medium, and the method comprises the steps that the states of a grassland under various environment parameters are simulated, a dynamic parameter database is generated, and the dynamic parameter database comprises multiple grassland dynamic deformation data; acquiring actual environment parameter data in the game in real time; setting an optimal grassland basic form according to the actual environment parameter data and the dynamic parameter database; and adjusting the optimal grassland basic form, and generating a real-time grassland rendering model. According to the method, the problems that in the prior art, due to a rendering mode based on patch grass, connection between rendered grassland color and space continuity is stiff, picture performance is not smooth enough, grassland edge connection is not natural, and memory and rendering consumption is too high are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the game technical field, in particular to a game grassland real-time rendering method and device, computer equipment and storage medium. BACKGROUND

[0002] In the real-time rendering game scene, the grassland belongs to the high order of magnitude, fine-grained natural elements. In the traditional game processing grass scheme, the rendering mode based on the patch grass is usually adopted, a large number of quadrilateral patches with transparent channels are arranged in the scene, and simple random transformation is applied to simulate the appearance of natural grassland.

[0003] However, this kind of rendering grassland mode has disadvantages, in the visual effect, since the patch grass usually adopts a limited kind of repeated unit, the adaptive fusion mechanism with the scene terrain is lack, the connection of the grass body and the ground, the grass body and the grass body in the form, color and space continuity is harsh, it is difficult to realize the visual transition conforming to the natural law, causing the problem of not smooth enough picture performance. At the same time, since the grassland in the range is usually loaded in the scheme, there are problems of unnatural connection of the grassland edge, high memory and rendering consumption. SUMMARY

[0004] Therefore, it is necessary to provide a game grassland real-time rendering method, device, computer equipment and storage medium, which can solve the problems of harsh connection of the grassland color and space continuity after rendering, not smooth enough picture performance, and unnatural connection of the grassland edge caused by the rendering mode based on the patch grass in the prior art.

[0005] The technical scheme of the present application is as follows: A game grassland real-time rendering method, the method comprises: Simulating the state of the grassland under a plurality of environmental parameters to generate a dynamic parameter database, wherein the dynamic parameter database comprises a plurality of grassland dynamic deformation data; Real-time collection of actual environmental parameter data in the game; Setting an optimal grassland basic form according to the actual environmental parameter data and the dynamic parameter database; Adjusting the optimal grassland basic form to generate a real-time grassland rendering model.

[0006] Optionally, simulating the state of the grassland under a plurality of environmental parameters to generate a dynamic parameter database comprises: Building a grass leaf physical model and calculating the state of the grass leaf physical model under a plurality of environmental parameters based on a physical engine to generate grassland dynamic deformation data; Generating a dynamic parameter database according to the grassland dynamic deformation data.

[0007] Optionally, the physics engine is unity engine; The state of the grass leaf physical model under various environmental parameters is calculated based on the physics engine to generate grass dynamic deformation data, including: An environmental parameter matrix is constructed based on various environmental parameters; BendingStrength, BendingSpeed, Flutter Strentgh, FlutterSpeed and other parameters are constructed, the parameters are merged into a parameter matrix, and the parameter matrix is stored in the grass leaf physical model; The grass leaf physical model is imported into the unity engine, and the parameter matrix in the model is automatically set to a global parameter matrix read in the engine through a custom tool in the unity engine; Simulation is performed according to the global parameter matrix and the environmental parameter matrix, and grass dynamic deformation data is generated; The grass dynamic deformation data is set to the shader through a rendering pipeline, and the wind force is calculated in the shader, and the acceleration formula of the wind force is:

[0008] Wherein: a is the instantaneous acceleration of the grass leaf micro unit, which is used to drive the grass leaf deformation movement; pleaf is the density of the grass leaf (material attribute parameter), and kb is the bending coefficient (constant, used to adjust the bending response strength); BendingStrength is the bending strength parameter output by the physics engine; is the spatial gradient of the bending angle of the grass leaf; is the flutter coefficient; FlutterStrength is the flutter strength parameter output by the physics engine; is the local wind speed vector calculated by the Navier-Stokes equation; n is the normal vector of the grass leaf surface; μ is the air dynamic viscosity coefficient; Δ is the Laplace operator; BendingSpeed is the bending speed parameter output by the physics engine; is the time derivative of the bending angle; FlutterSpeed is the flutter speed parameter output by the physics engine; is the time derivative of the flutter angle.

[0009] Optionally, an environmental parameter matrix is constructed based on multiple environmental parameters, including: The environmental parameter matrix is constructed according to wind data, illumination data, and terrain data; wherein, The wind data is: 0-10 level wind, with a wind speed difference of 1 m / s for each level of wind; The illumination range is: azimuth angle 0-360°, every 15°, elevation angle 0-90°, every 10°; The terrain data is: slope 0-60°, every 5°, aspect 0-360°, every 30°.

[0010] Optionally, real-time actual environmental parameter data in the game is collected; including: Real-time wind data, real-time illumination data, and real-time terrain data are obtained based on a preset weather system module; Actual environmental parameter data is generated according to the real-time wind data, real-time illumination data, and real-time terrain data.

[0011] Optionally, an optimal grassland basic form is set according to the actual environmental parameters and the dynamic parameter database, including: The actual environmental parameters are compared with each of the grassland dynamic deformation data in the dynamic parameter database; The grassland dynamic deformation data that matches the actual environmental parameters is filtered out from the dynamic parameter database and set as the optimal basic form.

[0012] Optionally, the optimal grassland basic form is adjusted to generate a real-time grassland rendering model, including: The optimal grassland basic form is subjected to trilinear interpolation to generate real-time dynamic grassland parameters; The real-time dynamic grassland parameters are transmitted to a vertex shader through a GPU driver interface and are rendered in parallel to generate a real-time grassland rendering model.

[0013] Optionally, a game grassland real-time rendering device is also provided, the device comprising: A grassland parameter data generation module for simulating the state of grassland under multiple environmental parameters to generate a dynamic parameter database, wherein the dynamic parameter database comprises multiple grassland dynamic deformation data; An actual grassland parameter collection module for collecting real-time actual environmental parameter data in the game; An optimal grassland form setting module for setting an optimal grassland basic form according to the actual environmental parameter data and the dynamic parameter database; A real-time grassland model rendering module for adjusting the optimal grassland basic form to generate a real-time grassland rendering model.

[0014] Optionally, the grass parameter data generation module is further configured to: build a grass leaf physical model, and calculate a state of the grass leaf physical model under a plurality of environmental parameters based on a physical engine to generate grass dynamic deformation data; and generate a dynamic parameter database according to the grass dynamic deformation data.

[0015] Optionally, the physical engine is a unity engine; and the grass parameter data generation module is further configured to: construct an environmental parameter matrix based on the plurality of environmental parameters; and import the grass leaf physical model into the unity engine, sequentially run simulation according to the environmental parameter matrix, and generate the grass dynamic deformation data.

[0016] Optionally, the grass parameter data generation module is further configured to: construct an environmental parameter matrix according to wind data, illumination data, and terrain data; wherein the wind data is 0-10 level wind, and a wind speed of each level of wind is different by 1 m / s; the illumination ranges from an azimuth angle of 0-360°, with each 15° as a grade, and a height angle of 0-90°, with each 10° as a grade; and the terrain data is a slope of 0-60°, with each 5° as a grade, and a slope direction of 0-360°, with each 30° as a grade.

[0017] Optionally, the actual grass parameter acquisition module is further configured to: acquire real-time wind data, real-time illumination data, and real-time terrain data based on a preset weather system module; and generate actual environmental parameter data according to the real-time wind data, the real-time illumination data, and the real-time terrain data.

[0018] Optionally, the optimal grass form setting module is further configured to: compare the actual environmental parameters with each of the grass dynamic deformation data in the dynamic parameter database; and select, from the dynamic parameter database, grass dynamic deformation data that matches the actual environmental parameters as an optimal basic form.

[0019] Optionally, the real-time grass model rendering module is further configured to: perform trilinear interpolation on the optimal grass basic form to generate real-time dynamic grass parameters; transfer the real-time dynamic grass parameters to a vertex shader through a GPU driving interface, and perform parallel rendering to generate a real-time grass rendering model.

[0020] Optionally, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of the game grass real-time rendering method when executing the computer program.

[0021] Optionally, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the game grass real-time rendering method when executed by a processor.

[0022] The application achieves the following technical effects: The game grassland real-time rendering method, device, computer equipment and storage medium generate a dynamic parameter database by sequentially simulating the state of the grassland under various environmental parameters, wherein the dynamic parameter database comprises a plurality of grassland dynamic deformation data; real-time collection of actual environmental parameter data in the game; setting of an optimal grassland basic form according to the actual environmental parameter data and the dynamic parameter database; adjustment of the optimal grassland basic form to generate a real-time grassland rendering model; the application pre-calculates and bakes all possible dynamic change data of the grassland to construct a complete dynamic parameter database, and realizes realistic dynamic effect simulation and unique artistic stylized rendering by efficient data sampling and interpolation calculation during game running; and the problems of harsh connection of the color and spatial continuity of the rendered grassland, insufficient smoothness of the picture performance, unnatural connection of the grassland edge, and excessive memory and rendering consumption caused by the rendering mode based on the patch grass in the prior art are solved. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 A flowchart of a game grassland real-time rendering method in an embodiment is shown in FIG. 1; Figure 2 A structural block diagram of a game grassland real-time rendering device in an embodiment is shown in FIG. 2; Figure 3 A structural block diagram of a computer equipment in an embodiment is shown in FIG. 3. DETAILED DESCRIPTION

[0024] In the following description, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be practiced without these specific details. In other instances, well-known systems, structures, circuits, and techniques have not been shown in detail in order not to obscure the understanding of this application.

[0025] It should be understood that the term "comprising" as used in the specification and in the claims indicates the presence of the recited features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0026] It should also be understood that the term "and / or" as used in the specification and in the claims indicates any combination of one or more of the associated listed items and all possible combinations of the items.

[0027] As used in the specification and the appended claims herein, the term “if’ can be interpreted as meaning “when” or “upon” or “in response to a determination” or “in response to a detection” depending on the context. Similarly, the phrase “if it is determined” or “if [the described condition or event] is detected” can be interpreted as meaning “upon a determination” or “in response to a determination” or “upon a detection of [the described condition or event]” or “in response to a detection of [the described condition or event]” depending on the context.

[0028] In addition, in the description of the present application and the appended claims, the terms “first”, “second”, “third”, etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0029] Reference in the specification to “one embodiment” or “some embodiments” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase “in one embodiment” or “in some embodiments” in various places in the specification are not necessarily all referring to the same embodiment, although it can. The terms “comprising”, “including”, “having” and their variants, mean “including but not limited to”, unless otherwise expressly specified and limited by the context.

[0030] In one embodiment, a terminal is provided, configured to: simulate the state of a grassland under a plurality of environmental parameters, generate a dynamic parameter database, wherein the dynamic parameter database comprises a plurality of dynamic deformation data of the grassland; collect actual environmental parameter data in a game in real time; set an optimal grassland basic form according to the actual environmental parameter data and the dynamic parameter database; adjust the optimal grassland basic form to generate a real-time grassland rendering model.

[0031] The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices.

[0032] In one embodiment, as shown in Figure 1 A game grassland real-time rendering method is provided, comprising: Step S100: simulate the state of a grassland under a plurality of environmental parameters, generate a dynamic parameter database, wherein the dynamic parameter database comprises a plurality of dynamic deformation data of the grassland; Step S200: collect actual environmental parameter data in a game in real time; Step S300: set an optimal grassland basic form according to the actual environmental parameter data and the dynamic parameter database; Step S400: adjusting the optimal grass base form to generate a real-time grass rendering model.

[0033] The application generates a dynamic parameter database by simulating the state of the grass under various environmental parameters, wherein the dynamic parameter database includes a plurality of grass dynamic deformation data; real-time collection of actual environmental parameter data in the game; setting an optimal grass base form according to the actual environmental parameter data and the dynamic parameter database; adjusting the optimal grass base form to generate a real-time grass rendering model; the application pre-calculates and bakes all possible dynamic change data of the grass to construct a complete dynamic parameter database, and realizes realistic dynamic effect simulation and unique artistic stylized rendering by efficient data sampling and interpolation calculation during game running; and further realizes the solution to the problems of the existing technology, such as the harsh connection of the color and spatial continuity of the rendered grass, the unsmooth picture performance, and the unnatural connection of the grass edge, and the excessive memory and rendering consumption caused by the rendering mode based on the patch grass.

[0034] In one embodiment, step S100: simulating the state of the grass under various environmental parameters to generate a dynamic parameter database, includes: Step S110: building a grass leaf physical model and calculating the state of the grass leaf physical model under various environmental parameters based on a physical engine to generate grass dynamic deformation data; Step S120: generating a dynamic parameter database according to the grass dynamic deformation data.

[0035] In this embodiment, a single grass leaf physical model is constructed by a 3D modeling tool, and physical attribute parameters are assigned to each grass leaf vertex to build a model containing grass leaf physical attributes (such as elastic coefficient and damping coefficient). Then, the state of the grass leaf physical model under various environmental parameters is calculated based on a physical engine to generate grass dynamic deformation data; and a dynamic parameter database is generated according to the grass dynamic deformation data. The dynamic parameter database not only stores physical attributes such as bending angle and swing frequency of the grass leaf, but also contains artistic parameters such as edge feathering value and color gradient coefficient specific to the cartoon style, realizing the fusion of bottom layer data of physical reality and stylized performance.

[0036] In one embodiment, the physical engine is a unity engine; and in step S110, the state of the grass leaf physical model under various environmental parameters is calculated based on the physical engine to generate grass dynamic deformation data, including: Step S111: constructing an environmental parameter matrix based on various environmental parameters; Step S112: build the parameters of BendingStrength, BendingSpeed, Flutter Strentgh, FlutterSpeed, and combine the parameters into a parameter matrix, and store it in the grass physical model; In this step, BendingStrength, BendingSpeed, Flutter Strentgh and FlutterSpeed respectively refer to bending strength, bending speed, flutter strength and flutter speed. The dynamic simulation control parameters are designed to simulate the bending and flutter of the grassland. By setting the dynamic simulation control parameters, the packaging of the grassland is realized, and the reality of the grassland model in the game is better reflected.

[0037] Step S113: import the grass physical model into the unity engine, and automatically set the parameter matrix in the model to the global parameter matrix read in the engine through the custom tool in the unity engine; Step S114: simulate according to the global parameter matrix and the environment parameter matrix, and generate grass dynamic deformation data; Step S115: set the grass dynamic deformation data to the shader through the rendering pipeline, and calculate the wind force in the shader. The acceleration formula of the wind force is:

[0038] Wherein: a is the instantaneous acceleration of the grass leaf micro unit, which is used to drive the grass leaf deformation movement.

[0039] is the density of the grass leaf (material attribute parameter). kb is the bending coefficient (constant, used to adjust the bending response strength); BendingStrength is the bending strength parameter output by the physical engine (characterizing the bending resistance of the grass leaf); is the spatial gradient of the bending angle (θ) of the grass leaf (describing the change rate of bending deformation).

[0040] is the flutter coefficient (constant, used to adjust the flutter response strength); FlutterStrength is the flutter strength parameter output by the physical engine (characterizing the flutter resistance of the grass leaf); is the local wind speed vector calculated by the Navier-Stokes equation; n is the normal vector of the grass leaf surface (used to calculate the vertical component of the wind force and the grass leaf).

[0041] μ is the aerodynamic viscosity coefficient (μ from the Navier-Stokes equations); Δ is the Laplace operator (describing the second-order rate of change in space); BendingSpeed ​​is the bending speed parameter output by the physics engine (characterizing the rate of bending motion). The time derivative of the bending angle (bending angular velocity); FlutterSpeed ​​is the shimmer speed parameter output by the physics engine (characterizing the rate of shimmering motion). This is the time derivative of the jitter angle (jitter angular velocity).

[0042] Wind force can be calculated from the acceleration of wind. Based on the above equation, a simplified wind-receiving equation can be derived. The approximate solution for the deformation displacement of the grass after the influence of force is calculated using the following formula:

[0043] The parameter mapping relationship between this equation and the acceleration equation is as follows:

[0044] Where: p0 is the original position of the grass apex, Random Noise is the superimposed random wind speed vector, L is the distance between the current point and the root, γ represents the wind-driven intensity, and ζ represents the bending damping. Indicates the stiffness of the grass blades.

[0045] In this embodiment, a "full-state pre-baking + real-time sampling" architecture is designed. Based on the Unity engine, simulations are run offline sequentially according to the environmental parameter matrix to calculate the dynamic data of grassland under different wind forces, light intensity, and terrain, thus constructing dynamic deformation data of the grassland. This facilitates rapid matching and interpolation calculations using lightweight algorithms during subsequent runtime, improving dynamic details while avoiding performance fluctuations in real-time physics simulations.

[0046] In one embodiment, step S111: constructing an environmental parameter matrix based on multiple environmental parameters includes: An environmental parameter matrix was constructed based on wind data, sunlight data, and topographic data; among which... The wind data is: wind force 0-10, with a wind speed difference of 1m / s for each wind force level; The illumination range is: azimuth angle 0-360°, in increments of 15°; elevation angle 0-90°, in increments of 10°. The terrain data are as follows: slope 0-60°, in increments of 5°; aspect 0-360°, in increments of 30°.

[0047] By gradient division of wind level, light angle, and terrain slope, the morphologies of the simulated grass plants in different environments are realized to provide a data basis for subsequent real-time rendering.

[0048] In one embodiment, step S200: real-time collection of actual environmental parameter data in the game; includes: Step S210: obtaining real-time wind data, real-time light data, and real-time terrain data based on a preset weather system module; Step S220: generating actual environmental parameter data according to the real-time wind data, real-time light data, and real-time terrain data.

[0049] In this embodiment, real-time wind data, real-time light data, and real-time terrain data are obtained based on a preset weather system module, and actual environmental parameter data is generated according to the real-time wind data, real-time light data, and real-time terrain data, thereby providing data support for subsequent generation of real-time grassland rendering models.

[0050] In one embodiment, step S300: setting an optimal grassland basic morphology according to the actual environmental parameters and the dynamic parameter database, includes: Step S310: comparing the actual environmental parameters with each of the grassland dynamic deformation data in the dynamic parameter database; Step S320: filtering out grassland dynamic deformation data matching the actual environmental parameters from the dynamic parameter database and setting as the optimal basic morphology.

[0051] In this embodiment, when the game is running, the CPU-side environmental parameter collection module obtains real-time wind, light, terrain, and other information, and then quickly locates the optimal basic state in the dynamic parameter database through a lightweight environmental parameter matching algorithm (response delay <1 ms).

[0052] In one embodiment, step S400: adjusting the optimal grassland basic morphology to generate a real-time grassland rendering model, includes: Step S410: performing trilinear interpolation on the optimal grassland basic morphology and generating real-time dynamic grassland parameters; Step S420: transferring the real-time dynamic grassland parameters to a vertex shader through a GPU driver interface and performing parallel rendering to generate a real-time grassland rendering model.

[0053] In this embodiment, trilinear interpolation is performed, such as wind weight 0.4, light weight 0.3, and terrain weight 0.3. The interpolated parameters are transferred to the vertex shader through the GPU driver interface (such as DirectX 12) to realize parallel rendering of 100,000+ grass leaves per frame, and the dynamic detail amount is increased by 300% compared with the traditional scheme.

[0054] In one embodiment, as shown in Figure 2 The device also comprises: A grass parameter data generation module for simulating the state of the grass under various environmental parameters and generating a dynamic parameter database, wherein the dynamic parameter database comprises a plurality of dynamic deformation data of the grass. An actual grass parameter acquisition module for acquiring real-time environmental parameter data in the game. An optimal grass form setting module for setting an optimal grass base form according to the actual environmental parameter data and the dynamic parameter database. A real-time grass model rendering module for adjusting the optimal grass base form and generating a real-time grass rendering model.

[0055] In one embodiment, the grass parameter data generation module is further configured to: build a grass leaf physical model, calculate the state of the grass leaf physical model under various environmental parameters based on a physical engine, and generate dynamic deformation data of the grass; and generate a dynamic parameter database according to the dynamic deformation data of the grass.

[0056] In one embodiment, the physical engine is a unity engine; and the grass parameter data generation module is further configured to: construct an environmental parameter matrix based on various environmental parameters; import the grass leaf physical model into the unity engine, sequentially run simulation according to the environmental parameter matrix, and generate dynamic deformation data of the grass.

[0057] In one embodiment, the grass parameter data generation module is further configured to: construct an environmental parameter matrix according to wind data, illumination data, and terrain data; wherein the wind data is: 0-10 level wind, with a wind speed difference of 1 m / s for each level of wind; the illumination range is: azimuth angle 0-360°, with one grade every 15°, and elevation angle 0-90°, with one grade every 10°; and the terrain data is: slope 0-60°, with one grade every 5°, and aspect 0-360°, with one grade every 30°.

[0058] In one embodiment, the actual grass parameter acquisition module is further configured to: obtain real-time wind data, real-time illumination data, and real-time terrain data based on a preset weather system module; and generate actual environmental parameter data according to the real-time wind data, the real-time illumination data, and the real-time terrain data.

[0059] In one embodiment, the optimal grass form setting module is further configured to: compare the actual environmental parameters with each of the dynamic deformation data of the grass in the dynamic parameter database; and select, from the dynamic parameter database, dynamic deformation data of the grass that matches the actual environmental parameters as an optimal base form.

[0060] In one embodiment, the real-time grass model rendering module is further configured to perform tri-linear interpolation on the optimal grass base shape and generate real-time dynamic grass parameters, and transmit the real-time dynamic grass parameters to a vertex shader through a GPU driver interface and perform parallel rendering to generate a real-time grass rendering model.

[0061] In one embodiment, as shown in FIG. 13, a computer device is also provided, which includes a memory and a processor, the memory stores a computer program and an operating system, and the processor implements the steps of the pet-based permanent cooperative battle method when executing the computer program. The computer device further includes a system bus, an internal memory, a network structure, a display screen, an input device, and the like. Figure 3

[0062] In one embodiment, a computer readable storage medium is also provided, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the game grass real-time rendering method.

[0063] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments, and the specific functions and technical effects brought by the above modules can be referred to the method embodiments part, which will not be repeated here.

[0064] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit or module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit, and the integrated unit can be realized in the form of hardware or software. In addition, the specific name of each functional unit or module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0065] The embodiments of the present application also provide a network device, which comprises at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, and the processor implements the steps in any of the method embodiments when executing the computer program.

[0066] ​The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program can realize the steps in each method embodiment described above by a processor.

[0067] The embodiment of the present application provides a computer program product, which, when running on a mobile terminal, enables the mobile terminal to realize the steps in each method embodiment described above.

[0068] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the embodiment of the present application can realize all or part of the processes in the above method by a computer program to instruct related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can realize the steps in each method embodiment described above when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium at least includes any entity or device capable of carrying the computer program code to a photographing device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0069] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0070] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0071] In the embodiments of the present application, it should be understood that the disclosed apparatus / network device and method can be implemented in other manners. For example, the described apparatus / network device embodiments are merely illustrative. For example, the division of the modules or units is only a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0072] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0073] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

[0074] An embodiment of the present application further provides a computer device, which comprises at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above-described embodiments.

[0075] The computer device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that the above description is an example of the computer device, and does not constitute a limitation on the computer device, and can include more or less components than the above description, or combine some components, or different components, for example, can also include input / output devices, network access devices, etc.

[0076] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0077] The memory can be an internal storage unit of the computer device in some embodiments, for example, a hard disk or a memory of the computer device. The memory can also be an external storage device of the computer device in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory can include both the internal storage unit and the external storage device of the computer device. The memory is used to store an operating system, application programs, a boot loader, data, and other programs, for example, program codes of the computer program, etc. The memory can also be used to temporarily store data that has been output or will be output.

[0078] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.

[0079] The above embodiments only express several implementation manners of the present application, and the description is specific and detailed, but it should not be understood as a limitation on the scope of the present application. It should be pointed out that for those skilled in the art, some modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the claims.

Claims

1. A method for real-time rendering of a game lawn, characterized in that, The method includes: Simulate the state of grassland under various environmental parameters to generate a dynamic parameter database, wherein the dynamic parameter database includes multiple grassland dynamic deformation data; Real-time collection of actual environmental parameter data in the game; The optimal basic grassland morphology is determined based on the actual environmental parameter data and the dynamic parameter database. Adjust the optimal basic grassland shape to generate a real-time grassland rendering model.

2. The real-time rendering method for game grassland according to claim 1, characterized in that, Simulate the state of grassland under various environmental parameters to generate a dynamic parameter database, including: A physical model of grass blades is built, and the state of the physical model of grass blades under various environmental parameters is calculated based on the physics engine to generate dynamic deformation data of grassland. A dynamic parameter database is generated based on grassland dynamic deformation data.

3. The real-time rendering method for game grassland according to claim 2, characterized in that, The physics engine is the Unity engine; Based on the physics engine, the state of the grass blade physical model is calculated under various environmental parameters to generate dynamic deformation data of the grassland, including: An environmental parameter matrix is ​​constructed based on multiple environmental parameters; Construct parameters such as BendingStrength, BendingSpeed, FlutterStrength, and FlutterSpeed, merge the parameters into a parameter matrix, and store it in the grass blade physics model; Import the grass blade physics model into the Unity engine, and use the custom tools in the Unity engine to automatically set the parameter matrix in the model to the global parameter matrix read in the engine; Simulations were performed based on the global parameter matrix and environmental parameter matrix, and dynamic deformation data of the grassland was generated. The dynamic deformation data of the grassland is set into the shader through the rendering pipeline. The wind force is calculated in the shader, and the acceleration formula of the wind force is: ; in: a represents the instantaneous acceleration of the grass blade micro-unit, used to drive the deformation motion of the grass blade; pleaf is the density of the grass blades (a material property parameter), and kb is the bending coefficient (a constant used to adjust the bending response strength). BendingStrength is the bending strength parameter output by the physics engine; The spatial gradient of the grass blade bending angle; This is the flutter coefficient; FlutterStrength is the flutter intensity parameter output by the physics engine; The local wind speed vector calculated for the Navier-Stokes equations; n is the normal vector of the grass blade surface; μ is the aerodynamic viscosity coefficient; Δ is the Laplace operator; BendingSpeed ​​is the bending speed parameter output by the physics engine; The time derivative of the bending angle; FlutterSpeed ​​is the shimmer speed parameter output by the physics engine; This is the time derivative of the tremor angle.

4. The real-time rendering method for game grassland according to claim 3, characterized in that, An environmental parameter matrix is ​​constructed based on multiple environmental parameters, including: An environmental parameter matrix was constructed based on wind data, sunlight data, and topographic data; among which... The wind data is: wind force 0-10, with a wind speed difference of 1m / s for each wind force level; The illumination range is: azimuth angle 0-360°, in increments of 15°; elevation angle 0-90°, in increments of 10°. The terrain data are as follows: slope 0-60°, in increments of 5°; aspect 0-360°, in increments of 30°.

5. The real-time rendering method for game grassland according to claim 1, characterized in that, Real-time collection of actual environmental parameter data in the game; including: Real-time wind data, real-time sunlight data, and real-time terrain data are obtained based on the preset weather system module; Actual environmental parameter data is generated based on the real-time wind data, real-time illumination data, and real-time terrain data.

6. The real-time rendering method for game grassland according to claim 1, characterized in that, Based on the actual environmental parameters and the dynamic parameter database, the optimal basic grassland morphology is set, including: Compare the actual environmental parameters with the dynamic deformation data of each grassland in the dynamic parameter database; Grassland dynamic deformation data that matches the actual environmental parameters are selected from the dynamic parameter database and set as the optimal basic morphology.

7. The real-time rendering method for game grassland according to claim 1, characterized in that, Adjusting the optimal basic grassland morphology to generate a real-time grassland rendering model includes: The optimal grassland basic morphology is subjected to trilinear interpolation to generate real-time dynamic grassland parameters. The real-time dynamic grass parameters are passed to the vertex shader through the GPU driver interface and rendered in parallel to generate a real-time grass rendering model.

8. A real-time rendering device for game grasslands, characterized in that, The device includes: The grassland parameter data generation module is used to simulate the state of grassland under various environmental parameters and generate a dynamic parameter database, wherein the dynamic parameter database includes multiple grassland dynamic deformation data. The actual grassland parameter acquisition module is used to collect actual environmental parameter data in the game in real time; The optimal grassland morphology setting module is used to set the optimal basic grassland morphology based on the actual environmental parameter data and the dynamic parameter database. The real-time grassland model rendering module is used to adjust the optimal basic grassland shape and generate a real-time grassland rendering model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.