Game scene rendering method and device

By obtaining vegetation configuration information and using spline curves to spread points, combining the collision body and distribution index relationship, the vegetation generation method in the existing technology cannot meet the flexible and realistic problem, and improves the visual effect and rendering effectiveness of game scenes.

CN119295629APending Publication Date: 2025-01-10BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311640674.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-01
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Vegetation generation methods in existing game scenes rely on topographic maps, which cannot meet the needs of flexible and realistic scene display, resulting in overlap and interspersion between vegetation and other scene objects, affecting the visual effect.

Method used

By obtaining vegetation configuration information, determine the spreading point distribution information of vegetation objects, and use spline curves to spread points of vegetation objects at the spreading point position, combining the collision body and distribution index relationship to avoid overlap and interspersion, and achieve more realistic scene rendering .

Benefits of technology

It improves the visual display effect of vegetation in the game scene, meets the needs of flexible and realistic scenes, avoids overlap and interspers between vegetation and other scene objects, and improves rendering effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295629A_ABST
    Figure CN119295629A_ABST
Patent Text Reader

Abstract

The invention discloses a game scene rendering method and device, relates to the technical field of game development, and mainly aims at solving the problem that an existing game scene is poor in visualization. Comprising the steps that vegetation configuration information is obtained in a game scene to be rendered, and the vegetation configuration information is used for representing a model parameter, a vegetation distribution parameter and a scene combination parameter of at least one vegetation object; determining scattering point distribution information of the vegetation configuration information in a target layer based on a scene object in a previous layer, and determining a scattering point position of the vegetation object based on the scattering point distribution information; and performing vegetation object point scattering at the point scattering position through a spline curve, and rendering the game scene after point scattering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of game development, and in particular to a method and device for rendering a game scene. Background Art

[0002] Creating vegetation scenes in games can simulate the ecological effects in real environments. Among them, vegetation ecology is the most utilized game scene in game development, and is usually developed directly using tools that can quickly generate various vegetation effects in game scenes.

[0003] At present, the existing method of generating vegetation in game scenes usually scatters vegetation points based on terrain maps, and then covers the scattering points with vegetation objects to generate effective scenes with vegetation. However, due to the diversity of terrain and materials in game scenes, relying solely on terrain maps cannot meet the needs of flexible and realistic scene presentation, and cannot avoid overlap and interlacing between vegetation and other scene objects, resulting in visual confusion between vegetation and other scene objects in the game scene, greatly affecting the visualization effect of the game scene. Summary of the invention

[0004] In view of this, the present invention provides a method and device for rendering a game scene, the main purpose of which is to solve the problem of poor visualization of existing game scenes.

[0005] According to one aspect of the present invention, a method for rendering a game scene is provided, comprising:

[0006] Acquire vegetation configuration information in a game scene to be rendered, where the vegetation configuration information is used to characterize a model parameter, a vegetation distribution parameter, and a scene combination parameter of at least one vegetation object;

[0007] Determine the scattering point distribution information of the vegetation configuration information in the target layer based on the scene object in the previous layer, and determine the scattering point position of the vegetation object based on the scattering point distribution information;

[0008] The vegetation objects are scattered at the scattering positions using a spline curve, and the game scene after scattering is rendered.

[0009] Furthermore, the determining of the scattering distribution information of the vegetation configuration information in the target layer based on the scene object in the previous layer includes:

[0010] Determine the position information of the scene object in the previous layer, and obtain the basic distribution position corresponding to the vegetation configuration information;

[0011] Under the condition that it is detected that the scene object is configured with a first collision body, the position information is removed from the basic distribution position to obtain the scattered point distribution information of the vegetation configuration information in the target layer.

[0012] Furthermore, the obtaining of the basic distribution position corresponding to the vegetation configuration information includes:

[0013] Determine a distribution index relationship between the vegetation object and the scene object, and determine a basic distribution position of the vegetation object based on the distribution index relationship and the vegetation configuration information.

[0014] Furthermore, before determining the scattering point positions of the vegetation objects based on the scattering point distribution information, the method further includes:

[0015] Under the condition that a second collision body is detected to be configured in the target layer, a collision area is determined based on the second collision body and the scattering distribution information, and the collision area is eliminated from the scattering distribution information, so as to determine the scattering position based on the scattering distribution information after eliminating the collision area, and the second collision body is a collision body of a non-vegetation object selected in the target layer.

[0016] Further, the scattering of the vegetation objects at the scattering positions by using a spline curve includes:

[0017] Determine the emission point of the spline curve at the scattering point position, and determine the distribution range of the spline curve at the emission point according to the vegetation distribution parameters, wherein the vegetation distribution parameters include at least one of a distance field intensity parameter, a vegetation density parameter, a scaling size, an offset distance, a direction interpolation, and a scattering point weight;

[0018] Under the condition that the spline curves collide with each other based on the distribution range, the vegetation objects to be scattered are eliminated based on the colliding spline curves.

[0019] Furthermore, the method further comprises:

[0020] Under the condition that the vegetation object is the same type of vegetation, obtaining the same type of vegetation coverage parameter, and judging whether the spline curves in the distribution range collide with each other based on the same type of vegetation coverage parameter;

