Map data processing method and device, electronic equipment and storage medium

By chunking and gradually loading the game scenes, the problem of low map loading efficiency in game development is solved, and more efficient data processing and simplified circulation process is achieved.

CN119925937AActive Publication Date: 2025-05-06NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510024714.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-06
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

During the game development process, when exporting the terrain data of the game world to generate contour maps, there are problems such as low map loading efficiency and cumbersome processing flow.

Method used

By dividing the target scene into several blocks, determining the virtual camera and shooting perspective, gradually loading the terrain data of each block, generating scene maps, and adding material information to improve loading efficiency and simplifying the flow process.

Benefits of technology

Improve map loading efficiency, reduce data loading time, simplify data flow process, and reduce the difficulty of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119925937A_ABST
    Figure CN119925937A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a map data processing method and device, electronic equipment and a storage medium, and relates to the technical field of game development, the method comprises the following steps: obtaining topographic data corresponding to a target scene, the target scene being divided into a plurality of blocks; determining a virtual camera for the target scene and a shooting visual angle corresponding to the virtual camera; obtaining coordinate information corresponding to each block, and loading topographic data corresponding to each block in sequence according to the shooting view angle and the coordinate information to obtain a scene graph corresponding to the target scene; determining at least one kind of scene material information for the scene graph, adding an image effect corresponding to the scene material information for the scene graph, and displaying a target scene graph corresponding to the target scene; and performing screenshot on the target scene graph, and outputting the topographic image set corresponding to the target scene graph, thereby improving the efficiency of data circulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game development technology, and in particular to a method for processing map data, a device for processing map data, an electronic device and a computer-readable storage medium. Background Art

[0002] In the process of game development, game engines are widely used in game development, virtual reality, architectural visualization and other fields. Their powerful rendering and post-processing capabilities make them an ideal choice for processing complex graphics tasks. In the process of managing and optimizing large-scale game worlds, it is often necessary to dynamically load and unload different parts of the game world in the engine to optimize memory and performance. In addition, it is necessary to export the terrain data of the game world to the corresponding terrain production software and output the corresponding contour map. However, in the process of outputting the contour map, it is often necessary to load the corresponding terrain data first. In the process of loading the terrain data, there are loading restrictions, which makes it impossible to quickly preview the map corresponding to the corresponding terrain data. At the same time, as the size of the terrain increases, the amount of data contained also increases. When it needs to flow in multiple processing software, it is easy to increase the import and export time, increase the processing flow, and seriously affect the processing efficiency. Summary of the invention

[0003] An embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for processing map data to solve or partially solve the problems of slow map loading efficiency and complicated processing procedures in the process of exporting a contour map corresponding to the terrain of a game world.

[0004] The embodiment of the present invention discloses a method for processing map data, comprising:

[0005] Acquire terrain data corresponding to a target scene, wherein the target scene is divided into a plurality of blocks;

[0006] Determine a virtual camera for the target scene and a shooting angle corresponding to the virtual camera;

[0007] Acquire coordinate information corresponding to each of the blocks, and sequentially load terrain data corresponding to each of the blocks according to the shooting angle of view and the coordinate information to obtain a scene graph corresponding to the target scene;

[0008] Determine at least one scene material information for the scene graph, add an image effect corresponding to the scene material information to the scene graph, and display a target scene graph corresponding to the target scene;

[0009] A screenshot is taken of the target scene graph, and a terrain image set corresponding to the target scene graph is output.

[0010] The embodiment of the present invention further discloses a map data processing device, comprising:

[0011] A data acquisition module, used to acquire terrain data corresponding to a target scene, wherein the target scene is divided into a plurality of blocks;

[0012] A camera determination module, used to determine a virtual camera for the target scene and a shooting angle corresponding to the virtual camera;

[0013] A loading module, used to obtain coordinate information corresponding to each of the blocks, and sequentially load terrain data corresponding to each of the blocks according to the shooting angle and the coordinate information, to obtain a scene graph corresponding to the target scene;

[0014] An image processing module, used to determine at least one scene material information for the scene graph, add an image effect corresponding to the scene material information to the scene graph, and display a target scene graph corresponding to the target scene;

[0015] The image capture module is used to capture the target scene graph and output a terrain image set corresponding to the target scene graph.

[0016] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0017] The memory is used to store computer programs;

[0018] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0019] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.

[0020] The embodiments of the present invention include the following advantages:

