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

By determining the target sub-mountain area in the virtual scene and converting the foothill model, the problem of low efficiency in generating the platform model in the prior art is solved, and an automated generation and efficient platform model is realized.

CN119445014AActive Publication Date: 2025-02-14GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the generation of platform models is inefficient and there is a lack of effective solutions.

Method used

By obtaining the mountain model and road model in the virtual scene, we determine the target mountain area and road model coverage area of ​​the foot of the mountain model on the mountain model, determine the target sub-mountain area based on these relationships, and convert the sub-mountain model in the foot of the mountain model into Platform model.

Benefits of technology

The automatic generation of platform models is realized, which improves the generation efficiency, avoids the inefficient process of manual addition or editing, and solves the problem of inefficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445014A_ABST
    Figure CN119445014A_ABST
Patent Text Reader

Abstract

The invention discloses a terrain model processing method and device, a storage medium and an electronic device. The method comprises the steps that a to-be-processed mountain model and a to-be-processed road model in a virtual scene are acquired, and the mountain model comprises a mountain foot model; determining a target mountain area of the mountain foot model on the mountain model and a coverage area of the road model; based on the coverage area, a target sub-mountain area is determined in the target mountain area, the target sub-mountain area is used for representing a mountain area of a to-be-generated platform model on the mountain foot model, and the target sub-mountain area and the coverage area are mutually independent; and converting a sub-mountain foot model located on the target sub-mountain area in the mountain foot model into a platform model. The technical problem of low efficiency of generating the platform model is solved.
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 in particular to a method, device, storage medium and electronic device for processing a terrain model. Background Art

[0002] Currently, in the processing of terrain models, the terrain models generated by automated means have high repetitiveness. In order to add changes to the map, it is necessary to generate a terrace model on the terrain model.

[0003] In the related art, a terrace model is usually generated by manually adding or editing a foothill model of a terrain model, which results in a technical problem of low efficiency in generating the terrace model.

[0004] With respect to the above-mentioned problem of low efficiency in generating terrace models, no effective solution has been proposed so far. Summary of the invention

[0005] At least some embodiments of the present disclosure provide a method, device, storage medium and electronic device for processing a terrain model to at least solve the technical problem of low efficiency in generating a terrace model.

[0006] According to one embodiment of the present disclosure, a method for processing a terrain model is provided. The method may include: obtaining a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a foot of mountain model; determining a target mountain area where the foot of mountain model is located on the mountain model, and a coverage area of ​​the road model; based on the coverage area, determining a target sub-mountain area in the target mountain area, wherein the target sub-mountain area is used to represent a mountain area on the foot of mountain model where a terrace model is to be generated, and the target sub-mountain area is independent of the coverage area; converting a sub-mountain foot model located on the target sub-mountain area in the foot of mountain model into a terrace model.

[0007] According to one embodiment of the present disclosure, a terrain model processing device is also provided. The device may include: an acquisition unit, used to acquire a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a foot of mountain model; a first determination unit, used to determine a target mountain area where the foot of mountain model is located on the mountain model, and a coverage area of ​​the road model; a second determination unit, used to determine 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 foot of mountain model where a terrace model is to be generated, and the target sub-mountain area and the coverage area are independent of each other; a conversion unit, used to convert a sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model into a terrace model.

[0008] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any of the above-mentioned terrain model processing methods when running.

[0009] According to one embodiment of the present disclosure, an electronic device is also provided. The electronic device may include a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above-mentioned terrain model processing methods.

[0010] According to one embodiment of the present disclosure, a computer program product is also provided. The computer program product may include a computer program, wherein the computer program is configured to execute any of the above terrain model processing methods when running.

[0011] According to one embodiment of the present disclosure, a computer program product is also provided. The computer program product may include a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and the computer program is configured to execute any of the above terrain model processing methods when running.

[0012] According to one embodiment of the present disclosure, a computer program is further provided, which is configured to execute any of the above terrain model processing methods when running.

[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 foot of mountain model; a target mountain area where the foot of mountain model is located on the mountain model, and a coverage area of ​​the road model are determined; 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 of mountain model where a terrace model is to be generated, and the target sub-mountain area is independent of the coverage area; and the sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model is converted into a terrace model. That is, the embodiment of the present disclosure determines a target sub-mountain area that is independent of the coverage area based on the intersection relationship between the coverage area of ​​the road model and the target mountain area where the foot of mountain model is located on the mountain model, and further converts the sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model into a terrace model, thereby achieving the purpose of automatically generating a terrace model, avoiding generating a terrace model by manual addition or editing, and thereby achieving the technical effect of improving the efficiency of generating a terrace model, and solving the technical problem of low efficiency of generating a terrace model. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:

[0015] Figure 1 is a hardware structure block diagram of a mobile terminal according to a terrain model processing method of an embodiment of the present disclosure;

[0016] Figure 2 is a flow chart of a method for processing a terrain model according to one embodiment of the present disclosure;

[0017] Figure 3 is a schematic diagram of a screening area mask according to one embodiment of the present disclosure;

[0018] Figure 4 is a schematic diagram of a basic mountain model mask according to one embodiment of the present disclosure;

[0019] Figure 5 is a schematic diagram of obtaining a mountain model grid according to one embodiment of the present disclosure;

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

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

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

[0023] Fig. 9 is a schematic diagram of obtaining a regional mask covering a road model at a foot of a mountain model according to one embodiment of the present disclosure;

[0024] Fig.10 is a schematic diagram of deleting a regional mask covering a road model at a foot of a mountain model according to one embodiment of the present disclosure;

[0025] Fig.11 is a schematic diagram of looping over regions with consistent class attributes according to one embodiment of the present disclosure;

[0026] Fig.12 is a schematic diagram of deleting a region according to the area of ​​the region according to one embodiment of the present disclosure;

[0027] Fig.13 is a schematic diagram of deleting regions based on distance according to one embodiment of the present disclosure;

[0028] Fig.14is a schematic diagram of a mask after a region is deleted according to one embodiment of the present disclosure;

[0029] Fig.15 is a schematic diagram of obtaining a terrace model mask according to one embodiment of the present disclosure;

[0030] Fig.16 is a schematic diagram of a grid cut out according to a terrace model mask during preprocessing according to one embodiment of the present disclosure;

[0031] Fig.17 is a schematic diagram of obtaining a first grid according to one embodiment of the present disclosure;

[0032] Fig.18 is a schematic diagram of obtaining a second grid according to one embodiment of the present disclosure;

[0033] Fig.19 is a schematic diagram of a hybrid first grid and a second grid according to one embodiment of the present disclosure;

[0034] Fig. 20 is a schematic diagram of obtaining a third grid according to one embodiment of the present disclosure;

[0035] Fig.21 is a schematic diagram of obtaining a terrace model mask according to one embodiment of the present disclosure;

[0036] Fig. 22 is a schematic diagram of obtaining a basic platform terrain model according to one embodiment of the present disclosure;

[0037] Fig.23 is a schematic diagram of a basic platform terrain model according to one embodiment of the present disclosure;

[0038] Fig.24 is a schematic diagram of a distorted base platform terrain model according to one embodiment of the present disclosure;

[0039] Fig.25 is a schematic diagram of a fuzzy basic platform terrain model according to one embodiment of the present disclosure;

[0040] Fig.26 is a schematic diagram of the generation effect of a terrace model according to one embodiment of the present disclosure;

[0041] Fig. 27 is a structural block diagram of a terrain model processing device according to one embodiment of the present disclosure;

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

[0043] In order to enable those skilled in the art to better understand the disclosed solution, the technical solution in the disclosed embodiment will be clearly and completely described below in conjunction with the drawings in the disclosed embodiment. Obviously, the described embodiment is only a part of the disclosed embodiment, not all of the embodiments. Based on the embodiments in the disclosed embodiment, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the disclosed embodiment.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, 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 "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may 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 terrace model needs to be generated, the terrace model can usually be generated by manually adding and editing the foot of the mountain model of the terrain model. However, after practice and careful research, the inventors found that if the above method is used to generate a terrace model, the manual addition and editing of the method is inefficient, resulting in a technical problem of low efficiency in generating the terrace model.

[0046] Based on the above, an embodiment of the present disclosure proposes a method for processing a terrain model, which obtains a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a foot of a mountain model; determines a target mountain area where the foot of the mountain model is located on the mountain model, and a coverage area of ​​the road model; based on the coverage area, determines a target sub-mountain area in the target mountain area, wherein the target sub-mountain area is used to represent the mountain area on the foot of the mountain model where a terrace model is to be generated, and the target sub-mountain area is independent of the coverage area; converts the sub-foot of the mountain model located on the target sub-mountain area in the foot of the mountain model into a terrace model, thereby achieving the technical effect of improving the efficiency of generating the terrace model.

[0047] Considering that in the related art, when a terrace model is generated by manually adding or editing a foot model of a terrain model, there is a technical problem of low efficiency in generating a terrace model. However, in the disclosed embodiment, based on the intersection relationship between the coverage area of ​​the road model and the target mountain area where the foot model is located on the mountain model, a target sub-mountain area independent of the coverage area is determined, and the sub-foot model located on the target sub-mountain area in the foot model is further converted into a terrace model, thereby achieving the technical effect of improving the efficiency of generating a terrace model and solving the technical problem of low efficiency in generating a terrace model.

[0048] According to one embodiment of the present disclosure, an embodiment of a method for processing a terrain model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings 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 running on a mobile terminal as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID for short), a tablet computer (PAD), a game console and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to a method for processing a terrain model in an embodiment of the present disclosure. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 (the processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may further include a transmission device 106, an input and output device 108, and a display device 110 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0050] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for processing the terrain model in the embodiment of the present disclosure. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method for processing the terrain model described above is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0051] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0052] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.