[0021] Under the condition that the vegetation object is heterogeneous vegetation, heterogeneous vegetation coverage parameters and spline curves corresponding to different vegetation objects are obtained, and based on the heterogeneous vegetation coverage parameters, it is determined whether collision occurs between the spline curves corresponding to different vegetation objects in the distribution range.

[0022] Furthermore, the obtaining of vegetation configuration information in the game scene to be rendered includes:

[0023] The vegetation configuration parameter items for configuring the vegetation object are displayed in the vegetation configuration component interface, and at least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object configured by the vegetation configuration parameter items are displayed, wherein the model parameter is used to characterize at least one of the size, material, texture, and form of the vegetation model, and the scene combination parameter is used to characterize the combination relationship between the same plurality of vegetation objects and / or the combination relationship between different vegetation objects;

[0024] At least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object are imported into the vegetation scattering component, so as to render the scene game in the vegetation scattering component based on the scattering distribution information.

[0025] According to another aspect of the present invention, a rendering device for a game scene is provided, comprising:

[0026] An acquisition module, used to acquire vegetation configuration information in a game scene to be rendered, wherein the vegetation configuration information is used to characterize a model parameter, a vegetation distribution parameter, and a scene combination parameter of at least one vegetation object;

[0027] A determination module, used to determine the scattering point distribution information of the vegetation configuration information in the target layer based on the scene objects in the previous layer, and determine the scattering point positions of the vegetation objects based on the scattering point distribution information;

[0028] A rendering module is used to scatter the vegetation objects at the scattering positions through spline curves and render the game scene after scattering.

[0029] Furthermore, the determination module is specifically used to determine the position information of the scene object in the previous layer, and obtain the basic distribution position corresponding to the vegetation configuration information; under the condition that it is detected that the scene object is configured with a first collision body, the position information is removed from the basic distribution position to obtain the scattered distribution information of the vegetation configuration information in the target layer.

[0030] Furthermore, the determination module is specifically used to determine a distribution index relationship between the vegetation object and the scene object, and determine a basic distribution position of the vegetation object based on the distribution index relationship and the vegetation configuration information.

[0031] Furthermore, the device also includes:

[0032] A removal module is used to determine a collision area based on the second collision body and the scattering distribution information when it is detected that a second collision body is configured in the target layer, and to remove the collision area from the scattering distribution information, so as to determine the scattering position based on the scattering distribution information after removing the collision area, wherein the second collision body is a collision body of a non-vegetation object selected in the target layer.

[0033] Furthermore, the rendering module is specifically used to determine the emission point of the spline curve at the scattering position, and determine the distribution range of the spline curve at the emission point according to the vegetation distribution parameters, the vegetation distribution parameters including at least one of a distance field intensity parameter, a vegetation density parameter, a scaling size, an offset distance, a direction interpolation, and a scattering weight; under the condition that a collision occurs between the spline curves based on the distribution range, the vegetation object to be scattered is eliminated based on the colliding spline curves.

[0034] Furthermore, the device also includes:

[0035] A first judgment module is used to obtain the same vegetation coverage parameter under the condition that the vegetation object is the same vegetation, and judge whether the spline curves in the distribution range collide based on the same vegetation coverage parameter;

[0036] The second judgment module is used to obtain heterogeneous vegetation coverage parameters and spline curves corresponding to different vegetation objects under the condition that the vegetation object is heterogeneous vegetation, and to judge whether there is a collision between the spline curves corresponding to different vegetation objects in the distribution range based on the heterogeneous vegetation coverage parameters.

[0037] Furthermore, the acquisition module is specifically used to display vegetation configuration parameter items for configuring the vegetation object in the vegetation configuration component interface, and to configure at least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object through the vegetation configuration parameter items, wherein the model parameter is used to characterize at least one of the size, material, texture, and shape of the vegetation model, and the scene combination parameter is used to characterize the combination relationship between the same multiple vegetation objects and / or the combination relationship between different vegetation objects; the model parameter, vegetation distribution parameter, and scene combination parameter of at least one vegetation object are imported into the vegetation scattering component to render the scene game based on the scattering distribution information in the vegetation scattering component.

[0038] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned method for rendering a game scene.

[0039] According to another aspect of the present invention, there is provided a terminal, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0040] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the rendering method of the above-mentioned game scene.

[0041] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0042] The present invention provides a rendering method and device for a game scene. Compared with the prior art, the embodiment of the present invention obtains vegetation configuration information in a game scene to be rendered, wherein the vegetation configuration information is used to characterize model parameters, vegetation distribution parameters, and scene combination parameters of at least one vegetation object; determines the scattering distribution information of the vegetation configuration information in a target layer based on scene objects in a previous layer, and determines the scattering position of the vegetation object based on the scattering distribution information; scatters the vegetation object at the scattering position through a spline curve, and renders the game scene after scattering, thereby meeting the needs of flexible and realistic scene presentation, avoiding overlapping and interlaced rendering between vegetation and other scene objects, thereby improving the visual presentation effect of vegetation in the game scene and greatly improving the rendering effectiveness of the game scene.

