Terrain model processing method and device, storage medium and electronic device

By determining the target area and coverage area of ​​the foothill model in a virtual scene, and generating a terrace model based on the intersection relationship, the problem of low efficiency in generating terrace models in existing technologies is solved, and automated and efficient terrace model generation is achieved.

CN119445014BActive Publication Date: 2026-02-27GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411464210.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2026-02-27
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

Existing technologies for generating plateau models are inefficient, often resulting from manually adding or editing the foothill model of the terrain model.

Method used

By acquiring mountain and road models in the virtual scene, the target area of ​​the foothill model on the mountain model and the coverage area of ​​the road model are determined. Based on the intersection relationship, the target sub-mountain area is determined in the target mountain area, and the sub-foothill model located on the target sub-mountain area in the foothill model is converted into a plateau model.

Benefits of technology

It achieves automated generation of terrace models, improves generation efficiency, avoids the inefficient method of manual addition or editing, and increases the speed of generating terrace models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445014B_ABST
    Figure CN119445014B_ABST
Patent Text Reader

Abstract

The application discloses a terrain model processing method and device, a storage medium and an electronic device. The method comprises the following steps: obtaining a mountain model and a road model to be processed in a virtual scene, wherein the mountain model comprises a mountain foot model; determining a target mountain area where the mountain foot model is located on the mountain model, and a coverage area of the road model; determining a target sub-mountain area in the target mountain area based on the coverage area, wherein the target sub-mountain area is used to represent a mountain area on the mountain foot model where a mesa model is to be generated, and the target sub-mountain area is independent of the coverage area; and converting a sub-mountain foot model on the target sub-mountain area in the mountain foot model into the mesa model. The present application solves the technical problem of low efficiency in generating the mesa model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer graphics, and particularly relates to a terrain model processing method and device, a storage medium and an electronic device. BACKGROUND

[0002] At present, in the processing of a terrain model, the terrain model generated by an automatic manner has high repeatability. In order to add changes to a map, a mesa model needs to be generated on the terrain model.

[0003] In the related art, the mesa model is usually generated by manually adding and editing a hill foot model of the terrain model, thereby causing the technical problem of low efficiency in generating the mesa model.

[0004] In view of the above problem of low efficiency in generating the mesa model, no effective solution has been proposed at present. SUMMARY

[0005] Embodiments of the present disclosure at least provide a terrain model processing method and device, a storage medium and an electronic device to at least solve the technical problem of low efficiency in generating a mesa model.

[0006] According to an embodiment of the present disclosure, a terrain model processing method is provided. The method can include: obtaining a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a hill foot model; determining a target mountain region where the hill foot model is located on the mountain model, and a coverage region of the road model; determining a target sub-mountain region in the target mountain region based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the hill foot model where a mesa model is to be generated, and the target sub-mountain region and the coverage region are independent of each other; and converting a sub-hill foot model in the hill foot model located on the target sub-mountain region into the mesa model.

[0007] According to an embodiment of the present disclosure, a terrain model processing device is also provided. The device can include: an obtaining unit configured to obtain a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a hill foot model; a first determining unit configured to determine a target mountain region where the hill foot model is located on the mountain model, and a coverage region of the road model; a second determining unit configured to determine a target sub-mountain region in the target mountain region based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the hill foot model where a mesa model is to be generated, and the target sub-mountain region and the coverage region are independent of each other; and a converting unit configured to convert a sub-hill foot model in the hill foot model located on the target sub-mountain region into the mesa model.

[0008] According to an embodiment of the present disclosure, a computer readable storage medium is also provided. The computer readable storage medium stores a computer program. The computer program is configured to execute the terrain model processing method in any of the above embodiments when the computer program is run.

[0009] According to an embodiment of the present disclosure, an electronic device is also provided. The electronic device can include a memory and a processor. The memory stores a computer program. The processor is configured to execute the terrain model processing method in any of the above embodiments when the computer program is run.

[0010] According to an embodiment of the present disclosure, a computer program product is also provided. The computer program product can include a computer program. The computer program is configured to execute the terrain model processing method in any of the above embodiments when the computer program is run.

[0011] According to an embodiment of the present disclosure, a computer program product is also provided. The computer program product can include a non-volatile computer readable storage medium. The non-volatile computer readable storage medium stores a computer program. The computer program is configured to execute the terrain model processing method in any of the above embodiments when the computer program is run.

[0012] According to an embodiment of the present disclosure, a computer program is also provided. The computer program is configured to execute the terrain model processing method in any of the above embodiments when the computer program is run.

[0013] In at least some embodiments of the present disclosure, a mountain model and a road model to be processed in a virtual scene are obtained, wherein the mountain model includes a mountain foot model; a target mountain region where the mountain foot model is located on the mountain model is determined, and a coverage region of the road model is determined; a target sub-mountain region is determined in the target mountain region based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region of the mountain foot model where a mesa model is to be generated, and the target sub-mountain region is independent of the coverage region; and a sub-mountain foot model in the mountain foot model located on the target sub-mountain region is converted into the mesa model. That is, according to an embodiment of the present disclosure, a target sub-mountain region independent of the coverage region is determined based on the intersection relationship between the coverage region of the road model and the target mountain region where the mountain foot model is located on the mountain model, and a sub-mountain foot model in the mountain foot model located on the target sub-mountain region is further converted into the mesa model, so as to automatically generate the mesa model, avoid generating the mesa model by manually adding or editing, and further improve the efficiency of generating the mesa model, thereby solving the technical problem of low efficiency of generating the mesa model. BRIEF DESCRIPTION OF DRAWINGS

[0014] The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this application, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure. In the drawings:

[0015] Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to an embodiment of the present disclosure;

[0016] Figure 2 FIG. 2 is a flowchart of a terrain model processing method according to an embodiment of the present disclosure;

[0017] Figure 3 FIG. 3 is a schematic diagram of a region mask according to an embodiment of the present disclosure;

[0018] Figure 4 FIG. 4 is a schematic diagram of a base mountain model mask according to an embodiment of the present disclosure;

[0019] Figure 5 FIG. 5 is a schematic diagram of obtaining a mountain model mesh according to an embodiment of the present disclosure;

[0020] Figure 6 FIG. 6 is a schematic diagram of obtaining a large mountain model mask according to an embodiment of the present disclosure;

[0021] Figure 7 FIG. 7 is a schematic diagram of obtaining a road model mask according to an embodiment of the present disclosure;

[0022] Figure 8 FIG. 8 is a schematic diagram of a road model mask according to an embodiment of the present disclosure;

[0023] Figure 9 FIG. 9 is a schematic diagram of obtaining a region mask where a mountain foot model covers a road model according to an embodiment of the present disclosure;

[0024] Figure 10 FIG. 10 is a schematic diagram of deleting a region mask where a mountain foot model covers a road model according to an embodiment of the present disclosure;

[0025] Figure 11 FIG. 11 is a schematic diagram of looping over regions with consistent attributes according to an embodiment of the present disclosure;

[0026] Figure 12 FIG. 12 is a schematic diagram of deleting regions according to region area according to an embodiment of the present disclosure;

[0027] Figure 13 FIG. 13 is a schematic diagram of deleting regions according to distance according to an embodiment of the present disclosure;

[0028] Figure 14FIG. 6 is a schematic diagram of a delete region post-mask according to an embodiment of the present disclosure;

[0029] Figure 15 FIG. 7 is a schematic diagram of obtaining a mesa model mask according to an embodiment of the present disclosure;

[0030] Figure 16 FIG. 8 is a schematic diagram of pre-processing a mesh cropped according to the mesa model mask according to an embodiment of the present disclosure;

[0031] Figure 17 FIG. 9 is a schematic diagram of obtaining a first mesh according to an embodiment of the present disclosure;

[0032] Figure 18 FIG. 10 is a schematic diagram of obtaining a second mesh according to an embodiment of the present disclosure;

[0033] Figure 19 FIG. 11 is a schematic diagram of mixing the first mesh and the second mesh according to an embodiment of the present disclosure;

[0034] Figure 20 FIG. 12 is a schematic diagram of obtaining a third mesh according to an embodiment of the present disclosure;

[0035] Figure 21 FIG. 13 is a schematic diagram of obtaining a mesa model mask according to an embodiment of the present disclosure;

[0036] Figure 22 FIG. 14 is a schematic diagram of obtaining a base platform terrain model according to an embodiment of the present disclosure;

[0037] Figure 23 FIG. 15 is a schematic diagram of a base platform terrain model according to an embodiment of the present disclosure;

[0038] Figure 24 FIG. 16 is a schematic diagram of warping a base platform terrain model according to an embodiment of the present disclosure;

[0039] Figure 25 FIG. 17 is a schematic diagram of blurring a base platform terrain model according to an embodiment of the present disclosure;

[0040] Figure 26 FIG. 18 is a schematic diagram of a generation effect of a mesa model according to an embodiment of the present disclosure;

[0041] Figure 27 FIG. 19 is a structural block diagram of a terrain model processing apparatus according to an embodiment of the present disclosure;

[0042] Figure 28 FIG. 20 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0043] In order to enable personnel in the technical field to better understand the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative labor should fall within the scope of protection of the present disclosure.

[0044] It should be noted that the terms "first", "second", and the like in the specification and claims of the present disclosure and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0045] In a possible implementation, when a mesa model needs to be generated, the mesa model can usually be generated by manually adding, editing a mountain foot model of a terrain model, etc. However, the inventors have found through practice and careful study that if the above method is used to generate the mesa model, the efficiency of manually adding and editing is low, and therefore there is a technical problem of low efficiency of generating the mesa model.

[0046] Based on the above, the embodiments of the present disclosure provide a processing method of a terrain model, which acquires a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a mountain foot model; determines a target mountain region where the mountain foot model is located on the mountain model, and a coverage region of the road model; determines a target sub-mountain region in the target mountain region based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region of the mountain foot model where a mesa model is to be generated, and the target sub-mountain region and the coverage region are independent of each other; and converts a sub-mountain foot model in the mountain foot model located on the target sub-mountain region into a mesa model, thereby achieving the technical effect of improving the efficiency of generating the mesa model.

[0047] In the related art, when a mesa model is generated by manually adding or editing a mountain foot model of a terrain model, there is a technical problem of low efficiency in generating the mesa model. However, in the embodiments of the present disclosure, a target sub-mountain region independent of the coverage region is determined based on the intersection relationship between the coverage region of the road model and the target mountain region on the mountain model where the mountain foot model is located, and a sub-mountain foot model in the mountain foot model located on the target sub-mountain region is converted into a mesa model, thereby achieving the technical effect of improving the efficiency of generating the mesa model, and solving the technical problem of low efficiency in generating the mesa model.