[0053] The display device 110 may be, for example, a Heads Up Display (HUD), a touch screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The LCD display enables the user to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and the user can interact with the GUI by finger contacts and / or gestures on the touch-sensitive surface. The human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.

[0054] Those skilled in the art will understand that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0055] In a possible implementation, the present disclosure provides a method for processing a terrain model. Figure 2is a flow chart of a method for processing a terrain model according to one embodiment of the present disclosure, such as Figure 2 As shown, the method may include the following steps:

[0056] Step S202, obtaining a mountain model and a road model to be processed in the virtual scene, wherein the mountain model includes a mountain foot model.

[0057] In the technical solution provided in the above step S202 of the present disclosure, the mountain model and road model to be processed in the virtual scene can be obtained. The virtual scene can be a virtual environment generated by computer technology, a virtual game scene, or a scene used to simulate various scenes in the real world, such as cities, forests, and mountains. The virtual scene can be a virtual game scene. This is only an example, and the type of virtual scene is not specifically limited.

[0058] Optionally, the mountain model can be a model that simulates terrain such as mountains and hills in the real world, and can be a mountain model in a virtual game scene. This is only an example and does not specifically limit the virtual scene in which the mountain model is located. The mountain model can include a foot of the mountain model, and the foot of the mountain model can be a model located at the foot of the mountain model.

[0059] Optionally, the road model may be a model simulating traffic routes such as roads and streets in the real world, or may be a road model in a virtual game scene. This is only an example and does not impose any specific restrictions on the virtual scene in which the road model is located.

[0060] For example, the virtual scene may be a virtual game scene, such as a big world game scene. In the big world game scene, when it is necessary to generate a terrace model at the foot of a mountain model, the mountain model and road model to be processed in the big world game scene may be obtained based on the big world map. Further, based on the obtained mountain model and road model, a terrace model may be generated.

[0061] Step S204, determining 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.

[0062] In the technical solution provided in the above step S204 of the present disclosure, after obtaining the mountain model and road model to be processed in the virtual scene, 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 can be determined. Among them, the target mountain area can be the area where the foot of the mountain model is located, for example, the target mountain area can be the bottom area of ​​the mountain model or the area close to the bottom of the mountain model. The coverage area can be the area range where the road model is located.

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

[0064] Step S206, based on the coverage area, determine a target sub-mountain area in the target mountain area, wherein the target sub-mountain area is used to represent the mountain area of ​​the terrace model to be generated on the foot of the mountain model, and the target sub-mountain area is independent of the coverage area.

[0065] In the technical solution provided in the above step S206 of the present disclosure, after determining 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 target sub-mountain area can be determined in the determined target mountain area based on the determined coverage area of ​​the road model. The target sub-mountain area can be used to represent the mountain area of ​​the terrace model to be generated on the foot of the mountain model, and the target sub-mountain area is independent of the coverage area.

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

[0067] Step S208, converting the sub-mountain foot model located on the target sub-mountain area in the mountain foot model into a terrace model.

[0068] In the technical solution provided in the above step S208 of the present disclosure, after the target sub-mountain area is determined in the target mountain area based on the coverage area, the sub-mountain foot model located on the target sub-mountain area in the mountain foot model can be converted into a terrace model. Among them, the sub-mountain foot model can be a mountain foot model located on the target sub-mountain area. The terrace model can be a model that matches the model other than the sub-mountain foot model in the mountain model, and the match here can mean that the terrace model can be naturally connected with the mountain model of the original terrain.

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

[0070] Through the above steps S202 to S208, the mountain model and road model to be processed in the virtual scene are obtained, wherein the mountain model includes a foot of mountain model; the target mountain area where the foot of mountain model is located on the mountain model, and the coverage area of ​​the road model are determined; based on the coverage area, the target sub-mountain area is determined in the target mountain area, wherein the target sub-mountain area is used to represent the mountain area of ​​the terrace model to be generated on the foot of mountain model, and the target sub-mountain area is independent of the coverage area; the sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model is converted into a terrace model, wherein the terrace model matches the model in the mountain model except the sub-foot of mountain model. That is to say, the disclosed embodiment determines a target sub-mountain area independent of the coverage area based on the intersection relationship between the coverage area of ​​the road model and the target mountain area where the foot of the mountain model is located on the mountain model, and further converts the sub-foot of the mountain model located on the target sub-mountain area in the foot of the mountain model into a terrace model, thereby achieving the purpose of automatically generating the terrace model, avoiding the generation of the terrace model by manual addition or editing, and further realizing the technical effect of improving the efficiency of generating the terrace model, and solving the technical problem of low efficiency in generating the terrace model.

[0071] The above method of the embodiment of the present disclosure is further introduced below.

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

[0073] In this embodiment, after determining 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, a road model mask corresponding to the coverage area and an initial foot of the mountain model mask corresponding to the target mountain area can be determined. Further based on the determined road model mask and the initial foot of the mountain model mask, a target sub-mountain area can be generated. Among them, the road model mask can be used to represent the coverage area, and the initial foot of the mountain model mask can be used to represent the target mountain area.

[0074] Optionally, after determining the target mountain area and the coverage area of ​​the road model, the road model mask corresponding to the coverage area and the initial foot of the mountain model mask corresponding to the target mountain area can be determined, that is, the road model mask and the initial foot of the mountain model mask are determined. Since the generated terrace model cannot cover the road model, the target sub-mountain area can be generated based on the intersection relationship between the road model mask and the initial foot of the mountain model mask, thereby generating a terrace model at the determined target sub-mountain area.

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

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

[0077] Optionally, the mountain model mask can be used to represent the mountain area of ​​the mountain model, and the mountain model mask can be called a large mountain model mask. The intersection model mask can be used to represent the mask range located in the foot model and covering the road model, and the intersection model mask can be represented by mask A. The first target foot model mask can be the foot model mask of the initial foot model mask with the intersection model mask removed, and the first target foot model mask can be represented by mask B. The mountain area set can include multiple target mountain areas with the same type (class) attribute, that is, the mountain area set includes areas with consistent class attributes.

[0078] Optionally, after obtaining the mountain model, the small hill model in the mountain model can be removed to obtain the mountain model mask, that is, to obtain the large mountain model mask. Since the generated terrace model cannot cover the road model, the intersection model mask between the road model mask and the mountain model mask of the mountain model can be determined, that is, to determine the mask A in which the large mountain model mask covers the road model mask. The determined intersection model mask can be further removed to obtain the first target foot of the mountain model mask, that is, to remove mask A from the initial foot of the mountain model mask to obtain mask B. After obtaining the first target foot of the mountain model mask, the mountain region set corresponding to the first target foot of the mountain model mask can be determined, and the target sub-mountain region can be determined in the determined mountain region set. That is to say, after obtaining mask B, the area with consistent class attributes in mask B can be determined as the mountain region set, and multiple target sub-mountain regions can be determined in the determined mountain region set.