[0043] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0045] Figure 1 A flowchart of a method for rendering a game scene provided by an embodiment of the present invention is shown;

[0046] Figure 2 A schematic diagram of the distribution of vegetation object scattering points provided by an embodiment of the present invention is shown;

[0047] Figure 3 A schematic diagram of burying vegetation in the ground provided by an embodiment of the present invention is shown;

[0048] Figure 4 A schematic diagram of vegetation orientation inclination provided by an embodiment of the present invention is shown;

[0049] Figure 5 A schematic diagram based on scattering points around a scene object provided by an embodiment of the present invention is shown;

[0050] Figure 6 A schematic diagram of point cloud scattering distribution provided by an embodiment of the present invention is shown;

[0051] Figure 7 A schematic diagram of rendering a game scene provided by an embodiment of the present invention is shown;

[0052] Figure 8 A schematic diagram of a point distribution based on an index provided by an embodiment of the present invention is shown;

[0053] Fig. 9 A schematic diagram showing a collision body configuration provided by an embodiment of the present invention is shown;

[0054] Fig.10 A schematic diagram of determining collision by spline curve emission provided by an embodiment of the present invention is shown;

[0055] Fig.11 A block diagram showing a composition of a rendering device for a game scene provided by an embodiment of the present invention is shown;

[0056] Fig.12 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0057] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0058] The embodiment of the present invention provides a rendering method for a game scene, which can meet the requirements of flexible and realistic scene presentation, avoid overlapping and interlaced rendering between vegetation and other scene objects, thereby improving the visual presentation effect of vegetation in the game scene and greatly improving the rendering effectiveness of the game scene. Figure 1 As shown, the method includes:

[0059] 101. Obtain vegetation configuration information in the game scene to be rendered.

[0060] In an embodiment of the present invention, the current execution end may be a cloud server or terminal server that executes game development in game development, and the game scene is a virtual scene in the development of a large-scale online game, including but not limited to a natural environment virtual scene, a technological environment virtual scene, a cosmic environment virtual scene, etc., which is not specifically limited in the embodiment of the present invention. Among them, the vegetation in the game scene simulates the vegetation in the real scene, and the vegetation configuration information needs to be obtained in the game scene to be rendered. The vegetation configuration information is used to characterize the model parameters, vegetation distribution parameters, and scene combination parameters of at least one vegetation object. Specifically, the model parameters are used to characterize at least one of the size, material, texture, and morphology of the vegetation model, and the scene combination parameters are used to characterize the combination relationship between the same multiple vegetation objects and / or the combination relationship between different vegetation objects. The vegetation distribution parameters include at least one of the distance field intensity parameters, vegetation density parameters, scaling size, offset distance, orientation interpolation, and point scattering weight. The vegetation model is a model for making 3D animations of vegetation. When making the vegetation model, the developer will set the size, material, texture, and shape of the vegetation model. The distance field strength parameter is used to characterize the gradient range when scattering vegetation in the scene. For example, the gradient parts of different vegetation that can be scattered in the same level, the larger the distance field strength parameter, the smaller the gradient range. Figure 2 As shown in the figure, the vegetation density parameter is used to characterize the number of vegetation points in a unit area, for example, 4-5 trees are randomly generated in a unit area, the scaling size is used to characterize the size of the vegetation points being reduced or enlarged, and the offset distance is used to characterize the vertical and horizontal offset distance between the vegetation and the ground. For example, when the vertical offset distance is greater than 0, the vegetation is above the ground, and when it is less than 0, the vegetation is buried in the ground. Figure 3 The scattering weight is used to characterize the probability of appearing in the mesh. The larger the weight value, the greater the probability of appearing. The embodiment of the present invention does not make specific limitations. The orientation interpolation is used to characterize the tilt orientation of the vegetation object. It can be a floating point parameter in the range of 0-1. 0 represents that the orientation of the plant is taken from the normal direction of the terrain where the plant is located or the surface of other objects. 1 represents that it is completely vertical and upward, not affected by the outside world. Figure 4 As shown, the embodiments of the present invention are not specifically limited.

[0061] It should be noted that the configuration of various parameters in the vegetation configuration information in the current execution end can be based on the BP_Configer component to configure various parameters of the vegetation to be scattered. In addition, since the vegetation in the embodiment of the present invention is scattered separately according to each layer, that is, after retaining the content of the previous layer on the basis of the previous layer, the current layer is scattered without affecting the scene of the previous layer, therefore, for the scattering of vegetation in each layer, the layers in each level can be configured separately in turn, so as to be more in line with the vegetation growth law in the natural environment. In addition, the scene combination parameters are set in the BP_Configer component, that is, whether the plant combination uses capsule collision to avoid self-overlapping, and whether Layer culling or Mesh name is used to control which terrains or objects the plant combination is generated on, which are not specifically limited in the embodiment of the present invention.

[0062] 102. Determine the scattering distribution information of the vegetation configuration information in the target layer based on the scene object in the previous layer, and determine the scattering position of the vegetation object based on the scattering distribution information.