[0048] According to an embodiment of the method for processing a terrain model according to the present disclosure, it should be noted that the steps shown in the flowchart can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0049] The method embodiment can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the case of running on a mobile terminal, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a mobile Internet device (Mobile Internet Devices, abbreviated as MID), a tablet computer (PAD), a game console and other terminal devices. Figure 1 is a hardware structure block diagram of a mobile terminal according to the method for processing a terrain model according to the embodiments of the present disclosure. As shown in Figure 1 The mobile terminal can include one or more Figure 1The mobile terminal shown in FIG. 1 includes only one processor 102 (the processor 102 can include, but is not limited to, a processing device such as a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP) chip, a Micro Controller Unit (MCU), a Field Programmable Gate Array (FPGA), a Neural Processing Unit (NPU), a Tensor Processing Unit (TPU), an Artificial Intelligence (AI) type processor, etc.), and a memory 104 for storing data. Optionally, the mobile terminal can further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, and does not limit the structure of the mobile terminal. For example, the mobile terminal can include more or fewer components than those shown, or have a different configuration of components than those shown. Figure 1 The mobile terminal shown in FIG. 1 includes only one processor 102 (the processor 102 can include, but is not limited to, a processing device such as a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP) chip, a Micro Controller Unit (MCU), a Field Programmable Gate Array (FPGA), a Neural Processing Unit (NPU), a Tensor Processing Unit (TPU), an Artificial Intelligence (AI) type processor, etc.), and a memory 104 for storing data. Optionally, the mobile terminal can further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, and does not limit the structure of the mobile terminal. For example, the mobile terminal can include more or fewer components than those shown, or have a different configuration of components than those shown.

[0050] The memory 104 can be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the terrain model processing method in the embodiments of the present disclosure. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, i.e., implements the terrain model processing method described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the mobile terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0051] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0052] The inputs in input / output device 108 can come from multiple human interface devices (HIDs). Examples include keyboards and mice, gamepads, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, and remote controls). Some HIDs, in addition to providing input functions, can also provide output functions, such as force feedback and vibration from gamepads, and audio output from controllers.

[0053] Display device 110 may be, for example, a head-up display (HUD), a touchscreen liquid crystal display (LCD), or a touch display (also referred to as a "touchscreen" or "touch display"). This LCD allows a user to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), which allows the user to interact with the GUI through finger contact and / or gestures on a touch-sensitive surface. Optional human-computer interaction functions include: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, a call interface, playing digital video, playing digital music, and / or web browsing, etc. Executable instructions for performing the above human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0054] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0055] In one possible implementation, embodiments of this disclosure provide a method for processing terrain models. Figure 2is a flowchart of a processing method of a terrain model according to an embodiment of the present disclosure, as shown in Figure 2 The method can include the following steps:

[0056] In step S202, a mountain model and a road model to be processed in a virtual scene are acquired, wherein the mountain model includes a mountain foot model.

[0057] In the technical solution provided in step S202 of the present disclosure, the mountain model and the road model to be processed in the virtual scene can be acquired. The virtual scene can be a virtual environment generated by computer technology, and can be a virtual game scene or used to simulate various scenes in the real world, such as city, forest, and mountain scenes. The virtual scene can be a virtual game scene, which is only an example and does not limit the type of virtual scene.

[0058] Optionally, the mountain model can be a model simulating a mountain, a hill, or other terrain in the real world, and can be a mountain model in a virtual game scene, which is only an example and does not limit the virtual scene in which the mountain model is located. The mountain model can include a mountain foot model, which can be a model located at the foot of the mountain model.

[0059] Optionally, the road model can be a model simulating a road, a street, or other traffic routes in the real world, and can be a road model in a virtual game scene, which is only an example and does not limit the virtual scene in which the road model is located.

[0060] For example, the virtual scene can be a virtual game scene, such as a Grand World game scene. In the Grand World game scene, when a mesa model needs to be generated at the mountain foot model of the mountain model, the mountain model and the road model to be processed in the Grand World game scene can be acquired based on a Grand World map. Further, based on the acquired mountain model and road model, the mesa model can be generated.

[0061] In step S204, a target mountain region where the mountain foot model is located on the mountain model and a coverage region of the road model are determined.

[0062] In the technical solution provided in step S204 of the present disclosure, after the mountain model and the road model to be processed in the virtual scene are acquired, the target mountain region where the mountain foot model is located on the mountain model and the coverage region of the road model can be determined. The target mountain region can be a region where the mountain foot model is located, such as a bottom region of the mountain model or a region close to the bottom zone of the mountain model. The coverage region can be a region range where the road model is located.

[0063] In this embodiment, after obtaining the mountain model and the road model to be processed in the virtual scene, the region of the mountain foot model of the mountain model can be determined, that is, the target mountain region where the mountain foot model is located on the mountain model is determined, and the coverage region of the road model is determined.

[0064] In step S206, based on the coverage region, a target sub-mountain region in the target mountain region is determined, where the target sub-mountain region is used to represent the mountain region on the mountain foot model where the mesa model is to be generated, and the target sub-mountain region is independent of the coverage region.

[0065] In the technical solution provided by the above step S206 of the present disclosure, after the target mountain region where the mountain foot model is located on the mountain model and the coverage region of the road model are determined, the target sub-mountain region in the determined target mountain region can be determined based on the determined coverage region of the road model. The target sub-mountain region can be used to represent the mountain region on the mountain foot model where the mesa model is to be generated, and the target sub-mountain region is independent of the coverage region.

[0066] In this embodiment, after the target mountain region where the mountain foot model is located and the coverage region of the road model are determined, since the mesa model needs to be generated in the region where the mountain foot model is located, and the mesa model is independent of the coverage region, that is, the mesa model cannot cover the road model, the mesa model can be generated in a region at a certain distance from the road model. Therefore, the target sub-mountain region in the determined target mountain region can be determined based on the determined coverage region of the road model, and the determined target sub-mountain region can meet the conditions for generating the mesa model.

[0067] In step S208, the sub-mountain foot model in the mountain foot model located on the target sub-mountain region is converted into a mesa model.

[0068] In the technical solution provided by the above step S208 of the present disclosure, after the target sub-mountain region in the target mountain region is determined based on the coverage region, the sub-mountain foot model in the mountain foot model located on the target sub-mountain region can be converted into a mesa model. The sub-mountain foot model can be the mountain foot model located on the target sub-mountain region. The mesa model can be a model matched with the model in the mountain model except the sub-mountain foot model, where the matching can mean that the mesa model can naturally connect with the original terrain of the mountain model.

[0069] In this embodiment, after the target sub-mountain region in the target mountain region is determined based on the coverage region of the road model, the terrain of the determined sub-mountain foot model located on the target sub-mountain region can be reshaped to convert the sub-mountain foot model into a mesa model, thereby improving the efficiency of generating the mesa model.

[0070] Through the steps S202 to S208, the mountain model and the road model to be processed in the virtual scene are obtained, wherein the mountain model includes a mountain foot model; a target mountain region where the mountain foot model is located on the mountain model and a coverage region of the road model are determined; a target sub-mountain region in the target mountain region is determined based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the mountain foot model where the mesa model is to be generated, and the target sub-mountain region is independent of the coverage region; a sub-mountain foot model on the target sub-mountain region in the mountain foot model is converted into a mesa model, wherein the mesa model matches the model in the mountain model except the sub-mountain foot model. That is, the disclosed embodiment determines the target sub-mountain region independent of the coverage region based on the intersection relationship between the coverage region of the road model and the target mountain region where the mountain foot model is located on the mountain model, and further converts the sub-mountain foot model on the target sub-mountain region in the mountain foot model into a mesa model, so as to achieve the purpose of automatically generating the mesa model, avoid generating the mesa model by manually increasing or editing, and further realize the technical effect of improving the efficiency of generating the mesa model, thereby solving the technical problem of low efficiency of generating the mesa model.

[0071] The above method of the disclosed embodiment will be further introduced below.

[0072] As an optional embodiment, in step S206, determining the target sub-mountain region in the target mountain region based on the coverage region includes: determining a road model mask corresponding to the coverage region and an initial mountain foot model mask corresponding to the target mountain region; and generating the target sub-mountain region based on the road model mask and the initial mountain foot model mask.

[0073] In this embodiment, after the target mountain region where the mountain foot model is located on the mountain model and the coverage region of the road model are determined, a road model mask corresponding to the coverage region and an initial mountain foot model mask corresponding to the target mountain region can be determined. Further, the target sub-mountain region can be generated based on the determined road model mask and initial mountain foot model mask. The road model mask can be used to represent the coverage region, and the initial mountain foot model mask can be used to represent the target mountain region.

[0074] Alternatively, after the target mountain region and the coverage region of the road model are determined, a road model mask corresponding to the coverage region and an initial mountain foot model mask corresponding to the target mountain region can be determined, i.e., a road model mask and an initial mountain foot model mask are determined. Since the generated mesa model cannot cover the road model, based on the intersection relationship between the road model mask and the initial mountain foot model mask, the target sub-mountain region can be generated, so as to generate the mesa model at the determined target sub-mountain region.

[0075] As an optional embodiment, the target sub-mountain region is generated based on the road model mask and the initial mountain foot model mask, including: determining an intersection model mask between the road model mask and a mountain model mask of the mountain model, wherein the mountain model mask is used to represent a mountain region of the mountain model, and the intersection model mask is used to represent a region located in the mountain foot model and covering the mask range of the road model; removing the intersection model mask from the initial mountain foot model mask to obtain a first target mountain foot model mask; determining a mountain region set corresponding to the first target mountain foot model mask, wherein the mountain region set includes a plurality of target mountain regions with the same type attribute; and determining the target sub-mountain region from the mountain region set.

[0076] In this embodiment, after the road model mask corresponding to the coverage region and the initial mountain foot model mask corresponding to the target mountain region are determined, the intersection model mask between the road model mask and the mountain model mask of the mountain model can be determined. After the intersection model mask is determined, the intersection model mask can be removed from the initial mountain foot model mask to obtain the first target mountain foot model mask. After the first target mountain foot model mask is obtained, the mountain region set corresponding to the first target mountain foot model mask can be determined. Further, the target sub-mountain region can be determined from the determined mountain region set.

[0077] Optionally, the mountain model mask can be used to represent the mountain region of the mountain model, and the mountain model mask can be referred to as a large mountain model mask. The intersection model mask can be used to represent a region located in the mountain foot model and covering the mask range of the road model, and the intersection model mask can be represented by mask A. The first target mountain foot model mask can be the mountain foot model mask obtained by removing the intersection model mask from the initial mountain foot model mask, and the first target mountain foot model mask can be represented by mask B. The mountain region set can include a plurality of target mountain regions with the same type (class) attribute, i.e., the mountain region set includes regions with the same class attribute.

