Scene map generation method, device, storage medium and computer equipment

By converting the height field data of the game terrain scene into polygonal mesh data and processing it according to the target accuracy, the problem of irreconciliation of scene map generation accuracy and low data utilization in the prior art is solved, and the accuracy adjustment and efficient data utilization are achieved scene map generation.

CN115006842BActive Publication Date: 2025-02-18NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210667485.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2025-02-18
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

In the prior art, it is difficult to achieve the problem of adjustable accuracy and high data utilization when generating game scene maps, especially when high refresh frequency and large-scale scene map generation.

Method used

By obtaining the height field data of the game terrain scene, converting it into polygon mesh data, and determining the mesh point color based on the mask data, and then performing precision processing based on the target accuracy, finally generating a scene map with adjustable accuracy.

Benefits of technology

The accuracy of the scene map is adjustable and controllable, improving the data utilization rate of terrain scenes and the integrity and accuracy of the scene map.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115006842B_ABST
    Figure CN115006842B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a scene map generation method, device, storage medium and computer equipment. The method includes: obtaining the height field data of the terrain scene of the game, and converting the height field data into polygonal mesh data. During the conversion process, the height data corresponding to the terrain scene in the height field data and the mask data of the terrain layer in the terrain scene are all inherited and transferred to the grid points in the polygonal mesh data. Based on the polygonal mesh data, the color of the grid points of the polygonal mesh data is determined according to the mask data, and the target accuracy required for the scene map is obtained. According to the target accuracy and color, the polygonal mesh data is precision processed to obtain the target point and the target color of the target point in the scene map, and the target point is rendered according to the target color to obtain the scene map. The embodiment of the present application improves the adjustability and controllability of the scene map, and at the same time improves the data utilization rate in the terrain scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a scene map generation method, device, computer-readable storage medium and computer equipment. Background Art

[0002] In the game, the scene map can guide and instruct the players, such as determining the area where the character is located based on the scene map. An accurate or distinctive scene map can improve the quality of the game and enhance the user experience to a certain extent.

[0003] Currently, the scene map in the game can be obtained in the following ways: the first way is to bind a camera on the top of the game character to obtain a bird's-eye view of the character's area in real time while the game is running; the second way is to capture an orthogonal bird's-eye view of the game terrain scene.

[0004] Among them, in the first method, the area where the character is located in each frame of the game is changing, resulting in a high frequency of capturing and refreshing the top-view screen. Even if the frequency of capturing and refreshing the top-view screen is reduced, there will still be a high consumption, and this method can only obtain the top-view screen of a small part of the area where the character is located, and cannot obtain a scene map containing the entire scene terrain. In the second method, a scene map of the entire scene terrain can be obtained, but because the top-view screen of the game terrain scene is captured from an orthogonal perspective, the effective utilization rate and controllability and adjustability of the data recorded in the obtained scene map are low. Summary of the invention

[0005] The embodiments of the present application provide a scene map generation method, apparatus, computer-readable storage medium, and computer equipment, which can generate a scene map with adjustable precision, improve the adjustability and controllability of the scene map, and improve the data utilization rate in the terrain scene.

[0006] The present application provides a method for generating a scene map, including:

[0007] Acquire height field data of a terrain scene of the game, the terrain scene including at least one terrain layer, the height field data including height data corresponding to the terrain scene and mask data corresponding to the terrain layer;

[0008] Converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data;

[0009] For each grid point in the polygonal grid data, determining the color of the grid point according to the mask data;

[0010] Acquire the target accuracy required by the scene map corresponding to the terrain scene, and perform precision processing on the polygonal mesh data according to the target accuracy and the color, so as to obtain the target point in the scene map and the target color of the target point;

[0011] The target point is rendered according to the target color to obtain the scene map corresponding to the terrain scene.

[0012] The present application also provides a scene map generating device, including:

[0013] An acquisition module, used to acquire height field data of a terrain scene of a game, wherein the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer;

[0014] A conversion module, used for converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data;

[0015] A color determination module, configured to determine, for each mesh point in the polygonal mesh data, a color of the mesh point according to the mask data;

[0016] A precision processing module, used to obtain the target precision required by the scene map corresponding to the terrain scene, and perform precision processing on the polygonal mesh data according to the target precision and the color, so as to obtain the target point in the scene map and the target color of the target point;

[0017] A rendering module is used to render the target point according to the target color to obtain the scene map corresponding to the terrain scene.

[0018] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for loading by a processor to execute the steps in the scene map generation method described in any of the above embodiments.

[0019] An embodiment of the present application also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps in the scene map generation method described in any of the above embodiments by calling the computer program stored in the memory.

[0020] The scene map generation method, device, computer-readable storage medium and computer equipment provided by the embodiments of the present application obtain height field data of the terrain scene of the game and convert the height field data into polygonal mesh data. During the conversion process, the height data corresponding to the terrain scene in the height field data and the mask data of the terrain layer in the terrain scene are all inherited and transmitted to the grid points in the polygonal mesh data. In this way, the polygonal mesh data includes all the information of the terrain scene, and then the scene map is generated based on the polygonal mesh data, so that the target point of the generated scene map includes the information of the corresponding terrain scene, thereby improving the data utilization rate of the terrain scene. Specifically, based on the polygonal mesh data, Data, determine the color of the grid points of the polygonal mesh data according to the mask data, and obtain the target accuracy required for the scene map, perform accuracy processing on the polygonal mesh data according to the target accuracy and color to obtain the target points and the target colors of the target points in the scene map, render the target points according to the target colors to obtain the scene map, wherein the polygonal mesh data is accuracy processed according to the obtained target accuracy, so that the accuracy of the generated scene map is adjustable and controllable, thereby improving the adjustability and controllability of the generated scene map, and at the same time, the scene map is obtained by processing the grid points in the polygonal mesh data, so that there is no missing content in the scene map, thereby improving the integrity and accuracy of the scene map. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A comparative schematic diagram of scene maps generated in the prior art.

[0023] Figure 2 A flowchart of a scene map generation method provided in an embodiment of the present application.

[0024] Figure 3 A schematic diagram of a scene map provided in an embodiment of the present application.

[0025] Figure 4a A schematic diagram of a scene map after color smoothing provided in an embodiment of the present application.

[0026] Figure 4b A schematic diagram of a scene map after lighting and shadow processing provided in an embodiment of the present application.

[0027] Figure 5 A flowchart of a scene map generation method provided in an embodiment of the present application.

[0028] Figure 6a A schematic diagram of the area after filling with color provided in an embodiment of the present application.

[0029] Figure 6b A schematic diagram of a region stroke diagram provided in an embodiment of the present application.

[0030] Figure 7 Another flowchart of the scene map generation method provided in an embodiment of the present application.

[0031] Figure 8 A schematic diagram of a channel diagram and several channels of the channel diagram provided in an embodiment of the present application.

[0032] Fig. 9 Another flowchart of the scene map generation method provided in an embodiment of the present application.

[0033] Fig.10 A schematic diagram of the structure of a scene map generating device provided in an embodiment of the present application.

[0034] Fig.11 Another structural schematic diagram of the scene map generation device provided in an embodiment of the present application.

[0035] Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0037] Before introducing the embodiments of the present application, we first analyze the current method of generating scene maps in games: capturing a bird's-eye view of the game terrain scene from an orthogonal perspective (i.e., the second method in the background technology).

[0038] Because it is an orthogonal top-down view of the game terrain scene, when capturing, due to different settings of scene visual distance cutting, multiple levels of detail of the model in the scene, and different materials assigned to the terrain in the scene, the content presented in the obtained scene map will be quite different, which may cause missing content in the corresponding scene map screen. Figure 1As shown in the figure, from left to right, they are the ideal bird's-eye view that needs to be obtained, the scene model with low multi-level detail settings and missing content, and the scene model with poor compatibility with the orthogonal bird's-eye view and missing content. Because it is a captured bird's-eye view, the effective utilization rate and controllability of the data recorded in the obtained scene map are low. In addition, the efficiency of capturing the bird's-eye view from an orthogonal perspective is low, especially when the number of scene terrains is large and the iteration frequency is high, it is very time-consuming and laborious.

[0039] Therefore, the embodiments of the present application provide a scene map generation method, device, computer-readable storage medium and computer equipment to solve the above technical problems. It should be noted that the scene map in the present application refers to a small map in the game scene, which can be used to guide and instruct players, such as indicating the current area of ​​the virtual object operated by the player, indicating the location of the teammate virtual object and / or the enemy and friend virtual object, etc.

[0040] Specifically, the scene map generation method of the embodiment of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other devices. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, and cloud storage.