[0079] In this embodiment, since the terrace model cannot cover the road model, this embodiment first determines the intersection model mask covering the road model, and further removes the intersection model mask to obtain multiple target sub-mountain areas that can generate the terrace model.

[0080] As an optional embodiment, determining the intersection model mask between the road model mask and the mountain model mask of the mountain model includes: respectively enlarging the road model mask and the mountain model mask; and obtaining the intersection model mask between the enlarged road model mask and the enlarged mountain model mask.

[0081] In this embodiment, after determining the road model mask corresponding to the coverage area, the road model mask and the mountain model mask may be enlarged respectively, and further, an intersection model mask between the enlarged road model mask and the enlarged mountain model mask may be obtained.

[0082] Optionally, after determining the road model mask and the mountain model mask, the road model mask and the mountain model mask may be enlarged respectively. Further, a mask A between the enlarged road model mask and the mountain model mask may be obtained to remove the mask A, thereby generating a terrace model in the area after the mask A is removed.

[0083] As an optional embodiment, 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.

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

[0085] Optionally, after determining mask A between the road model mask and the mountain model mask, mask A may be removed. Further, cell noise may be generated in the initial mountain foot model mask from which mask A is removed to obtain mask B.

[0086] As an optional embodiment, the method also includes: in an initial terrain grid corresponding to the terrain file, deleting areas whose mask values ​​are less than a first mask value threshold to obtain a first target terrain grid, wherein the terrain file is used to represent the terrain of the virtual scene, and the initial terrain grid is used to represent the grid of the terrain corresponding to the terrain file; determining a mountain area set corresponding to the first target foot of the mountain model mask, including: in the first target terrain grid, determining a mountain area set based on multiple initial mountain areas corresponding to the first target foot of the mountain model mask, wherein the type attributes of the multiple initial mountain areas are the same.

[0087] In this embodiment, in the initial terrain mesh corresponding to the terrain file, the area whose mask value is less than the first mask value threshold can be deleted to obtain the first target terrain mesh. After obtaining the first target terrain mesh, a mountain area set can be determined in the obtained first target terrain mesh based on multiple initial mountain areas corresponding to the first target foot of the mountain model mask. Among them, the terrain file can be used to represent the terrain of the virtual scene. 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 mesh can be used to represent the grid 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. This is only for example, and no specific limitation is made to the value of the first mask value threshold. The type attributes of multiple initial mountain areas are the same, that is, the class attributes of multiple initial mountain areas are consistent.

[0088] Optionally, after converting the terrain file into an initial terrain grid, the area whose mask value is less than the first mask value threshold can be deleted in the initial terrain grid corresponding to the terrain file to obtain the first target terrain grid. Further, based on multiple initial mountain areas with the same type attribute as the first target foothill model mask, a mountain area set is determined.

[0089] For example, the first mask value threshold is set to 0.5, and the terrain heightfield is converted into a first target terrain mesh to obtain the first target terrain mesh. Further, in the obtained first target terrain mesh, multiple initial mountain regions having the same class attribute as mask B are determined as a mountain region set.

[0090] As an optional embodiment, in the first target terrain grid, based on multiple initial mountain areas corresponding to the first target mountain foot model mask, a mountain area set is determined, including: in the first target terrain grid, the area of ​​the initial mountain area is determined; among the multiple initial mountain areas, a first number of initial mountain areas whose areas are within an area threshold range is determined; among the first number of initial mountain areas, a second number of initial mountain areas is randomly deleted to obtain multiple target mountain areas, wherein the second number is smaller than the first number; and the multiple target mountain areas are determined as a mountain area set.

[0091] In this embodiment, in the initial terrain grid corresponding to the terrain file, the area whose mask value is less than the first mask value threshold is deleted, and after the first target terrain grid is obtained, the area of ​​the initial mountain area can be determined in the obtained first target terrain grid. After determining the area of ​​the initial mountain area, a first number of initial mountain areas whose areas are within the area threshold range can be determined from multiple initial mountain areas. Further, a second number of initial mountain areas can be randomly deleted from the first number of initial mountain areas to obtain multiple target mountain areas. After obtaining multiple target mountain areas, the obtained multiple target mountain areas can be determined as a mountain area set. Among them, the area threshold range can be a range between the lower area limit value and the upper area 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 here, and no specific limitation is made to the value of the second number.

[0092] Optionally, after obtaining the first target terrain grid, the area of ​​the initial mountain region can be determined in the first target terrain grid. It can be further determined whether the area of ​​the initial mountain region is within an area threshold range, and a first number of initial mountain regions whose areas are within the area threshold range can be determined. It can be further determined that 50% of the initial mountain regions are randomly deleted from the first number of initial mountain regions to obtain multiple target mountain regions, and the multiple target mountain regions are determined as a mountain region set.

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

[0094] In this embodiment, after determining the mountain area set corresponding to the first target foot of mountain model mask, the first distance between the center point of the target mountain area in the mountain area set and the center line of the road model mask can be determined. After determining the first distance between the center point of the target mountain area and the center line of the road model mask, the minimum first distance can be determined among multiple first distances corresponding to multiple target mountain areas. Further, the target mountain area whose minimum first distance is less than the first distance threshold can be deleted from the mountain area set. After deleting the target mountain area whose minimum first distance is less than the first distance threshold from the mountain area set, the deleted mountain area set can be projected onto the terrain to obtain the second target foot of mountain model mask. Further, based on the second target foot of mountain model mask, the target sub-mountain area can be determined.

[0095] Optionally, the first distance may be the distance between the center point of the target mountain area and the center line of the road model mask. The minimum first distance may be the minimum distance among the first distances. The first distance threshold may be a distance threshold set according to actual conditions, for example, the first distance threshold may be 1000 meters, which is only used as an example and does not impose a specific restriction on the value of the first distance threshold. The second target foothill model mask may be represented by mask C.

[0096] Optionally, since the distance between the generated terrace model and the road model is not very far, based on the first distance between the center point of the target mountain area and the center line of the road model mask, it can be determined whether to delete the corresponding target mountain area. 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 area corresponding to the minimum first distance can be deleted from the mountain area set. Further, the mountain area set after deleting the target mountain area can be projected onto the terrain to obtain a second target foot model mask, that is, to obtain mask C, so as to determine the target sub-mountain area based on the obtained mask C.

[0097] As an optional embodiment, determining the target sub-mountain area based on the second target foothill model mask includes: blurring the edge of the second target foothill model mask to obtain a third target foothill model mask, wherein the third target foothill model mask is used to represent the target sub-mountain area.

[0098] In this embodiment, after the deleted mountain area set is projected onto the terrain to obtain the second target foot of the mountain model mask, the edge of the second target foot of the mountain model mask can be blurred to obtain the third target foot of the mountain model mask. The third target foot of the mountain model mask can be used to represent the target sub-mountain area, can be represented by mask D, and can be called a terrace model mask.

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

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

[0101] In this embodiment, after determining the target sub-mountain area in the target mountain area based on the coverage area, the sub-mountain foot model can be converted into a terrace model based on the initial terrain grid corresponding to the terrain file. The terrain file can be used to represent the terrain of the virtual scene. 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 converting the terrain file into the initial terrain grid, based on the initial terrain grid corresponding to the terrain file, the sub-mountain foot model located on the target sub-mountain area in the mountain foot model can be converted into a terrace model, and the corresponding terrain grid can be cut out in the initial terrain grid according to the range of the target sub-mountain area, and the terrain grid is fuzzy processed, and then the sub-mountain foot model can be converted into a terrace model based on the fuzzy terrain grid. This is further explained below.

[0103] As an optional embodiment, based on the initial terrain grid corresponding to the terrain file, the sub-mountain foot model is converted into a terrace model, including: in the initial terrain grid, according to the mountain area range corresponding to the third target mountain foot model mask, cutting out the second target terrain grid, wherein the third target mountain foot model mask is used to represent the target sub-mountain area, and the mountain area range is used to represent the range of the target sub-mountain area; fuzzy processing is performed on the second target terrain grid to obtain the third target terrain grid; based on the third target terrain grid, the sub-mountain foot model is converted into a terrace model.