[0078] Optionally, after the mountain model is obtained, small mountain models in the mountain model can be removed to obtain a mountain model mask, i.e., a large mountain model mask. Since the generated plateau model cannot cover the road model, an intersection model mask between the road model mask and the mountain model mask of the mountain model can be determined, i.e., a mask A in which the large mountain model mask covers the road model mask. Further, the determined intersection model mask can be removed to obtain a first target mountain foot model mask, i.e., the mask A is removed from the initial mountain foot model mask to obtain a mask B. After the first target mountain foot model mask is obtained, a mountain region set corresponding to the first target mountain foot model mask can be determined, and a target sub-mountain region can be determined in the determined mountain region set. That is, after the mask B is obtained, regions with consistent class attributes in the mask B can be determined as the mountain region set, and a plurality of target sub-mountain regions can be determined in the determined mountain region set.

[0079] In this embodiment, since the plateau model cannot cover the road model, the embodiment first determines an intersection model mask covering the road model, and further removes the intersection model mask to obtain a plurality of target sub-mountain regions in which the plateau model can be generated.

[0080] As an optional embodiment, determining the intersection model mask between the road model mask and the mountain model mask of the mountain model comprises: respectively performing expansion processing on the road model mask and the mountain model mask; and obtaining an intersection model mask between the expanded road model mask and the expanded mountain model mask.

[0081] In this embodiment, after the road model mask corresponding to the coverage region is determined, the road model mask and the mountain model mask can be respectively expanded. Further, an intersection model mask between the expanded road model mask and the expanded mountain model mask can be obtained.

[0082] Optionally, after the road model mask and the large mountain model mask are determined, the road model mask and the large mountain model mask can be respectively expanded. Further, a mask A between the expanded road model mask and the expanded large mountain model mask can be obtained, so as to remove the mask A to generate the plateau model in the region after the mask A is removed.

[0083] As an optional embodiment, in the initial mountain foot model mask, removing the intersection model mask to obtain the first target mountain foot model mask comprises: removing the intersection model mask in the initial mountain foot model mask, and generating noise information in the initial mountain foot model mask after the removal to obtain the first target mountain foot model mask.

[0084] In this embodiment, after the intersection mask between the road model mask and the mountain model mask of the mountain model is determined, the intersection mask can be removed in the initial mountain foot model mask, and noise information is generated in the initial mountain foot model mask after the removal to obtain a first target mountain foot model mask. The noise information can be cell noise generated in the initial mountain foot model mask, which can be used to simulate the rock texture of the mountain foot model and can be used to make the generated first target mountain foot model mask more natural and diversified.

[0085] Optionally, after the mask A between the road model mask and the large mountain model mask is determined, the mask A can be removed. Further, cell noise can be generated in the initial mountain foot model mask after the removal of the mask A to obtain a mask B.

[0086] As an optional embodiment, the method further includes: deleting, in an initial terrain mesh corresponding to a terrain file, a region with a mask value less than a first mask value threshold to obtain a first target terrain mesh, wherein the terrain file is used to represent a terrain of a virtual scene, and the initial terrain mesh is used to represent a mesh of the terrain corresponding to the terrain file; and determining a mountain region set corresponding to the first target mountain foot model mask, including: determining, in the first target terrain mesh, the mountain region set based on a plurality of initial mountain regions corresponding to the first target mountain foot model mask, wherein the plurality of initial mountain regions have the same type attribute.

[0087] In this embodiment, in an initial terrain mesh corresponding to a terrain file, a region with a mask value less than a first mask value threshold can be deleted to obtain a first target terrain mesh. After obtaining the first target terrain mesh, a mountain region set can be determined in the obtained first target terrain mesh based on a plurality of initial mountain regions corresponding to the first target mountain foot model mask. The terrain file can be used to represent a terrain of a virtual scene, and when the virtual scene is a virtual game scene, the terrain file can be a large map terrain file and can be represented by a terrain height field. The initial terrain mesh can be used to represent a mesh of the terrain corresponding to the terrain file. The first mask value threshold can be a threshold set according to actual conditions, for example, the first mask value threshold can be 0.5, which is only an example and does not limit the value of the first mask value threshold. The plurality of initial mountain regions have the same type attribute, that is, the class attribute of the plurality of initial mountain regions is consistent.

[0088] Optionally, after the terrain file is converted into an initial terrain mesh, a region with a mask value less than a first mask value threshold can be deleted in the initial terrain mesh corresponding to the terrain file to obtain a first target terrain mesh. Further, based on a plurality of initial mountain regions corresponding to the first target mountain foot model mask and having the same type attribute, a mountain region set is determined.

[0089] For example, the first mask value threshold is set as 0.5, the terrain heightfield is converted into the first target terrain mesh, and the first target terrain mesh is obtained. Further, in the obtained first target terrain mesh, the plurality of initial mountain regions consistent with the class attribute corresponding to the mask B are determined as the mountain region set.

[0090] As an optional embodiment, in the first target terrain mesh, the mountain region set is determined based on the plurality of initial mountain regions corresponding to the first target mountain foot model mask, including: determining the area of the initial mountain region in the first target terrain mesh; determining the first number of initial mountain regions with the area within the area threshold range in the plurality of initial mountain regions; randomly deleting the second number of initial mountain regions in the first number of initial mountain regions to obtain a plurality of target mountain regions, wherein the second number is less than the first number; and determining the plurality of target mountain regions as the mountain region set.

[0091] In this embodiment, after the region with the mask value less than the first mask value threshold is deleted in the initial terrain mesh corresponding to the terrain file to obtain the first target terrain mesh, the area of the initial mountain region can be determined in the obtained first target terrain mesh. After the area of the initial mountain region is determined, the first number of initial mountain regions with the area within the area threshold range can be determined in the plurality of initial mountain regions. Further, the second number of initial mountain regions can be randomly deleted in the first number of initial mountain regions to obtain a plurality of target mountain regions. After the plurality of target mountain regions are obtained, the obtained plurality of target mountain regions can be determined as the mountain region set. The area threshold range can be a range between the area lower limit value and the area upper limit value set in advance according to actual conditions. The second number can be less than the first number, for example, the second number can be 50% of the first number, which is only an example and does not limit the value of the second number.

[0092] Optionally, after the first target terrain mesh is obtained, the area of the initial mountain region can be determined in the first target terrain mesh. Further, it can be determined whether the area of the initial mountain region is within the area threshold range, and the first number of initial mountain regions with the area within the area threshold range can be determined. Further, 50% of the initial mountain regions can be randomly deleted in the first number of initial mountain regions to obtain a plurality of target mountain regions, and the plurality of target mountain regions are determined as the mountain region set.

[0093] As an optional embodiment, in the mountain region set, the target sub-mountain region is determined, including: determining a first distance between a center point of the target mountain region in the mountain region set and a center line of the road model mask; determining a minimum first distance in the plurality of first distances corresponding to the plurality of target mountain regions; deleting, in the mountain region set, the target mountain region with the minimum first distance less than a first distance threshold; projecting the mountain region set after the deletion onto the terrain to obtain a second target mountain foot model mask; and determining the target sub-mountain region based on the second target mountain foot model mask.

[0094] In this embodiment, after the mountain region set corresponding to the first target mountain foot model mask is determined, the first distance between the center point of the target mountain region in the mountain region set and the center line of the road model mask can be determined. After the first distance between the center point of the target mountain region and the center line of the road model mask is determined, the minimum first distance can be determined in the plurality of first distances corresponding to the plurality of target mountain regions. Further, the target mountain region with the minimum first distance less than the first distance threshold can be deleted in the mountain region set. After the target mountain region with the minimum first distance less than the first distance threshold is deleted in the mountain region set, the mountain region set after the deletion can be projected onto the terrain to obtain a second target mountain foot model mask. Further, based on the second target mountain foot model mask, the target sub-mountain region can be determined.

[0095] Optionally, the first distance can be the distance between the center point of the target mountain region and the center line of the road model mask. The minimum first distance can be the minimum distance in the first distance. The first distance threshold can be a distance threshold set according to actual conditions. For example, the first distance threshold can be 1000 meters, which is only an example and does not limit the value of the first distance threshold. The second target mountain foot model mask can be represented by mask C.

[0096] Optionally, since the distance between the generated mesa model and the road model is not very far, based on the first distance between the center point of the target mountain region and the center line of the road model mask, it can be determined whether to delete the corresponding target mountain region. The minimum value in the first distance can be determined to obtain the minimum first distance. When the determined minimum first distance is less than the first distance threshold of 1000 meters, the target mountain region corresponding to the minimum first distance can be deleted in the mountain region set. Further, the mountain region set after the target mountain region is deleted can be projected onto the terrain to obtain a second target mountain foot model mask, i.e., to obtain mask C, so as to determine the target sub-mountain region based on the obtained mask C.

[0097] As an optional embodiment, the target sub-mountain region is determined based on the second target mountain foot model mask, including: performing a blur processing on an edge of the second target mountain foot model mask to obtain a third target mountain foot model mask, wherein the third target mountain foot model mask is used to represent the target sub-mountain region.

[0098] In this embodiment, after the set of mountain regions after deletion is projected onto the terrain to obtain the second target mountain foot model mask, the edge of the second target mountain foot model mask can be blurred to obtain a third target mountain foot model mask. The third target mountain foot model mask can be used to represent the target sub-mountain region, and can be represented by mask D, which can be referred to as a mesa model mask.

[0099] Optionally, after obtaining the mask C, the edge of the mask C can be blurred to obtain a mask D, which is the mask of the mesa model to be finally generated.

[0100] As an optional embodiment, the step S208 of converting the sub-mountain foot model located on the target sub-mountain region in the mountain foot model into a mesa model includes: converting the sub-mountain foot model into a mesa model based on an initial terrain grid corresponding to a terrain file, wherein the terrain file is used to represent the terrain of the virtual scene.

[0101] In this embodiment, after the target sub-mountain region is determined in the target mountain region based on the coverage region, the sub-mountain foot model can be converted into a mesa model based on an initial terrain grid corresponding to a terrain file. The terrain file can be used to represent the terrain of the virtual scene, and when the virtual scene is a virtual game scene, the terrain file can be a large map terrain file, which can be represented by a terrain heightfield. The initial terrain grid can be used to represent the grid of the terrain corresponding to the terrain file.

[0102] Optionally, after the terrain file is converted into an initial terrain grid, the sub-mountain foot model located on the target sub-mountain region in the mountain foot model can be converted into a mesa model based on the initial terrain grid corresponding to the terrain file. The corresponding terrain grid can be cut out in the initial terrain grid according to the range of the target sub-mountain region, and the terrain grid can be blurred, and then the sub-mountain foot model can be converted into a mesa model based on the blurred terrain grid. This will be further described below.

[0103] As an optional embodiment, the converting the sub-mountain foot model into the plateau model based on the initial terrain mesh corresponding to the terrain file comprises: in the initial terrain mesh, a second target terrain mesh is cropped according to a mountain area range corresponding to a third target mountain foot model mask, wherein the third target mountain foot model mask is used to represent a target sub-mountain area, and the mountain area range is used to represent a range of the target sub-mountain area; the second target terrain mesh is blurred to obtain a third target terrain mesh; and the sub-mountain foot model is converted into the plateau model based on the third target terrain mesh.