[0041] For example, when the scene map generation method is applied to a terminal, a scene map is generated on the terminal, for example, height field data is obtained from a server, and the scene map is generated on the terminal using the height field data. The terminal is used to interact with a user through a graphical user interface, for example, a user can input / set information such as target accuracy and / or initial color of a terrain layer required for a scene map through a graphical user interface, and display the generated scene map through a graphical user interface.

[0042] For example, when the scene map generation method is applied to a server, a scene map is generated in the server, and the server interacts with the client, for example, the target accuracy and / or the initial color of the terrain layer required for the scene map are input / set through the graphical user interface of the client, and the target accuracy and / or the initial color of the terrain layer required for the scene map are uploaded to the server, so that the server executes the scene map generation method in the embodiment of the present application to generate a scene map, and the generated scene map can be displayed on the client. Alternatively, the target accuracy and / or the initial color of the terrain layer required for the scene map can be directly input / set in the server to generate the scene map.

[0043] The following will respectively describe in detail a scene map generation method, device, computer-readable storage medium and computer equipment provided in the embodiments of the present application. It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0044] Figure 2 It is a flow chart of a scene map generation method provided in an embodiment of the present application. The scene map generation method is applied in a computer device and includes the following steps.

[0045] 101. Obtain height field data of a terrain scene of a game, where the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer.

[0046] Among them, the terrain scene of the game can be a scene of three dimensions or above, and the terrain scene includes at least one terrain layer. Generally, the terrain scene includes multiple terrain layers. The terrain layer may include terrains such as rocks, rivers, roads, land, oceans / lakes, etc., wherein rocks, rivers, roads, land, oceans / lakes, etc. correspond to a terrain layer respectively, such as rocks corresponding to rock terrain layers or rock layers, rivers corresponding to river terrain layers or river layers, etc. The terrain layer also includes terrain layers obtained after calculation. It should be noted that, depending on the actual scene, the terrain scene may also include other different terrains, which are not listed here one by one.

[0047] The height field data may be HeightField data, and the data form of the terrain in the height field data is voxel (volume), which can be understood as a pixel in three-dimensional space. The height field data includes a height layer and various mask layers (mask), wherein the height layer stores the height data, which records the height information of each location on the terrain scene, and the various mask layers include the mask layer corresponding to the terrain layer, and / or various terrain layers obtained after calculation (essentially also belonging to the mask layer), such as the flow layer (flow formation or flow layer), debris layer (rock debris terrain layer or rock debris layer), slope layer (slope terrain layer or slope layer) obtained after erosion calculation. Among them, the mask layer includes the corresponding mask data in the terrain layer.

[0048] The mask data specifically corresponds to the mask weight, which indicates the weight / proportion of each place in the terrain scene belonging to a certain terrain layer. For example, if a certain point in the terrain scene is the highest point in the entire terrain, and there is snow there as required, the point belongs to the snow layer and is completely wrapped by the snow layer, so the mask data corresponding to it on the snow layer is 1, and if a certain point at the foot of the mountain is located at the junction of the slope and the flat land, then the mask data corresponding to it on the slope terrain layer is 0.5. The mask data corresponding to different terrain layers records the weight / proportion of each point in the terrain scene on the terrain layer. The mask data is the basis for the visualization of the terrain layer, and the value of the mask data of the terrain layer is any value in [0,1].

[0049] In one case, the height field data can be the data output by the terrain making tool when making the terrain scene. The terrain making tool can be the Houdini tool, or other tools that can achieve similar functions. Correspondingly, the scene map generation method in the embodiment of the present application can be closely combined with the terrain making tool to output the required scene map. The height field data can also be obtained by other means.

[0050] 102 , converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data.

[0051] The data format of height field data is voxel, while the data format of polygon mesh data is point, line, surface, etc. Since the data formats are different and the subsequent processing is mainly based on points, it is necessary to convert the height field data into polygon mesh data. The points in the converted polygon mesh data are called grid points. The converted polygon mesh data also includes line information and surface information, etc. Among them, the line information includes the grid points included in the line, and the surface information includes the grid points and / or line information included in the surface.

[0052] In one embodiment, the step of converting the height field data into polygonal mesh data includes: converting voxels in the height field data into mesh points in the polygonal mesh data, converting the relationship between voxels in the height field data into line information and / or surface information in the polygonal mesh data, converting the height data into height data of the mesh points, and converting the terrain layer in the height field data and the mask data of the terrain layer into attribute value information of newly added attributes of the mesh points.

[0053] The process of converting the height field data into the polygonal mesh data includes: obtaining a conversion density, converting the height field data into the polygonal mesh data according to the conversion density, specifically, converting voxels in the height field data into grid points in the polygonal mesh data according to the conversion density, etc. The conversion density can be any value in (0,10).

[0054] The conversion density refers to the conversion ratio, such as the conversion ratio of converting voxels in the height field data to grid points in the polygonal mesh data. The data accuracy of the height field data refers to the data size of the height field data, the data dimension of the height field data, or the data resolution of the height field data. The data accuracy of the height field data can also be understood as the height field (HeightField) accuracy, height field size, height field size, or height field resolution corresponding to the height field data. Assume that the data accuracy / size / dimension / resolution of the height field data is 4033*4033. When the conversion density is 1, one voxel corresponds to one grid point. The coordinate information corresponding to the voxel is used as the coordinate information of the grid point to obtain a polygonal mesh data of 4033*4033. There are 4033*4033 grid points in the polygonal mesh data, wherein the height data corresponding to the voxel corresponds to the height data corresponding to the terrain scene, and the height data corresponding to the voxel is used as the height data of the grid point; when the conversion density is 0.5, two voxels correspond to one grid point, and the average value corresponding to the two voxels is used as the coordinate information of the grid point to obtain a polygonal mesh data of 4033*4033, but the grid points in the polygonal mesh data are 2016*2016; when the conversion density is 2, one voxel corresponds to two grid points, and the specific examples are not listed one by one.

[0055] Among them, when the conversion density changes from 1 to 0.5, the grid points in the polygonal mesh data change from more than 16 million to more than 4 million, and the number of processed grid points is greatly reduced. When the effect meets the requirements, the conversion density is reduced (the accuracy is reduced) to increase the speed of outputting the map. It can be understood that the accuracy of the output scene map is adjusted by the conversion density, so that the accuracy of the scene map can be adjusted and controlled. The accuracy adjustment of the scene map can also be achieved in other ways, which will be described in detail below.

[0056] The conversion density may be a value set by setting, or may be a default value if not set, such as 1 by default.

[0057] In one embodiment, the conversion density can be set before converting the height field data into polygonal mesh data, for example, it can be set before obtaining the height field data, such as it can be set on a graphical user interface, the default value is 1, and the height field data is converted into polygonal mesh data according to the set conversion density. Specifically, a conversion setting instruction is obtained, and the conversion setting instruction can be triggered by a command, by touching / clicking a corresponding conversion control, or by other means; a conversion parameter setting interface is called according to the conversion setting instruction, wherein the conversion density can be set / selected / input by the user in the conversion parameter setting interface, and if the user does not set / select / input the conversion density, the conversion density adopts the default value; the conversion density in the conversion parameter setting interface is obtained; and the height field data is automatically converted into polygonal mesh data according to the conversion density.

[0058] Among them, at the converted grid point, the terrain layer data in the height field data is used as the newly added attribute of the grid point. For the convenience of description, the newly added attribute is called the point-level attribute, and the value corresponding to the terrain layer data, that is, the terrain layer to which the voxel corresponding to the grid point specifically belongs, is used as the attribute value of the point-level attribute. For example, the terrain scene includes four terrain layers, namely, the ocean terrain layer (ocean), the stronghold terrain layer (prefab), the river terrain layer (river), and the rock terrain layer (rock). The terrain layer corresponding to a certain voxel before conversion is the ocean terrain layer. After conversion, a point-level attribute is added to the grid point corresponding to the voxel (such as the first grid point), and the attribute value of the point-level attribute is ocean. If the terrain layer corresponding to a certain voxel before conversion includes the stronghold terrain layer and the river terrain layer, the attribute value of the point-level attribute converted to the grid point corresponding to the voxel (such as the second grid point) is (prefab, river). Other ways of expressing it can also be used. For example, the attribute value of the point-level attribute of the first grid point is (1, 0, 0, 0), and the attribute value of the point-level attribute of the second grid point is (0, 1, 1, 0). The number of values ​​in the attribute value of the point-level attribute is the same as the number of terrain layers. For example, if the number of terrain layers is 4, the attribute value of the point-level attribute in the grid point is (a1, a2, a3, a4). The values ​​of a1, a2, a3, and a4 are related to the terrain layer to which the grid point belongs. If the grid point belongs to a certain terrain layer, the value in the point-level attribute corresponding to the certain terrain layer is 1, otherwise it is 0.