[0021] In an embodiment of the present invention, for the terrain data processing of the target scene, after the user edits the terrain of the target scene, if the corresponding data needs to be exported for data processing in another graphics processing software, the user can export the terrain image set corresponding to the target scene through the corresponding plug-in to feed back the user's terrain modification of the target scene to the corresponding scene map. Specifically, the terrain data corresponding to the target scene can be obtained, the target scene can be divided into a number of blocks, and then a virtual camera for the target scene and a shooting angle corresponding to the virtual camera can be determined. During the loading process, the coordinate information corresponding to each block can be obtained, and the terrain corresponding to each block can be sequentially processed according to the shooting angle and the coordinate information. The shape data is loaded to obtain the scene graph corresponding to the target scene. By dividing the entire scene into several small-range blocks that support fast loading, the loading efficiency of the map is improved and the time for data loading is reduced. In addition, by determining at least one scene material information for the scene graph and adding an image effect corresponding to the scene material information to the scene graph, the target scene graph corresponding to the target scene is displayed, and then a screenshot of the target scene graph is taken to output a terrain image set corresponding to the target scene graph. By taking a screenshot of the scene graph with the corresponding material added, the user can import the terrain image set into the corresponding image processing software for further map management and control, simplifying the data flow process and reducing the difficulty of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flowchart of a method for processing map data provided in an embodiment of the present invention;

[0023] Figure 2 is a top view of a target scene provided in an embodiment of the present invention;

[0024] Figure 3 is a top view of a target scene provided in an embodiment of the present invention;

[0025] Figure 4 is a schematic diagram of a target scene graph provided in an embodiment of the present invention;

[0026] Figure 5 is a schematic diagram of a target scene graph provided in an embodiment of the present invention;

[0027] Figure 6 is a schematic diagram of a target scene graph provided in an embodiment of the present invention;

[0028] Figure 7 is a schematic diagram of a target scene graph provided in an embodiment of the present invention;

[0029] Figure 8 It is a structural block diagram of a map data processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0031] As an example, after a user modifies the terrain of a corresponding scene in a graphics processing software, the modified terrain data needs to be exported and imported into another graphics processing software. As the size of the terrain increases, the amount of data contained also increases. When it needs to circulate in multiple processing software, the import and export time is easily increased, which increases the processing flow and seriously affects the processing efficiency.

[0032] In this regard, in the present invention, for the terrain data processing of the target scene, after the user edits the terrain of the target scene, if the corresponding data needs to be exported for data processing in another graphics processing software, the user can export the terrain image set corresponding to the target scene through the corresponding plug-in to feed back the user's terrain modification of the target scene to the corresponding scene map. Specifically, the terrain data corresponding to the target scene can be obtained, the target scene can be divided into several blocks, and then the virtual camera for the target scene and the shooting angle corresponding to the virtual camera can be determined. During the loading process, the coordinate information corresponding to each block can be obtained, and the terrain corresponding to each block can be sequentially processed according to the shooting angle and the coordinate information. The shape data is loaded to obtain the scene graph corresponding to the target scene. By dividing the entire scene into several small-range blocks that support fast loading, the loading efficiency of the map is improved and the time for data loading is reduced. In addition, by determining at least one scene material information for the scene graph and adding an image effect corresponding to the scene material information to the scene graph, the target scene graph corresponding to the target scene is displayed, and then a screenshot of the target scene graph is taken to output a terrain image set corresponding to the target scene graph. By taking a screenshot of the scene graph with the corresponding material added, the user can import the terrain image set into the corresponding image processing software for further map management and control, simplifying the data flow process and reducing the difficulty of use.

[0033] Reference Figure 1 , shows a flowchart of a method for processing map data provided in an embodiment of the present invention, which may specifically include the following steps:

[0034] Step 101, obtaining terrain data corresponding to a target scene, wherein the target scene is divided into a plurality of blocks;

[0035] Optionally, the embodiment of the present invention can be applied to graphics processing software, and a plug-in matching the technical solution of the embodiment of the present invention can be made and run in the graphics processing software so that the user can input corresponding operations to execute the technical solution corresponding to the embodiment of the present invention.

[0036] Among them, the graphics processing software can be software for processing terrain data, for example, it can be software for processing the terrain of a game scene, etc. In actual applications, the user can edit the game scene accordingly in the graphics processing software ①. Based on the editing results, the user can export the corresponding terrain data in the graphics processing software ①, and import the exported terrain data into the graphics processing software ② for further processing to meet the actual needs of the user.

[0037] In one example, the user can edit the terrain of the corresponding target scene in the graphics processing software ①, and then export the corresponding terrain image set, such as a contour map, based on the editing result.

[0038] In an embodiment of the present invention, the user can process the terrain data of the target scene in the corresponding graphics processing software. Specifically, the user can run the corresponding plug-in in the graphics processing software and input the corresponding operation through the software graphical interface provided by the plug-in. For example, a data import interface can be provided in the software graphical interface, and the user imports the terrain data of the target scene through the data import interface so as to load the terrain data in the graphics processing software to display the terrain corresponding to the target scene, etc.

[0039] It should be noted that in order to improve the loading efficiency of terrain data, the plug-in can block the target scene and divide the target scene into several blocks of the same size that support fast loading. At the same time, in order to further improve the loading efficiency, the blocks can be further divided, and each block can be further divided into several smaller sub-blocks, etc. For example, for the target scene, it can be divided into 25 blocks, and then each block can be further divided into 25 sub-blocks, so as to obtain 25 groups of sub-blocks, a total of 625 sub-blocks. During the loading process, the terrain data of the target scene can be loaded with "blocks" as the loading unit to improve the loading efficiency of the target scene and reduce the time of data loading.