[0063] In the embodiment of the present invention, the current execution end is expected to first obtain the scene objects in the previous layer of the target layer (such as the current layer) before scattering vegetation in the target layer, so as to determine the scattering distribution information of the vegetation to be scattered based on the scene objects and the vegetation configuration information. The scene objects can be buildings, environmental objects, etc. that have been generated in the previous layer in the game scene, including but not limited to houses, stones, streams, etc., which are not specifically limited in the embodiment of the present invention. For example, Figure 5 As shown, the scene object in the previous layer is a stone, and the vegetation configuration information in the target layer of the current layer can be determined around the stone, so that the scattered vegetation will not grow on the stone. The embodiment of the present invention does not make specific limitations. In addition, the scattering distribution information is used to characterize the distribution of the points to be scattered, including the spacing and position of the point cloud to be scattered, that is, based on the vegetation configuration information, the determination is made under the premise of meeting the distribution of the scene objects, so as to determine the scattering position of the vegetation object based on this scattering distribution information. The embodiment of the present invention does not make specific limitations. Among them, the vegetation object is a virtual 3D model of vegetation to be rendered by scattering, and the vegetation includes but is not limited to grass, trees and other plant communities that can cover the ground surface. The embodiment of the present invention does not make specific limitations.

[0064] 103. Scatter the vegetation objects at the scattering positions using a spline curve, and render the game scene after scattering.

[0065] In the embodiment of the present invention, in order to realistically render the game scene, the current execution end scatters the point cloud at the scattering position through the spline curve, such as Figure 6As shown, the vegetation object is inserted into the point cloud of the current layer, thereby rendering a game scene with vegetation objects, such as Figure 7 As shown. Among them, scattering points through spline curves is to use the point cloud as the starting point of the spline curve, and draw a curve around it. The area where the curve is located is the mesh area where the scattered points are inserted into the vegetation object. At this time, the size of the spline curve can be configured based on the size of the vegetation object, or it can be configured randomly, and the number of meshes in the layer should not be too many to avoid jamming. The embodiment of the present invention does not make specific limitations. In addition, if the scene combination parameters in the vegetation configuration information are configured with a combination of two vegetations, then one point cloud of the scattered points will correspond to one vegetation combination, and this vegetation combination is projected onto the terrain.

[0066] It should be noted that when scattering vegetation objects at the scattering positions through spline curves, the scattering point cloud and scattering range can be configured through the BP_Scatter component, and it can also be set whether different spline curves need to be eliminated to avoid overlap and interlacing between vegetation of different levels or types, thereby avoiding overlapping effects between vegetation. In addition, after calling the BP_Scatter component, the current execution end can load the vegetation configuration information from the BP_Configer component, configure the specific range and number of scattering points, and scatter points according to the overlap, interlacing and other parameters between vegetation in the same layer or in different layers configured by the developer, which is not specifically limited in the embodiments of the present invention.

[0067] In another embodiment of the present invention, for further definition and explanation, the step of determining the scattering distribution information of the vegetation configuration information in the target layer based on the scene object in the previous layer includes:

[0068] Determine the position information of the scene object in the previous layer, and obtain the basic distribution position corresponding to the vegetation configuration information;

[0069] Under the condition that it is detected that the scene object is configured with a first collision body, the position information is removed from the basic distribution position to obtain the scattered point distribution information of the vegetation configuration information in the target layer.

[0070] In order to achieve layered vegetation scattering, improve the realism of vegetation rendering in the game scene, and avoid overlap between vegetation, the current execution end determines the scattering distribution information based on the scene objects in the previous layer. Specifically, it first determines the position information of the scene objects in the previous layer. At this time, it can be determined by the world coordinates of the scene objects in the previous layer rendered in the game engine. The embodiment of the present invention does not make specific limitations. At the same time, a basic distribution position is determined based on the model parameters, vegetation distribution parameters, and scene combination parameters of the vegetation object in the vegetation configuration information. At this time, the basic distribution position is all the distribution position points that can be scattered, for example, all unit coordinates in the world coordinates that match the configuration requirements of the vegetation distribution, such as Figure 6 As shown, the embodiments of the present invention are not specifically limited. Furthermore, the current execution end can pre-configure the first collision body for the scene object through the BP_Scatter component, so that when determining the scatter distribution information, when it is detected that the scene object is configured with the first collision body, the position information corresponding to the scene object is removed from the basic distribution position to obtain the scatter distribution information of the vegetation configuration information in the target layer. Among them, the shape and size of the first collision body can be determined based on the shape configuration of the scene object, so that the position information of the scene object is removed from the basic distribution position to obtain the final scatter distribution information.

[0071] In another embodiment of the present invention, for further definition and explanation, the step of obtaining the basic distribution position corresponding to the vegetation configuration information includes:

[0072] Determine a distribution index relationship between the vegetation object and the scene object, and determine a basic distribution position of the vegetation object based on the distribution index relationship and the vegetation configuration information.