[0104] In this embodiment, after blurring the edge of the second target foot of the mountain model mask to obtain the third target foot of the mountain model mask, in the initial terrain grid, the second target terrain grid can be cut out according to the mountain area range corresponding to the obtained third target foot of the mountain model mask. After cutting out the second target terrain grid, the cut out second target terrain grid can be blurred to obtain the third target terrain grid. Further based on the obtained third target terrain grid, the sub-foot of the mountain model can be converted into a terrace model. Among them, the third target foot of the mountain model mask can be used to represent the target sub-mountain area, which can be represented by mask D and can be called a terrace model mask. The mountain area range can be used to represent the range of the target sub-mountain area. The second target terrain grid can be represented by mesh A. The third target terrain grid can be represented by mesh B.

[0105] Optionally, in the initial terrain grid, the second target terrain grid can be cut out according to the mountain area range corresponding to the obtained third target foothill model mask. For example, the area less than 0.5 in the third target foothill model mask can be deleted to obtain the second target terrain grid. The second target terrain grid is further fuzzy processed to obtain the third target terrain grid. Based on the obtained third target terrain grid, the sub-foothill model can be converted into a terrace model.

[0106] Optionally, in the initial terrain mesh, the area with a value less than 0.5 in mask D can be deleted, that is, mesh A can be clipped according to the mountain area range corresponding to the obtained mask D. Mesh A can be further fuzzy processed to obtain mesh B. After mesh B is obtained, the sub-mountain foot model can be converted into a terrace model based on the obtained mesh B.

[0107] As an optional embodiment, based on the third target terrain grid, the sub-mountain foot model is converted into a terrace model, including: mixing the third target terrain grid and the second target terrain grid to obtain a fourth target terrain grid; setting the height of the fourth target terrain grid as the target height to obtain a fifth target terrain grid; and deforming the sub-mountain foot model according to the fifth target terrain grid to obtain a terrace model.

[0108] In this embodiment, after the second target terrain grid is fuzzy processed to obtain the third target terrain grid, the third target terrain grid and the second target terrain grid can be mixed to obtain a fourth target terrain grid. After obtaining the fourth target terrain grid, the height of the fourth target terrain grid can be set to the target height to obtain a fifth target terrain grid. Further, according to the obtained fifth target terrain grid, the sub-mountain foot model is deformed to obtain a terrace model. Among them, 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. This is only an example and does not specifically limit the value of the target height. The fifth target terrain grid can be represented by mesh D.

[0109] Optionally, after mesh A and mesh B are obtained, mesh A and mesh B may be mixed to obtain mesh C, which is relatively flat. The height value of mesh C may be further set to 0 to form mesh D. After mesh D is obtained, the sub-mountain foot model may be deformed based on the obtained mesh D to obtain a terrace model.

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

[0111] In this embodiment, the height of the terrain can be set as the target height. After obtaining the fifth target terrain grid and setting the height of the terrain to the target height, the second distance between the set terrain and the fifth target terrain grid can be determined. After determining the second distance between the set terrain and the fifth target terrain grid, based on the determined second distance, a terrace model mask corresponding to the terrace model to be obtained can be determined. The sub-mountain foot model is further deformed according to the determined terrace model mask to obtain the terrace model.

[0112] Optionally, the height of the terrain is set to 0, and the 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 mesh D are both 0, that is, they can be called the flattened terrain and the flattened mesh D. The determined second distance is further normalized and blurred to determine the terrace model mask corresponding to the terrace model to be obtained. The sub-mountain foot model is further deformed according to the determined terrace model mask to obtain the terrace model.

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

[0114] In this embodiment, the target point on the mountain model that is closest to the fifth target terrain grid and the texture coordinates of the target point can be obtained. After obtaining the target point and the texture coordinates 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 coordinates of the target point. The mask value of the terrace model mask is further used to mix the height of the sub-foot model and the height corresponding to the fourth target terrain grid to obtain an initial terrace model. The sub-foot model is deformed based on the obtained initial terrace model to obtain a terrace model. Among them, the target point can be represented by closest_primnum. The texture coordinate (UV) can be represented by closest_primuv. The mask value of the terrace model mask is between (0, 1). The height of the sub-foot model can be the original height of the sub-foot model in the terrain. The initial terrace model can be a basic platform terrain model.

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

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

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

[0118] Optionally, after obtaining the basic platform terrain model, the basic platform terrain model is distorted based on the mountain area range of the mask corresponding to the basic platform terrain model to obtain the target terrace model. Further, based on the mountain area range of the mask corresponding to the target terrace model, the target terrace model is fuzzy processed to obtain the terrace model, so as to replace the sub-mountain foot model with the terrace model.

[0119] This embodiment performs post-processing on the acquired basic platform terrain model, first distorts the terrain according to the mask range, and then blurs the terrain according to the mask range to obtain a terrace model.

[0120] As an optional embodiment, the method further includes: determining, in a terrain file, a terrain area whose slope is within a slope threshold range, 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 the slope of the mountain model; performing enlargement and blurring processing on a mask corresponding to the terrain area to obtain an initial mountain model mask; in an initial terrain grid corresponding to the terrain file, deleting an area in the initial mountain model mask whose mask value is less than a second mask value threshold 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; in the terrain grid of the mountain model, deleting a terrain grid 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; and projecting the deleted terrain grid of the mountain model onto the terrain to obtain a mountain model mask.

[0121] In this embodiment, in the terrain file, a terrain area with a slope within a slope threshold range can be determined. After determining the terrain area with a slope within the slope threshold range, the mask corresponding to the terrain area can be enlarged and blurred to obtain an initial mountain model mask. Further, in the initial terrain grid corresponding to the terrain file, the area in the initial mountain model mask whose mask value is less than the second mask value threshold can be deleted to obtain the terrain grid of the mountain model. In the terrain grid of the obtained mountain model, the terrain grid of at least one sub-mountain model whose height is less than the height threshold and / or whose area is less than the area threshold can be deleted. Finally, the terrain grid of the deleted mountain model is projected onto the terrain to obtain the mountain model mask.

[0122] Optionally, the terrain file can be used to represent the terrain of the virtual scene. The slope threshold range can be used to represent the range of the slope of the mountain model. For example, the slope threshold range can be a range between 20 and 90 degrees. This is only an example, and the value of the slope threshold range is not specifically limited. 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. This is only an example, and the value of the second mask value threshold is not specifically limited. The initial terrain grid can be used to represent the grid of the 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. This is only an example, and the value of the height threshold is not specifically limited. The area threshold can be a threshold set according to actual conditions. For example, the area threshold can be 150,000 meters. This is only an example, and the value of the area threshold is not specifically limited.

[0123] Optionally, determine the terrain area with a slope between 20 and 90 degrees in the terrain file, and expand and blur the mask corresponding to the terrain area to obtain a basic mountain model mask. Further convert the terrain into a mesh, and in the initial terrain mesh corresponding to the terrain file, delete the faces with a mask value less than 0.8 in the basic mountain model mask to obtain the terrain mesh of the mountain model, that is, the mesh of all mountain models. Define mountains with a height less than 100 or a projected area less than 150,000 as small hill models, delete the small hill models, and project the terrain mesh of the deleted mountain model onto the terrain to obtain a mountain model mask, that is, a large mountain model mask.

[0124] As an optional embodiment, determining a road model mask corresponding to the coverage area includes: acquiring a tubular model of the road model; and projecting a terrain grid of the tubular model onto the terrain to obtain a road model mask.

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

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

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

[0128] In an embodiment 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 foot of mountain model; a target mountain area where the foot of mountain model is located on the mountain model, and a coverage area of ​​the road model are determined; 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 of mountain model where a terrace model is to be generated, and the target sub-mountain area is independent of the coverage area; and a sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model is converted into a terrace model, wherein the terrace model matches models other than the sub-foot of mountain model in the mountain model. That is to say, the disclosed embodiment determines a target sub-mountain area independent of the coverage area based on the intersection relationship between the coverage area of ​​the road model and the target mountain area where the foot of the mountain model is located on the mountain model, and further converts the sub-foot of the mountain model located on the target sub-mountain area in the foot of the mountain model into a terrace model, thereby achieving the purpose of automatically generating the terrace model, avoiding the generation of the terrace model by manual addition or editing, and further realizing the technical effect of improving the efficiency of generating the terrace model, and solving the technical problem of low efficiency in generating the terrace model.