[0059] Among them, in the converted grid points, the mask layer corresponding to the terrain layer is used as the newly added attribute of the grid points. For the convenience of description, the newly added attribute is called the mask attribute, and the specific mask data in the mask layer is used as the attribute value of the mask attribute, that is, the mask data of the terrain layer to which the voxel corresponding to the grid point belongs is used as the attribute value of the mask attribute. Continuing with the example described in the previous paragraph, a mask attribute is added to the first grid point. Since the mask data corresponding to the ocean terrain layer is 1, the attribute value of the mask attribute is (1,0,0,0); a mask attribute is added to the second grid point. Since the mask data corresponding to the stronghold terrain layer and the river terrain layer are 0.3 and 0.7 respectively, the attribute value of the mask attribute is (0,0.3,0.7,0). Among them, the number of numerical values ​​in the attribute value of the mask attribute is the same as the number of terrain layers with mask data. For example, if the number of terrain layers with mask data is 6, the attribute value of the mask attribute in the grid point is (a, b, c, d, e, f), and the specific values ​​of a, b, c, d, e, and f are the same as the mask data of the corresponding terrain layer.

[0060] The representation method of the attribute value of the point level and the representation method of the attribute value of the mask attribute are only examples, and any other representation method may also be used.

[0061] It can be seen from the above description that in the process of converting height field data into polygonal mesh data, the height field data in the terrain scene, such as height data and mask data of the terrain layer, are inherited and transferred to the polygonal mesh data. In this way, the polygonal mesh data includes all the information in the terrain scene, and then the scene map is generated based on the polygonal mesh data, so that the target points of the generated scene map include the information of the corresponding terrain scene, which improves the data utilization rate of the terrain scene / scene map; and the scene map is obtained by processing the grid points (small data processing unit) in the polygonal mesh data, so that there is no missing content in the scene map, and the integrity and accuracy of the scene map are improved. After obtaining the polygonal mesh data, it provides a basis for more subsequent operations based on the polygonal mesh data.

[0062] 103 , for each grid point in the polygonal grid data, determine the color of the grid point according to the mask data.

[0063] After obtaining the polygonal mesh data, for each mesh point in the polygonal mesh data, its corresponding color is determined, and the color corresponding to the mesh point is processed according to the mask data to determine the color of the processed mesh point. The mask data corresponding to the terrain layer has been inherited and transferred to the polygonal mesh data, and the mask data in the polygonal mesh data refers to the mask attribute and the corresponding attribute value.

[0064] In one case, the color of each grid point in the polygonal grid data is set to a default color, and then the default color of the grid point is processed according to the mask data to determine the color of the processed grid point. The default color of each grid point in the polygonal grid data is the same; or the default color of each grid point in the polygonal grid data is related to the default color of the terrain layer to which the grid point belongs, wherein the default colors of the terrain layers to which the grid point belongs are different, or the default colors of each adjacent terrain layer are different, etc. In this way, for a grid point in a terrain layer, the default color corresponding to the grid point is the same as the default color of the terrain layer to which the grid point belongs, and for a grid point that does not belong to a terrain layer, the default color corresponding to the grid point is the set default color.

[0065] Whether a grid point belongs to a grid point in the terrain layer can be determined based on the attribute value of the point level attribute. For example, when the attribute value of the point level attribute is river, it means that the grid point belongs to a grid point in the river terrain layer. When the attribute value of the point level attribute is (prefab, river), it means that the grid point belongs to both a grid point in the stronghold terrain layer and a grid point in the river terrain layer.

[0066] In one embodiment, the color of the terrain layer to which the grid point belongs can be adjusted, and the color of the terrain layer after adjustment is used as the initial color of the terrain layer. Correspondingly, the default color of the grid point is obtained, and the initial color of the terrain layer to which the grid point belongs is obtained. For example, if a grid point belongs to both terrain layer A and terrain layer B, the initial color of terrain layer A and the initial color of terrain layer B are obtained; when it is determined that the grid point does not belong to any terrain layer, the default color is determined as the color of the grid point; when it is determined that the grid point belongs to a terrain layer, the color of the grid point is determined according to the initial color of the terrain layer and the mask data. For example, the initial color corresponding to terrain layer A is m, the mask data is 0.4, the initial color corresponding to terrain layer B is n, the mask data is 0.6, then the color of the grid point is 0.4*m+0.6*n. In this case, the color of the grid points at the intersection of different ecological regions and terrain layers is mainly determined, that is, the colors of the grid points at the intersection of different ecological regions and terrain layers are mixed according to the mask weight; or other methods can be used to determine the color of the grid points. In this embodiment, since the color of the terrain layer to which the grid point belongs is adjustable, the color of the terrain layer is adjustable and controllable, thereby improving the adjustability and controllability of the generated scene map.

[0067] Among them, the initial color of the terrain layer to which the grid point belongs can be set before the color of the grid point is determined, for example, the initial color of the terrain layer to which the grid point belongs can be set after obtaining the height field data, or the initial color of the terrain layer to which the grid point belongs can be set after obtaining the polygonal mesh data and before determining the color of the grid point, and the specific details are not limited. For example, the terrain layer parameters in the height field data are obtained, and the terrain layer parameters include the number of terrain layers and the names of the terrain layers, and the initial color of each terrain layer corresponding to the terrain layer parameters is set. In one case, for example, a color setting instruction is obtained; a color parameter setting interface is called according to the color setting instruction, wherein the name and color setting box of each terrain layer are displayed in the color parameter setting interface, and the initial color is set / selected / entered in the color setting box corresponding to the name of the terrain layer. If the initial color is not set / selected / entered, the default color of the terrain layer is used; the initial color of the set terrain layer is obtained; and the color of the grid point is automatically determined according to the initial color of the terrain layer and the mask data.

[0068] 104 , obtaining the target accuracy required by the scene map corresponding to the terrain scene, and performing precision processing on the polygonal mesh data according to the target accuracy and color, so as to obtain the target point and the target color of the target point in the scene map.

[0069] The target accuracy required for the scene map corresponding to the terrain scene can be determined according to the actual situation. There are two ways to determine the target accuracy: one is to match the data accuracy of the height field data, which is the size of the terrain corresponding to the height field data. For example, if the data accuracy of the height field data is 4033*4033, the target accuracy of the output scene map is also 4033*4033. If the data accuracy of the height field data is 1009*1009, the target accuracy of the output scene map is also 1009*1009; the other is that the user determines the output target accuracy, that is, the target accuracy is determined by user settings, for example, the accuracy set / selected / entered in the accuracy parameter setting interface is obtained, and the accuracy is used as the target accuracy. In one case, for example, the accuracy setting instruction is obtained; the accuracy parameter setting interface is called according to the accuracy setting instruction, wherein the accuracy setting box is displayed in the accuracy parameter setting interface, and the target accuracy is set / selected / entered in the accuracy setting box. If the target accuracy is not set / selected / entered, the data accuracy of the height field data is matched by default; the set target accuracy is obtained; and the accuracy processing is automatically performed according to the target accuracy. In this way, the accuracy of the scene map can be customized and the accuracy can be adjusted and controlled.

[0070] Correspondingly, the target accuracy required for the scene map corresponding to the terrain scene is obtained. The default target accuracy of the scene map can be obtained, such as the target accuracy that matches the data accuracy of the height field data, or the set target accuracy can be obtained.

[0071] After obtaining the polygonal mesh data and the color of each grid point in the polygonal mesh data, perspective projection can be directly performed to obtain a scene map, or the grid points can be processed for precision first, and then perspective projection can be performed to obtain a high-precision scene map. This method of using perspective projection can make the scene map adjustable and controllable, and improve the effective utilization rate of the data recorded in the scene map. However, the use of perspective projection may result in missing content in the obtained scene map, reducing the effect of the scene map. In addition, a better implementation method is also provided in this application.

[0072] In one embodiment, the above-mentioned step of precision processing the polygonal mesh data according to the target accuracy and color to obtain the target point and the target color of the target point in the scene map includes: deleting the height data in the coordinates of each grid point in the polygonal mesh data; precision processing the grid points with the height data deleted according to the target accuracy and color to obtain the target point and the target color of the target point in the scene map.

[0073] The grid points in the polygonal mesh data are points in three-dimensional space. After deleting the height data in three-dimensional space, the grid points in two-dimensional space are obtained, and then precision processing is performed based on the grid points in two-dimensional space, so as to reduce the amount of data processing; at the same time, deleting the height data does not affect the content display of the scene map.