[0073] In order to accurately match the scene objects of the previous layer in the target layer for point scattering insertion, the current execution end first determines the distribution index relationship between the vegetation object and the scene object when obtaining the basic distribution position. The distribution index relationship is used to characterize whether there is an association relationship between the scene objects in the previous layer and the vegetation to be scattered in the current layer in terms of the point scattering range. For example, the scene objects in the previous layer are trees, and the distribution index relationship records the association relationship between large trees and shrubs. The tree index is 0-, and the shrub index is 1. At the same time, the point scattering range can be adjusted by configuring the index parameters, such as making a circle through the center of the tree, and scattering the shrubs on the circumference. At this time, the basic distribution position of the vegetation object is determined based on the distribution index relationship and the vegetation configuration information, and the embodiment of the present invention does not make specific limitations. In addition, the configuration of the distribution index relationship in the embodiment of the present invention may include at least two layers. For example, when the distribution index relationship is three layers, the combination is performed in the manner of large (trees, index 0) - medium (shrubs, index 1) - small (grass, index 2), that is, the trees are sequentially used as the scene objects in the first layer, and after the shrubs are scattered, the shrubs are used as the scene objects in the second layer and the grass is scattered, such as Figure 8 As shown, the embodiments of the present invention are not specifically limited.

[0074] In another embodiment of the present invention, for further definition and explanation, before the step of determining the scattering point position of the vegetation object based on the scattering point distribution information, the method further includes:

[0075] Under the condition that a second collision body is detected in the target layer, a collision area is determined based on the second collision body and the scattering distribution information, and the collision area is eliminated from the scattering distribution information to determine the scattering position based on the scattering distribution information without the collision area.

[0076] In order to meet the flexible scattering requirements of vegetation and improve the rendering effect of vegetation in the game scene, the current execution end can also pre-configure a second collision body for the target layer to isolate the area where the vegetation needs to be scattered. The second collision body is a collision body of a non-vegetation object selected from the target layer. The second collision body is configured for the target layer. The shape, size, etc. of the collision body can be configured in the BP_Scatter component according to different vegetation scattering requirements, and the embodiments of the present invention do not make specific limitations. For example, Fig. 9As shown, in the current execution end, you can select the BlockingVolume blocking volume in the panel of the BP_Scatter component, and then change its collision preset to BlockAll. At this time, the configured vegetation will not be generated in it, that is, the collision area is determined based on the second collision body and the scattering point distribution information, and the collision area is eliminated in the scattering point distribution information. In addition, you can also adjust the radius of the collision body to adjust the range of scattering points that are eliminated by collision with the collision body. The larger the collision radius, the larger the range of scattering points.

[0077] It should be noted that in the current execution end, the layer culling instruction can be enabled in the BP_Scatter component to execute the current identified collision body to eliminate the scattered point distribution in the collision area.

[0078] In another embodiment of the present invention, for further definition and explanation, the step of scattering the vegetation object at the scattering position by means of a spline curve comprises:

[0079] Determine the scattering point position as the emission point of the spline curve, and determine the distribution range of the spline curve at the emission point according to the vegetation distribution parameter;

[0080] Under the condition that the spline curves collide with each other based on the distribution range, the vegetation objects to be scattered are eliminated based on the colliding spline curves.

[0081] In order to meet the vegetation generation requirements of different game scenes and improve the realistic effect of vegetation generation, when the current execution end scatters vegetation objects based on spline curves, specifically, firstly, the determined scattering point position is used as the emission point of the spline curve, so as to determine the distribution range of the spline curve at the emission point according to at least one of the distance field intensity parameter, vegetation density parameter, scaling size, offset distance, orientation interpolation, and scattering weight in the vegetation distribution parameters, for example, the curve extension length of the spline curve is increased according to the vegetation density parameter, and the embodiment of the present invention does not make specific restrictions. Further, the current execution end detects whether a collision occurs between multiple spline curves emitted at multiple emission points based on the distribution range. At this time, if a collision occurs, it means that there is a collision between the vegetations to be scattered. Therefore, the vegetation objects to be scattered are eliminated based on the collided spline curves. Among them, the vegetation to be scattered corresponding to the spline curves for judging whether there is a collision can be the same vegetation or different vegetation on the same layer, or the same vegetation or different vegetation on different layers. It can be configured based on different vegetation coverage requirements to flexibly adjust the vegetation coverage effect of the scattering point. For example, the grass spline curve in the same layer can be selected to determine whether it collides with the stone spline curve, or it can be selected to determine whether it collides with the grass spline curve. Fig.10As shown, when grass and stone overlap or grass and grass overlap, the overlapping part is removed and scattered points are generated in the game scene. In addition, the current execution end can also configure a spline curve in the BP_Scatter component to determine whether it collides with the first collision body and the second collision body to remove the scattered point position when sending the collision.

[0082] In another embodiment of the present invention, for further definition and description, the steps further include:

[0083] Under the condition that the vegetation object is the same type of vegetation, obtaining the same type of vegetation coverage parameter, and judging whether the spline curves in the distribution range collide with each other based on the same type of vegetation coverage parameter;

[0084] Under the condition that the vegetation object is heterogeneous vegetation, heterogeneous vegetation coverage parameters and spline curves corresponding to different vegetation objects are obtained, and based on the heterogeneous vegetation coverage parameters, it is determined whether collision occurs between the spline curves corresponding to different vegetation objects in the distribution range.

