CN109949693B - Map drawing method and device, computing equipment and storage medium - Google Patents

Map drawing method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN109949693B
CN109949693B CN201910308355.XA CN201910308355A CN109949693B CN 109949693 B CN109949693 B CN 109949693B CN 201910308355 A CN201910308355 A CN 201910308355A CN 109949693 B CN109949693 B CN 109949693B
Authority
CN
China
Prior art keywords
map
baking
drawn
information
detail
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910308355.XA
Other languages
Chinese (zh)
Other versions
CN109949693A (en
Inventor
谭贤亮
杨林
李晶晶
程佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Xishanju Network Technology Co ltd
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Guangzhou Xishanju Network Technology Co ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Xishanju Network Technology Co ltd, Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Guangzhou Xishanju Network Technology Co ltd
Priority to CN201910308355.XA priority Critical patent/CN109949693B/en
Publication of CN109949693A publication Critical patent/CN109949693A/en
Application granted granted Critical
Publication of CN109949693B publication Critical patent/CN109949693B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Instructional Devices (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present specification provides a map drawing method, apparatus, computing device and storage medium, wherein the map drawing method comprises: acquiring multiple detail levels of a target terrain block in a map to be drawn; determining map scene data of a target terrain block at multiple detail levels, wherein the map scene data comprises color data, normal data and material information data; baking and rendering the multiple detail levels of the target terrain block based on the map scene data, and storing the generated baking information; receiving a map drawing instruction, acquiring baking information corresponding to multiple detail levels of a target terrain block which is baked, and drawing the map to be drawn based on the baking information. According to the method and the device, the map to be drawn is partitioned according to the distance between the map to be drawn and the virtual camera, the partitioned detail layers are baked to generate corresponding baking information, and when the map is required to be drawn, the baking information can be directly loaded to the corresponding position to achieve map drawing.

Description

Map drawing method and device, computing equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a map drawing method and apparatus, a computing device, and a storage medium.
Background
The method for drawing the large-scale map is always a research hotspot in the field of computer graphics, and the drawing of large-scale map scenes is widely applied in the fields of animation production, movies, game production and the like.
Although the development of display hardware is rapid in recent years, the magnitude of model data related to large-scale map scene drawing is larger and larger, and the rendering requirement is higher along with the technical development, so that the quantity of materials is large, the number of maps is increased, when map drawing is performed, the related materials are very complex, the quantity of shader instructions required to be used is often up to the magnitude of four digits, and the hardware performance is over-limited during real-time drawing.
Disclosure of Invention
In view of this, embodiments of the present specification provide a map drawing method, apparatus, computing device and storage medium, so as to solve technical defects in the prior art.
According to a first aspect of embodiments herein, there is provided a map drawing method including:
acquiring multiple detail levels of a target terrain block in a map to be drawn;
determining map scene data of multiple detail levels of the target terrain block, wherein the map scene data comprises color data, normal data and material information data;
baking and rendering the multiple detail levels of the target terrain block based on the map scene data, and storing the generated baking information;
receiving a map drawing instruction, acquiring baking information corresponding to multiple detail levels of a target terrain block which is baked, and drawing the map to be drawn based on the baking information.
Optionally, before obtaining multiple levels of detail of the target terrain block in the map to be drawn, the method further includes:
determining a map to be drawn;
dividing the map to be drawn into at least two multi-detail levels according to the distance between the map to be drawn and the virtual camera;
the obtaining of multiple levels of detail of a target terrain block in a map to be drawn comprises:
and determining the multi-detail level of which the distance between the at least two multi-detail levels and the virtual camera is greater than a preset distance threshold value as the multi-detail level of the target terrain block.
Optionally, performing baking rendering on multiple detail levels of the target terrain block based on the map scene data, and storing the generated baking information includes:
baking and rendering multiple detail levels of a target terrain block in a map to be drawn based on color data, normal data and material information data in map scene data, and generating a corresponding baking map;
determining baking information corresponding to the multiple detail levels of the target terrain block, wherein the baking information comprises baking maps obtained by baking the multiple detail levels of the target terrain block, and the number and the corresponding map position of the multiple detail levels of the target terrain block corresponding to each baking map;
and storing the baking information corresponding to the multiple detail levels of the target terrain block.
Optionally, after determining the baking information corresponding to the multiple detail levels of the target terrain block, before storing the baking information corresponding to the multiple detail levels of the target terrain block, the method further includes:
determining the precision of multiple detail levels of a target terrain block;
and respectively processing the baking maps in the baking information corresponding to the multiple detail levels of the target terrain block according to the precision to generate the baking maps corresponding to the precision.
Optionally, the map drawing instruction includes a map to be drawn, and the acquiring baking information corresponding to multiple detail levels of the target terrain block that has been baked includes:
acquiring parameter information of the map to be drawn;
and acquiring baking information corresponding to multiple detail levels of the target terrain block in the map to be drawn according to the parameter information.
Optionally, after obtaining baking information corresponding to multiple levels of detail of the target terrain block in the map to be drawn, the method further includes:
detecting illumination information in a map to be drawn, wherein the illumination information comprises a light source and the color and brightness of the light source;
and drawing the map to be drawn according to the baking information and the illumination information.
Optionally, the drawing the map to be drawn based on the baking information includes:
acquiring the designated map position of the multiple detail levels of the target terrain block corresponding to each baking map in the baking information in the map to be drawn;
and loading each baking map and the illumination information to the specified map position of the map to be drawn so as to realize the drawing of the preset area of the map to be drawn.
According to another aspect of embodiments herein, there is provided a map drawing apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is configured to acquire multiple detail levels of a target terrain block in a map to be drawn;
a first determination module configured to determine map scene data of multiple levels of detail for the target terrain block, the map scene data including color data, normal data, and material information data;
a processing module configured to perform baking rendering on multiple detail levels of the target terrain block based on the map scene data and store the generated baking information;
the drawing module is configured to receive a map drawing instruction, acquire baking information corresponding to multiple detail levels of a target terrain block which is baked, and draw the map to be drawn based on the baking information.
Optionally, the mapping apparatus further includes:
a second determination module configured to determine a map to be drawn;
the map dividing module is configured to divide the map to be drawn into at least two multi-detail levels according to the distance between the map to be drawn and the virtual camera;
the second obtaining module is further configured to determine, as the multi-level of detail of the target terrain, a multi-level of detail of the at least two multi-level of detail for which a distance to the virtual camera is greater than a preset distance threshold.
Optionally, the processing module comprises:
the rendering submodule is configured to bake and render multiple detail levels of a target terrain block in a map to be drawn based on color data, normal data and material information data in map scene data, and generate a corresponding baking map;
a baking sub-module configured to determine baking information corresponding to the multiple levels of detail of the target terrain block, the baking information including a baking map obtained by baking the multiple levels of detail of the target terrain block, a number of the multiple levels of detail of the target terrain block corresponding to each baking map, and a corresponding map position;
a storage sub-module configured to store the baking information corresponding to the multiple levels of detail of the target terrain block.
Optionally, the processing module further comprises:
a determination submodule configured to determine a precision of a plurality of levels of detail of a target terrain block;
and the processing sub-module is configured to process the baking maps in the baking information corresponding to the multiple detail levels of the target terrain block according to the precision respectively, and generate the baking maps corresponding to the precision.
Optionally, the rendering module comprises:
the first obtaining sub-module is configured to obtain parameter information of the map to be drawn;
and the second acquisition sub-module is configured to acquire baking information corresponding to multiple detail levels of the target terrain block in the map to be drawn according to the parameter information.
Optionally, the drawing module further comprises:
the detection sub-module is configured to detect illumination information in a map to be drawn, wherein the illumination information comprises a light source and the color and brightness of the light source;
and the drawing processing submodule is configured to draw the map to be drawn according to the baking information and the illumination information.
Optionally, the drawing module further comprises:
a third obtaining sub-module, configured to obtain a designated map position of a multi-detail level of the target terrain block corresponding to each baking map in the baking information in a map to be drawn;
and the drawing sub-module is configured to load each baking map to a specified map position of a map to be drawn so as to draw the preset area of the map to be drawn.
According to another aspect of embodiments of the present specification, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the mapping method when executing the instructions.
According to another aspect of embodiments of the present specification, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the mapping method.
In the embodiment of the specification, multiple detail levels of a target terrain block in a map to be drawn are obtained; determining map scene data of multiple detail levels of the target terrain block, wherein the map scene data comprises color data, normal data and material information data; baking and rendering the multiple detail levels of the target terrain block based on the map scene data, and storing the generated baking information; the method comprises the steps of partitioning the map to be drawn according to the distance between the map to be drawn and a virtual camera, baking the partitioned detail layers to generate corresponding baking information, directly loading the baking information to a corresponding position to realize map drawing without real-time drawing when the map drawing is needed, and overcoming the problem of hardware performance overrun when the map drawing is implemented in the prior art.
Drawings
FIG. 1 is a block diagram of a computing device provided by an embodiment of the present application;
FIG. 2 is a flow chart of a mapping method provided by an embodiment of the present application;
FIG. 3 is a diagram illustrating a mapping method according to an embodiment of the present disclosure;
FIG. 4 is a diagram illustrating a mapping method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a mapping apparatus according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the present application, a map drawing method, an apparatus, a computing device, and a storage medium are provided, and detailed descriptions are individually made in the following embodiments.
FIG. 1 shows a block diagram of a computing device 100, according to an embodiment of the present description. The components of the computing device 100 include, but are not limited to, memory 110 and processor 120. The processor 120 is coupled to the memory 110 via a bus 130 and a database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 140 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 100 and other components not shown in FIG. 1 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 1 is for purposes of example only and is not limiting as to the scope of the description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the mapping method shown in fig. 2. Fig. 2 shows a flow chart of a mapping method according to an embodiment of the present specification, including step 202 to step 208.
Step 202: and acquiring multiple detail levels of a target terrain block in a map to be drawn.
In an embodiment of the present specification, before obtaining multiple levels of detail (LODs) of a target terrain block in a map to be drawn, a map to be drawn may be determined, then a closest distance and a farthest distance between the map to be drawn and a virtual camera may be determined, and the map to be drawn is divided into n multiple levels of detail according to the closest distance and the farthest distance between the map to be drawn and the virtual camera, where n is a positive integer greater than or equal to 2, and an LOD of a target terrain block, which is greater than a preset distance threshold value, in the n multiple levels of detail is determined.
In an embodiment of this specification, taking n as an example, assuming that a closest distance between a map to be drawn and a virtual camera is d 1-20, a farthest distance is d 2-40, 10 detail levels are generated between the closest distance and the farthest distance, corresponding numbers are a1-a10 in sequence from near to far, and assuming that a preset distance threshold is d 3-24, it is determined that the LOD of a target ground block is 8 detail levels of numbers a3-a10, where a distance between each detail level and the virtual camera is smaller, a material effect of a corresponding map surface is richer, a distance between each detail level and the virtual camera is larger, a material and illumination information of the corresponding map surface are reduced, and a picture is rougher.
In an embodiment of this specification, in the LOD dividing process, detail levels may be added or merged according to actual needs, and distances of the detail levels may be equal or unequal, which is not limited herein.
Step 204: and determining multi-detail-level map scene data of the target terrain block, wherein the map scene data comprises color data, normal data and material information data.
Step 206: and performing baking rendering on the multiple detail levels of the target terrain block based on the map scene data, and storing the generated baking information.
In an embodiment of the present specification, step 206 may be implemented by steps shown in fig. 3, including step 302 to step 306.
Step 302: and baking and rendering the multiple detail levels of the target terrain blocks in the map to be drawn based on the color data, the normal data and the material information data in the map scene data, and generating corresponding baking maps.
In an embodiment of this specification, taking a game map as an example, if baking rendering is performed on a level of detail in the game map, map scene data in the game map, including composition data, material data, color data, normal data, and position data of a game model in the map in the level of detail, is read first, baking rendering is performed on an LOD of a target terrain block according to the obtained map scene data, where the baking rendering process is substantially a process of performing calculation according to different map scene data, and a main thread in a 3D engine sends a rendering command to at least one rendering thread, where the main thread is used to process logic of an application, and at least one of the rendering threads obtains the rendering command and updates a picture of the application according to the rendering command.
Step 304: and determining baking information corresponding to the multiple detail levels of the target terrain block, wherein the baking information comprises baking maps obtained by baking the multiple detail levels of the target terrain block, and the number and the corresponding map position of the multiple detail levels of the target terrain block corresponding to each baking map.
In an embodiment of the present specification, the baking information corresponding to the multiple levels of detail of the target terrain block is determined, that is, the number of the LOD of the target terrain block corresponding to each baking map is determined according to the number of the multiple levels of detail of the target terrain block, and then the position of the baking map corresponding to each baking map is determined according to the relative position of the target terrain block and the virtual camera in the map to be drawn, where the relative position of the target terrain block and the virtual camera in the map to be drawn can be obtained according to map scene data, and the baking map obtained by baking the multiple levels of detail of the target terrain block, the number of the multiple levels of detail of the target terrain block corresponding to each baking map, and the corresponding position of the baking map are used as the baking information corresponding to the multiple levels of detail of the target terrain block.
In one embodiment of the present description, after baking is completed, the accuracy of the LOD of the target terrain block is determined; and respectively processing the baking maps in the baking information corresponding to the LOD of the target terrain block according to the precision to generate the baking maps corresponding to the precision.
Step 306: and storing the baking information corresponding to the multiple detail levels of the target terrain block.
In an embodiment of the present specification, after all detail levels of a map to be drawn are baked, a baking map obtained by baking an LOD of a target terrain block according to map scene data in baking information corresponding to the baking map, a number of the LOD of the target terrain block corresponding to each baking map, and a corresponding map position are stored according to a specified format, so that a baking effect in a game map is achieved according to the baking information when a game is loaded, where the predetermined format includes a JPG format.
In an embodiment of the present description, as the model in the map is farther from the virtual camera, details on the model are not easily observed by naked eyes, the map may be divided into a plurality of detail levels according to the distance between the map and the virtual camera, the block baking rendering may be performed according to the generated detail levels, and the baking information corresponding to each detail level generated by the baking rendering may be stored according to the specified precision, so that the rendering performance of the map may be effectively improved.
Step 208: receiving a map drawing instruction, acquiring baking information corresponding to multiple detail levels of a target terrain block which is baked, and drawing the map to be drawn based on the baking information.
In an embodiment of the present specification, step 208 may be implemented by steps shown in fig. 4, including step 402 to step 408.
Step 402: and acquiring the parameter information of the map to be drawn.
In an embodiment of the present specification, the map drawing instruction includes a map to be drawn, and after the map drawing instruction is received, parameter information of the map to be drawn is acquired, where the parameter information includes a material and a precision corresponding to an LOD of a target terrain block in the map to be drawn, and the precision of the LOD may be determined by a distance between the map to be drawn and the virtual camera and a terrain height.
In an embodiment of the present specification, after baking information corresponding to multiple levels of detail of a target terrain block in the map to be drawn is acquired, illumination information in the map to be drawn is detected, where the illumination information includes a light source and a color and a brightness of the light source.
Step 404: and acquiring baking information corresponding to multiple detail levels of the target terrain block in the map to be drawn according to the parameter information.
In an embodiment of the present specification, baking information corresponding to the LOD of the target terrain is acquired according to parameter information of a map to be drawn, wherein an area in the map to be drawn, in which a distance between the area and a virtual camera is greater than a preset distance threshold, is determined as a target drawing area, a level of detail obtained by dividing the target drawing area is determined as the LOD of the target terrain, and an area in the map to be drawn, in which the distance between the area and the virtual camera is less than the preset distance threshold, is determined as a real-time drawing area.
Step 406: and acquiring the LOD of the target terrain block corresponding to each baking map in the baking information at the specified map position in the map to be drawn.
Step 408: and loading each baking map and the illumination information to the specified map position of the map to be drawn so as to realize the drawing of the preset area of the map to be drawn.
In an embodiment of the present specification, the baking information includes baking maps obtained by baking LODs of the target terrain blocks according to map scene data, numbers of LODs of the target terrain blocks corresponding to each baking map, and corresponding map positions, the illumination information includes colors and brightness of a light source and the light source, and the baking maps and the illumination information are loaded to corresponding positions according to the map position of each baking map in the map to be drawn, so as to implement drawing of a target drawing area of the map to be drawn.
In an embodiment of the present specification, an LOD of a target terrain block is baked according to map scene data in a map to be drawn, generated baking information is stored, and when the map to be drawn is drawn, corresponding baking information is directly loaded to a specified position of the map to be drawn to complete a map drawing process, so that real-time rendering is not required, a problem of hardware performance overrun in real-time drawing in the prior art is overcome, loading of a game map is more efficient, and user experience is improved.
Corresponding to the above method embodiment, the present specification further provides a map drawing apparatus embodiment, and fig. 5 shows a schematic structural diagram of the map drawing apparatus according to an embodiment of the present specification. As shown in fig. 5, the apparatus includes: a first acquisition module 502, a first determination module 504, a processing module 506, and a rendering module 508.
A first obtaining module 502 configured to obtain multiple levels of detail of a target terrain block in a map to be drawn;
a first determining module 504 configured to determine map scene data of multiple levels of detail for the target terrain block, the map scene data including color data, normal data, and texture information data;
a processing module 506 configured to perform baking rendering on the multiple detail levels of the target terrain block based on the map scene data and store the generated baking information;
the drawing module 508 is configured to receive a map drawing instruction, acquire baking information corresponding to multiple detail levels of the target terrain block that has been baked, and draw the map to be drawn based on the baking information.
In an embodiment of the present specification, the mapping apparatus further includes:
a second determination module configured to determine a map to be drawn;
the map dividing module is configured to divide the map to be drawn into at least two multi-detail levels according to the distance between the map to be drawn and the virtual camera;
the second acquisition module is further configured to determine, as the LOD of the target terrain block, a multi-level of detail of the at least two multi-level of detail having a distance to the virtual camera greater than a preset distance threshold.
In an embodiment of the present specification, before obtaining an LOD of a target terrain block in a map to be drawn, a map to be drawn needs to be determined, then a closest distance and a farthest distance between the map to be drawn and a virtual camera are determined, the map to be drawn is divided into n LODs according to the closest distance and the farthest distance between the map to be drawn and the virtual camera, where n is a positive integer greater than or equal to 2, and an LOD, of the n LODs, whose distance from the virtual camera is greater than a preset distance threshold value is determined as an LOD of the target terrain block.
In an embodiment of this specification, in the LOD dividing process, detail levels may be added or merged according to actual needs, and distances of the detail levels may be equal or unequal, which is not limited herein.
In an embodiment of the present specification, the processing module includes:
the rendering submodule is configured to perform baking rendering on the LOD of a target terrain block in the map to be drawn based on color data, normal data and material information data in the map scene data, and generate a corresponding baking map;
a baking sub-module configured to determine baking information corresponding to the multiple levels of detail of the target terrain block, the baking information including a baking map obtained by baking the multiple levels of detail of the target terrain block, a number of the multiple levels of detail of the target terrain block corresponding to each baking map, and a corresponding map position;
a storage sub-module configured to store the baking information corresponding to the LOD of the target terrain block.
In an embodiment of the present specification, the baking information corresponding to the multiple levels of detail of the target terrain block is determined, that is, the number of the LOD of the target terrain block corresponding to each baking map is determined according to the number of the multiple levels of detail of the target terrain block, and then the position of the baking map corresponding to each baking map is determined according to the relative position of the target terrain block and the virtual camera in the map to be drawn, where the relative position of the target terrain block and the virtual camera in the map to be drawn can be obtained according to map scene data, and the baking map obtained by baking the multiple levels of detail of the target terrain block, the number of the multiple levels of detail of the target terrain block corresponding to each baking map, and the corresponding position of the baking map are used as the baking information corresponding to the multiple levels of detail of the target terrain block.
In an embodiment of this specification, the processing module further includes:
a determination submodule configured to determine an accuracy of the LOD of the target terrain block;
and the processing sub-module is configured to process the baking maps in the baking information corresponding to the LOD of the target terrain block according to the precision, and generate the baking maps corresponding to the precision.
In an embodiment of this specification, if baking rendering is performed on a detail level in the map to be rendered, map scene data, including material data, color data, and normal data, in the map to be rendered is read first, baking rendering is performed according to an LOD of a target terrain block of the obtained map scene data pair, a baking rendering process is substantially a process of performing calculation according to different map scene data, and a main thread in a 3D engine sends a rendering command to at least one rendering thread, where the main thread is used to process an application logic, and the at least one rendering thread acquires the rendering command and updates an application picture according to the rendering command.
In an embodiment of the present specification, after baking is completed, the accuracy of the LOD of the target land mass is determined; and respectively processing the baking maps in the baking information corresponding to the LOD of the target terrain block according to the precision, generating the baking maps corresponding to the precision, and storing the baking maps, the number of the LOD of the target terrain block corresponding to each baking map and the corresponding map position according to a specified format, so that the baking effect in the game map is realized according to the baking information when the game is loaded.
In an embodiment of the present specification, the drawing module includes:
the first obtaining sub-module is configured to obtain parameter information of the map to be drawn;
and the second acquisition sub-module is configured to acquire baking information corresponding to the LOD of the target terrain block in the map to be drawn according to the parameter information.
In an embodiment of this specification, the drawing module further includes:
the detection sub-module is configured to detect illumination information in a map to be drawn, wherein the illumination information comprises a light source and the color and brightness of the light source;
and the drawing processing submodule is configured to draw the map to be drawn according to the baking information and the illumination information.
In an embodiment of this specification, the drawing module further includes:
a third obtaining sub-module, configured to obtain a specified map position of the LOD of the target terrain block corresponding to each baked map in the baking information in the map to be drawn;
and the drawing sub-module is configured to load each baking map to a specified map position of a map to be drawn so as to draw the preset area of the map to be drawn.
In an embodiment of the present specification, the map drawing instruction includes a map to be drawn, and after the map drawing instruction is received, parameter information of the map to be drawn is acquired, where the parameter information includes a material and a precision corresponding to an LOD of a target terrain block in the map to be drawn, and the precision of the LOD may be determined by a distance between the map to be drawn and the virtual camera and a terrain height.
In an embodiment of the present specification, after baking information corresponding to multiple levels of detail of a target terrain block in the map to be drawn is acquired, illumination information in the map to be drawn is detected, where the illumination information includes a light source and a color and a brightness of the light source.
In an embodiment of the present specification, baking information corresponding to the LOD of the target terrain is acquired according to parameters of a map to be drawn, wherein an area in the map to be drawn, in which a distance between the area and a virtual camera is greater than a preset distance threshold, is determined as a target drawing area, a level of detail obtained by dividing the target drawing area is determined as the LOD of the target terrain, and an area in the map to be drawn, in which the distance between the area and the virtual camera is less than the preset distance threshold, is determined as a real-time drawing area.
In an embodiment of the present specification, the baking information includes a baking map obtained by baking the LOD of the target terrain block according to map scene data, a number of the LOD of the target terrain block corresponding to each baking map, and a corresponding map position, and the baking map and the illumination information are loaded to corresponding positions according to the map position of each baking map in the map to be drawn, so as to implement drawing of the target drawing area of the map to be drawn.
In an embodiment of the description, the LODs of the target terrain blocks in the map to be drawn are baked in advance, and the baking information is stored according to a specified format, so that real-time rendering is not required during drawing, the defect that the hardware performance is over-limit during real-time drawing in the prior art is overcome, the loading efficiency of a game map scene is improved, and the game experience of a user is facilitated to be improved.
There is also provided in an embodiment of the present specification a computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the mapping method when executing the instructions.
An embodiment of the present application also provides a computer readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the mapping method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the above-mentioned map drawing method, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the above-mentioned map drawing method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (14)

1. A map drawing method, comprising:
acquiring multiple detail levels of a target terrain block in a map to be drawn;
determining map scene data of multiple detail levels of the target terrain block, wherein the map scene data comprises color data, normal data and material information data;
baking and rendering the multiple detail levels based on the color data, the normal data and the material information data, and generating corresponding baking maps;
determining baking information corresponding to the multiple detail levels, and storing the baking information, wherein the baking information comprises baking maps obtained by baking the multiple detail levels, numbers of the multiple detail levels corresponding to each baking map and corresponding map positions;
receiving a map drawing instruction, acquiring baking information corresponding to multiple detail levels of a target terrain block which is baked, and drawing the map to be drawn based on the baking information.
2. The method of claim 1, wherein prior to obtaining multiple levels of detail of a target terrain block in a map to be rendered, further comprising:
determining a map to be drawn;
dividing the map to be drawn into at least two multi-detail levels according to the distance between the map to be drawn and the virtual camera;
the obtaining of multiple levels of detail of a target terrain block in a map to be drawn comprises:
and determining the multi-detail level of which the distance between the at least two multi-detail levels and the virtual camera is greater than a preset distance threshold value as the multi-detail level of the target terrain block.
3. The method of claim 1, wherein after determining the baking information corresponding to the multi-level of detail of the target terrain block and before storing the baking information corresponding to the multi-level of detail of the target terrain block, further comprising:
determining the precision of multiple detail levels of a target terrain block;
and respectively processing the baking maps in the baking information corresponding to the multiple detail levels of the target terrain block according to the precision to generate the baking maps corresponding to the precision.
4. The method according to claim 1, wherein the map drawing instruction includes a map to be drawn, and the obtaining baking information corresponding to multiple levels of detail of the target terrain block for which baking is completed comprises:
acquiring parameter information of the map to be drawn;
and acquiring baking information corresponding to multiple detail levels of the target terrain block in the map to be drawn according to the parameter information.
5. The method of claim 4, wherein after obtaining baking information corresponding to multiple levels of detail of a target terrain block in the map to be rendered, further comprising:
detecting illumination information in a map to be drawn, wherein the illumination information comprises a light source and the color and brightness of the light source;
and drawing the map to be drawn according to the baking information and the illumination information.
6. The method of claim 1, wherein the mapping the map to be mapped based on the baking information comprises:
acquiring the designated map position of the multiple detail levels of the target terrain block corresponding to each baking map in the baking information in the map to be drawn;
and loading each baking map and the illumination information to the specified map position of the map to be drawn so as to realize the drawing of the preset area of the map to be drawn.
7. A map drawing apparatus, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is configured to acquire multiple detail levels of a target terrain block in a map to be drawn;
a first determination module configured to determine map scene data of multiple levels of detail for the target terrain block, the map scene data including color data, normal data, and material information data;
a processing module configured to perform baking rendering on the multiple levels of detail based on the color data, the normal data, and the material information data, and generate a corresponding baking map;
the processing module is further configured to determine baking information corresponding to the multiple detail levels, and store the baking information, wherein the baking information comprises baking maps obtained by baking the multiple detail levels, numbers of the multiple detail levels corresponding to each baking map and corresponding map positions;
the drawing module is configured to receive a map drawing instruction, acquire baking information corresponding to multiple detail levels of a target terrain block which is baked, and draw the map to be drawn based on the baking information.
8. The apparatus of claim 7, further comprising:
a second determination module configured to determine a map to be drawn;
the map dividing module is configured to divide the map to be drawn into at least two multi-detail levels according to the distance between the map to be drawn and the virtual camera;
the second obtaining module is further configured to determine, as the multi-level of detail of the target terrain, a multi-level of detail of the at least two multi-level of detail for which a distance to the virtual camera is greater than a preset distance threshold.
9. The apparatus of claim 7, wherein the processing module further comprises:
a determination submodule configured to determine a precision of a plurality of levels of detail of a target terrain block;
and the processing sub-module is configured to process the baking maps in the baking information corresponding to the multiple detail levels of the target terrain block according to the precision respectively, and generate the baking maps corresponding to the precision.
10. The apparatus of claim 7, wherein the rendering module comprises:
the first obtaining sub-module is configured to obtain parameter information of the map to be drawn;
and the second acquisition sub-module is configured to acquire baking information corresponding to multiple detail levels of the target terrain block in the map to be drawn according to the parameter information.
11. The apparatus of claim 10, wherein the rendering module further comprises:
the detection sub-module is configured to detect illumination information in a map to be drawn, wherein the illumination information comprises a light source and the color and brightness of the light source;
and the drawing processing submodule is configured to draw the map to be drawn according to the baking information and the illumination information.
12. The apparatus of claim 7, wherein the rendering module comprises:
a third obtaining sub-module, configured to obtain a designated map position of a multi-detail level of the target terrain block corresponding to each baking map in the baking information in a map to be drawn;
and the drawing sub-module is configured to load each baking map and the illumination information to a specified map position of the map to be drawn so as to draw the preset area of the map to be drawn.
13. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1-6 when executing the instructions.
14. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 6.
CN201910308355.XA 2019-04-17 2019-04-17 Map drawing method and device, computing equipment and storage medium Active CN109949693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910308355.XA CN109949693B (en) 2019-04-17 2019-04-17 Map drawing method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910308355.XA CN109949693B (en) 2019-04-17 2019-04-17 Map drawing method and device, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109949693A CN109949693A (en) 2019-06-28
CN109949693B true CN109949693B (en) 2021-12-10

Family

ID=67015428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910308355.XA Active CN109949693B (en) 2019-04-17 2019-04-17 Map drawing method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109949693B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111524231B (en) * 2020-05-20 2024-01-26 网易(杭州)网络有限公司 Virtual terrain processing method and device, electronic equipment and storage medium
CN112245926B (en) * 2020-11-16 2022-05-17 腾讯科技(深圳)有限公司 Virtual terrain rendering method, device, equipment and medium
CN112843735B (en) * 2020-12-31 2022-12-02 上海米哈游天命科技有限公司 Game picture shooting method, device, equipment and storage medium
CN112907741B (en) * 2021-02-05 2024-02-02 深圳市润谦科技有限公司 Terrain scene generation method and device, electronic equipment and storage medium
CN113808246B (en) * 2021-09-13 2024-05-10 深圳须弥云图空间科技有限公司 Method and device for generating map, computer equipment and computer readable storage medium
CN114677467B (en) * 2022-05-30 2022-09-02 腾讯科技(深圳)有限公司 Terrain image rendering method, device, equipment and computer readable storage medium
CN116824082B (en) * 2023-08-30 2024-02-23 腾讯科技(深圳)有限公司 Virtual terrain rendering method, device, equipment, storage medium and program product

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504661A (en) * 2009-03-12 2009-08-12 北京英特图原信息技术有限责任公司 System and method for providing three-dimensional geographic information
CN101593361A (en) * 2009-06-25 2009-12-02 北京航空航天大学 A kind of large-scale terrain rendering system based on double-layer nested grid
CN102074049A (en) * 2011-03-01 2011-05-25 哈尔滨工程大学 Wide-range terrain scheduling simplifying method based on movement of viewpoint
CN102651141A (en) * 2012-03-30 2012-08-29 北京师范大学 Method for automatically superposing and rendering vector map and high-resolution digital elevation models in large scene
CN103077497A (en) * 2011-10-26 2013-05-01 中国移动通信集团公司 Method and device for zooming image in level-of-detail model
CN104157011A (en) * 2014-09-05 2014-11-19 电子科技大学 Modeling method for three-dimensional terrain
CN104766360A (en) * 2015-03-09 2015-07-08 腾讯科技(深圳)有限公司 Rendering method and device of three-dimensional space data
CN109102560A (en) * 2018-08-09 2018-12-28 腾讯科技(深圳)有限公司 Threedimensional model rendering method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504661A (en) * 2009-03-12 2009-08-12 北京英特图原信息技术有限责任公司 System and method for providing three-dimensional geographic information
CN101593361A (en) * 2009-06-25 2009-12-02 北京航空航天大学 A kind of large-scale terrain rendering system based on double-layer nested grid
CN102074049A (en) * 2011-03-01 2011-05-25 哈尔滨工程大学 Wide-range terrain scheduling simplifying method based on movement of viewpoint
CN103077497A (en) * 2011-10-26 2013-05-01 中国移动通信集团公司 Method and device for zooming image in level-of-detail model
CN102651141A (en) * 2012-03-30 2012-08-29 北京师范大学 Method for automatically superposing and rendering vector map and high-resolution digital elevation models in large scene
CN104157011A (en) * 2014-09-05 2014-11-19 电子科技大学 Modeling method for three-dimensional terrain
CN104766360A (en) * 2015-03-09 2015-07-08 腾讯科技(深圳)有限公司 Rendering method and device of three-dimensional space data
CN109102560A (en) * 2018-08-09 2018-12-28 腾讯科技(深圳)有限公司 Threedimensional model rendering method and device

Also Published As

Publication number Publication date
CN109949693A (en) 2019-06-28

Similar Documents

Publication Publication Date Title
CN109949693B (en) Map drawing method and device, computing equipment and storage medium
CN109961507B (en) Face image generation method, device, equipment and storage medium
CN110570506B (en) Map resource management method, device, computing equipment and storage medium
CN114972632A (en) Image processing method and device based on nerve radiation field
US10846887B2 (en) Machine vision processing system
CN111127624A (en) Illumination rendering method and device based on AR scene
CN110570507A (en) Image rendering method and device
US10922852B2 (en) Oil painting stroke simulation using neural network
WO2018177112A1 (en) Object rendering method, device, storage medium, and electronic device
CN108230434B (en) Image texture processing method and device, storage medium and electronic device
CN110544291A (en) Image rendering method and device
CN110866965A (en) Mapping drawing method and device for three-dimensional model
CN109377552B (en) Image occlusion calculating method, device, calculating equipment and storage medium
CN115423923A (en) Model rendering method and device
CN114757837A (en) Target model rendering method, device and storage medium
CN111111179A (en) Unity-based graphics resource loading method and device
CN109558676B (en) Collision detection method and device, computing equipment and storage medium
KR20230167746A (en) Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions
CN109529349B (en) Image drawing method and device, computing equipment and storage medium
CN112604279A (en) Special effect display method and device
CN111784807A (en) Virtual character drawing method and device
CN113509722B (en) Data processing method and device
CN109920045B (en) Scene shadow drawing method and device, computing equipment and storage medium
CN111080763A (en) Method and device for merging maps
CN110300266B (en) Lens moving method and system, computing device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant after: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Applicant after: Guangzhou Xishanju Network Technology Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Applicant before: GUANGZHOU SEASUN ENTERTAINMENT NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Patentee after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Patentee after: Guangzhou Xishanju Network Technology Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Patentee before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Patentee before: Guangzhou Xishanju Network Technology Co.,Ltd.

CP01 Change in the name or title of a patent holder