[0074] Among them, the above-mentioned step of precision processing the grid points with height data deleted according to the target accuracy and color to obtain the target points in the scene map and the target colors of the target points includes: obtaining the data accuracy of the height field data of the terrain scene; when the target accuracy is the same as the data accuracy, determining the grid points with height data deleted as the target points in the scene map, and determining the colors of the grid points as the target colors of the target points; when the target accuracy is different from the data accuracy, precision processing the grid points with height data deleted according to the target accuracy to obtain the target points in the scene map, and determining the target colors of the target points according to the colors.

[0075] Understandably, when the target accuracy is the same as the data accuracy, no specific accuracy processing is required, and the grid point with the height data deleted is directly determined as the target point in the scene map, and the color of the grid point is determined as the target color of the target point. When the target accuracy is different from the data accuracy, the grid point with the height data deleted needs to be processed for accuracy.

[0076] Specifically, the above-mentioned steps of performing precision processing on the grid points from which the height data has been deleted according to the target precision to obtain the target points in the scene map, and determining the target colors of the target points according to the colors, include: determining the second number of target points corresponding to each first number of grid points when the data precision is adjusted to the target precision; for the grid points from which the height data has been deleted, determining the coordinates of the second number of target points corresponding to each first number of grid points; and for each of the second number of target points, determining the target color of the target point according to the color.

[0077] For example, when the data precision is 600*600 and the target precision is 1000*1000, every 3 grid points correspond to 5 target points, that is, the first number is 3 and the second number is 5. It is understood that when the data precision of 600*600 needs to be adjusted to the target precision of 1000*1000, every 3 grid points in 600*600 need to be replaced with 5 target points to adjust to 1000*1000. For another example, when the data precision is 4033*4033 and the target precision is 2016*2016, every 2 grid points correspond to 1 target point, that is, the first number is 2 and the second number is 1. It is understood that when the data precision of 4033*4033 needs to be adjusted to the target precision of 2016*2016, every 2 grid points in 4033*4033 need to be replaced with 1 target point to adjust to 2016*2016.

[0078] When the target accuracy is greater than the data accuracy, the above step of determining the coordinates of the second number of target points corresponding to each first number of grid points for the grid points whose height data has been deleted includes: for the grid points whose height data has been deleted, determining the grid lines / grid surfaces corresponding to each first number of grid points, creating the second number of target points on the grid lines / grid surfaces, for example, creating the second number of target points at equal distances on the grid lines / grid surfaces, and determining the coordinates of each created target point, and deleting the first number of grid points. Correspondingly, the above step of determining the target color of the target point according to the color for each second number of target points includes: for each second number of target points, searching for the grid point closest to the target point among the grid points, inheriting all the attributes of the grid point closest to the target point to the target point, including determining the color of the grid point closest to the target point as the color of the target point, etc.

[0079] When the target accuracy is less than the data accuracy, the above step of determining the coordinates of the second number of target points corresponding to each first number of grid points for the grid points whose height data has been deleted includes: for the grid points whose height data has been deleted, deleting a preset number of grid points from each first number of grid points to obtain a second number of grid points, for example, the deletion may be random or according to a certain rule; and using the coordinates of the second number of grid points as the coordinates of the target point. Correspondingly, the above step of determining the target color of the target point according to the color for each second number of target points includes: using the color of the second number of grid points as the target color of the target point. In one embodiment, when the target accuracy is less than the data accuracy, for the grid points whose height data has been deleted, for each first number of grid points, a second number of target points may also be created first, and after determining the coordinates of the target points, the first number of grid points may be deleted.

[0080] In an embodiment of the present application, the polygonal mesh data is precision processed according to the acquired target precision, so that the precision of the generated scene map is adjustable and controllable, thereby improving the adjustability and controllability of the generated scene map. When adjusting the precision of the scene map, the adjustment unit is the grid point. In this way, the scene map is obtained by adjusting the grid points, thereby improving the accuracy of the adjustment, and ensuring that there is no missing content in the scene map, thereby improving the integrity of the scene map. In addition, before rendering, all information of the target points corresponding to the scene map can be saved, thereby improving the data utilization rate of the terrain scene / scene map.

[0081] It should be noted that the implementation method of the precision processing in the above embodiment is only an example, and in other embodiments, other methods can also be used to achieve the same technical effect.

[0082] 105 , rendering the target point according to the target color to obtain a scene map corresponding to the terrain scene.

[0083] After obtaining the target point and the target color of the target point, the target point and the color of the target point are rendered to obtain a scene map corresponding to the terrain scene. Figure 3 , which is a schematic diagram of a scene map corresponding to a terrain scene obtained after rendering, and the scene map is a basic scene map.

[0084] In some embodiments, in addition to the terrain layer corresponding to the mask layer mask that can be directly provided in the height field data, more other areas are required, such as shallow sea areas and buildable areas in the terrain scene. These other more areas can be obtained by calculation, such as the erosion calculation mentioned above, or other calculations. Among them, a region is a terrain layer. For ease of understanding, it is described here in terms of regions. Correspondingly, before the step of converting the height field data into polygonal mesh data, the scene map generation method also includes: calibrating and dividing the area data corresponding to the first area in the height field data according to the mask data, and the first area is not the area of ​​the terrain layer corresponding to the mask data in the terrain scene; correspondingly, the above-mentioned step of converting the height field data into polygonal mesh data includes: converting the height field data including the area data of the first area into polygonal mesh data, and adding newly added attribute values ​​to the grid points corresponding to the first area in the polygonal mesh data to mark the first area.

[0085] Other more areas required in the height field are calibrated and divided according to the mask data corresponding to the mask layer. The other more areas are called first areas. The first area may include shallow sea areas and buildable areas in the terrain scene. When converting the height field data into polygonal mesh data, in addition to the detailed steps described above, it is also necessary to add corresponding attribute values ​​to the mesh points corresponding to the first area. For example, the attribute value corresponding to the first area is added to the point level attribute corresponding to the first area. The attribute value corresponding to the first area is the name of the terrain layer corresponding to the first area.

[0086] Wherein, when the first area is a shallow sea area, the above-mentioned step of calibrating and dividing the area data corresponding to the first area in the height field data according to the mask data includes: obtaining the height information of the first terrain layer in the terrain layer corresponding to the mask data, the first terrain layer including the ocean terrain layer; determining the first shallow sea area within a preset distance from the sea surface of the ocean terrain layer according to the height information; based on the first shallow sea area, performing a point cloud extension search according to the preset search distance to determine a part of the coastline land area; determining the first shallow sea area and the coastline land area as shallow sea areas. Wherein, the preset distance and the preset search distance can be determined according to actual conditions, for example, the preset distance is 12 meters, the preset search distance is 5 meters, etc.

[0087] For example, on the mask layer corresponding to the ocean terrain layer, the part within 12 meters from the sea surface is initially marked as the first shallow sea area according to the height data of the terrain. Then, based on the first shallow sea area, a point cloud extension search is performed, and a preset search distance is set to achieve the extension and widening of the first shallow sea area, so as to widen the ocean area that is larger than the first shallow sea area and a part of the coastal land area that is closer to the ocean area, and the first shallow sea area and the coastal land area are determined as shallow sea areas. In this way, after the color smoothing process mentioned later, the color transition between the ocean and the land can be made more natural.

[0088] Wherein, when the first area is a buildable area, the step of calibrating and dividing the area data corresponding to the first area in the height field data according to the mask data includes: determining a flat area in the terrain scene where the terrain slope is less than a preset slope; obtaining an area of ​​a second terrain layer corresponding to the mask data in the height field data, the second terrain layer does not include a terrain layer corresponding to the buildable area, nor does it include a terrain layer corresponding to the terrain grade area, wherein the second terrain layer, for example, includes a mountain terrain layer, an ocean terrain layer, a stronghold terrain layer, a river terrain layer, etc.; determining the buildable area in the height field data according to the flat area and the area of ​​the second terrain layer. Wherein, the preset slope can be a slope of less than 20 degrees.

[0089] For example, the terrain in the terrain scene is calculated to obtain a flat area with a slope less than 20 degrees on the terrain, the areas of all terrain layers (such as the second terrain layer) corresponding to all mask data in the height field data are obtained, and the area of ​​the second terrain layer is subtracted from the flat area to obtain the buildable area in the height field data. For example, the buildable area is obtained by subtracting the area where the prefab mask is located, the area where the river mask is located, the area where the rock mask is located, the area where the ocean mask is located, etc. from the flat area.

[0090] Other areas can be determined according to actual conditions and are not listed here one by one.

[0091] On the basis of all the above embodiments, after the step of determining the color of the grid points according to the mask data, the scene map generation method further includes: performing color smoothing processing on the grid points in the polygonal mesh data to obtain the polygonal mesh data after color smoothing processing; and / or performing lighting and shadow processing on the grid points in the polygonal mesh data to obtain the polygonal mesh data after lighting and shadow processing; and / or performing filter processing on the grid points in the polygonal mesh data to obtain the polygonal mesh data after filter processing, etc.