[0085] In order to avoid overlap or coverage between different vegetation, in a specific implementation scenario, when the vegetation object is the same vegetation, the same vegetation coverage parameter is first obtained. At this time, the same vegetation coverage parameter is used to characterize the degree to which the same vegetation objects can cover each other, so as to serve as a basis for judging whether a collision occurs, and then the same vegetation coverage parameter is used to judge whether the spline curves collide in the distribution range. For example, if the same vegetation coverage parameter is 0, it means that two same vegetation cannot cover each other. For example, as long as the spline curves between two grasses intersect, it is determined that a collision occurs.

[0086] In order to avoid overlapping or covering points between different vegetation, in a specific implementation scenario, when the vegetation object is heterogeneous vegetation, first, the heterogeneous vegetation coverage parameter is obtained. At this time, the heterogeneous vegetation coverage parameter is used to characterize the degree of mutual coverage between different vegetation objects, so as to serve as a basis for judging whether a collision occurs, thereby judging whether a collision occurs between the spline curves corresponding to different vegetation objects in the distribution range based on the heterogeneous vegetation coverage parameter. For example, if the heterogeneous vegetation coverage parameter is 0, it means that the two heterogeneous vegetation cannot cover each other. For example, if the spline curves corresponding to grass and shrubs intersect, it is determined that a collision occurs.

[0087] In another embodiment of the present invention, for further definition and explanation, the step of obtaining vegetation configuration information in the game scene to be rendered includes:

[0088] Displaying vegetation configuration parameter items for configuring the vegetation object in the vegetation configuration component interface, and configuring at least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object through the vegetation configuration parameter items;

[0089] At least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object are imported into the vegetation scattering component, so as to render the scene game in the vegetation scattering component based on the scattering distribution information.

[0090] In order to meet the flexible configuration requirements of vegetation objects and thus achieve realistic game scene rendering, the current execution end specifically configures through the vegetation configuration component BP_Configer when acquiring vegetation configuration information. At this time, the vegetation configuration parameter items for the vegetation objects to be configured are first displayed in the interface of the vegetation configuration component, so that developers can select and configure based on the vegetation configuration parameter items. The current execution end configures at least one of the model parameters, vegetation distribution parameters, and scene combination parameters of the vegetation object through the vegetation configuration parameter items, and imports the model parameters, vegetation distribution parameters, and scene combination parameters of at least one vegetation object into the vegetation scattering component BP_Scatter, so as to render the scene game based on the scattering distribution information in the vegetation scattering component.

[0091] In a specific implementation scenario, since the vegetation distribution parameters include the distance field strength parameters, the distance field strength parameters are used to characterize the gradient range when scattering vegetation in the scene. The gradient range can be configured as a floating point value of 0-1. The point value in the middle is 1, and the closer to the outside, the smaller the value. When the value is between 0-0.5, some points will be randomly deleted. Visually, the points in the outer circle will be sparse and the points in the middle will be dense. The remaining points are then used as scattering positions. Vegetation combinations can be configured in BP_Configner. A point combination generates a combination containing multiple vegetations, which are then inserted onto the ground according to projections such as collision culling. In addition, the size of each combination can be multiplied by a gradient value. The resulting effect is that the vegetation combinations extending outward from the scene object as the center are relatively small overall and sparsely distributed, while the vegetation combinations in the inner circle are relatively large and densely distributed. For example, Figure 2 As shown, the embodiments of the present invention are not specifically limited.

[0092] In a specific implementation scenario, the vegetation distribution parameters include a scattering weight, which is used to characterize the probability of appearing in a mesh. When the current execution end emits a curve based on a spline curve emission point, one emission point is in a mesh. If this scattering weight is not set, no vegetation will be generated under the curve. For example, due to the obstruction of rocks, the current spline curve cannot hit the terrain layer, so the mesh of the terrain layer cannot recognize the scattering weight, and therefore, vegetation cannot be generated on the rock. When the curve hits the rock mesh and the scattering weight is configured, vegetation can be generated on the rock.

[0093] In another specific implementation scenario, the current execution end can configure vegetation configuration information through the BP_Configer component, and can also configure other related parameters of the vegetation, including but not limited to adjusting random values ​​(i.e., configuring the probability value of random scattering), freezing transformation (freezing and locking the combined vegetation object so that it will not change due to random scattering), ignoring object configuration (the selected target object must not generate a vegetation combination), whether to scatter on a specified layer (the vegetation combination can be scattered on certain layers in a specified game scene, such as a swamp layer that only scatters some low shrub combinations), Layer weight culling value (such as a terrain weight map, with a value range of 0-1, and no vegetation will be generated on terrain less than a certain threshold), vegetation size transition range (affected by the two parameters of distance field strength and density adjustment, the black and gray parts will be scaled according to the parameters. Usually set at around 0.5 to 0.8), etc., which are not specifically limited in the embodiments of the present invention.

[0094] It should be noted that, in the embodiment of the present invention, the current execution end can also be configured through the BP_Configer component to delete parameters in any vegetation configuration information of the aforementioned configuration, including but not limited to destroying all Actors (clearing objects generated by scattering points), adding instances to the foliage (converting the generated actors to the foliage of the plot), removing instances from the foliage (clearing the foliage converted from the Spline), etc., which are not specifically limited in the embodiment of the present invention.