[0104] In this embodiment, after the edge of the second target mountain foot model mask is blurred to obtain the third target mountain foot model mask, in the initial terrain mesh, the second target terrain mesh can be cropped according to the mountain area range corresponding to the obtained third target mountain foot model mask. After the second target terrain mesh is cropped, the cropped second target terrain mesh can be blurred to obtain the third target terrain mesh. Further based on the obtained third target terrain mesh, the sub-mountain foot model can be converted into the plateau model. The third target mountain foot model mask can be used to represent the target sub-mountain area, and can be represented by mask D, and can be referred to as a plateau model mask. The mountain area range can be used to represent the range of the target sub-mountain area. The second target terrain mesh can be represented by mesh A. The third target terrain mesh can be represented by mesh B.

[0105] Optionally, in the initial terrain mesh, the second target terrain mesh can be cropped according to the mountain area range corresponding to the obtained third target mountain foot model mask, for example, the region less than 0.5 in the third target mountain foot model mask can be deleted to obtain the second target terrain mesh. The second target terrain mesh is further blurred to obtain the third target terrain mesh. Based on the obtained third target terrain mesh, the sub-mountain foot model can be converted into the plateau model.

[0106] Optionally, in the initial terrain mesh, the region less than 0.5 in the mask D can be deleted, that is, mesh A is cropped according to the mountain area range corresponding to the obtained mask D. Mesh A can be further blurred to obtain mesh B. After mesh B is obtained, based on the obtained mesh B, the sub-mountain foot model can be converted into the plateau model.

[0107] As an optional embodiment, the converting the sub-mountain-foot model into the mesa model based on the third target terrain grid comprises: performing a mixing process on the third target terrain grid and the second target terrain grid to obtain a fourth target terrain grid; setting a height of the fourth target terrain grid as a target height to obtain a fifth target terrain grid; and performing a deformation process on the sub-mountain-foot model according to the fifth target terrain grid to obtain the mesa model.

[0108] In this embodiment, after the blurring process is performed on the second target terrain grid to obtain the third target terrain grid, a mixing process can be performed on the third target terrain grid and the second target terrain grid to obtain a fourth target terrain grid. After the fourth target terrain grid is obtained, a height of the fourth target terrain grid can be set as a target height to obtain a fifth target terrain grid. Further, a deformation process can be performed on the sub-mountain-foot model according to the obtained fifth target terrain grid to obtain the mesa model. The fourth target terrain grid can be represented by mesh C. The target height can be a height set according to actual conditions, for example, the target height can be 0 meters, which is only an example and does not limit the numerical value of the target height. The fifth target terrain grid can be represented by mesh D.

[0109] Optionally, after the mesh A and the mesh B are obtained, a mixing process can be performed on the mesh A and the mesh B to obtain a mesh C, which is relatively flat. Further, a height value of the mesh C can be set as 0 to form a mesh D. After the mesh D is obtained, a deformation process can be performed on the sub-mountain-foot model based on the obtained mesh D to obtain the mesa model.

[0110] As an optional embodiment, the performing the deformation process on the sub-mountain-foot model according to the fifth target terrain grid to obtain the mesa model comprises: setting a height of a terrain as a target height; determining a second distance between the terrain after the height is set and the fifth target terrain grid; determining a mesa model mask corresponding to the mesa model to be obtained based on the second distance, wherein the mesa model mask is used to represent a mountain area of the mesa model; and performing a deformation process on the sub-mountain-foot model according to the mesa model mask to obtain the mesa model.

[0111] In this embodiment, the height of the terrain can be set as the target height. After the fifth target terrain grid is obtained and the height of the terrain is set as the target height, the second distance between the terrain after the height is set and the fifth target terrain grid can be determined. After the second distance between the terrain after the height is set and the fifth target terrain grid is determined, the mesa model mask corresponding to the mesa model to be obtained can be determined based on the determined second distance. Further, the deformation process can be performed on the sub-mountain-foot model according to the determined mesa model mask to obtain the mesa model.

[0112] Optionally, the height of the terrain is set to 0, and a second distance between the flattened terrain and the flattened mesh D is calculated. It should be noted that the height values of the terrain and the mesh D are both 0, i.e., the flattened terrain and the flattened mesh D. The determined second distance is further normalized and blurred, and a mesa model mask corresponding to the mesa model to be obtained is determined. The sub-mountain foot model is deformed according to the determined mesa model mask, and the mesa model is obtained.

[0113] As an optional embodiment, the method further includes: obtaining a target point on the mountain model closest to the fifth target terrain grid and a texture coordinate of the target point; obtaining a target height corresponding to the fourth target terrain grid based on the target point and the texture coordinate of the target point; and deforming the sub-mountain foot model according to the mesa model mask to obtain the mesa model, including: mixing the height of the sub-mountain foot model and the height corresponding to the fourth target terrain grid using the mask value of the mesa model mask to obtain an initial mesa model; and deforming the sub-mountain foot model based on the initial mesa model to obtain the mesa model.

[0114] In this embodiment, the target point on the mountain model closest to the fifth target terrain grid and the texture coordinate of the target point can be obtained. After obtaining the target point and the texture coordinate of the target point, the target height corresponding to the fourth target terrain grid can be obtained based on the obtained target point and the texture coordinate of the target point. The height of the sub-mountain foot model and the height corresponding to the fourth target terrain grid are mixed using the mask value of the mesa model mask to obtain an initial mesa model. The sub-mountain foot model is deformed based on the obtained initial mesa model to obtain the mesa model. The target point can be represented by closest_primnum. The texture coordinate (UV) can be represented by closest_primuv. The mask value of the mesa model mask is between 0 and 1. The height of the sub-mountain foot model can be the original height of the sub-mountain foot model in the terrain. The initial mesa model can be the basic platform terrain model.

[0115] Optionally, a target point closest_primnum closest to the mesh D in the terrain and a UV coordinate closest_primuv of the target point are obtained. Based on the obtained target point and the UV coordinate of the target point, a height value of a corresponding point on the mesh C is obtained. Further, a mask value of the mesa model mask is utilized, and the mask value is between (0, 1), and the height of the sub-mountain foot model and the height corresponding to the fourth target terrain grid are mixed to obtain an initial mesa model, that is, the mask value is used as a coefficient to mix the original height of the terrain and the height value of the corresponding point on the mesh C to obtain the basic platform terrain model. Finally, the sub-mountain foot model is deformed based on the obtained basic platform terrain model to obtain the mesa model.

[0116] As an optional embodiment, the mesa model is deformed based on the initial mesa model to obtain the mesa model, including: deforming the initial mesa model based on the mountain area range of the mask corresponding to the initial mesa model to obtain a target mesa model; performing blur processing on the target mesa model based on the mountain area range of the mask corresponding to the target mesa model to obtain the mesa model; and replacing the sub-mountain foot model with the mesa model.

[0117] In this embodiment, after the initial mesa model is obtained, the initial mesa model can be deformed based on the mountain area range of the mask corresponding to the obtained initial mesa model to obtain a target mesa model. After the target mesa model is obtained, the target mesa model is blurred based on the mountain area range of the mask corresponding to the obtained target mesa model to obtain the mesa model. After the mesa model is obtained, the sub-mountain foot model can be further replaced with the mesa model.

[0118] Optionally, after the basic platform terrain model is obtained, the basic platform terrain model is twisted and deformed based on the mountain area range of the mask corresponding to the basic platform terrain model to obtain a target mesa model. Further, the target mesa model is blurred based on the mountain area range of the mask corresponding to the target mesa model to obtain the mesa model, so as to replace the sub-mountain foot model with the mesa model.

[0119] This embodiment performs post-processing on the obtained basic platform terrain model, first twists the terrain according to the mask range, and then blurs the terrain according to the mask range to obtain the mesa model.

[0120] As an optional embodiment, the method further comprises: determining, in the terrain file, a terrain region with a slope in a slope threshold range, wherein the terrain file is used to represent a terrain of a virtual scene, and the slope threshold range is used to represent a range of slopes of the mountain model; performing expansion processing and blur processing on a mask corresponding to the terrain region to obtain an initial mountain model mask; deleting, in an initial terrain mesh corresponding to the terrain file, a region with a mask value less than a second mask value threshold in the initial mountain model mask to obtain a terrain mesh of the mountain model, wherein the initial terrain mesh is used to represent a mesh of a terrain corresponding to the terrain file; deleting, in the terrain mesh of the mountain model, a terrain mesh of at least one sub-mountain model with a height less than a height threshold and / or an area less than an area threshold; and projecting the terrain mesh of the mountain model after the deletion onto the terrain to obtain a mountain model mask.

[0121] In this embodiment, in the terrain file, a terrain region with a slope in a slope threshold range can be determined. After determining the terrain region with the slope in the slope threshold range, expansion processing and blur processing can be performed on a mask corresponding to the terrain region to obtain an initial mountain model mask. Further, in an initial terrain mesh corresponding to the terrain file, a region with a mask value less than a second mask value threshold in the initial mountain model mask can be deleted to obtain a terrain mesh of the mountain model. In the obtained terrain mesh of the mountain model, a terrain mesh of at least one sub-mountain model with a height less than a height threshold and / or an area less than an area threshold can be deleted. Finally, the terrain mesh of the mountain model after the deletion can be projected onto the terrain to obtain a mountain model mask.

[0122] Optionally, the terrain file can be used to represent a terrain of a virtual scene. The slope threshold range can be used to represent a range of slopes of the mountain model, for example, the slope threshold range can be a range between 20 and 90 degrees, which is only used for illustration and does not limit the numerical value of the slope threshold range. The initial mountain model mask can be a basic mountain model mask. The second mask value threshold can be a mask value threshold set according to actual conditions, for example, the second mask value threshold can be 0.8, which is only used for illustration and does not limit the numerical value of the second mask value threshold. The initial terrain mesh can be used to represent a mesh of a terrain corresponding to the terrain file. The height threshold can be a threshold set according to actual conditions, for example, the height threshold can be 100 meters, which is only used for illustration and does not limit the numerical value of the height threshold. The area threshold can be a threshold set according to actual conditions, for example, the area threshold can be 150,000 square meters, which is only used for illustration and does not limit the numerical value of the area threshold.

[0123] Optionally, a terrain region with a slope between 20 and 90 degrees is determined in the terrain file, and the mask corresponding to the terrain region is expanded and blurred to obtain a basic mountain model mask. The terrain is further converted into a mesh, and in the initial terrain grid corresponding to the terrain file, the faces with a mask value less than 0.8 in the basic mountain model mask are deleted to obtain a terrain grid of the mountain model, that is, the mesh of all mountain models. A mountain with a height less than 100 or a projection area less than 150,000 is defined as a small mountain model, and the small mountain model is deleted, and the terrain grid of the deleted mountain model is projected onto the terrain to obtain a mountain model mask, that is, a large mountain model mask.