[0092] Among them, the purpose of color smoothing is to make the color transition of all grid points in the polygonal mesh data natural. Color smoothing includes color mixing fuzzy processing of all grid points. For example, a color mixing fuzzy processing with a larger step and a higher number of cycles can be used to obtain a more harmonious effect, and then a color mixing fuzzy processing with a smaller step and a lower number of cycles can be used to process the parts that did not get a good effect in the previous processing. Color smoothing can be processed by the blur node provided by the Houdini terrain graphics production tool. In some cases, when the blur node cannot be used to process the required effect, a custom method can be used to process it. For example, if the color of the river estuary is expected to be the color of the shallow sea instead of the color of the river, it is necessary to mix the color of the river that the grid points of this part have with the color of the coastline (the color source of the shallow sea area). The specific processing method varies according to the desired effect, and is not listed here one by one. For example Figure 4a As shown, after adding the shallow sea area, the effect of the scene map is obtained after color smoothing of the polygonal mesh data.

[0093] Among them, the lighting and shadow processing is used to simulate the lighting and shadow effects on the scene map. For example, using a lighting algorithm such as the semi-Lambert lighting algorithm, providing a custom lighting direction, and performing lighting and shadow processing on the grid points in the polygonal mesh data to obtain the polygonal mesh data after lighting and shadow processing, so as to achieve the shadow effect of simulating lighting on the terrain scene. Figure 4b As shown in Figure 4a Based on this, the rendering of the scene map is obtained after lighting and shadow processing, and the lighting and shadow effects are added to the rendering.

[0094] Among them, filter processing is used to simulate various other effects, such as blur effect, oil painting effect, etc. For example, after the illumination and shadow processing, the grid points in the polygonal mesh data can be subjected to filter processing by superimposing the filter algorithm, so as to achieve superimposition effects such as Gaussian blur, and the grid points in the polygonal mesh data can be subjected to filter processing by using the Kuwahara filter algorithm to simulate the effect of oil painting, etc.

[0095] There are many specific processing methods. Various processing can be performed on the grid points in the polygonal mesh data to achieve various effects, customize the scene map style, and improve the adjustability and controllability of the scene map.

[0096] In one embodiment, if Figure 5 As shown, it is a flow chart of the scene map generation method provided in an embodiment of the present application, and the scene map generation method includes the following steps.

[0097] 201 , obtaining height field data of a terrain scene of a game, where the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer.

[0098] 202 , converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data.

[0099] In one embodiment, before processing the mesh points in the polygonal mesh data, step 203 is further included.

[0100] 203, deleting the height data in the coordinates of each grid point in the polygonal grid data.

[0101] Please refer to the description of the corresponding steps in the above text for steps 201 to 203, which will not be repeated here.

[0102] 204 , determining, in the polygonal mesh data from which the height data has been deleted, mesh data blocks corresponding to each terrain layer in the height field data.

[0103] The grid points in the polygonal grid data with height data deleted are points in two-dimensional space. In the grid points in two-dimensional space, the grid points corresponding to each terrain layer in the height field data are obtained, and the grid points corresponding to each terrain layer are used as corresponding grid data blocks.

[0104] Among them, the terrain layers in this embodiment include mountain and rock terrain layers, river terrain layers, ocean terrain layers, etc., as well as the terrain layers obtained by calculation, and also include the terrain grade areas to which the terrain layers belong, such as temperate zone, tropical zone, frigid zone, desert, etc., or it can be understood that in this embodiment, the terrain grade area is also regarded as a special terrain layer, and a terrain grade area is regarded as a terrain layer. This embodiment takes this case as an example for explanation.

[0105] In some embodiments, the terrain level area can also be distinguished from the mountain and rock terrain layer, river terrain layer, ocean terrain layer, etc., as well as the terrain layers obtained through calculation. During the conversion process, the mountain and rock terrain layer, river terrain layer, ocean terrain layer, etc., as well as the terrain layers obtained through calculation are used as a new attribute of the grid point, such as point level data, and the terrain level area is used as another new attribute of the grid point, such as point area attribute, and the specific terrain level area is used as the attribute value of the point area attribute.

[0106] Specifically, step 204 includes: traversing each grid point in the polygonal grid data and determining the terrain layer to which the grid point belongs; using the grid points belonging to the same terrain layer as the grid data block corresponding to the terrain layer, so as to obtain the grid data block corresponding to each terrain layer in the polygonal grid data. For example, if there are 6 terrain layers in the height field data, 6 grid data blocks are obtained.

[0107] Wherein, determining the terrain layer to which the grid point belongs includes: obtaining the point level attribute of the grid point, and determining the terrain layer corresponding to the grid point according to the point level attribute. For example, if the point level attribute is (rock, prefab), then the terrain layer corresponding to the grid point is determined to be the rock terrain layer and the stronghold terrain layer, that is, the grid point belongs to both the rock terrain layer and the stronghold terrain layer. For example, if the point level attribute is (rock, temperature), then the terrain layer corresponding to the grid point is determined to be the rock terrain layer and the temperate terrain layer, that is, the grid point belongs to both the rock terrain layer and the temperate terrain layer.

[0108] 205, deleting the grid points inside the grid data block to obtain the area stroke points corresponding to each terrain layer.

[0109] The grid points inside the grid data block are determined according to the coordinates of the grid points in the grid data block, and the grid points inside the grid data block are deleted. Each grid data block is processed accordingly to obtain the regional stroke points corresponding to each terrain layer.

[0110] 206, setting the target color of the area stroke point to a preset color.

[0111] The preset color can be a default color, or any other color or multiple colors that are set. When the preset color is one color, the target color corresponding to the area stroke points of each terrain layer is the same. If the preset color is multiple colors, and the number of multiple colors is the same as the terrain layer, the target color corresponding to each terrain layer is different. When the area description points corresponding to multiple terrain layers overlap, one of the target colors is used during rendering.

[0112] 207 , rendering the area stroke points according to the target color to obtain an area stroke map corresponding to the terrain scene.

[0113] The terrain layer corresponding to the terrain level area is processed separately in the above steps to obtain the regional stroke map as shown in the following figure: Figure 6b shown.

[0114] In one embodiment, after the above step of determining the mesh data blocks corresponding to each terrain layer from the height field data, the method further includes: calibrating the mesh points in each mesh data block by color. The mesh points in different mesh data blocks are calibrated using different colors, so as to further determine whether each mesh data block is incorrect through the calibration results. After the mesh points in each mesh data block are calibrated by color, the rendering effect is as follows: Figure 6a As shown, Figure 6a The effect image obtained corresponds to the rendered effect image corresponding to the terrain level area.

[0115] In this embodiment, polygonal mesh data is processed to obtain an area stroke map corresponding to a terrain scene. The area stroke map can be applied in the game. For example, when a user triggers a scene map, when it is determined that the triggered point belongs to an area corresponding to a certain terrain layer, the edge of the terrain layer (area stroke point) and / or the information of the terrain layer (such as the name of the terrain layer, etc.) are displayed on the scene map, so that players can quickly understand the area where the virtual object they are operating is located / the area where the virtual object of their teammates is located / the area where the virtual objects of enemies and friends are located, as well as the terrain where the virtual object currently operated by the current player is currently located.

[0116] In one embodiment, if Figure 7 As shown, it is another flow chart of the scene map generation method provided in an embodiment of the present application, and the scene map generation method includes the following steps.

[0117] 301, obtaining height field data of a terrain scene of a game, where the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer.

[0118] 302 , converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data.

[0119] In one embodiment, before processing the mesh points in the polygonal mesh data, step 303 is further included.

[0120] 303, delete the height data in the coordinates of each grid point in the polygonal grid data.

[0121] 304 , in the polygonal mesh data from which the height data has been deleted, traverse each grid point in the polygonal mesh data, determine the terrain layer to which each grid point belongs, and obtain the terrain layer number corresponding to the terrain layer.

[0122] The grid points in the polygonal grid data with height data deleted are points in two-dimensional space. Each grid point in the polygonal grid data is traversed to obtain the point level attributes in the grid point. The terrain layer corresponding to the grid point is determined according to the point level attributes, and the terrain layer number corresponding to the terrain layer is obtained.

[0123] Among them, the terrain layer number corresponding to the terrain layer is pre-set, and the terrain layer number corresponding to the terrain layer can be set in the mapping parameter setting interface. For example, the terrain layer number corresponding to the ocean terrain layer (ocean) is set to 1, the terrain layer number corresponding to the desert terrain layer (arid) is set to 3, the terrain layer number corresponding to the temperate terrain layer is set to 4, and so on. In this way, the terrain layer number corresponding to each terrain layer is set.