[0095] An embodiment of the present invention provides a rendering method for a game scene. Compared with the prior art, the embodiment of the present invention obtains vegetation configuration information in a game scene to be rendered, wherein the vegetation configuration information is used to characterize model parameters, vegetation distribution parameters, and scene combination parameters of at least one vegetation object; determines the scattering distribution information of the vegetation configuration information in a target layer based on scene objects in a previous layer, and determines the scattering position of the vegetation object based on the scattering distribution information; scatters the vegetation object at the scattering position through a spline curve, and renders the game scene after scattering, thereby meeting the needs of flexible and realistic scene presentation, avoiding overlapping and interlaced rendering between vegetation and other scene objects, thereby improving the visual presentation effect of vegetation in the game scene and greatly improving the rendering effectiveness of the game scene.

[0096] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a rendering device for a game scene, such as Fig.11 As shown, the device comprises:

[0097] An acquisition module 21, used to acquire vegetation configuration information in a game scene to be rendered, wherein the vegetation configuration information is used to characterize a model parameter, a vegetation distribution parameter, and a scene combination parameter of at least one vegetation object;

[0098] A determination module 22, configured to determine the scattering point distribution information of the vegetation configuration information in the target layer based on the scene objects in the previous layer, and determine the scattering point positions of the vegetation objects based on the scattering point distribution information;

[0099] The rendering module 23 is used to scatter the vegetation objects at the scattering positions through spline curves and render the game scene after scattering.

[0100] Furthermore, the determination module is specifically used to determine the position information of the scene object in the previous layer, and obtain the basic distribution position corresponding to the vegetation configuration information; under the condition that it is detected that the scene object is configured with a first collision body, the position information is removed from the basic distribution position to obtain the scattered distribution information of the vegetation configuration information in the target layer.

[0101] Furthermore, the determination module is specifically used to determine a distribution index relationship between the vegetation object and the scene object, and determine a basic distribution position of the vegetation object based on the distribution index relationship and the vegetation configuration information.

[0102] Furthermore, the device also includes:

[0103] A removal module is used to determine a collision area based on the second collision body and the scattering distribution information when it is detected that a second collision body is configured in the target layer, and to remove the collision area from the scattering distribution information, so as to determine the scattering position based on the scattering distribution information after removing the collision area, wherein the second collision body is a collision body of a non-vegetation object selected in the target layer.

[0104] Furthermore, the rendering module is specifically used to determine the emission point of the spline curve at the scattering position, and determine the distribution range of the spline curve at the emission point according to the vegetation distribution parameters, the vegetation distribution parameters including at least one of a distance field intensity parameter, a vegetation density parameter, a scaling size, an offset distance, a direction interpolation, and a scattering weight; under the condition that a collision occurs between the spline curves based on the distribution range, the vegetation object to be scattered is eliminated based on the colliding spline curves.

[0105] Furthermore, the device also includes:

[0106] A first judgment module is used to obtain the same vegetation coverage parameter under the condition that the vegetation object is the same vegetation, and judge whether the spline curves in the distribution range collide based on the same vegetation coverage parameter;

[0107] The second judgment module is used to obtain heterogeneous vegetation coverage parameters and spline curves corresponding to different vegetation objects under the condition that the vegetation object is heterogeneous vegetation, and to judge whether there is a collision between the spline curves corresponding to different vegetation objects in the distribution range based on the heterogeneous vegetation coverage parameters.

[0108] Furthermore, the acquisition module is specifically used to display vegetation configuration parameter items for configuring the vegetation object in the vegetation configuration component interface, and to configure at least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object through the vegetation configuration parameter items, wherein the model parameter is used to characterize at least one of the size, material, texture, and shape of the vegetation model, and the scene combination parameter is used to characterize the combination relationship between the same multiple vegetation objects and / or the combination relationship between different vegetation objects; the model parameter, vegetation distribution parameter, and scene combination parameter of at least one vegetation object are imported into the vegetation scattering component to render the scene game based on the scattering distribution information in the vegetation scattering component.

[0109] An embodiment of the present invention provides a rendering device for a game scene. Compared with the prior art, the embodiment of the present invention obtains vegetation configuration information in a game scene to be rendered, wherein the vegetation configuration information is used to characterize model parameters, vegetation distribution parameters, and scene combination parameters of at least one vegetation object; determines the scattering distribution information of the vegetation configuration information in a target layer based on scene objects in a previous layer, and determines the scattering position of the vegetation object based on the scattering distribution information; scatters the vegetation object at the scattering position through a spline curve, and renders the game scene after scattering, thereby meeting the needs of flexible and realistic scene presentation, avoiding overlapping and interlaced rendering between vegetation and other scene objects, thereby improving the visual presentation effect of vegetation in the game scene and greatly improving the rendering effectiveness of the game scene.

[0110] According to an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the game scene rendering method in any of the above method embodiments.

[0111] Fig.12 A schematic diagram of the structure of a terminal provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.

[0112] like Fig.12 As shown, the terminal may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .

[0113] The processor 302 , the communication interface 304 , and the memory 306 communicate with each other via the communication bus 308 .