[0040] Step 102, determining a virtual camera for the target scene and a shooting angle corresponding to the virtual camera;

[0041] After importing the terrain data corresponding to the target scene, the user may input corresponding setting operations to set a virtual camera for the target scene and a shooting angle corresponding to the virtual camera.

[0042] Among them, the virtual camera is a tool for loading terrain data for the target scene, and the shooting angle can be the angle of view for capturing the target scene. Therefore, by creating a corresponding virtual camera in the graphics processing software and setting the corresponding shooting angle, the loading range of the target scene can be accurately controlled to improve the loading efficiency of the terrain data.

[0043] It should be noted that after determining the virtual camera for the target scene, the user can also create a post-processing box for the virtual camera in the graphics processing software through a plug-in, and set the virtual camera in the post-processing box, which is configured with different post-processing material information. Post-processing refers to additional processing of the image after rendering the scene to achieve visual enhancement, for example, you can add a variety of special effects, such as depth of field, motion blur, and color correction.

[0044] In a specific implementation, by placing a virtual camera in a post-processing box and turning on a corresponding material processing switch, the virtual camera can apply the post-processing material information configured in the post-processing box to process the loaded target scene to obtain a target scene graph with corresponding material information added, etc. Also, the post-processing material information configured in the plug-in can be provided to the user through a corresponding interface, and the user can select the corresponding post-processing material information and start adding materials through the corresponding interface, etc., and the present invention does not limit this.

[0045] Step 103, obtaining coordinate information corresponding to each of the blocks, and sequentially loading terrain data corresponding to each of the blocks according to the shooting angle and the coordinate information, to obtain a scene graph corresponding to the target scene;

[0046] After importing the corresponding terrain data and determining the virtual camera, the terrain data can be loaded through the virtual camera. Specifically, since the target scene is divided into several blocks, during the loading process, the coordinate information corresponding to each block can be obtained first, and the terrain data corresponding to each block can be loaded in turn according to the shooting angle and coordinate information to obtain the scene graph corresponding to the target scene. By dividing the entire scene into several small-range blocks that support fast loading, the amount of loaded data can be reduced by loading them one by one during the loading process, thereby effectively improving the overall loading efficiency and reducing the time of data loading.

[0047] In some feasible implementations, the coordinate information may be the center coordinates of the blocks, and the shooting angle may be an orthogonal angle. For the loading process of the terrain data, the terrain data of each block may be loaded in sequence according to the orthogonal angle along each center coordinate, and a scene graph corresponding to the target scene may be obtained based on the loading result. By setting the shooting angle of the virtual camera to an orthogonal angle, the size of all objects in the picture will not change with the change of distance.

[0048] In addition, refer to Figure 2 , shows a top view of a target scene provided in an embodiment of the present invention, in order to more intuitively illustrate the block division process of the target scene, Figure 2In the figure, the target scene is divided into blocks from a vertical perspective. Assuming that the target scene is divided into 25 blocks, and each block is further divided into 25 sub-blocks, the center coordinates can be the coordinates of the center point of the sub-block located in the middle of each block, specifically the coordinates of the sub-block in the horizontal plane, that is, (x, y). The loading position of the virtual camera when loading the terrain data can be determined by the center coordinates.

[0049] In a specific implementation, in order to further improve the loading efficiency of terrain data, a corresponding sequence mark can be set for each block. Therefore, during the loading process of terrain data, by obtaining the sequence marks corresponding to each block, and then in accordance with the order corresponding to the sequence marks, the virtual camera is controlled to move to the top of the position of each center coordinate in sequence, and the terrain data of the block is loaded with an orthogonal perspective. Based on the recorded results, a scene graph corresponding to the target scene is obtained, and the entire scene is divided into several small-range blocks that support fast loading. During the loading process, the amount of loaded data is reduced by loading them one by one in the corresponding order, thereby effectively improving the overall loading efficiency and reducing the time of data loading.

[0050] For example, refer to Figure 3 , showing a top view of the target scene provided in an embodiment of the present invention. In the process of loading terrain data, the presentation angle of the graphics processing software is first set to the shooting angle of the virtual camera, and then the virtual camera can be controlled to move to the target scene blocks A-4_B-4, A-3_B-4, A-2_B-4, A-1_B-4, A-0_B-4, A-3_B-4... etc. above the corresponding center coordinates to load terrain data for the corresponding blocks, thereby dividing the entire scene into several small-range blocks that support fast loading, and loading them one by one in the corresponding order during the loading process, thereby reducing the amount of loaded data, thereby effectively improving the overall loading efficiency and reducing the time of data loading.

[0051] Step 104, determining at least one scene material information for the scene graph, adding an image effect corresponding to the scene material information to the scene graph, and displaying a target scene graph corresponding to the target scene;