[0129] The technical solution of the embodiment of the present disclosure is further introduced below with examples in combination with preferred implementation modes.

[0130] Currently, in large-world games, terrain models are usually generated by automated means, so the generated mountain models usually have a certain degree of repetitiveness. In order to add changes to the map, smaller-scale terrain changes can be introduced, such as the introduction of foot of the mountain terrace model, which is particularly important to create points of interest and break the repetitiveness of the map. Due to the characteristics of the automatic generation of terrain models, the process of manually adding and editing scene elements such as foot of the mountain terrace model that are attached to the terrain model not only requires a lot of manpower and time, but also when the large map changes, these manual edits are no longer applicable.

[0131] In the related art, the method of introducing the foot of the mountain terrace model requires customized editing of the terrain model or production and placement of the terrace model when it is necessary to adapt to the large map generated automatically, and it cannot be well integrated with the original mountain model. In addition, each foot of the mountain terrace model is a unique combination, and each production cannot be universal, which consumes a lot of manpower.

[0132] In order to solve the above problems, the disclosed embodiment proposes a general solution for automatically generating a foot terrace model for a large world map through computer graphics software (Houdini). According to the input basic map and road location, the foot terrace model is generated at a reasonable location to enhance the playability of the map and improve the production process of the large world automated map. Among them, the rules for generating the foot terrace model may at least include: generating a terrace model in the area of ​​the foot model; the location of the foot terrace model cannot cover the road model; the foot terrace model is a terrain element with a strong artificiality, so it should only be generated within a certain distance limit from the road model. Based on the above generation rules, this embodiment selects the range that will become the foot terrace model based on the location of the foot model and the location of the road model on the large map, and further reorganizes the terrain model within these foot terrace ranges to shape the foot terrace model, and can be naturally connected with the original terrain model mountain model.

[0133] In this embodiment, for the step of obtaining the mountain model mask, the large map terrain file heightfield and the road centerline file are input into Houdini. Figure 3 is a schematic diagram of a screening area mask according to one embodiment of the present disclosure, such as Figure 3 As shown, the heightfield mask by feature node in Houdini is used to filter out the area mask with a slope within the target range (between 20 and 90 degrees) on the map. Figure 4 is a schematic diagram of a basic mountain model mask according to one embodiment of the present disclosure, such as Figure 4 As shown, the filtered area mask is expanded and blurred through the heightfield mask expand node and the heightfield blur node to obtain the mask of the basic mountain model.

[0134] Regarding the steps to remove the hill model, Figure 5 is a schematic diagram of obtaining a mountain model grid according to one embodiment of the present disclosure, such as Figure 5 As shown, the terrain is converted into mesh through the terrain conversion (convert heightfield) node, and then the mask less than 0.8 in the mask of the basic mountain model obtained in the previous step is deleted through the deletion (blast) node to obtain the mesh of all mountain models.

[0135] These mountain model meshes are further looped (for-each connected piece), where a group of connected faces is defined as a mountain model. In each loop, the height of each mountain model is calculated using the height calculation formula (f@mountain_height=getbbox_size(0)[1]). The projection surface (perpendicular to the Y axis) of each mountain model is obtained by extracting the silhouette node, and the area of ​​the projection surface is calculated by measuring the node to obtain the projection area of ​​each mountain model. After obtaining the height and projection area of ​​each mountain model, mountain models with a height less than 100 meters or a projection area less than 150,000 meters are defined as small mountain models, and small mountain models with a height less than 100 meters or a projection area less than 150,000 meters are deleted.

[0136] Figure 6 is a schematic diagram of obtaining a mountain model mask according to one embodiment of the present disclosure, such as Figure 6 As shown in the figure, after deleting the small mountain models, the filtered large mountain model mesh is reprojected onto the terrain model through the heightfieldmask by object node to obtain the large mountain model mask. The foot of the mountain terrace model will be generated at the foot of these large mountain models (foot of the mountain model mask).

[0137] Steps for obtaining road model mask based on road centerline file. Figure 7 is a schematic diagram of obtaining a road model mask according to one embodiment of the present disclosure, such as Figure 7 As shown in the figure, after the road centerline file is input into Houdini, the tubular model (wire-to-tube) of the road model is generated through the polygonal line (polywire) node in Houdini, and then the tubular model mesh is projected onto the basic terrain model through the terrain projection (heightfield project) node to form a road model mask.

[0138] The step of filtering out the range that will become the foot of the mountain terrace model at the foot of the mountain model based on the road position is the step of filtering the terrace model mask. Figure 8 is a schematic diagram of a road model mask according to one embodiment of the present disclosure, such as Figure 8 As shown, the large map terrain has a road model mask. Fig. 9 FIG. 1 is a schematic diagram of obtaining a regional mask covering a road model at a foot of a mountain model according to one embodiment of the present disclosure, such as Fig. 9As shown, after the mountain model mask and the road model mask are expanded using the heightfield expand node, the intersection of the expanded mountain model mask and the expanded road model mask is further obtained, and the mask range located at the foot of the mountain model and covering the road model is preliminarily obtained, that is, the first mask covering the road model at the foot of the mountain model is obtained (which can be represented by mask A).

[0139] Fig.10 FIG. 1 is a schematic diagram of deleting the regional mask covering the road model at the foot of the mountain model according to one embodiment of the present disclosure, such as Fig.10 As shown, since the foot of the mountain terrace model cannot cover the road model, after obtaining the Mask A covering the road model, Mask A is excluded based on the foot of the mountain model mask, and the terrain noise (heightfield noise) node is used to generate cell noise for the remaining foot of the mountain model mask excluding Mask A to obtain the second mask (which can be represented by Mask B).

[0140] Fig.11 is a schematic diagram of looping over regions with consistent class attributes according to one embodiment of the present disclosure, such as Fig.11 As shown, loop through each area in mask B, that is, the area with the same class attribute, and finally obtain the third mask (which can be represented by mask C). Use the terrain conversion (convert heightfield) node to convert the terrain heightfield into a mesh, and then use the delete (blast) node to delete the area with a mask value less than 0.5, that is Fig.10 The white area shown in . Next, these meshes are looped (for-each connected piece), that is, each area defined by a group of connected faces is looped, and only the connected faces will be assigned the same class attribute.

[0141] It should be noted that each mountain model or each area has the same class attribute, while different mountain models or different areas have different class attributes. The class attribute can be used to distinguish identifiers of different areas or area types.

[0142] Fig.12 is a schematic diagram of deleting a region according to the area of ​​the region according to one embodiment of the present disclosure, such as Fig.12As shown, in the loop, calculations are performed for each area (i.e., areas with consistent class attributes), and the area area is calculated using the measure node to obtain the area attribute. Further determine whether the area of ​​the area is within the set upper and lower limits of the area. When the area of ​​the area is outside the set upper and lower limits of the area, the area is deleted. When the area of ​​the area is within the set upper and lower limits of the area, the center point of the area is obtained, and the coordinates of the center point of the area are taken as the starting point (seed), and 50% of the areas are randomly deleted to determine whether to delete the area based on the total area of ​​the area. Among them, the area upper limit (AreaThreshold Max) can be 40,000 meters, and the area lower limit (Area Threshold Min) can be 10,000 meters. This is only an example, and no specific restrictions are imposed on the values ​​of the area upper limit and area lower limit.

[0143] Furthermore, it is determined whether to delete the region according to the minimum distance between the region and the road model, that is, only the region that is not far from the road model is retained to generate the terrace model. The distance calculation function (xyzdist function) is used to calculate the distance between each point in the region (the center point of each face) and the road model, and the result is recorded in the distance (dist_to_road) attribute. The minimum (min) mode of the minimum and maximum average (min_max_Average) node is further used to calculate the minimum value of the dist_to_road attribute, that is, the minimum distance between the region and the center line of the road.

[0144] Fig.13 is a schematic diagram of deleting regions according to distance according to one embodiment of the present disclosure, such as Fig.13 As shown, when the minimum distance is less than the set distance, the entire area is deleted. The set distance can be a limit on the distance of the area relative to the road model, which can be 1000 meters. This is only an example and does not impose specific restrictions on the value of the set distance.