[0124] As an optional embodiment, the road model mask corresponding to the coverage region is determined, including: obtaining a tubular model of the road model; and projecting the terrain grid of the tubular model onto the terrain to obtain the road model mask.

[0125] In this embodiment, the tubular model of the road model can be obtained. After obtaining the tubular model of the road model, the terrain grid of the obtained tubular model can be projected onto the terrain to obtain the road model mask. Optionally, the tubular model of the road model is obtained (tubular along the line). After obtaining the tubular model of the road model, the mesh of the tubular model can be projected onto the terrain to form the road model mask.

[0126] As an optional embodiment, the mountain model and the road model to be processed in the virtual scene are obtained, including: obtaining the mountain model based on a terrain file, wherein the terrain file is used to represent the terrain of the virtual scene; and obtaining the road model based on a road center line file, wherein the road center line file is used to represent the center line of the road in the virtual scene.

[0127] In this embodiment, the mountain model can be obtained based on the terrain file. The road model can be obtained based on the road center line file. The terrain file can be used to represent the terrain of the virtual scene. The road center line file can be used to represent the center line of the road in the virtual scene.

[0128] In the embodiments of the present disclosure, a mountain model and a road model to be processed in a virtual scene are acquired, wherein the mountain model comprises a mountain foot model; a target mountain region where the mountain foot model is located on the mountain model is determined, and a coverage region of the road model is determined; a target sub-mountain region in the target mountain region is determined based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the mountain foot model where a mesa model is to be generated, and the target sub-mountain region is independent of the coverage region; a sub-mountain foot model on the target sub-mountain region in the mountain foot model is converted into the mesa model, wherein the mesa model matches a model other than the sub-mountain foot model in the mountain model. That is, in the embodiments of the present disclosure, the target sub-mountain region independent of the coverage region is determined based on the intersection relationship between the coverage region of the road model and the target mountain region where the mountain foot model is located on the mountain model, and the sub-mountain foot model on the target sub-mountain region in the mountain foot model is further converted into the mesa model, so that the mesa model is automatically generated, manual generation or editing of the mesa model is avoided, and the technical effect of improving the efficiency of generating the mesa model is achieved, thereby solving the technical problem of low efficiency of generating the mesa model.

[0129] The technical solutions of the embodiments of the present disclosure will be further described below in conjunction with preferred embodiments.

[0130] At present, in the Grand World game, the terrain model is usually generated by automatic means, so that the generated mountain model usually has a certain repeatability. In order to add changes to the map, small size terrain changes can be introduced, for example, mountain foot mesa models are introduced, which are particularly important for creating points of interest and breaking the map repetition. Due to the characteristics of automatic generation of terrain models, the process of manually adding, editing mountain foot mesa models and other scene elements dependent on terrain models not only needs to consume a lot of manpower and time, and when the large map changes, these manual edits are no longer applicable.

[0131] In the related art, the method of introducing mountain foot mesa models needs to customize and edit the terrain model or make and place the mesa model when the large map generated automatically needs to be adapted, and cannot be well integrated with the original mountain model. In addition, each mountain foot mesa model is a unique combination, and cannot be used every time, consuming a lot of manpower.

[0132] To solve the above problems, the embodiment of the present disclosure proposes a general solution for automatically generating a mountain foot terrace model for a large world map by computer graphics software (Houdini). According to the input basic map and road position, a mountain foot terrace model is generated at a reasonable position to enhance the playability of the map and perfect the automatic map making process of the large world. The rules for generating the mountain foot terrace model can at least include: generating a terrace model in the area of the mountain foot model; the position of the mountain foot terrace model cannot cover the road model; the mountain foot terrace model is a man-made terrain element, so it should only be generated within a certain distance limit from the road model. Based on the above generation rules, the embodiment screens the range to be changed into a mountain foot terrace model based on the position of the mountain foot model and the position of the road model on the large map, and further reorganizes the terrain model in these mountain foot terrace ranges to shape the mountain foot terrace model, and can be naturally connected with the original terrain model mountain body model.

[0133] In this embodiment, for the step of obtaining the mountain model mask, the large map terrain file heightfield and the road center line file are input into Houdini. Figure 3 is a schematic diagram of a screened area mask according to one embodiment of the present disclosure, as Figure 3 shown, the area mask in the target range (20-90 degrees) is screened on the map by the heightfield mask by feature node in Houdini. Figure 4 is a schematic diagram of a basic mountain model mask according to one embodiment of the present disclosure, as Figure 4 shown, the screened area mask is expanded and blurred by the heightfield mask expand node and the heightfield blur node to obtain the mask of the basic mountain model.

[0134] For the step of removing small mountain models, Figure 5 is a schematic diagram of obtaining a mountain model mesh according to one embodiment of the present disclosure, as Figure 5 shown, the terrain is converted to mesh by the convert heightfield node, and then the mask smaller than 0.8 in the mask of the basic mountain model obtained in the previous step is removed by the blast node to obtain the mesh of all mountain models.

[0135] Further, the mountain mesh is looped for each connected piece, where a set of connected pieces defines a mountain model. In each loop, the height of each mountain model is calculated by the height formula (f@mountain_height = getbbox_size(0)[1]). The projection plane (perpendicular to the Y axis) of each mountain model is obtained by the extract sihouette node, and the area of the projection plane is calculated by the measure node, thereby obtaining the projection area of each mountain model. After obtaining the height and projection area of each mountain model, the mountain model with a height less than 100 meters or a projection area less than 150000 square meters is defined as a small mountain model, and the small mountain model with a height less than 100 meters or a projection area less than 150000 square meters is deleted.

[0136] Figure 6 is a schematic diagram of obtaining a large mountain model mask according to an embodiment of the present disclosure, as shown in Figure 6 After the small mountain model is deleted, the large mountain model mesh obtained by screening is projected onto the terrain model by the heightfield mask by object node to obtain a large mountain model mask. The mountain foot terrace model is generated at the foot of the large mountain model (mountain foot model mask).

[0137] The step of obtaining a road model mask based on a road centerline file. Figure 7 is a schematic diagram of obtaining a road model mask according to an embodiment of the present disclosure, as shown in Figure 7 After the road centerline file is input into Houdini, the polywire node in Houdini is used to generate a tubular model of the road model (wire to tube), and the heightfield project node is used to project the tubular model mesh onto the base terrain model to form a road model mask.

[0138] The step of screening the range of the mountain foot model that will become a mountain foot terrace model based on the road position, that is, the step of screening a terrace model mask. Figure 8 is a schematic diagram of a road model mask according to an embodiment of the present disclosure, as shown in Figure 8 The large map terrain has a road model mask, Figure 9 is a schematic diagram of obtaining a region mask covering the road model at the mountain foot model according to an embodiment of the present disclosure, as shown in Figure 9As shown, the mountain model mask and the road model mask are expanded by a heightfield expand node, and then the intersection of the expanded mountain model mask and the expanded road model mask is obtained to preliminarily obtain a mask range of the mountain foot model covering the road model, i.e., a first mask (which can be represented by mask A) covering the road model at the mountain foot model.

[0139] Figure 10 FIG. 6 is a schematic diagram of deleting the region mask covering the road model at the mountain foot model according to an embodiment of the present disclosure, as shown in Figure 10 As shown, since the mountain foot plateau model cannot cover the road model, after obtaining the mask A covering the road model, the mask A is excluded from the mountain foot model mask, and a cell noise is generated for the remaining mountain foot model mask excluding the mask A by a heightfield noise node to obtain a second mask (which can be represented by mask B).

[0140] Figure 11 FIG. 7 is a schematic diagram of looping the regions with consistent class attributes according to an embodiment of the present disclosure, as shown in Figure 11 As shown, each region in the mask B, i.e., the region with consistent class attributes, is looped to finally obtain a third mask (which can be represented by mask C). A convert heightfield node is used to convert the heightfield into a mesh, and then a blast node is used to delete the regions with mask values less than 0.5, i.e., the white regions shown in Figure 10 Next, the meshes are looped (for-each connected piece), i.e., each region defined by a group of connected faces is looped, and only the faces connected to each other are assigned with the same class attribute.

[0141] It should be noted that each mountain model or each region has the same class attribute, and the class attributes of different mountain models or different regions are different. The class attribute can be used as an identifier for distinguishing different regions or region types.

[0142] Figure 12 FIG. 8 is a schematic diagram of deleting the regions according to the region area according to an embodiment of the present disclosure, as shown in Figure 12As shown, in the loop, for each region (i.e. the region with the same class attribute), the area of the region is calculated using the measure node to obtain the area attribute. It is further determined whether the area of the region is within the set upper and lower limit values of the area. When the area of the region is outside the set upper and lower limit values of the area, the region is deleted. When the area of the region is within the set upper and lower limit values of the area, the center point of the region is obtained, and the coordinates of the center point of the region are taken as the seed. 50% of the region is randomly deleted to realize the judgment of whether to delete the region according to the total area of the region. The upper limit value of the area (AreaThreshold Max) can be 40,000 meters, and the lower limit value of the area (Area Threshold Min) can be 10,000 meters. Here, only an example is given, and the numerical values of the upper limit value of the area and the lower limit value of the area are not limited.

[0143] Further, it is determined whether to delete the region according to the minimum distance of the region to the road model, that is, only the region far from the road model is reserved to generate the mesa model. The distance between each point (the center point of each face) in the region and the road model is calculated using the distance calculation function (xyzdist function), and the result is recorded in the distance (dist_to_road) attribute. The minimum value of the dist_to_road attribute is calculated using the minimum (min) mode of the min_max_Average node, that is, the minimum distance between the region and the center line of the road.

[0144] Figure 13 FIG. 6 is a schematic diagram of deleting a region according to distance according to an embodiment of the present disclosure, as shown in Figure 13 When the minimum distance is less than the set distance, the entire region is deleted. The set distance can be the limit of the distance of the region to the road model, which can be 1,000 meters. Here, only an example is given, and the numerical value of the set distance is not limited.

[0145] Figure 14 FIG. 7 is a schematic diagram of a mask after deleting a region according to an embodiment of the present disclosure, as shown in Figure 14 After the preliminary region is obtained by screening according to the area and the retention probability, it is further determined whether to further delete the region according to the minimum distance of the region to the road model. The mesh is projected back onto the terrain model by the heightfield_mask_by_object node through the above two steps to obtain mask C. Figure 15 FIG. 8 is a schematic diagram of obtaining a mesa model mask according to an embodiment of the present disclosure, as shown in Figure 15As shown, mask C is processed to obtain a fourth mask (which can be represented by mask D) that is finally used to generate the mesa model. The edges of mask C are blurred by a heightfield blur node to obtain mask D, i.e., the mesa model mask.