[0114] The communication interface 304 is used to communicate with other devices such as clients or other servers.

[0115] The processor 302 is used to execute the program 310, and specifically can execute the relevant steps in the above-mentioned game scene rendering method embodiment.

[0116] Specifically, the program 310 may include program codes, which include computer operation instructions.

[0117] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0118] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0119] The program 310 may be specifically configured to enable the processor 302 to perform the following operations:

[0120] Acquire vegetation configuration information in a game scene to be rendered, where the vegetation configuration information is used to characterize a model parameter, a vegetation distribution parameter, and a scene combination parameter of at least one vegetation object;

[0121] Determine the scattering point distribution information of the vegetation configuration information in the target layer based on the scene object in the previous layer, and determine the scattering point position of the vegetation object based on the scattering point distribution information;

[0122] The vegetation objects are scattered at the scattering positions using a spline curve, and the game scene after scattering is rendered.

[0123] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for rendering a game scene, characterized in that: include: Acquire vegetation configuration information in a game scene to be rendered, where the vegetation configuration information is used to characterize a model parameter, a vegetation distribution parameter, and a scene combination parameter of at least one vegetation object; Determine the scattering point distribution information of the vegetation configuration information in the target layer based on the scene object in the previous layer, and determine the scattering point position of the vegetation object based on the scattering point distribution information; The vegetation objects are scattered at the scattering positions using a spline curve, and the game scene after scattering is rendered.

2. The method according to claim 1, characterized in that The step of determining the scattering distribution information of the vegetation configuration information in the target layer based on the scene objects in the previous layer includes: Determine the position information of the scene object in the previous layer, and obtain the basic distribution position corresponding to the vegetation configuration information; Under the condition that it is detected that the scene object is configured with a first collision body, the position information is removed from the basic distribution position to obtain the scattered point distribution information of the vegetation configuration information in the target layer.

3. The method according to claim 2, characterized in that The obtaining of the basic distribution position corresponding to the vegetation configuration information includes: Determine a distribution index relationship between the vegetation object and the scene object, and determine a basic distribution position of the vegetation object based on the distribution index relationship and the vegetation configuration information.

4. The method according to claim 2, characterized in that: Before determining the scattering point positions of the vegetation object based on the scattering point distribution information, the method further includes: Under the condition that a second collision body is detected to be configured in the target layer, a collision area is determined based on the second collision body and the scattering distribution information, and the collision area is eliminated from the scattering distribution information, so as to determine the scattering position based on the scattering distribution information after eliminating the collision area, and the second collision body is a collision body of a non-vegetation object selected in the target layer.

5. The method according to claim 1, characterized in that The step of scattering the vegetation objects at the scattering positions by using a spline curve comprises: Determine the emission point of the spline curve at the scattering point position, and determine the distribution range of the spline curve at the emission point according to the vegetation distribution parameters, wherein the vegetation distribution parameters include at least one of a distance field intensity parameter, a vegetation density parameter, a scaling size, an offset distance, a direction interpolation, and a scattering point weight; Under the condition that the spline curves collide with each other based on the distribution range, the vegetation objects to be scattered are eliminated based on the colliding spline curves.

6. The method according to claim 5, characterized in that The method further comprises: Under the condition that the vegetation object is the same type of vegetation, obtaining the same type of vegetation coverage parameter, and judging whether the spline curves in the distribution range collide with each other based on the same type of vegetation coverage parameter; Under the condition that the vegetation object is heterogeneous vegetation, heterogeneous vegetation coverage parameters and spline curves corresponding to different vegetation objects are obtained, and based on the heterogeneous vegetation coverage parameters, it is determined whether collision occurs between the spline curves corresponding to different vegetation objects in the distribution range.

7. The method according to any one of claims 1 to 6, characterized in that: The step of obtaining vegetation configuration information in the game scene to be rendered includes: The vegetation configuration parameter items for configuring the vegetation object are displayed in the vegetation configuration component interface, and at least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object configured by the vegetation configuration parameter items are displayed, wherein the model parameter is used to characterize at least one of the size, material, texture, and form of the vegetation model, and the scene combination parameter is used to characterize the combination relationship between the same plurality of vegetation objects and / or the combination relationship between different vegetation objects; At least one model parameter, vegetation distribution parameter, and scene combination parameter of the vegetation object are imported into the vegetation scattering component, so as to render the scene game in the vegetation scattering component based on the scattering distribution information.

8. A rendering device for a game scene, characterized in that: include: An acquisition module, used to acquire vegetation configuration information in a game scene to be rendered, wherein the vegetation configuration information is used to characterize a model parameter, a vegetation distribution parameter, and a scene combination parameter of at least one vegetation object; A determination module, used to determine the scattering point distribution information of the vegetation configuration information in the target layer based on the scene objects in the previous layer, and determine the scattering point positions of the vegetation objects based on the scattering point distribution information; A rendering module is used to scatter the vegetation objects at the scattering positions through spline curves and render the game scene after scattering.

9. A storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the method for rendering a game scene as described in any one of claims 1-7.

10. A terminal, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the rendering method of the game scene as described in any one of claims 1-7.