[0052] After the plug-in has completely loaded the terrain data corresponding to the target scene, the corresponding scene graph can be obtained. At the same time, according to user needs, if the user enters the corresponding material adding instruction in the plug-in, it can respond to the material adding instruction for the target scene, extract at least one scene material information corresponding to the material adding instruction from the post-processing material information configured in the post-processing box, and then add the image effect corresponding to the scene material information to the scene graph to display the target scene graph corresponding to the target scene in the graphics processing software, so that by configuring the corresponding post-processing material information in the plug-in, the user can add the corresponding material to the target scene according to actual needs to obtain an image that meets the user's needs, such as a contour map, a topographic map, etc., and the present invention is not limited to this.

[0053] In some feasible implementations, the scene material information includes contour line material information, height color material information, and model color material information, etc. The contour line material information can be used to process the scene graph to obtain the corresponding contour line map, the height color material information can be used to process the scene graph to obtain the corresponding terrain height map, and the model color material information can be used to process the scene model in the target scene to obtain the corresponding model color map, so that the terrain height corresponding to the target scene can be intuitively presented through the contour line map, the height change corresponding to the target scene can be intuitively presented through the terrain height map, and the relevant scene models in the target scene can be intuitively presented through the model color map.

[0054] In a specific implementation, if the scene material information is contour material information, the contour lines corresponding to the target scene are calculated, and the contour lines are displayed in the scene graph, and the contour map corresponding to the target scene is displayed. If the scene material information is height color material information, the terrain color corresponding to the target scene is calculated, and the scene graph is dyed according to the terrain color, and the terrain height map corresponding to the target scene is displayed based on the dyeing result. If the scene material information is model color material information, the scene model is identified from the scene graph, and the target scene model is extracted from the scene model, and then the display color corresponding to the target scene model is obtained, and then the target scene model is dyed according to the display color, and the model color map corresponding to the target scene is displayed based on the dyeing result.

[0055] For the processing of contour lines, the height information of each pixel in the scene map in the world coordinate system and the contour line interval value can be obtained. The world coordinate system is a coordinate system constructed according to the depth map data of the target scene and the position information of the virtual camera. Then, the height information and the contour line interval value are used for calculation to obtain the detection value corresponding to the pixel point, and the pixel point with a detection value less than a preset threshold in the target scene is taken as the first pixel point, and the pixel point with a detection value greater than or equal to the preset threshold in the target scene is taken as the second pixel point, and then the first pixel point in the target scene is set to the first color, and the second pixel point in the target scene is set to the second color, and the contour line map corresponding to the target scene is displayed. Among them, the first pixel point of the first color constitutes the contour line in the contour line map.

[0056] It should be noted that the world coordinate system can be a world coordinate system constructed based on the depth map data of the target scene (the pixel value of each pixel in the depth map corresponding to the target scene represents the distance from the virtual camera to the pixel in the target scene) and the position information of the virtual camera. By constructing the world coordinate system, each pixel in the scene map can be mapped to the world coordinate system to obtain the world coordinates (x, y, z) corresponding to each pixel. The x-coordinate and y-coordinate can locate the horizontal position corresponding to the pixel, and the z-coordinate can represent the height of the pixel in the world coordinate system, that is, the height of the corresponding position in the target scene.

[0057] For example, the construction process of the world coordinate system can be as follows:

[0058] ① By obtaining the depth map data corresponding to the target scene. The depth map is a two-dimensional image in which each pixel value represents the distance from the virtual camera to the corresponding point in the scene. The depth map can be a single-channel image, and the pixel value is usually in millimeters or meters.

[0059] ② Get the virtual camera internal parameters: The virtual camera internal parameters include focal length (fx, fy) and image center point (cx, cy). These parameters describe the optical characteristics of the virtual camera and are used to convert pixel coordinates into three-dimensional points in the camera coordinate system.

[0060] ③ Get the virtual camera external parameters: The virtual camera external parameters include the rotation matrix and the translation vector. The rotation matrix describes the direction of the virtual camera, and the translation vector describes the position of the virtual camera in the world coordinate system. If the virtual camera is located at the origin of the world coordinate system and is facing forward, the rotation matrix can be the unit matrix and the translation vector can be the zero vector.

[0061] ④Pixel coordinates to camera coordinates: For each pixel in the depth map, use the virtual camera internal parameters to convert it into a 3D point in the camera coordinate system. Specifically, the point (x, y, z) in the camera coordinate system can be calculated through the pixel coordinates (u, v) and the depth value (z).

[0062] ⑤ Camera coordinates to world coordinates: Use the external parameters of the virtual camera (rotation matrix and translation vector) to transform the points in the camera coordinate system to the world coordinate system. This step is achieved through matrix operations, taking into account the position and direction of the virtual camera.

[0063] ⑥Constructing the world coordinate system: Through the above steps, each pixel in the depth map corresponds to a 3D point in the world coordinate system. These points together constitute the world coordinate system representation of the scene.