[0146] The step of generating the mesa model based on the mesa model mask. Figure 16 is a schematic diagram of preprocessing a mesh clipped according to a mesa model mask according to an embodiment of the present disclosure, as shown in Figure 16 As shown, the mesh clipped according to the mesa model mask is preprocessed to clip a first mesh (which can be represented by mesh A) on the original terrain model according to the range of mask D. The mesh A is blurred to obtain a second mesh (which can be represented by mesh B). The mesh A and the mesh B are blended to obtain a third mesh (which can be represented by mesh C), and the blended mesh C not only conforms to the contour line of the mesh A but also smoothes the height value. The mesh C is flattened and the height value is recorded to obtain a fourth mesh (which can be represented by mesh D), i.e., the mesh D is a flattened mesh recording the original height value.

[0147] Figure 17 is a schematic diagram of obtaining a first mesh according to an embodiment of the present disclosure, as shown in Figure 17 As shown, a heightfield is converted into a mesh using a convert heightfield node, and then a blast node is used to delete the area with a mask value less than 0.5 (i.e., the white area shown in Figure 15 , to obtain the mesh A shown in Figure 17 . Figure 18 is a schematic diagram of obtaining a second mesh according to an embodiment of the present disclosure, as shown in Figure 18 As shown, the location attribute (which can be represented by a P attribute) of each point is processed by an attribute blur to obtain the mesh B.

[0148] Figure 19 is a schematic diagram of blending the first mesh and the second mesh according to an embodiment of the present disclosure, as shown in Figure 19 As shown, the mesh A shown in Figure 17 is blended with the mesh B shown in Figure 18The mesh B is blended with the mesh A. The P attribute (location attribute) of the mesh A and the P attribute of the mesh B are obtained, and the maximum value (max) of the P.y of the mesh A and the P.y of the mesh B is determined, wherein the P.y represents the vertical component. The determined maximum value is linearly mixed with the P attribute of the mesh B, and the mixing coefficient can be set to 0.75 according to the effect. Finally, the linearly mixed result is combined with the P.x and the P.z of the mesh A as the y component to form a new P attribute, wherein the P.x represents the horizontal component, and the P.z represents the depth component. Figure 20 is a schematic diagram of obtaining a third mesh according to one of the embodiments of the present disclosure, as shown in Figure 20 The mesh A is blended with the mesh B to obtain a relatively flat mesh C. Finally, the height value of the mesh C is set to 0 to form a mesh D, which is used for the next step of calculation.

[0149] After obtaining the mesh D, the terrain model can be deformed according to the mesh D. Figure 21 is a schematic diagram of obtaining a mesa model mask according to one of the embodiments of the present disclosure, as shown in Figure 21 The height value of the terrain model is set to 0, and the original height of the terrain model is recorded in the original height (orig_height) attribute. The distance between the flattened terrain model and the flattened mesh D is calculated using a function (xyzdist) for calculating the distance, and the calculated distance is normalized and blurred. The calculated distance can be assigned to the mask attribute, the mask attribute is mapped to the range of (0, 1), and the blurred transition is performed. Finally, the mask is flipped to obtain the mesa model mask. At the same time, the point closest to the mesh D on the flattened terrain model can be obtained (the point can be represented by index or closest_primnum), and the texture (uv) coordinate of the point (the uv coordinate can be represented by closest_primuv).

[0150] Figure 22 is a schematic diagram of obtaining a base platform terrain model according to one of the embodiments of the present disclosure, as shown in Figure 22As shown, the original height of the terrain model is recovered according to the orig_height attribute, and then the original height value of the nearest point on mesh D (i.e. the height value of the corresponding point on mesh C) is obtained according to the closest_primnum and closest_primuv attributes returned by the xysdist function, and the mesa model mask value in the range of (0, 1) is used as a coefficient to mix the original height of the terrain model and the height value of the corresponding point on mesh C, to obtain the basic platform terrain model. Figure 23 is a schematic diagram of a basic platform terrain model according to an embodiment of the present disclosure, and the basic platform terrain model as shown in Figure 23 can be obtained through the above steps.

[0151] After obtaining the basic platform terrain model, the obtained basic platform terrain model is post-processed. Figure 24 is a schematic diagram of a twisted basic platform terrain model according to an embodiment of the present disclosure, and the twisted basic platform terrain model as shown in Figure 24 is twisted according to the mask range. Figure 25 is a schematic diagram of a blurred basic platform terrain model according to an embodiment of the present disclosure, and the blurred basic platform terrain model as shown in Figure 25 is blurred according to the mask range, to obtain the final result as shown in Figure 25 . Figure 26 is a schematic diagram of the generation effect of a mesa model according to an embodiment of the present disclosure, and the effect as shown in Figure 26 is obtained by importing the final result obtained above into the UE, to obtain the effect as shown in Figure 26 .

[0152] This embodiment generates a mesa model at a reasonable position according to the input basic map model and road position. When the input basic terrain model and road centerline position change, an updated new terrain file with a reasonable mesa model can be automatically obtained. The automatic workflow in this embodiment allows an artist or planner to adjust parameters according to specific project requirements, such as customizing the area boundary value of the large mountain model and the small mountain model, or customizing the distance parameter for generating a mesa model within a certain range from the road model, etc. When applied to a large world game type, the efficiency is particularly improved. In addition, this embodiment has strong scalability, and based on the current scheme, new mesa model rules can be easily integrated, such as limiting the generation of a mesa model within a certain range from a river model.

[0153] In the embodiments of the present disclosure, a mountain model and a road model to be processed in a virtual scene are acquired, wherein the mountain model comprises a mountain foot model; a target mountain region where the mountain foot model is located on the mountain model and a coverage region of the road model are determined; a target sub-mountain region in the target mountain region is determined based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the mountain foot model where a mesa model is to be generated, and the target sub-mountain region is independent of the coverage region; and a sub-mountain foot model in the mountain foot model located on the target sub-mountain region is converted into the mesa model. That is, the embodiments of the present disclosure determine the target sub-mountain region independent of the coverage region based on the intersection relationship between the coverage region of the road model and the target mountain region where the mountain foot model is located on the mountain model, further convert the sub-mountain foot model in the mountain foot model located on the target sub-mountain region into the mesa model, achieve the purpose of automatically generating the mesa model, avoid generating the mesa model by manually increasing or editing, and thus realize the technical effect of improving the efficiency of generating the mesa model, and solve the technical problem of low efficiency of generating the mesa model.

[0154] Those skilled in the art can clearly understand the method according to the above-mentioned embodiments can be realized by means of software and necessary general hardware platforms, of course, it can also be realized by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, or network device, etc.) execute the method of each embodiment of the present disclosure.

[0155] In the embodiments, a terrain model processing apparatus is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "unit" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.

[0156] Figure 27 is a structural block diagram of a terrain model processing apparatus according to an embodiment of the present disclosure, as shown in Figure 27 The terrain model processing apparatus 2700 can include an acquisition unit 2702, a first determination unit 2704, a second determination unit 2706, and a conversion unit 2708.

[0157] The acquisition unit 2702 is configured to acquire a mountain model and a road model to be processed in a virtual scene, wherein the mountain model comprises a mountain foot model.

[0158] The first determining unit 2704 is configured to determine a target mountain region of the mountain foot model on the mountain model and a coverage region of the road model.

[0159] The second determining unit 2706 is configured to determine a target sub-mountain region in the target mountain region based on the coverage region, where the target sub-mountain region is used to represent a mountain region of the mountain foot model on which the mesa model is to be generated, and the target sub-mountain region is independent of the coverage region.

[0160] The converting unit 2708 is configured to convert a sub-mountain foot model on the target sub-mountain region in the mountain foot model into the mesa model.

[0161] Optionally, the second determining unit 2706 includes a determining module configured to determine a road model mask corresponding to the coverage region and an initial mountain foot model mask corresponding to the target mountain region; and a generating module configured to generate the target sub-mountain region based on the road model mask and the initial mountain foot model mask.

[0162] Optionally, the generating module includes a first determining sub-module configured to determine an intersection model mask between the road model mask and a mountain model mask of the mountain model, where the mountain model mask is used to represent a mountain region of the mountain model, the intersection model mask is used to represent a region on the mountain foot model and covered by the road model mask; a removing sub-module configured to remove the intersection model mask from the initial mountain foot model mask to obtain a first target mountain foot model mask; a second determining sub-module configured to determine a mountain region set corresponding to the first target mountain foot model mask, where the mountain region set includes a plurality of target mountain regions of the same type attribute; and a third determining sub-module configured to determine the target sub-mountain region from the mountain region set.

[0163] Optionally, the first determining sub-module is further configured to respectively expand the road model mask and the mountain model mask, and obtain the intersection model mask between the expanded road model mask and the expanded mountain model mask.

[0164] Optionally, the removing sub-module is further configured to remove the intersection model mask from the initial mountain foot model mask, and generate noise information in the initial mountain foot model mask after the removal to obtain the first target mountain foot model mask.

[0165] Optionally, the apparatus further includes a first deleting unit configured to delete, in an initial terrain grid corresponding to the terrain file, a region with a mask value less than a first mask value threshold to obtain a first target terrain grid, wherein the terrain file is configured to represent a terrain of a virtual scene, and the initial terrain grid is configured to represent a grid of the terrain corresponding to the terrain file.

[0166] Optionally, the third determining sub-module is further configured to: determine, in the first target terrain grid, an area of the initial mountain region; determine, in the plurality of initial mountain regions, a first number of initial mountain regions with an area within an area threshold range; randomly delete, in the first number of initial mountain regions, a second number of initial mountain regions to obtain a plurality of target mountain regions, wherein the second number is less than the first number; and determine the plurality of target mountain regions as the mountain region set.

[0167] Optionally, the third determining sub-module is further configured to: determine a first distance between a center point of a target mountain region in the mountain region set and a center line of the road model mask; determine, in a plurality of first distances corresponding to the plurality of target mountain regions, a minimum first distance; delete, in the mountain region set, a target mountain region with a minimum first distance less than a first distance threshold; project the mountain region set after the deletion onto the terrain to obtain a second target hill model mask; and determine a target sub-mountain region based on the second target hill model mask.

[0168] Optionally, the third determining sub-module is further configured to: perform a blur processing on an edge of the second target hill model mask to obtain a third target hill model mask, wherein the third target hill model mask is configured to represent the target sub-mountain region.

[0169] Optionally, the converting unit 2708 includes a conversion module configured to convert the sub-hill model into the mesa model based on an initial terrain grid corresponding to the terrain file, wherein the terrain file is configured to represent a terrain of a virtual scene.