[0124] For example, obtain a number setting instruction; call a number parameter setting interface according to the number setting instruction, wherein the name and number setting box of each terrain layer are displayed in the number parameter setting interface, and the terrain layer number is set / selected / entered in the number setting box corresponding to the name of the terrain layer. If the terrain layer number is not set / selected / entered, the default terrain layer number of the terrain layer is used; obtain the terrain layer number of the set terrain layer.

[0125] Among them, the numbering parameter setting interface, precision parameter setting interface, color parameter setting interface, and conversion parameter setting interface mentioned above can be the same interface, that is, the numbering parameter setting, precision parameter setting, color parameter setting, and conversion parameter setting are implemented in the same interface, and correspondingly, the numbering setting instruction, precision setting instruction, color setting instruction, and conversion setting instruction are the same instruction; in other cases, the numbering parameter setting interface, precision parameter setting interface, color parameter setting interface, and conversion parameter setting interface may not belong to the same interface, for example, the numbering parameter setting interface, precision parameter setting interface, and color parameter setting interface are in the same interface, while the conversion parameter setting interface is in another interface, without specific limitation.

[0126] 305 , for each grid point in the polygonal grid data, map the corresponding terrain layer number to a channel of the corresponding pixel in the channel map.

[0127] Map the terrain layer number corresponding to each grid point to a channel of the channel map. The channel map is understood as a picture, in which a picture has four channels, RGBA, and each channel can store data from 0 to 255. Correspondingly, the terrain layer number is data from 0 to 255, and different data can be stored in different channels of the picture according to needs. In an embodiment of the present application, the terrain layer number corresponding to the grid point can be mapped to a channel of the corresponding pixel of the channel map, such as the G channel, or other channels. Finally, the terrain layer corresponding to the mask of the entire terrain scene can be presented in a channel of the channel map.

[0128] It should be noted that the mask layer mentioned in the previous article is a three-dimensional mask map, which stores the mask weight. One mask corresponds to the mask weight of a terrain layer, that is, one mask can only present the information of one terrain layer. In the channel map used to store the terrain layer corresponding to the mask, one channel can store the points corresponding to all terrain layers, that is, one channel can present the information of multiple terrain layers. It can also be understood that a simplified version of the scene map can be obtained through one channel.

[0129] Other channels of the channel map can store other data as needed. For example, the R channel can store the terrain layer number corresponding to the terrain level area, and the B channel can include the base number corresponding to the base type. Figure 8 As shown, the upper left corner is the overall display effect of the channel map, the upper right corner is the display effect corresponding to the R channel of the channel map, the lower left corner is the display effect corresponding to the G channel of the channel map, and the lower right corner is the display effect corresponding to the B channel of the channel map. In some embodiments, the a channel (also called the alpha channel) of the channel map can also be used to store some other data information. Figure 8 The a channel is not shown.

[0130] The terrain layer number corresponding to the terrain layer (including the terrain layer number corresponding to the terrain grade area) and the stronghold number corresponding to the stronghold type can be set through the number parameter setting interface. Specifically, the terrain layer number corresponding to the terrain layer and the stronghold number corresponding to the stronghold type can be implemented using different mapping rules. Any data information saved through different channels of the channel map can be implemented using corresponding mapping rules.

[0131] In some embodiments, the terrain layer number corresponding to the terrain layer, the stronghold number corresponding to the stronghold type, and other information can be set in advance, saved in different data tables, and loaded in the number parameter setting interface. Understandably, the data corresponding to a channel of the channel map is saved in a data table. If the R channel, G channel, B channel, and a channel all have data saved, there are four corresponding data tables.

[0132] 306, rendering and displaying the channel graph.

[0133] After obtaining the channel map, the channel map can be applied to the game. For example, according to the coordinate position of the virtual object currently operated by the player in the channel map, such as the G channel, the coordinate position of the virtual object in the terrain scene can be reversed, and the terrain layer where the virtual object is located can be determined according to the coordinate position of the virtual object in the virtual scene, and the default function in the terrain layer can be triggered. For example, if the terrain layer where the virtual object is located is snow, the snowing function is triggered.

[0134] like Fig. 9 As shown, another scene map generation method provided in an embodiment of the present application, the scene map generation method includes the following steps.

[0135] 401, obtaining height field data of a terrain scene of a game, where the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer.

[0136] 402 , converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data.

[0137] When converting height field data to polygonal mesh data, conversion density is used. The height field data is converted to polygonal mesh data according to the conversion density. For details, please refer to the corresponding section above.

[0138] In one embodiment, before processing each mesh point in the polygon mesh data, step 403 is further included.

[0139] 403, delete the height data in the coordinates of each grid point in the polygonal grid data.

[0140] 404 , in the polygonal mesh data from which the height data has been deleted, traverse each mesh point in the polygonal mesh data, determine the terrain layer to which each mesh point belongs, and count the number of mesh points belonging to the same terrain layer.

[0141] The grid points in the polygonal grid data with height data deleted are points in two-dimensional space. Each grid point in the polygonal grid data is traversed to obtain the point level attributes in the grid point. The terrain layer corresponding to the grid point is determined according to the point level attributes, and the number of grid points belonging to the same terrain layer is counted. The number of points corresponds to the number of points in two-dimensional space. For example, the number of grid points belonging to the stronghold terrain layer, the number of grid points belonging to the river terrain layer, the number of grid points belonging to the rock terrain layer, the number of grid points belonging to the ocean terrain layer, etc. are counted.

[0142] 405 , obtaining the conversion density of the height field data into the polygonal mesh data and the data accuracy of the height field data.

[0143] Please refer to the above description for the content of the conversion density part, which will not be repeated here. The data accuracy of the height field data can also be understood as the size / size of the height field data.

[0144] 406 , according to the conversion density, the number of points and the data accuracy, the area ratio of each terrain layer in the terrain scene is calculated, and the number of virtual resources in the terrain scene is counted.

[0145] Among them, the area ratio can be approximately determined by the point ratio. The total number of grid points in the three-dimensional space in the height field data can be determined according to the data accuracy of the height field data, and the above-mentioned number of grid points belonging to the same terrain layer is obtained in the two-dimensional space. The three-dimensional space is converted to the two-dimensional space, and the converted two-dimensional points are determined according to the conversion density. Therefore, the number of three-dimensional grid points belonging to the same terrain layer in the height field data can be determined according to the conversion density and the number of two-dimensional points. The ratio of the number of three-dimensional grid points belonging to the same terrain layer to the total number of points is determined as the area ratio of the terrain layer in the terrain scene. If the conversion density is 0.5, the number of two-dimensional points is multiplied by 4 (because both the xy axis are multiplied by 0.5 during the conversion, so it needs to be multiplied by 4) to obtain the number of three-dimensional grid points of the terrain layer in the height field data. When the conversion density is set to 0.5, the converted polygonal mesh data only contains 25% of the points, lines and surfaces. Taking a 4K terrain scene as an example, it is only necessary to process and count about 4 million two-dimensional points, and then multiply them by 4 to get the corresponding data of the original 16 million points, which reduces the processing and statistical time and improves the efficiency of processing and statistical processing.

[0146] According to the method in this embodiment, data such as the proportion of ocean and land in the entire scene, the area proportion of each ecological area in the map, the length calculation of rivers and roads, the area size of the buildable area and its proportion can be counted. It is also possible to count the number of various strongholds in the entire terrain scene, the amount of vegetation in each ecological area, the amount of mineral resources, etc.

[0147] On the one hand, these statistical data can provide a reference for the production of terrain scenes. For example, based on these statistical data, it can be determined whether the terrain scene meets the output requirements, such as the output requirements stipulate that the land area accounts for more than 40%. In addition, these statistical data can be used in games. For example, when the virtual object operated by the player enters a certain terrain, the player can be prompted with the area ratio of the terrain, the amount of vegetation in the terrain, the amount of mineral resources, etc., to provide the player with a better gaming experience.

[0148] 407, saves the area ratio of each terrain layer and the number of virtual resources.

[0149] The area ratio of each terrain layer and the number of virtual resources can be saved in a table or in a file, such as a json file.

[0150] In this embodiment, the attribute information of the grid points of the polygonal mesh data is further retrieved and counted to make full use of the polygonal mesh data and provide guidance for the creation of terrain scenes. At the same time, the statistical data can also be applied to the game, thereby improving the data utilization rate in the terrain scene / scene map and enhancing the player's gaming experience.

[0151] All of the above technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described in detail here.

[0152] In order to better implement the scene map generation method of the embodiment of the present application, the embodiment of the present application also provides a scene map generation device. Fig.10 , Fig.10 The schematic diagram of the structure of the scene map generation device provided in the embodiment of the present application is as follows: The scene map generation device 500 may include an acquisition module 501 , a conversion module 502 , a color determination module 503 , a precision processing module 504 and a rendering module 505 .