[0064] After the corresponding world coordinate system is constructed through the above process, the world coordinates of each pixel in the world coordinate system can be obtained, thereby determining the height information corresponding to each pixel. Then, a modulo operation can be performed based on the height information. For example, assuming that the height of a pixel in the world coordinate system is 10.03 meters, and the contour interval is every 5 meters, then the modulo operation is calculated as 10.3%5=0.03. When this value is less than 0.05, the pixel is set to black, otherwise it is set to white. Therefore, based on the black and white pixels, a contour map corresponding to the target scene can be presented. In the contour map, a line segment with a width of 0.05 decimeter is displayed at every 5 meters in height. Therefore, by adding corresponding material information to the scene map, a contour map corresponding to the target scene can be obtained, so that the user can intuitively perceive the terrain height corresponding to the target scene.

[0065] For the terrain height map, we can obtain the height information of each pixel in the scene graph in the world coordinate system and the upper limit of the height. The world coordinate system is a coordinate system constructed according to the depth map data of the target scene and the position information of the virtual camera. Then, we use the height information and the upper limit of the height to calculate and obtain the color ratio coefficient corresponding to each pixel. Then, we sample the color ratio coefficient corresponding to the pixel in the preset color map to obtain the terrain color corresponding to each pixel. Then, we dye the scene graph according to the terrain color, and display the height color map corresponding to the target scene based on the dyeing result.

[0066] It should be noted that, for the construction process of the world coordinate system, reference can be made to the description in the aforementioned embodiment, which will not be repeated here. After the height of each pixel in the world coordinate system is obtained, the height corresponding to the pixel can be calculated with the preset upper limit of the height to obtain the corresponding color ratio coefficient, which can be used to determine the color of the pixel. For example, by constructing a color map from bottom to top to indicate the color from low to high, the highest height corresponding to the entire target scene can be set, and then the height corresponding to each pixel is compared with the highest height. For example, the highest height in the world is 2000 meters, and the height of the obtained pixel is 1500 meters, then 1500 / 2000=0.75, that is, the pixel can sample the color with V of 0.75 in the UV of the color map as the terrain color, and then dye the pixel according to the terrain color, so that the corresponding terrain height map can be obtained by dyeing the entire scene map, so that the height change corresponding to the target scene can be intuitively presented through the terrain height map.

[0067] For the model color map, the target scene model is a road model, and the model color map is a road color map. After the road model is extracted from the scene model, different road models may correspond to different colors, and the display colors corresponding to each road model may be further obtained. The road model is then dyed according to the display colors, and the road color map corresponding to the target scene is displayed based on the dyeing result.

[0068] For example, different Stencil values ​​can be set for different road models, and different Stencil values ​​correspond to different display colors. In the process of constructing the model color map, after reading the Stencil values ​​corresponding to each road model, the colors corresponding to the Stencil values ​​are further obtained, and then the road models are dyed according to the obtained colors. The road color map corresponding to the target scene can be obtained, so that the relevant scene models in the target scene can be intuitively presented through the model color map.

[0069] For Stencil map values, different Stencil map values ​​can correspond to different material information (such as display color, etc.). By setting different Stencil map values ​​for different scene models, different material information can be added to different scene models, so that different scene models can be intuitively displayed in the scene graph. For example, for the first type of road, the Stencil map value can be set to 1, for the second type of road, the Stencil map value can be set to 2, and for the third type of road, the Stencil map value can be set to 3, 1, 2, and 3 correspond to blue, yellow, and green, respectively. When displaying these three types of roads, the first type of road can be displayed in blue, the second type of road can be displayed in yellow, and the third type of road can be displayed in green, etc., thereby intuitively displaying three different types of road models in the scene graph.

[0070] It should be noted that, in the above process, adding a single material information to the scene graph is taken as an example for illustrative explanation. It can be understood that multiple material adding entries are provided in the plug-in, and the user can choose to process the target scene according to at least one material to obtain a corresponding image. For example, the contour map can be combined with the road color map to display the terrain height of the target scene and the road model in the target scene at the same time. The terrain height map can also be combined with the road color map to display the terrain height change of the target scene and the road model in the target scene at the same time. The user can choose flexibly, and the present invention does not limit this.

[0071] Step 105: Take a screenshot of the target scene graph and output a terrain image set corresponding to the target scene graph.

[0072] After the corresponding target scene graph is constructed through the upload process, the user can take a screenshot of the target scene graph through the plug-in to obtain multiple images corresponding to the target scene graph, and construct a corresponding terrain image set based on the multiple images, so as to export the terrain image set and import it into another graphics processing software. By taking a screenshot of the scene graph with the corresponding materials added, the user can import the terrain image set into the corresponding image processing software for further map management and control, simplifying the data flow process and reducing the difficulty of use.

[0073] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that those skilled in the art can also make settings according to actual needs under the guidance of the ideas of the embodiments of the present invention, and the present invention is not limited to this.