[0170] Optionally, the conversion module includes a clipping sub-module configured to clip, in the initial terrain grid, a second target terrain grid according to a mountain region range corresponding to the third target hill model mask, wherein the third target hill model mask is configured to represent the target sub-mountain region, and the mountain region range is configured to represent a range of the target sub-mountain region; a processing sub-module configured to perform a blur processing on the second target terrain grid to obtain a third target terrain grid; and a conversion sub-module configured to convert the sub-hill model into the mesa model based on the third target terrain grid.

[0171] Optionally, the conversion sub-module is further configured to: perform a mixing process on the third target terrain grid and the second target terrain grid to obtain a fourth target terrain grid; set a height of the fourth target terrain grid as the target height to obtain a fifth target terrain grid; and perform a deformation process on the sub-mountain foot model according to the fifth target terrain grid to obtain the mesa model.

[0172] Optionally, the conversion sub-module is further configured to: set a height of the terrain as the target height; determine a second distance between the terrain after the height is set and the fifth target terrain grid; determine, based on the second distance, a mesa model mask corresponding to the mesa model to be obtained, wherein the mesa model mask is used to represent a mountain region of the mesa model; and perform a deformation process on the sub-mountain foot model according to the mesa model mask to obtain the mesa model.

[0173] Optionally, the apparatus further includes: a first acquisition unit configured to acquire a target point on the mountain model closest to the fifth target terrain grid and a texture coordinate of the target point; and a second acquisition unit configured to acquire a target height corresponding to the fourth target terrain grid based on the target point and the texture coordinate of the target point. The second processing sub-module is further configured to: perform a mixing process on a height of the sub-mountain foot model and a height corresponding to the fourth target terrain grid by using a mask value of the mesa model mask to obtain an initial mesa model; and perform a deformation process on the sub-mountain foot model based on the initial mesa model to obtain the mesa model.

[0174] Optionally, the second processing sub-module is further configured to: perform a deformation process on the initial mesa model based on a mountain region range of the mask corresponding to the initial mesa model to obtain a target mesa model; perform a blurring process on the target mesa model based on a mountain region range of the mask corresponding to the target mesa model to obtain the mesa model; and replace the sub-mountain foot model with the mesa model.

[0175] Optionally, the apparatus further includes: a third determination unit configured to determine, in a terrain file, a terrain region with a slope in a slope threshold range, wherein the terrain file is used to represent a terrain of a virtual scene, and the slope threshold range is used to represent a range of slopes of the mountain model; a processing unit configured to perform an expansion process and a blurring process on a mask corresponding to the terrain region to obtain an initial mountain model mask; a second deletion unit configured to delete, in an initial terrain grid corresponding to the terrain file, a region with a mask value less than a second mask value threshold in the initial mountain model mask to obtain a terrain grid of the mountain model, wherein the initial terrain grid is used to represent a grid of the terrain corresponding to the terrain file; a third deletion unit configured to delete, in the terrain grid of the mountain model, a terrain grid of at least one sub-mountain model with a height less than a height threshold and / or an area less than an area threshold; and a projection unit configured to project the terrain grid of the mountain model after the deletion onto the terrain to obtain the mountain model mask.

[0176] Optionally, the determining module is configured to determine the road model mask corresponding to the coverage area, including: obtaining a tubular model of the road model; and projecting a terrain grid of the tubular model onto the terrain to obtain the road model mask.

[0177] Optionally, the obtaining unit 2702 includes: a first obtaining module configured to obtain the mountain model based on a terrain file, where the terrain file is used to represent the terrain of the virtual scene; and a second obtaining module configured to obtain the road model based on a road centerline file, where the road centerline file is used to represent the centerline of the road in the virtual scene.

[0178] In this embodiment, the mountain model and the road model to be processed in the virtual scene are obtained by the obtaining unit 2702, where the mountain model includes a mountain foot model. The target mountain region where the mountain foot model is located on the mountain model and the coverage area of the road model are determined by the first determining unit 2704. The target sub-mountain region in the target mountain region is determined based on the coverage area by the second determining unit 2706, where the target sub-mountain region is used to represent the mountain region on the mountain foot model where the mesa model is to be generated, and the target sub-mountain region is independent of the coverage area. The sub-mountain foot model in the mountain foot model located on the target sub-mountain region is converted into the mesa model by the converting unit 2708, where the mesa model matches the model in the mountain model except the sub-mountain foot model. That is, the intersection relationship between the coverage area of the road model and the target mountain region where the mountain foot model is located on the mountain model is used to determine the target sub-mountain region independent of the coverage area in the embodiment of the present disclosure, and the sub-mountain foot model in the mountain foot model located on the target sub-mountain region is further converted into the mesa model, so as to achieve the purpose of automatically generating the mesa model, avoid generating the mesa model by manually increasing or editing, and further achieve the technical effect of improving the efficiency of generating the mesa model, and solve the technical problem of low efficiency of generating the mesa model.

[0179] It should be noted that the above units can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all the units are located in the same processor; or the units are located in different processors in any combination.

[0180] The embodiment of the present disclosure further provides a computer readable storage medium, which stores a computer program, where the computer program is set to execute the steps in any of the above method embodiments when running.

[0181] Optionally, in the embodiment, the above computer readable storage medium can be set to store a computer program for executing the following steps:

[0182] S1, acquire a mountain model and a road model to be processed in a virtual scene, wherein the mountain model comprises a mountain foot model;

[0183] S2, determine a target mountain region where the mountain foot model is located on the mountain model, and a coverage region of the road model;

[0184] S3, determine a target sub-mountain region in the target mountain region based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the mountain foot model where a mesa model is to be generated, and the target sub-mountain region is independent of the coverage region;

[0185] S4, convert a sub-mountain foot model in the mountain foot model located on the target sub-mountain region into the mesa model.

[0186] Optionally, in the embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various computer program storage media.

[0187] Embodiments of the present disclosure also provide an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the above method embodiments.

[0188] Optionally, the electronic device can further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0189] Optionally, in the embodiment, the processor can be configured to execute the following steps through the computer program:

[0190] S1, acquire a mountain model and a road model to be processed in a virtual scene, wherein the mountain model comprises a mountain foot model;

[0191] S2, determine a target mountain region where the mountain foot model is located on the mountain model, and a coverage region of the road model;

[0192] S3, determine a target sub-mountain region in the target mountain region based on the coverage region, wherein the target sub-mountain region is used to represent a mountain region on the mountain foot model where a mesa model is to be generated, and the target sub-mountain region is independent of the coverage region;

[0193] S4, convert a sub-mountain foot model in the mountain foot model located on the target sub-mountain region into the mesa model.

[0194] Embodiments of the present disclosure also provide a computer program product, which can include a computer program, wherein the computer program is configured to execute the steps in any of the method embodiments described above when running.

[0195] Optionally, in the present embodiment, the computer program product described above can be configured to include a computer program for executing the following steps:

[0196] S1, obtaining a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a mountain foot model;

[0197] S2, determining a target mountain area where the mountain foot model is located on the mountain model, and a coverage area of the road model;

[0198] S3, determining a target sub-mountain area in the target mountain area based on the coverage area, wherein the target sub-mountain area is used to represent a mountain area on the mountain foot model where a mesa model is to be generated, and the target sub-mountain area and the coverage area are independent of each other;

[0199] S4, converting a sub-mountain foot model in the mountain foot model located on the target sub-mountain area into the mesa model.

[0200] Embodiments of the present disclosure also provide a computer program product, which can include a non-volatile computer readable storage medium, wherein the non-volatile computer readable storage medium stores a computer program configured to execute the steps in any of the method embodiments described above when running.

[0201] Optionally, in the present embodiment, the computer program product described above can be configured to include a non-volatile computer readable storage medium, which can be configured to store a computer program for executing the following steps:

[0202] S1, obtaining a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a mountain foot model;

[0203] S2, determining a target mountain area where the mountain foot model is located on the mountain model, and a coverage area of the road model;

[0204] S3, determining a target sub-mountain area in the target mountain area based on the coverage area, wherein the target sub-mountain area is used to represent a mountain area on the mountain foot model where a mesa model is to be generated, and the target sub-mountain area and the coverage area are independent of each other;

[0205] S4, converting a sub-mountain foot model in the mountain foot model located on the target sub-mountain area into the mesa model.

[0206] Embodiments of the present disclosure also provide a computer program which is arranged to perform the steps of any of the method embodiments described above when executed.

[0207] Optionally, in the present embodiment, the computer program described above is arranged to perform the following steps:

[0208] S1, obtaining a mountain model and a road model to be processed in a virtual scene, wherein the mountain model comprises a mountain foot model;

[0209] S2, determining a target mountain area where the mountain foot model is located on the mountain model, and a coverage area of the road model;

[0210] S3, determining a target sub-mountain area in the target mountain area based on the coverage area, wherein the target sub-mountain area is used to represent a mountain area of the mountain foot model where a mesa model is to be generated, and the target sub-mountain area is independent of the coverage area;

[0211] S4, converting a sub-mountain foot model in the mountain foot model located on the target sub-mountain area into a mesa model.

[0212] Optionally, specific examples in the present embodiment can refer to the examples described in the above embodiments and optional implementation manners, which will not be described herein again.

[0213] Figure 28 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. As shown in Figure 28 , the electronic device 2800 is merely one example and should not bring any limitation to the function and use range of the embodiments of the present disclosure.

[0214] As shown in Figure 28 , the electronic device 2800 is in the form of a general computing device. The components of the electronic device 2800 can include but are not limited to the above-mentioned at least one processor 2810, the above-mentioned at least one memory 2820, a bus 2830 connecting different system components (including the memory 2820 and the processor 2810), and a display 2840.

[0215] The above-mentioned memory 2820 stores program codes which can be executed by the processor 2810, so that the processor 2810 performs the steps according to various exemplary embodiments of the present disclosure described in the above method part of the embodiments of the present disclosure.

[0216] Memory 2820 can include a readable medium in the form of volatile memory units, such as random access memory (RAM) 28201 and / or cache memory 28202, and can further include a read-only memory (ROM) 28203, and can also include nonvolatile memory such as one or more magnetic data storage devices, flash memory, or other non-volatile solid-state memory.

[0217] In some examples, memory 2820 can also include a program / utility 28204 having a set (at least one) of program modules 28205, including an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof, can include implementation of a network environment as in each of these examples or some combination thereof. Memory 2820 can further include memory that is remote from the processor 2810, which can be connected to electronic device 2800 through a network connection. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network (LAN), a wide area network (WAN), and combinations thereof.

[0218] Bus 2830 can be representative of one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor 2810, or a local bus using any of a variety of bus architectures.

[0219] Display 2840 can be, for example, a liquid crystal display (LCD) that is touch screen-enabled, which can enable a user to interact with a user interface of electronic device 2800.