[0145] Fig.14 is a schematic diagram of a mask after deleting an area according to one embodiment of the present disclosure, such as Fig.14 As shown in the example, after obtaining the preliminary area based on the area and the retention probability, it is further determined whether to delete the area based on the minimum distance between the area and the road model. The mesh obtained through the above two steps is projected back onto the terrain model using the heightfield_mask_by_object node to obtain mask C. Fig.15 is a schematic diagram of obtaining a terrace model mask according to one embodiment of the present disclosure, such as Fig.15As shown, mask C is processed to obtain the fourth mask (which can be represented by mask D) for generating the terrace model. The edge of mask C is blurred by the heightfield blur node to obtain mask D, that is, the terrace model mask.

[0146] Steps for generating a mesa model based on the mesa model mask. Fig.16 is a schematic diagram of a grid cut out according to a terrace model mask in a preprocessing according to one embodiment of the present disclosure, such as Fig.16 As shown in the figure, the mesh clipped out according to the plateau model mask is preprocessed, and the first mesh (which can be represented by mesh A) is clipped out according to the range of mask D on the original terrain model. Mesh A is fuzzy processed to obtain the second mesh (which can be represented by mesh B). Mesh A and mesh B are blended to obtain the third mesh (which can be represented by mesh C). The blended mesh C not only conforms to the contour line of mesh A, but also smoothes the height value. Mesh C is flattened and the height value is recorded to obtain the fourth mesh (which can be represented by mesh D), that is, mesh D is the flattened mesh that records the original height value.

[0147] Fig.17 is a schematic diagram of obtaining a first grid according to one embodiment of the present disclosure, such as Fig.17 As shown, the terrain heightfield is converted to mesh using the Terrain Convert (Convert Heightfield) node, and then the Delete (Blast) node is used to delete the area with a mask value less than 0.5 (i.e. Fig.15 The white area shown in Figure 2 gives Fig.17 Mesh A shown. Fig.18 is a schematic diagram of obtaining a second grid according to one embodiment of the present disclosure, such as Fig.18 As shown, the location attribute (which can be represented by the P attribute) of each point is subjected to attribute blur processing to obtain meshB.

[0148] Fig.19 is a schematic diagram of a mixed first grid and a second grid according to one embodiment of the present disclosure, such as Fig.19 As shown, Fig.17 The meshA shown is Fig.18The meshB shown in the figure is blended. Get the P attribute (location attribute) of mesh A and the P attribute of mesh B, and determine the maximum value (max) of Py of mesh A and Py of mesh B, where Py represents the vertical component. Linearly blend the determined maximum value with the P attribute of mesh B, and the blending coefficient can be set to 0.75 according to the effect. Finally, the result of linear blending is combined with Px and Pz of mesh A as the y component to form a new P attribute, where Px represents the horizontal component and Pz represents the depth component. Fig. 20 is a schematic diagram of obtaining a third grid according to one embodiment of the present disclosure, such as Fig. 20 As shown in the figure, meshA and meshB are blended to obtain a relatively flat meshC. Finally, the height value of mesh C is set to 0 to form mesh D for the next calculation.

[0149] After mesh D is obtained, the terrain model can be deformed according to mesh D. Fig.21 is a schematic diagram of obtaining a terrace model mask according to one embodiment of the present disclosure, such as Fig.21 As shown, 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 calculation function (xyzdist) is used to calculate the distance between the flattened terrain model and the flattened mesh D, 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 blur transition is performed, and finally the mask is flipped to obtain the terrace model mask. At the same time, the point closest to mesh D on the flattened terrain model can be obtained (the point can be represented by index or closest_primnum), as well as the texture (uv) coordinates of the point (the uv coordinates can be represented by closest_primuv).

[0150] Fig. 22 is a schematic diagram of obtaining a basic platform terrain model according to one embodiment of the present disclosure, such as Fig. 22As shown in the figure, the original height of the terrain model is restored according to the orig_height attribute, and then the original height value of the nearest point on mesh D (that is, 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 above-mentioned platform model mask value is used as a coefficient. The platform model mask value is in the range of (0, 1), and the original height of the terrain model and the height value of the corresponding point on mesh C are mixed to obtain the basic platform terrain model. Fig.23 is a schematic diagram of a basic platform terrain model according to one embodiment of the present disclosure. Through the above steps, the following can be obtained: Fig.23 The base platform terrain model is shown.

[0151] After the basic platform terrain model is obtained, the obtained basic platform terrain model is post-processed. Fig.24 is a schematic diagram of a distorted base platform terrain model according to one embodiment of the present disclosure, such as Fig.24 As shown, the terrain model is distorted according to the mask range. Fig.25 is a schematic diagram of a fuzzy basic platform terrain model according to one embodiment of the present disclosure, such as Fig.25 As shown, according to the mask range, the terrain is blurred and the following is obtained: Fig.25 The final result is shown. Fig.26 is a schematic diagram of the generation effect of a terrace model according to one embodiment of the present disclosure, such as Fig.26 As shown, the final result obtained above is imported into the UE, and the following is obtained: Fig.26 The effect shown.

[0152] This embodiment generates a terrace model at the foot of a mountain at a reasonable location based on the input basic map model and the road position. When the input basic terrain model and the road centerline position change, an updated new terrain file with a reasonable terrace model added can be automatically obtained. The automated workflow in this embodiment allows artists or planners to intelligently adjust parameters according to specific project requirements. For example, the area boundary values ​​of large mountain models and small hill models can be customized, or the distance parameters for generating a terrace model within a certain range from a road model can be customized. When applied to large world game types, the efficiency improvement is particularly obvious. In addition, this embodiment is highly scalable. Based on the current solution, new terrace model rules can be easily integrated. For example, the terrace model can be generated within a certain range from a river model.

[0153] In an embodiment 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 foot of mountain model; a target mountain area where the foot of mountain model is located on the mountain model, and a coverage area of ​​the road model are determined; 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 of mountain model where a terrace model is to be generated, and the target sub-mountain area is independent of the coverage area; and the sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model is converted into a terrace model. That is, based on the intersection relationship between the coverage area of ​​the road model and the target mountain area where the foot of mountain model is located on the mountain model, the embodiment of the present disclosure determines a target sub-mountain area that is independent of the coverage area, and further converts the sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model into a terrace model, thereby achieving the purpose of automatically generating a terrace model, avoiding generating a terrace model by manual addition or editing, and thereby achieving the technical effect of improving the efficiency of generating a terrace model, and solving the technical problem of low efficiency of generating a terrace model.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present disclosure.

[0155] In this embodiment, a terrain model processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "unit" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0156] Fig. 27 is a structural block diagram of a terrain model processing device according to one embodiment of the present disclosure, such as Fig. 27 As shown, the terrain model processing device 2700 may 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 used to acquire the mountain model and road model to be processed in the virtual scene, wherein the mountain model includes a mountain foot model.

[0158] The first determining unit 2704 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.

[0159] The second determining unit 2706 is used to determine 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 the mountain area on the foot of the mountain model to be generated for the terrace model, and the target sub-mountain area is independent of the coverage area.

[0160] The conversion unit 2708 is used to convert the sub-mountain foot model located on the target sub-mountain area in the mountain foot model into a terrace model.

[0161] Optionally, the second determination unit 2706 includes: a determination module for determining a road model mask corresponding to the coverage area and an initial foothill model mask corresponding to the target mountain area; and a generation module for generating a target sub-mountain area based on the road model mask and the initial foothill model mask.

[0162] Optionally, the generation module includes: a first determination submodule, used to determine the 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 area of ​​the mountain model, and the intersection model mask is used to represent the mask range located in the foot model and covering the road model; a removal submodule, used to remove the intersection model mask in the initial foot model mask to obtain a first target foot model mask; a second determination submodule, used to determine the mountain area set corresponding to the first target foot model mask, wherein the mountain area set includes multiple target mountain areas with the same type attributes; a third determination submodule, used to determine the target sub-mountain area in the mountain area set.

[0163] Optionally, the first determining submodule is further used to: respectively enlarge the road model mask and the mountain model mask; and obtain an intersection model mask between the enlarged road model mask and the enlarged mountain model mask.

[0164] Optionally, the removal submodule is further used to: remove the intersection model mask in the initial foothill model mask, and generate noise information in the removed initial foothill model mask to obtain a first target foothill model mask.

[0165] Optionally, the device also includes: a first deletion unit, used to delete areas whose mask values ​​are less than a first mask value threshold in an initial terrain grid corresponding to the terrain file, to obtain a first target terrain grid, wherein the terrain file is used to represent the terrain of the virtual scene, and the initial terrain grid is used to represent the grid of the terrain corresponding to the terrain file; the third determination submodule is also used to: in the first target terrain grid, determine a mountain area set based on multiple initial mountain areas corresponding to the first target foot of mountain model mask, wherein the type attributes of the multiple initial mountain areas are the same.

[0166] Optionally, the third determination submodule is further used to: determine the area of ​​the initial mountain area in the first target terrain grid; determine a first number of initial mountain areas whose areas are within an area threshold range among multiple initial mountain areas; randomly delete a second number of initial mountain areas from the first number of initial mountain areas to obtain multiple target mountain areas, wherein the second number is smaller than the first number; and determine the multiple target mountain areas as a mountain area set.

[0167] Optionally, the third determination submodule is also used to: determine the first distance between the center point of the target mountain area in the mountain area set and the center line of the road model mask; determine the minimum first distance among multiple first distances corresponding to multiple target mountain areas; delete the target mountain area whose minimum first distance is less than the first distance threshold in the mountain area set; project the deleted mountain area set onto the terrain to obtain a second target mountain foot model mask; and determine the target sub-mountain area based on the second target mountain foot model mask.

[0168] Optionally, the third determining submodule is further used to: blur the edge of the second target foothill model mask to obtain a third target foothill model mask, wherein the third target foothill model mask is used to represent the target sub-mountain area.

[0169] Optionally, the conversion unit 2708 includes: a conversion module, which is used to convert the sub-mountain foot model into a terrace 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.

[0170] Optionally, the conversion module includes: a clipping submodule, used to clip out a second target terrain grid in the initial terrain grid according to the mountain area range corresponding to the third target foot of the mountain model mask, wherein the third target foot of the mountain model mask is used to represent the target sub-mountain area, and the mountain area range is used to represent the range of the target sub-mountain area; a processing submodule, used to fuzzy process the second target terrain grid to obtain a third target terrain grid; and a conversion submodule, used to convert the sub-foot of the mountain model into a terrace model based on the third target terrain grid.

[0171] Optionally, the conversion submodule is also used to: mix the third target terrain grid and the second target terrain grid to obtain a fourth target terrain grid; set the height of the fourth target terrain grid to the target height to obtain a fifth target terrain grid; and deform the sub-mountain foot model according to the fifth target terrain grid to obtain a terrace model.

[0172] Optionally, the conversion submodule is also used to: set the height of the terrain as the target height; determine the second distance between the set terrain and the fifth target terrain grid; based on the second distance, determine the terrace model mask corresponding to the terrace model to be obtained, wherein the terrace model mask is used to represent the mountain area of ​​the terrace model; deform the sub-mountain foot model according to the terrace model mask to obtain the terrace model.

[0173] Optionally, the device also includes: a first acquisition unit, used to acquire the target point on the mountain model that is closest to the fifth target terrain grid, and the texture coordinates of the target point; a second acquisition unit, used to acquire the target height corresponding to the fourth target terrain grid based on the target point and the texture coordinates of the target point; the second processing submodule is also used to: use the mask value of the terrace model mask to mix the height of the sub-mountain foot model and the height corresponding to the fourth target terrain grid to obtain an initial terrace model; and deform the sub-mountain foot model based on the initial terrace model to obtain a terrace model.

[0174] Optionally, the second processing sub-module is also used to: deform the initial terrace model based on the mountain area range of the mask corresponding to the initial terrace model to obtain a target terrace model; blur the target terrace model based on the mountain area range of the mask corresponding to the target terrace model to obtain a terrace model; and replace the sub-mountain foot model with the terrace model.

[0175] Optionally, the device further includes: a third determining unit, used to determine, in a terrain file, a terrain area whose slope is within a slope threshold range, 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 the slope of the mountain model; a processing unit, used to perform enlargement processing and blur processing on the mask corresponding to the terrain area to obtain an initial mountain model mask; a second deleting unit, used to delete, in an initial terrain grid corresponding to the terrain file, an area in the initial mountain model mask whose mask value is less than a second mask value threshold, 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 deleting unit, used to delete, in the terrain grid of the mountain model, a terrain grid 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; and a projection unit, used to project the deleted terrain grid of the mountain model onto the terrain to obtain a mountain model mask.

[0176] Optionally, the determination module determines a 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 a road model mask.

[0177] Optionally, the acquisition unit 2702 includes: a first acquisition module, used to acquire a mountain model based on a terrain file, wherein the terrain file is used to represent the terrain of the virtual scene; a second acquisition module, used to acquire a road model based on a road centerline file, wherein 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 road model to be processed in the virtual scene are acquired by the acquisition unit 2702, wherein the mountain model includes a foot of mountain model. The target mountain area where the foot of mountain model is located on the mountain model, and the coverage area of ​​the road model are determined by the first determination unit 2704. The target sub-mountain area is determined in the target mountain area based on the coverage area by the second determination unit 2706, wherein the target sub-mountain area is used to represent the mountain area where the terrace model is to be generated on the foot of mountain model, and the target sub-mountain area is independent of the coverage area. The sub-foot of mountain model located on the target sub-mountain area in the foot of mountain model is converted into a terrace model by the conversion unit 2708, wherein the terrace model matches the model in the mountain model except the sub-foot of mountain model. That is to say, the disclosed embodiment determines a target sub-mountain area independent of the coverage area based on the intersection relationship between the coverage area of ​​the road model and the target mountain area where the foot of the mountain model is located on the mountain model, and further converts the sub-foot of the mountain model located on the target sub-mountain area in the foot of the mountain model into a terrace model, thereby achieving the purpose of automatically generating the terrace model, avoiding the generation of the terrace model by manual addition or editing, and further realizing the technical effect of improving the efficiency of generating the terrace model, and solving the technical problem of low efficiency in generating the terrace model.

[0179] It should be noted that the above-mentioned units can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned units are all located in the same processor; or the above-mentioned units are located in different processors in any combination.

[0180] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.

[0181] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0182] 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;