[0074] In an embodiment of the present invention, for the terrain data processing of the target scene, after the user edits the terrain of the target scene, if the corresponding data needs to be exported for data processing in another graphics processing software, the user can export the terrain image set corresponding to the target scene through the corresponding plug-in to feed back the user's terrain modification of the target scene to the corresponding scene map. Specifically, the terrain data corresponding to the target scene can be obtained, the target scene can be divided into a number of blocks, and then a virtual camera for the target scene and a shooting angle corresponding to the virtual camera can be determined. During the loading process, the coordinate information corresponding to each block can be obtained, and the terrain corresponding to each block can be sequentially processed according to the shooting angle and the coordinate information. The shape data is loaded to obtain the scene graph corresponding to the target scene. By dividing the entire scene into several small-range blocks that support fast loading, the loading efficiency of the map is improved and the time for data loading is reduced. In addition, by determining at least one scene material information for the scene graph and adding an image effect corresponding to the scene material information to the scene graph, the target scene graph corresponding to the target scene is displayed, and then a screenshot of the target scene graph is taken to output a terrain image set corresponding to the target scene graph. By taking a screenshot of the scene graph with the corresponding material added, the user can import the terrain image set into the corresponding image processing software for further map management and control, simplifying the data flow process and reducing the difficulty of use.

[0075] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following examples are used for exemplary description:

[0076] As an example, when a user runs a plug-in for implementing the technical solution of the embodiment of the present invention in a corresponding graphics processing software, the plug-in can provide a corresponding control interface, and the control interface can provide a file import entry, a material processing entry, a model processing entry, and a resolution processing entry, etc. Among them, the file import entry is used to import the terrain data corresponding to the corresponding scene; the material processing entry can be used to determine whether to turn on the display of contour lines, display landscapes or terrain, display roads or paths, etc. When the display of the corresponding content is turned on, the scene can be processed based on the corresponding material information to display the corresponding content; the model processing entry allows the user to change the display material of the model, such as the display color, etc.; the resolution can be used to adjust the resolution of the image after the terrain data is rendered, etc., and the present invention does not limit this.

[0077] For example, when the user turns on the display of terrain and roads, by creating a corresponding virtual camera and loading the terrain data based on the virtual camera, the following can be displayed: Figure 4 The target scene graph shown in FIG. 1 can intuitively present the terrain corresponding to the target scene and the corresponding road model in the scene ( Figure 4The "crisscross" paths in the figure are the road models). Figure 5 As shown in , when the user only turns on the display of contour lines, after loading the corresponding scene graph, the scene graph can be processed and the contour line graph corresponding to the target scene can be displayed; Figure 6 As shown in , when the user only turns on the display of terrain, after loading the corresponding scene graph, the scene graph can be processed to display the terrain corresponding to the target scene through colors of different depths; Figure 7 As shown, when the user turns on the display of road models, after loading the corresponding scene graph, the road models in the target scene can be identified, and the road models can be assigned corresponding colors according to the Stencil graph values ​​corresponding to each road model, so that various road models can be displayed in different colors in the scene graph to obtain the corresponding road color map.

[0078] Furthermore, after obtaining the corresponding target scene graph by turning on the corresponding material processing function, the user can screenshot the target scene graph through the corresponding high-precision screenshot tool to obtain the corresponding image set. It should be noted that in the process of screenshot, the screenshot images can be sorted according to the corresponding coding rules, so that in the subsequent process, the image set can be merged based on the corresponding order to restore the target scene graph. For example, the size of each image can be read, and then the values ​​after the two letters A_B in the name of each image can be read. According to these two numbers, the corresponding plot coordinate system of each image when it is screenshotted in the graphics processing software is restored, and then according to the coordinate system, each image is restored to the corresponding position to obtain the corresponding target scene graph, so that by screenshotting the scene graph with the corresponding material added, the user can import the terrain image set in the corresponding image processing software, do further map control processing, simplify the data flow process, and reduce the difficulty of use.

[0079] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0080] Reference Figure 8 , shows a structural block diagram of a map data processing device provided in an embodiment of the present invention, which may specifically include the following modules:

[0081] The data acquisition module 801 is used to acquire terrain data corresponding to a target scene, where the target scene is divided into a number of blocks;

[0082] A camera determination module 802 is used to determine a virtual camera for the target scene and a shooting angle corresponding to the virtual camera;

[0083] The loading module 803 is used to obtain the coordinate information corresponding to each of the blocks, and load the terrain data corresponding to each of the blocks in turn according to the shooting angle and the coordinate information to obtain a scene graph corresponding to the target scene;

[0084] An image processing module 804 is used to determine at least one scene material information for the scene graph, add an image effect corresponding to the scene material information to the scene graph, and display a target scene graph corresponding to the target scene;

[0085] The image capture module 805 is used to capture the target scene graph and output a terrain image set corresponding to the target scene graph.

[0086] In some feasible implementations, the coordinate information is the center coordinates of the block, the shooting angle is an orthogonal angle, and the loading module 803 is specifically used for:

[0087] Along each of the central coordinates, the terrain data of each of the blocks is loaded in turn according to the orthogonal perspective, and a scene graph corresponding to the target scene is obtained based on the loading results.

[0088] In some feasible implementations, the loading module 803 is specifically used for:

[0089] Obtaining sequence marks corresponding to each of the blocks;

[0090] According to the order corresponding to the sequence marks, the virtual camera is controlled to move to the top of each center coordinate position in turn, the terrain data of the blocks are loaded with the orthogonal perspective, and the scene graph corresponding to the target scene is obtained based on the recorded results.