[0153] The acquisition module 501 is used to acquire height field data of a terrain scene of a game, wherein the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer.

[0154] The conversion module 502 is used to convert the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data.

[0155] The color determination module 503 is used to determine the color of each mesh point in the polygonal mesh data according to the mask data.

[0156] The precision processing module 504 is used to obtain the target precision required by the scene map corresponding to the terrain scene, and to perform precision processing on the polygonal mesh data according to the target precision and the color to obtain the target point in the scene map and the target color of the target point.

[0157] The rendering module 505 is used to render the target point according to the target color to obtain the scene map corresponding to the terrain scene.

[0158] In one embodiment, the color determination module 503 is specifically used to obtain, for each grid point in the polygonal grid data, a default color of the grid point and an initial color of the terrain layer to which the grid point belongs; when it is determined that the grid point does not belong to any terrain layer, determine the default color as the color of the grid point; when it is determined that the grid point belongs to the terrain layer, determine the color of the grid point according to the initial color of the terrain layer and the mask data.

[0159] In one embodiment, the precision processing module 504 is specifically used to delete the height data in the coordinates of each grid point in the polygonal mesh data; based on the target precision and the color, the grid point from which the height data has been deleted is precision processed to obtain the target point in the scene map and the target color of the target point.

[0160] In one embodiment, when the precision processing module 504 executes the step of performing precision processing on the grid points from which the height data has been deleted according to the target precision and the color to obtain the target points in the scene map and the target colors of the target points, the precision processing module 504 specifically performs the following steps: obtaining the data precision of the height field data of the terrain scene; when the target precision is the same as the data precision, determining the grid points from which the height data has been deleted as the target points in the scene map, and determining the colors of the grid points as the target colors of the target points; when the target precision is different from the data precision, performing precision processing on the grid points from which the height data has been deleted according to the target precision to obtain the target points in the scene map, and determining the target colors of the target points according to the colors.

[0161] In one embodiment, when the precision processing module 504 performs the steps of performing precision processing on the grid points from which the height data has been deleted according to the target precision to obtain the target points in the scene map, and determining the target colors of the target points according to the colors, the precision processing module 504 specifically performs the following steps: determining the second number of target points corresponding to each first number of grid points when the data precision is adjusted to the target precision; for the grid points from which the height data has been deleted, determining the coordinates of the second number of target points corresponding to each first number of grid points; and for each of the second number of target points, determining the target color of the target point according to the color.

[0162] In one embodiment, if Fig.11 As shown, the scene map generating device 500 further includes a terrain layer determining module 506. The terrain layer determining module 506 is used to calibrate and divide the region data corresponding to the first region in the height field data according to the mask data, and the first region is not the region of the terrain layer corresponding to the mask data in the terrain scene. Correspondingly, the conversion module 502 is used to convert the height field data including the region data of the first region into polygonal mesh data, and add a newly added attribute value to the mesh points corresponding to the first region in the polygonal mesh data to mark the first region.

[0163] When the first area includes a shallow sea area, the terrain layer determination module 506 is specifically used to obtain height information of a first terrain layer in the terrain layer corresponding to the mask data, wherein the first terrain layer includes an ocean terrain layer; determine a first shallow sea area within a preset distance from the sea surface of the ocean terrain layer according to the height information; perform a point cloud extension search based on the first shallow sea area according to a preset search distance to determine a portion of the coastline land area; and determine the first shallow sea area and the coastline land area as the shallow sea area in the height field data.

[0164] When the first area includes a buildable area, the terrain layer determination module 506 is specifically used to determine a flat area in the terrain scene where the terrain slope is less than a preset slope; obtain an area of ​​a second terrain layer corresponding to the mask data in the height field data, the second terrain layer does not include a terrain layer corresponding to the buildable area; and determine the buildable area in the height field data based on the flat area and the area of ​​the second terrain layer.

[0165] In one embodiment, if Fig.11As shown, the scene map generating device 500 further includes a style processing module 507. The style processing module 507 is used to perform color smoothing processing on the grid points in the polygonal grid data to obtain polygonal grid data after color smoothing processing; and / or perform illumination and shadow processing on the grid points in the polygonal grid data to obtain polygonal grid data after illumination and shadow processing; and / or perform filter processing on the grid points in the polygonal grid data to obtain polygonal grid data after filter processing.

[0166] In one embodiment, if Fig.11 The scene map generation device 500 further includes a stroke determination module 508. The stroke determination module 508 is used to determine the mesh data blocks corresponding to the terrain layers in the height field data in the polygonal mesh data; delete the mesh points inside the mesh data blocks to obtain the regional stroke points corresponding to the terrain layers; and set the target color of the regional stroke points to a preset color. The rendering module 505 is also used to render the regional stroke points according to the target color to obtain the regional stroke map corresponding to the terrain scene.

[0167] In one embodiment, if Fig.11 As shown, the scene map generating device 500 also includes a mapping module 509. The mapping module 509 is used to traverse each grid point in the polygonal grid data, determine the terrain layer to which the grid point belongs, and obtain the terrain layer number corresponding to the terrain layer; for each grid point in the polygonal grid data, map the corresponding terrain layer number to a channel of the corresponding pixel of the channel map. The rendering module 505 is also used to render and display the channel map.

[0168] In one embodiment, if Fig.11 As shown, the scene map generating device 500 further includes a statistical module 510. The statistical module 510 is used to traverse each grid point in the polygonal grid data, determine the terrain layer to which the grid point belongs, and count the number of grid points belonging to the same terrain layer; obtain the conversion density of the height field data into the polygonal grid data and the data accuracy of the height field data; calculate the area proportion of each terrain layer in the terrain scene according to the conversion density, the number of points and the data accuracy, and count the number of virtual resources in the terrain scene.

[0169] All of the above technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described in detail here.

[0170] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal or a server. Fig.12 As shown, Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 600 includes a processor 601 having one or more processing cores, a memory 602 having one or more computer-readable storage media, and a computer program stored in the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0171] The processor 601 is the control center of the computer device 600. It uses various interfaces and lines to connect the various parts of the entire computer device 600, and executes various functions of the computer device 600 and processes data by running or loading software programs (computer programs) and / or modules stored in the memory 602, and calling data stored in the memory 602, thereby monitoring the computer device 600 as a whole.

[0172] In the embodiment of the present application, the processor 601 in the computer device 600 will load instructions corresponding to the processes of one or more application programs into the memory 602 according to the following steps, and the processor 601 will run the application programs stored in the memory 602 to implement various functions:

[0173] Acquire height field data of a terrain scene of a game, wherein the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer; convert the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data; for each grid point in the polygonal mesh data, determine the color of the grid point according to the mask data; acquire the target accuracy required for a scene map corresponding to the terrain scene, and perform accuracy processing on the polygonal mesh data according to the target accuracy and the color to obtain a target point in the scene map and a target color of the target point; render the target point according to the target color to obtain a scene map corresponding to the terrain scene.

[0174] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0175] Optional, such as Fig.12As shown, the computer device 600 further includes: a touch screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607, respectively. Those skilled in the art can understand that Fig.12 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0176] The touch display screen 603 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 603 can include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-EmittingDiode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. The touch panel can cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor 601 to determine the type of the touch event, and then the processor 601 provides corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 603 to realize the input and output functions. However, in some embodiments, the touch panel and the display panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to realize the input function.

[0177] In the embodiment of the present application, the touch display screen 603 is used to present a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface.

[0178] The radio frequency circuit 604 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.

[0179] The audio circuit 605 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 605 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and converted into audio data, and then the audio data is output to the processor 601 for processing, and then sent to another computer device through the radio frequency circuit 604, or the audio data is output to the memory 602 for further processing. The audio circuit 605 may also include an earplug jack to provide communication between an external headset and the computer device.

[0180] The input unit 606 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0181] The power supply 607 is used to supply power to various components of the computer device 600. Optionally, the power supply 607 can be logically connected to the processor 601 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 607 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0182] although Fig.12 Not shown, the computer device 600 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0183] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0184] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0185] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any of the scene map generation methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:

[0186] Acquire height field data of a terrain scene of a game, wherein the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer; convert the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data; for each grid point in the polygonal mesh data, determine the color of the grid point according to the mask data; acquire the target accuracy required for a scene map corresponding to the terrain scene, and perform accuracy processing on the polygonal mesh data according to the target accuracy and the color to obtain a target point in the scene map and a target color of the target point; render the target point according to the target color to obtain the scene map corresponding to the terrain scene.