[0220] Optionally, electronic device 2800 can also communicate with one or more external devices 2900 such as a keyboard or a pointing device, a Bluetooth device, etc.; and can communicate with one or more devices that enable a user to interact with electronic device 2800 and / or one or more devices (e.g., a router, a modem, etc.) that enable electronic device 2800 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface 2850. Still yet, electronic device 2800 can communicate with one or more networks, such as one or more Local Area Networks (LANs), Wide Area Networks (WANs), and / or the public network, such as the Internet, via network adapter 2860. As Figure 28 illustrated, network adapter 2860 can communicate with the other components of electronic device 2800 via bus 2830. It should be appreciated that although not shown, other hardware and / or software components that are used in connection with the Figure 28As not shown, other hardware and / or software modules may be used in conjunction with electronic device 2800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Array of Independent Disks (RAID) systems, tape drives, and data backup storage systems.

[0221] The aforementioned electronic device 2800 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0222] Those skilled in the art will understand that Figure 28 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 2800 may also include components that are more... Figure 28 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 2820 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the terrain model processing method in this embodiment. The processor 2810 executes various functional applications and data processing by running the computer program stored in the memory 2820, thereby implementing the aforementioned terrain model processing method.

[0223] The sequence numbers of the embodiments disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0224] In the above embodiments of this disclosure, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0225] In the several embodiments provided in this disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0226] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0227] In addition, each function unit in various embodiments of the present disclosure can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0228] If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present disclosure, essentially or in the contribution to the related art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the method of the present disclosure. The foregoing storage medium includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various other media that can store program codes.

[0229] The above is only the preferred embodiment of the present disclosure, and it should be pointed out that, for those skilled in the art, without departing from the principles of the present disclosure, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present disclosure.

Claims

1. A method for processing terrain models, characterized in that, include: Obtain the mountain model and road model to be processed in the virtual scene, wherein the mountain model includes the mountain foot model; Determine the target mountain area where the foot of the mountain model is located on the mountain model, and the coverage area of ​​the road model; Based on the coverage area, a target sub-mountain area is determined in the target mountain area, wherein the target sub-mountain area is used to represent the mountain area on the foot mountain model where the plateau model is to be generated, and the target sub-mountain area is independent of the coverage area; The sub-mountain foot model located on the target sub-mountain area in the mountain foot model is converted into a plateau model; The process of determining a target sub-mountain region within the target mountain region based on the coverage area includes: determining a road model mask corresponding to the coverage area and an initial foothill model mask corresponding to the target mountain region; determining an intersection model mask between the road model mask and the mountain model mask of the mountain model, wherein the mountain model mask represents the mountain region of the mountain model, and the intersection model mask represents the mask range located at the foothill model and covering the road model; removing the intersection model mask from the initial foothill model mask to obtain a first target foothill model mask; determining a set of mountain regions corresponding to the first target foothill model mask, wherein the set of mountain regions includes multiple target mountain regions with the same type attributes; and determining the target sub-mountain region within the set of mountain regions.

2. The method according to claim 1, characterized in that, Determine the intersection model mask between the road model mask and the mountain model mask, including: The road model mask and the mountain model mask are enlarged respectively; Obtain the intersection model mask between the enlarged road model mask and the enlarged mountain model mask.

3. The method according to claim 1, characterized in that, In the initial foothill model mask, the intersection model mask is removed to obtain the first target foothill model mask, including: In the initial foothill model mask, the intersection model mask is removed, and noise information is generated in the removed initial foothill model mask to obtain the first target foothill model mask.

4. The method according to claim 1, characterized in that, The method further includes: In the initial terrain mesh corresponding to the terrain file, areas with mask values ​​less than a first mask value threshold are deleted to obtain a first target terrain mesh. The terrain file is used to represent the terrain of the virtual scene, and the initial terrain mesh is used to represent the mesh of the terrain corresponding to the terrain file. Determining the set of mountain regions corresponding to the first target mountain foot model mask includes: in the first target terrain mesh, determining the set of mountain regions based on multiple initial mountain regions corresponding to the first target mountain foot model mask, wherein the multiple initial mountain regions have the same type attribute.

5. The method according to claim 4, characterized in that, Within the first target terrain mesh, based on multiple initial mountain regions corresponding to the mask of the first target mountain foot model, the set of mountain regions is determined, including: Within the first target terrain grid, determine the area of ​​the initial mountain region; Among the plurality of said initial mountain regions, a first number of initial mountain regions whose area is within the area threshold range are determined; In the first number of initial mountain regions, a second number of initial mountain regions are randomly deleted to obtain multiple target mountain regions, wherein the second number is less than the first number; The multiple target mountain regions are defined as the mountain region set.

6. The method according to claim 4, characterized in that, Within the aforementioned mountain region, the target sub-mountain region is determined, including: Determine the first distance between the center point of the target mountain region and the center line of the road model mask; Among the multiple first distances corresponding to the multiple target mountain areas, the minimum first distance is determined; In the mountain region, delete the target mountain regions whose minimum first distance is less than the first distance threshold. The deleted mountain region set is projected onto the terrain to obtain the mask of the second target mountain foot model; Based on the mask of the second target mountain foot model, the target sub-mountain region is determined.

7. The method according to claim 6, characterized in that, Based on the mask of the second target mountain foot model, the target sub-mountain region is determined, including: The edges of the second target mountain foot model mask are blurred to obtain the third target mountain foot model mask, wherein the third target mountain foot model mask is used to represent the target sub-mountain region.

8. The method according to claim 1, characterized in that, The method further includes: In the terrain file, terrain areas with slopes within a slope threshold range are identified, wherein the terrain file is used to represent the terrain of the virtual scene, and the slope threshold range is used to represent the range of slopes of the mountain model; The mask corresponding to the terrain region is enlarged and blurred to obtain the initial mountain model mask; In the initial terrain mesh corresponding to the terrain file, areas in the initial mountain model mask whose mask value is less than the second mask value threshold are deleted to obtain the terrain mesh of the mountain model. The initial terrain mesh is used to represent the mesh of the terrain corresponding to the terrain file. In the terrain mesh of the mountain model, delete the terrain mesh of at least one sub-mountain model whose height is less than a height threshold and / or whose area is less than an area threshold; The terrain mesh of the deleted mountain model is projected onto the terrain to obtain the mountain model mask.

9. The method according to claim 8, characterized in that, Determining the road model mask corresponding to the covered area includes: Obtain the tubular model of the road model; The terrain mesh of the tubular model is projected onto the terrain to obtain the road model mask.

10. The method according to claim 1, characterized in that, Converting the sub-mountain foot model located on the target sub-mountain region into a plateau model includes: Based on the initial terrain mesh corresponding to the terrain file, the sub-mountain foot model is converted into a plateau model, wherein the terrain file is used to represent the terrain of the virtual scene.

11. The method according to claim 10, characterized in that, Based on the initial terrain mesh corresponding to the terrain file, the sub-mountain foot model is converted into a plateau model, including: In the initial terrain mesh, the second target terrain mesh is cropped according to the range of the mountain area corresponding to the third target mountain foot model mask. The third target mountain foot model mask is used to represent the target sub-mountain area, and the range of the mountain area is used to represent the range of the target sub-mountain area. The second target terrain mesh is blurred to obtain the third target terrain mesh; Based on the third target terrain grid, the sub-mountain foot model is converted into the plateau model.

12. The method according to claim 11, characterized in that, Based on the third target terrain mesh, the sub-mountain foot model is converted into the plateau model, including: The third target terrain grid and the second target terrain grid are mixed to obtain the fourth target terrain grid; The height of the fourth target terrain grid is set to the target height to obtain the fifth target terrain grid; Based on the fifth target terrain grid, the sub-mountain foot model is deformed to obtain the plateau model.

13. The method according to claim 12, characterized in that, Based on the fifth target terrain grid, the sub-mountain foot model is deformed to obtain the plateau model, including: Set the height of the terrain to the target height; Determine the second distance between the configured terrain and the fifth target terrain grid; Based on the second distance, a plateau model mask corresponding to the plateau model to be obtained is determined, wherein the plateau model mask is used to represent the mountain area of ​​the plateau model; The sub-mountain foot model is deformed according to the terrace model mask to obtain the terrace model.

14. The method according to claim 13, characterized in that, The method further includes: Obtain the target point on the mountain model that is closest to the fifth target terrain mesh, and the texture coordinates of the target point; Based on the target point and its texture coordinates, the target height corresponding to the fourth target terrain mesh is obtained; The process of deforming the sub-mountain foot model according to the plateau model mask to obtain the plateau model includes: using the mask value of the plateau model mask to mix the height of the sub-mountain foot model and the height corresponding to the fourth target terrain mesh to obtain an initial plateau model; and deforming the sub-mountain foot model based on the initial plateau model to obtain the plateau model.

15. The method according to claim 14, characterized in that, Based on the initial plateau model, the sub-mountain foot model is deformed to obtain the plateau model, including: Based on the mountain area range of the mask corresponding to the initial plateau model, the initial plateau model is deformed to obtain the target plateau model; Based on the mountain area range of the mask corresponding to the target plateau model, the target plateau model is blurred to obtain the plateau model. Replace the sub-mountain foot model with the plateau model.

16. The method according to any one of claims 1 to 15, characterized in that, Obtain the mountain and road models to be processed in the virtual scene, including: The mountain model is obtained based on the terrain file, wherein the terrain file is used to represent the terrain of the virtual scene; The road model is obtained based on the road centerline file, wherein the road centerline file is used to represent the centerline of the road in the virtual scene.

17. A terrain model processing device, characterized in that, include: An acquisition unit is used to acquire a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a mountain foot model; The first determining unit is used to determine the target mountain area where the foot of the mountain model is located on the mountain model, and the coverage area of ​​the road model; The second determining unit is used to determine a target sub-mountain region in the target mountain region based on the coverage area, wherein the target sub-mountain region is used to indicate that the mountain region of the terrace model to be generated on the foot of the mountain model is independent of the coverage area; The conversion unit is used to convert the sub-mountain foot model located on the target sub-mountain area in the mountain foot model into a plateau model; The second determining unit is configured to determine a target sub-mountain region in the target mountain region based on the coverage area through the following steps: determining a road model mask corresponding to the coverage area and an initial foothill model mask corresponding to the target mountain region; determining an intersection model mask between the road model mask and the mountain model mask of the mountain model, wherein the mountain model mask is used to represent the mountain region of the mountain model, and the intersection model mask is used to represent the mask range located in the foothill model and covering the road model; removing the intersection model mask from the initial foothill model mask to obtain a first target foothill model mask; determining a set of mountain regions corresponding to the first target foothill model mask, wherein the set of mountain regions includes multiple target mountain regions with the same type attribute; and determining the target sub-mountain region in the set of mountain regions.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 16 when run by a processor.

19. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any one of claims 1 to 16.

20. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 16.

Citation Information

Patent Citations

  • Method and device for rendering mountain in three-dimensional virtual scene of application program

    CN112927365A

  • Terrain model generation method and device, storage medium and electronic equipment

    CN116212375A