[0091] In some feasible implementations, the device further includes:

[0092] The box creation module is used to create a post-processing box for the virtual camera and set the virtual camera in the post-processing box, wherein different post-processing material information is configured in the post-processing box.

[0093] In some feasible implementations, the image processing module 804 is specifically used to:

[0094] In response to a material adding instruction for the target scene, at least one scene material information corresponding to the material adding instruction is extracted from the post-processing material information.

[0095] In some feasible implementations, the scene material information includes contour material information, the target scene graph includes a contour graph, and the image processing module 804 is specifically configured to:

[0096] If the scene material information is the contour material information, the contours corresponding to the target scene are calculated, and the contours are displayed in the scene graph, and a contour graph corresponding to the target scene is displayed.

[0097] In some feasible implementations, the image processing module 804 is specifically used to:

[0098] Acquire height information and contour line interval values ​​of each pixel point in the scene graph in a world coordinate system, where the world coordinate system is a coordinate system constructed according to the depth map data of the target scene and the position information of the virtual camera;

[0099] The height information and the contour line interval value are used to perform calculations to obtain a detection value corresponding to the pixel point;

[0100] Taking a pixel point in the target scene whose detection value is less than a preset threshold as a first pixel point, and taking a pixel point in the target scene whose detection value is greater than or equal to the preset threshold as a second pixel point;

[0101] Setting the first pixel point in the target scene to a first color, and setting the second pixel point in the target scene to a second color, and displaying a contour map corresponding to the target scene;

[0102] The first pixel points of the first color constitute the contour lines in the contour map.

[0103] In some feasible implementations, the scene material information includes height color material information, the target scene graph includes a height color graph, and the image processing module 804 is specifically used to:

[0104] If the scene material information is the height color material information, the terrain color corresponding to the target scene is calculated, and the scene graph is dyed according to the terrain color, and the terrain height map corresponding to the target scene is displayed based on the dyeing result.

[0105] In some feasible implementations, the image processing module 804 is specifically used to:

[0106] Obtaining height information and a height upper limit value of each pixel point in the scene graph in a world coordinate system, wherein the world coordinate system is a coordinate system constructed according to the depth map data of the target scene and the position information of the virtual camera;

[0107] The height information and the height upper limit are used to perform calculations to obtain a color ratio coefficient corresponding to each of the pixel points;

[0108] Performing color sampling on the color ratio coefficients corresponding to the pixel points in a preset color map to obtain the terrain color corresponding to each pixel point;

[0109] The scene graph is dyed according to the terrain color, and a height color graph corresponding to the target scene is displayed based on the dyeing result.

[0110] In some feasible implementations, the target scene includes a scene model, the scene material information includes model color material information, the target scene graph includes a model color graph, and the image processing module 804 is specifically used to:

[0111] If the scene material information is the model color material information, identifying the scene model from the scene graph, and extracting a target scene model from the scene model;

[0112] Obtaining the display color corresponding to the target scene model;

[0113] The target scene model is dyed according to the display color, and a model color map corresponding to the target scene is displayed based on the dyeing result.

[0114] In some feasible implementations, the target scene model is a road model, the model color map is a road color map, and the image processing module 804 is specifically used for:

[0115] The road model is dyed according to the display color, and a road color map corresponding to the target scene is displayed based on the dyeing result.

[0116] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0117] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, each process of the above-mentioned map data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0118] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned map data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0119] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0120] It should be understood by those skilled in the art that the embodiments of the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, EEPROM, Flash, and eMMC, etc.) containing computer-usable program codes.

[0121] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0124] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0126] A method for processing map data and a device for processing map data provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for processing map data, characterized in that: include: Acquire terrain data corresponding to a target scene, wherein the target scene is divided into a plurality of blocks; Determine a virtual camera for the target scene and a shooting angle of view corresponding to the virtual camera; Acquire coordinate information corresponding to each of the blocks, and sequentially load terrain data corresponding to each of the blocks according to the shooting angle of view and the coordinate information to obtain a scene graph corresponding to the target scene; Determine at least one scene material information for the scene graph, add an image effect corresponding to the scene material information to the scene graph, and display a target scene graph corresponding to the target scene; A screenshot is taken of the target scene graph, and a terrain image set corresponding to the target scene graph is output.

2. The method according to claim 1, characterized in that The coordinate information is the center coordinate of the block, the shooting angle is an orthogonal angle, and the terrain data corresponding to each block is loaded in sequence according to the shooting angle and the coordinate information to obtain a scene graph corresponding to the target scene, including: Along each of the central coordinates, the terrain data of each of the blocks are loaded in turn according to the orthogonal perspective, and a scene graph corresponding to the target scene is obtained based on the loading results.

3. The method according to claim 2, characterized in that The step of loading the terrain data of each block in sequence according to the orthogonal perspective along each of the central coordinates, and obtaining a scene graph corresponding to the target scene based on the loading result, includes: Obtaining sequence marks corresponding to each of the blocks; According to the order corresponding to the sequence marks, the virtual camera is controlled to move to the top of each center coordinate position in turn, the terrain data of the blocks are loaded with the orthogonal perspective, and the scene graph corresponding to the target scene is obtained based on the recorded results.