[0183] S2, determining 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;

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

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

[0186] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0187] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0188] Optionally, the electronic device may 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 this embodiment, the processor may be configured to perform the following steps through a computer program:

[0190] 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;

[0191] S2, determining 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;

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

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

[0194] An embodiment of the present disclosure further provides a computer program product, which may include a computer program, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0195] Optionally, in this embodiment, the computer program product may be configured to include a computer program for performing 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 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;

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

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

[0200] An embodiment of the present disclosure further provides a computer program product, which may include a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and the computer program is configured to execute the steps of any of the above method embodiments when running.

[0201] Optionally, in this embodiment, the computer program product may be configured to include a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium may be configured to store a computer program for performing 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 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;

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

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

[0206] An embodiment of the present disclosure further provides a computer program, which is configured to execute the steps of any of the above method embodiments when running.

[0207] Optionally, in this embodiment, the computer program is configured 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 includes a mountain foot model;

[0209] S2, determining 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;

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

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

[0212] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

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

[0214] like Fig.28 As shown, the electronic device 2800 is in the form of a general computing device. The components of the electronic device 2800 may include but are not limited to: at least one processor 2810, 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 memory 2820 stores program codes, which can be executed by the processor 2810, so that the processor 2810 executes the steps described in the method part of the embodiment of the present disclosure according to various exemplary embodiments of the present disclosure.

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

[0217] In some examples, the memory 2820 may also include a program / utility 28204 having a set (at least one) of program modules 28205, such program modules 28205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. The memory 2820 may further include a memory remotely disposed relative to the processor 2810, and these remote memories may be connected to the electronic device 2800 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0218] Bus 2830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of processor 2810, or a bus using any of a variety of bus architectures.

[0219] The display 2840 may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 2800 .

[0220] Optionally, the electronic device 2800 may also communicate with one or more external devices 2900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 2800, and / or any device that enables the electronic device 2800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 2850. Furthermore, the electronic device 2800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 2860. Fig.28 As shown, the network adapter 2860 communicates with other modules of the electronic device 2800 via the bus 2830. It should be understood that although Fig.28Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 2800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, redundant arrays of independent disks (RAID) systems, tape drives, and data backup storage systems.