[0187] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0188] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0189] Since the computer program stored in the storage medium can execute the steps in any scene map generation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any scene map generation method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0190] The above is a detailed introduction to a scene map generation method, device, storage medium and computer equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A scene map generation method, characterized in that: include: Acquire height field data of a terrain scene of the game, the terrain scene including at least one terrain layer, the height field data including height data corresponding to the terrain scene and mask data corresponding to the terrain layer; Converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data; For each grid point in the polygonal grid data, determining the color of the grid point according to the mask data; Acquire the target accuracy required by the scene map corresponding to the terrain scene, and perform precision processing on the polygonal mesh data according to the target accuracy and the color, so as to obtain the target point in the scene map and the target color of the target point; Rendering the target point according to the target color to obtain the scene map corresponding to the terrain scene; The step of converting the height field data into polygonal mesh data includes: converting voxels in the height field data into mesh points in the polygonal mesh data, converting the relationship between voxels in the height field data into line information and / or surface information in the polygonal mesh data, converting the height data corresponding to the terrain scene into the height data of the mesh points, and converting the terrain layer in the height field data and the mask data of the terrain layer into attribute value information of newly added attributes of the mesh points.

2. The scene map generation method according to claim 1, characterized in that: The step of determining the color of the grid point according to the mask data comprises: Obtaining the default color of the grid point, and obtaining the initial color of the terrain layer to which the grid point belongs; When it is determined that the grid point does not belong to any terrain layer, determining the default color as the color of the grid point; When it is determined that the grid point belongs to the terrain layer, the color of the grid point is determined according to the initial color of the terrain layer and the mask data.

3. The scene map generation method according to claim 1, characterized in that: The step of performing precision processing on the polygonal mesh data according to the target precision and the color to obtain the target point in the scene map and the target color of the target point comprises: Deleting the height data in the coordinates of each grid point in the polygonal grid data; According to the target accuracy and the color, the grid points from which the height data has been deleted are precision processed to obtain the target points in the scene map and the target colors of the target points.

4. The scene map generation method according to claim 3, characterized in that: The step of performing precision processing on the grid points from which the height data has been deleted according to the target precision and the color to obtain the target point in the scene map and the target color of the target point comprises: Acquire the data accuracy of the height field data of the terrain scene; When the target accuracy is the same as the data accuracy, the grid point with the height data deleted is determined as the target point in the scene map, and the color of the grid point is determined as the target color of the target point; When the target accuracy is different from the data accuracy, the grid points from which the height data has been deleted are precision processed according to the target accuracy to obtain the target point in the scene map, and the target color of the target point is determined according to the color.

5. The scene map generation method according to claim 4, characterized in that: The step of performing precision processing on the grid points from which the height data has been deleted according to the target precision to obtain the target point in the scene map, and determining the target color of the target point according to the color, comprises: Determining a second number of target points corresponding to each first number of grid points when adjusting the data precision to the target precision; For the grid points from which the height data has been deleted, determining the coordinates of the second number of target points corresponding to each first number of grid points; For each of the second number of target points, a target color of the target point is determined based on the color.

6. The scene map generation method according to claim 1, characterized in that: Before converting the height field data into polygonal mesh data, the scene map generation method further includes: Calibrate and divide the area data corresponding to the first area in the height field data according to the mask data, the first area not being the area of ​​the terrain layer corresponding to the mask data in the terrain scene; The converting the height field data into polygonal mesh data includes: converting the height field data including the area data of the first area into polygonal mesh data, and adding newly added attribute values ​​to the mesh points corresponding to the first area in the polygonal mesh data to mark the first area.

7. The scene map generation method according to claim 6, characterized in that: The first area includes a shallow sea area, and the step of calibrating and dividing the area data corresponding to the first area in the height field data according to the mask data includes: Acquire height information of a first terrain layer in the terrain layers corresponding to the mask data, wherein the first terrain layer includes an ocean terrain layer; Determine a first shallow sea area within a preset distance from the sea surface of the marine terrain layer according to the height information; Based on the first shallow sea area, a point cloud extension search is performed according to a preset search distance to determine a portion of the coastline land area; The first shallow sea area and the coastline land area are determined as the shallow sea area in the height field data.

8. The scene map generation method according to claim 6, characterized in that: The first area includes a buildable area, and the step of calibrating and dividing the area data corresponding to the first area in the height field data according to the mask data includes: Determine a gentle area in the terrain scene where the terrain slope is less than a preset slope; Acquire the area of ​​the second terrain layer corresponding to the mask data in the height field data; A buildable area in the height field data is determined according to the flat area and the area of ​​the second terrain layer.

9. The scene map generation method according to any one of claims 1 to 8, characterized in that: After the step of determining the color of the grid points according to the mask data, the scene map generation method further includes: Performing color smoothing processing on the grid points in the polygonal mesh data to obtain polygonal mesh data after color smoothing processing; and / or Performing lighting and shadow processing on the grid points in the polygonal mesh data to obtain polygonal mesh data after lighting and shadow processing; and / or The mesh points in the polygonal mesh data are subjected to filter processing to obtain the polygonal mesh data after the filter processing.

10. The scene map generation method according to any one of claims 1 to 8, characterized in that: After the step of converting the height field data into polygonal mesh data, the scene map generation method further comprises: In the polygonal mesh data, determine the mesh data blocks corresponding to each terrain layer in the height field data; Deleting the grid points inside the grid data block to obtain the regional stroke points corresponding to each terrain layer; Set the target color of the stroke points in the area to a preset color; The area stroke points are rendered according to the target color to obtain an area stroke map corresponding to the terrain scene.

11. The scene map generation method according to claim 10, characterized in that: The step of determining the grid data blocks corresponding to each terrain layer from the height field data comprises: Traversing each grid point in the polygonal grid data, and determining the terrain layer to which the grid point belongs; The grid points belonging to the same terrain layer are used as the grid data blocks corresponding to the terrain layer.

12. The scene map generation method according to claim 11, characterized in that: When converting the height field data into polygonal mesh data, converting the terrain layer in the height field data into attribute value information of the newly added attribute of the mesh point, the newly added attribute being a point level attribute; The step of determining the terrain layer to which the grid point belongs comprises: Obtaining point-level attributes in the grid point; The terrain layer corresponding to the grid point is determined according to the point level attribute.

13. The scene map generation method according to any one of claims 1 to 8, characterized in that: After the step of converting the height field data into polygonal mesh data, the scene map generation method further comprises: In the polygonal mesh data, traverse each grid point in the polygonal mesh data, determine the terrain layer to which the grid point belongs, and obtain the terrain layer number corresponding to the terrain layer; For each grid point in the polygonal grid data, mapping the corresponding terrain layer number to a channel of a corresponding pixel in the channel map; Rendering and displaying the channel graph.

14. The scene map generation method according to any one of claims 1 to 8, characterized in that: After the step of converting the height field data into polygonal mesh data, the scene map generation method further comprises: Traversing each grid point in the polygonal grid data, determining the terrain layer to which the grid point belongs, and counting the number of grid points belonging to the same terrain layer; Acquire the conversion density of the height field data into the polygonal mesh data and the data accuracy of the height field data; According to the conversion density, the number of points and the data accuracy, the area ratio of each terrain layer in the terrain scene is calculated, and the number of virtual resources in the terrain scene is counted.

15. A scene map generating device, characterized in that: include: An acquisition module, used to acquire height field data of a terrain scene of a game, wherein the terrain scene includes at least one terrain layer, and the height field data includes height data corresponding to the terrain scene and mask data corresponding to the terrain layer; A conversion module, used for converting the height field data into polygonal mesh data, wherein the polygonal mesh data inherits the height data and the mask data; A color determination module, configured to determine, for each mesh point in the polygonal mesh data, a color of the mesh point according to the mask data; A precision processing module, used to obtain the target precision required by the scene map corresponding to the terrain scene, and perform precision processing on the polygonal mesh data according to the target precision and the color, so as to obtain the target point in the scene map and the target color of the target point; A rendering module, used for rendering the target point according to the target color to obtain the scene map corresponding to the terrain scene; The conversion module is specifically used to: convert voxels in the height field data into grid points in the polygonal mesh data, convert the relationship between voxels in the height field data into line information and / or surface information in the polygonal mesh data, convert the height data corresponding to the terrain scene into the height data of the grid points, and convert the terrain layer in the height field data and the mask data of the terrain layer into attribute value information of the newly added attributes of the grid points.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the scene map generation method as described in any one of claims 1-14.

17. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the steps in the scene map generation method as described in any one of claims 1 to 14 by calling the computer program stored in the memory.

Citation Information

Patent Citations

  • Mesh object generation method and device

    CN108171797A

  • Generation method and device of height map of virtual scene terrain and storage medium

    CN112233241A