4. The method according to claim 1, characterized in that: After determining the virtual camera for the target scene, the method further includes: A post-processing box for the virtual camera is created, and the virtual camera is set in the post-processing box, wherein different post-processing material information is configured in the post-processing box.

5. The method according to claim 4, characterized in that The determining of at least one scene material information for the target scene includes: In response to a material adding instruction for the target scene, at least one scene material information corresponding to the material adding instruction is extracted from the post-processing material information.

6. The method according to claim 1, characterized in that The scene material information includes contour material information, the target scene graph includes a contour graph, and adding an image effect corresponding to the scene material information to the scene graph to display the target scene graph corresponding to the target scene includes: If the scene material information is the contour material information, the contours corresponding to the target scene are calculated, and the contours are displayed in the scene graph, and a contour graph corresponding to the target scene is displayed.

7. The method according to claim 6, characterized in that The step of calculating the contour lines corresponding to the target scene, displaying the contour lines in the scene graph, and displaying the contour line graph corresponding to the target scene includes: Acquire height information and contour line interval values ​​of each pixel point in the scene graph in a world coordinate system, where the world coordinate system is a coordinate system constructed according to the depth map data of the target scene and the position information of the virtual camera; The height information and the contour line interval value are used to perform calculations to obtain a detection value corresponding to the pixel point; Taking a pixel point in the target scene whose detection value is less than a preset threshold as a first pixel point, and taking a pixel point in the target scene whose detection value is greater than or equal to the preset threshold as a second pixel point; Setting the first pixel point in the target scene to a first color, and setting the second pixel point in the target scene to a second color, and displaying a contour map corresponding to the target scene; The first pixel points of the first color constitute the contour lines in the contour map.

8. The method according to claim 1, characterized in that The scene material information includes height color material information, the target scene graph includes a height color graph, and adding an image effect corresponding to the scene material information to the target scene to obtain a target scene graph corresponding to the target scene includes: If the scene material information is the height color material information, the terrain color corresponding to the target scene is calculated, and the scene graph is dyed according to the terrain color, and the terrain height map corresponding to the target scene is displayed based on the dyeing result.

9. The method according to claim 8, characterized in that The calculating the terrain color corresponding to the target scene, dyeing the scene graph according to the terrain color, and displaying the terrain height map corresponding to the target scene based on the dyeing result, includes: Obtaining height information and a height upper limit value of each pixel point in the scene graph in a world coordinate system, wherein the world coordinate system is a coordinate system constructed according to the depth map data of the target scene and the position information of the virtual camera; The height information and the height upper limit are used to perform calculations to obtain a color ratio coefficient corresponding to each of the pixel points; Performing color sampling on the color ratio coefficients corresponding to the pixel points in a preset color map to obtain the terrain color corresponding to each pixel point; The scene graph is dyed according to the terrain color, and a height color graph corresponding to the target scene is displayed based on the dyeing result.

10. The method according to claim 1, characterized in that The target scene includes a scene model, the scene material information includes model color material information, the target scene graph includes a model color graph, and adding an image effect corresponding to the scene material information to the scene graph to display the target scene graph corresponding to the target scene includes: If the scene material information is the model color material information, identifying the scene model from the scene graph, and extracting a target scene model from the scene model; Obtaining the display color corresponding to the target scene model; The target scene model is dyed according to the display color, and a model color map corresponding to the target scene is displayed based on the dyeing result.

11. The method according to claim 10, characterized in that The target scene model is a road model, the model color map is a road color map, and coloring the target scene model in the scene map according to the display color, and displaying the model color map corresponding to the target scene based on the coloring result, comprises: The road model is dyed according to the display color, and a road color map corresponding to the target scene is displayed based on the dyeing result.

12. A map data processing device, characterized in that: include: A data acquisition module, used to acquire terrain data corresponding to a target scene, wherein the target scene is divided into a plurality of blocks; A camera determination module, used to determine a virtual camera for the target scene and a shooting angle corresponding to the virtual camera; A loading module, used to obtain coordinate information corresponding to each of the blocks, and sequentially load terrain data corresponding to each of the blocks according to the shooting angle and the coordinate information, to obtain a scene graph corresponding to the target scene; An image processing module, used to determine at least one scene material information for the scene graph, add an image effect corresponding to the scene material information to the scene graph, and display a target scene graph corresponding to the target scene; The image capture module is used to capture the target scene graph and output a terrain image set corresponding to the target scene graph.

13. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 11 when executing the program stored in the memory.

14. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

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

    CN111773709A

  • Map generation method and device, computer equipment and computer readable storage medium

    CN114053708A

  • Virtual object rendering method and device, electronic equipment and storage medium

    CN117654030A

  • Game terrain rendering method and device, computer storage medium and electronic equipment

    CN118846502A

  • The image resource loading system and method whichcarries out loading of the object for renewal of agame screen

    KR1020050122045A