[0221] The 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] It can be understood by those skilled in the art that Fig.28 The structure shown is for illustration only and does not limit the structure of the electronic device. Fig.28 More or fewer components as shown, or with Figure 1 The memory 2820 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the terrain model processing method in the embodiment of the present disclosure. The processor 2810 executes various functional applications and data processing by running the computer programs stored in the memory 2820, that is, implements the terrain model processing method described above.

[0223] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.

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

[0225] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0227] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0228] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk, etc., which can store program code.

[0229] The above are only preferred embodiments of the present disclosure. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as the protection scope of the present disclosure.

Claims

1. A method for processing a terrain model, characterized in that: include: Acquire a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a 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, determining a target sub-mountain area in the target mountain area, wherein the target sub-mountain area is used to represent the mountain area of ​​the terrace model to be generated on the foot of the mountain model, 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 terrace model.

2. The method according to claim 1, characterized in that Determining a target sub-mountain area in the target mountain area based on the coverage area includes: Determine a road model mask corresponding to the coverage area and an initial foothill model mask corresponding to the target mountain area; The target sub-mountain area is generated based on the road model mask and the initial foothill model mask.

3. The method according to claim 2, characterized in that Generating the target sub-mountain area based on the road model mask and the initial foot of the mountain model mask includes: Determine 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 area of ​​the mountain model, and the intersection model mask is used to represent the mask range located at the foot of the mountain model and covered by the road model; In the initial foothill model mask, remove the intersection model mask to obtain a first target foothill model mask; Determine 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 attributes; In the mountain area set, the target sub-mountain area is determined.

4. The method according to claim 3, characterized in that Determining an intersection model mask between the road model mask and the mountain model mask of the mountain model includes: respectively enlarging the road model mask and the mountain model mask; The intersection model mask between the enlarged road model mask and the enlarged mountain model mask is obtained.

5. The method according to claim 3, characterized in that: In the initial foothill model mask, the intersection model mask is removed to obtain a 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 initial foothill model mask after the removal, so as to obtain the first target foothill model mask.

6. The method according to claim 3, characterized in that The method further comprises: In an initial terrain grid corresponding to a terrain file, deleting an area whose mask value is less than a first mask value threshold, to obtain a first target terrain grid, wherein the terrain file is used to represent the terrain of the virtual scene, and the initial terrain grid is used to represent a grid of the terrain corresponding to the terrain file; Determining a mountain area set corresponding to the first target mountain foot model mask includes: in the first target terrain grid, determining the mountain area set based on a plurality of initial mountain areas corresponding to the first target mountain foot model mask, wherein the type attributes of the plurality of initial mountain areas are the same.

7. The method according to claim 6, characterized in that In the first target terrain grid, based on a plurality of initial mountain regions corresponding to the first target mountain foot model mask, determining the mountain region set comprises: In the first target terrain grid, determining the area of ​​the initial mountain region; Determine a first number of initial mountain regions whose areas are within an area threshold range among the plurality of initial mountain regions; Randomly deleting a second number of initial mountain areas from the first number of initial mountain areas to obtain a plurality of the target mountain areas, wherein the second number is smaller than the first number; The plurality of target mountain regions are determined as the mountain region set.

8. The method according to claim 6, characterized in that In the mountain area set, determining the target sub-mountain area includes: Determine a first distance between a center point of the target mountain area in the mountain area set and a center line of the road model mask; Determine a minimum first distance among a plurality of first distances corresponding to a plurality of target mountain areas; Deleting the target mountain area whose minimum first distance is less than a first distance threshold from the mountain area set; Projecting the deleted mountain area set onto the terrain to obtain a second target mountain foot model mask; The target sub-mountain area is determined based on the second target mountain foot model mask.

9. The method according to claim 8, characterized in that Determining the target sub-mountain area based on the second target mountain foot model mask includes: The edge of the second target mountain foot model mask is blurred 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 area.

10. The method according to claim 3, characterized in that The method further comprises: In a terrain file, determining a terrain area whose slope is within a slope threshold range, 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 the slope of the mountain model; Performing enlargement and blurring processing on the mask corresponding to the terrain area to obtain an initial mountain model mask; In the initial terrain grid corresponding to the terrain file, the area whose mask value in the initial mountain model mask is less than the second mask value threshold is deleted to obtain the terrain grid of the mountain model, wherein the initial terrain grid is used to represent the grid of the terrain corresponding to the terrain file; In the terrain grids of the mountain model, deleting at least one terrain grid of the sub-mountain model whose height is less than a height threshold and / or whose area is less than an area threshold; The deleted terrain grid of the mountain model is projected onto the terrain to obtain the mountain model mask.

11. The method according to claim 10, characterized in that Determining a road model mask corresponding to the coverage area includes: Obtaining a tubular model of the road model; The terrain grid of the tubular model is projected onto the terrain to obtain the road model mask.

12. The method according to claim 1, characterized in that Converting the sub-mountain foot model located on the target sub-mountain area in the mountain foot model into a terrace model includes: The sub-mountain foot model is converted into a terrace 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.

13. The method according to claim 12, characterized in that Based on the initial terrain grid corresponding to the terrain file, the sub-mountain foot model is converted into a terrace model, including: In the initial terrain grid, a second target terrain grid is cut out according to the mountain area range corresponding to the third target mountain foot model mask, wherein the third target mountain foot model mask is used to represent the target sub-mountain area, and the mountain area range is used to represent the range of the target sub-mountain area; Performing fuzzy processing on the second target terrain grid to obtain a third target terrain grid; Based on the third target terrain grid, the sub-mountain foot model is converted into the terrace model.

14. The method according to claim 13, characterized in that Based on the third target terrain grid, converting the sub-mountain foot model into the terrace model comprises: Mixing the third target terrain grid and the second target terrain grid to obtain a fourth target terrain grid; Setting the height of the fourth target terrain grid as the target height to obtain a fifth target terrain grid; According to the fifth target terrain grid, the sub-mountain foot model is deformed to obtain the terrace model.

15. The method according to claim 14, characterized in that According to the fifth target terrain grid, the sub-mountain foot model is deformed to obtain the terrace model, including: Setting the height of the terrain to the target height; Determine a second distance between the set terrain and the fifth target terrain grid; Based on the second distance, determining a terrace model mask corresponding to the terrace model to be obtained, wherein the terrace model mask is used to represent a mountain area of ​​the terrace model; The sub-mountain foot model is deformed according to the terrace model mask to obtain the terrace model.

16. The method according to claim 15, characterized in that The method further comprises: Acquire a target point on the mountain model that is closest to the fifth target terrain grid, and texture coordinates of the target point; Based on the target point and the texture coordinates of the target point, acquiring a target height corresponding to the fourth target terrain grid; The sub-mountain foot model is deformed according to the terrace model mask to obtain the terrace model, including: using the mask value of the terrace model mask to mix the height of the sub-mountain foot model and the height corresponding to the fourth target terrain grid to obtain an initial terrace model; based on the initial terrace model, the sub-mountain foot model is deformed to obtain the terrace model.

17. The method according to claim 16, characterized in that The sub-mountain foot model is deformed based on the initial terrace model to obtain the terrace model, including: Based on the mountain area range of the mask corresponding to the initial terrace model, deforming the initial terrace model to obtain a target terrace model; Based on the mountain area range of the mask corresponding to the target terrace model, the target terrace model is fuzzy processed to obtain the terrace model; The sub-mountain foot model is replaced by the terrace model.

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

19. A terrain model processing device, characterized in that: include: An acquisition unit, used for acquiring a mountain model and a road model to be processed in a virtual scene, wherein the mountain model includes a mountain foot model; A first determining unit, used to determine a target mountain area where the foot of the mountain model is located on the mountain model, and a coverage area of ​​the road model; A second determining unit is used to determine a target sub-mountain area in the target mountain area based on the coverage area, wherein the target sub-mountain area is used to indicate that the mountain area 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 terrace model.

20. 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 18 when executed by a processor.

21. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method described in any one of claims 1 to 18.

22. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 18.

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

  • Automatic generation method, device and equipment of platform foundation model and storage medium

    CN116740294A

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

    CN117974921A