Virtual Terrain Processing Method, Device, Storage Medium and Electronic Device
By extracting and processing the virtual terrain of the third-party terrain production platform, generating a terrain height grayscale map and performing terrain transformation, the problem of the inability to edit the third-party virtual terrain in the existing technology is solved, and the secondary editing and rendering optimization of the virtual terrain is realized.
Patent Information
- Application Number
- CN202111319827.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-11-09
AI Technical Summary
The existing Unreal Engine cannot edit virtual terrain that has been produced by third-party terrain production platforms.
By obtaining the virtual terrain that has been produced by the third-party terrain production platform, extracting the terrain vertices and determining their height information, generating a terrain height grayscale map, using this grayscale map to convert terrain to generate an editable second virtual terrain.
The secondary editing of the virtual terrain that has been completed is realized, the terrain structure and rendering effect are optimized, the performance cost of replacing the entire virtual terrain due to changes in local structural requirements is avoided, and the rendering rate and screen display effect are improved.
Smart Images

Figure CN114022629B_ABST
Abstract
Description
Background Art
[0002] With the development of computer network technology and mobile device platforms, people have an increasing demand for various styles of virtual scenes, and virtual terrain is almost an essential part of virtual scenes.
[0003] In related technologies, during the production and use of virtual terrain, usually a pre-made terrain height map is directly imported into the Unreal Engine to construct an editable virtual terrain, or the terrain generation component of the Unreal Engine is used to directly sculpt an editable virtual terrain. However, the existing Unreal Engine cannot edit the virtual terrain that has been made by a third-party terrain production platform.
[0004] It should be noted that the information disclosed in the above Background Art section is only used to enhance the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0005] The present disclosure provides a virtual terrain processing method, a virtual terrain processing device, a computer-readable storage medium, and an electronic device, thereby at least to some extent solving the problem in related technologies that the virtual terrain made by a third-party terrain production platform cannot be edited.
[0006] Other features and advantages of the present disclosure will become apparent through the following detailed description, or will be partially learned through the practice of the present disclosure.
[0007] According to a first aspect of the present disclosure, there is provided a virtual terrain processing method, the method including: obtaining a first virtual terrain that has been produced by a third-party terrain production platform; extracting terrain vertices from the first virtual terrain, and determining terrain height information corresponding to the terrain vertices; generating a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices; and performing terrain conversion using the terrain height grayscale map to generate a second virtual terrain.
[0008] In an exemplary embodiment of the present disclosure, the determining the terrain height information corresponding to the terrain vertices includes: using a virtual camera disposed along the vertical direction of the first virtual terrain to obtain depth information corresponding to the terrain vertices, the vertical direction being perpendicular to the horizontal plane of the first virtual terrain; and determining the terrain height information corresponding to the terrain vertices according to the depth information corresponding to the terrain vertices.
[0009] In an exemplary embodiment of the present disclosure, generating a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices includes: rendering a terrain height grayscale map according to the arrangement positions of the terrain vertices in the first virtual terrain and using the terrain height information corresponding to each terrain vertex.
[0010] In an exemplary embodiment of the present disclosure, extracting terrain vertices from the first virtual terrain includes: parsing the terrain bounding box of the first virtual terrain and extracting the terrain vertices of the first virtual terrain from within the range of the terrain bounding box of the first virtual terrain.
[0011] In an exemplary embodiment of the present disclosure, parsing the terrain bounding box of the first virtual terrain includes: framing the first virtual terrain in the horizontal plane direction of the first virtual terrain to obtain the terrain bounding box of the first virtual terrain.
[0012] In an exemplary embodiment of the present disclosure, extracting terrain vertices from the first virtual terrain includes: meshing the first virtual terrain to obtain the terrain mesh of the first virtual terrain; and taking the vertices of the terrain mesh of the first virtual terrain as the terrain vertices in the first virtual terrain.
[0013] In an exemplary embodiment of the present disclosure, extracting terrain vertices from the first virtual terrain further includes: parsing the terrain feature information of the first virtual terrain; and determining the terrain vertices of the first virtual terrain according to the terrain feature information of the first virtual terrain.
[0014] According to a second aspect of the present disclosure, there is provided a virtual terrain processing apparatus, the apparatus including: a first terrain acquisition module for acquiring a first virtual terrain that has been produced by a third-party terrain production platform; a terrain height determination module for extracting terrain vertices from the first virtual terrain and determining the terrain height information corresponding to the terrain vertices; a grayscale map generation module for generating a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices; and a second terrain generation module for performing terrain conversion using the terrain height grayscale map to generate a second virtual terrain. According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program, which when executed by a processor implements the above-mentioned virtual terrain processing method.
[0015] According to a fourth aspect of the present disclosure, there is provided an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned virtual terrain processing method by executing the executable instructions.
[0016] The technical solution of the present disclosure has the following beneficial effects:
[0017] In the above virtual terrain processing process, a first virtual terrain that has been produced by a third-party terrain production platform is obtained; terrain vertices are extracted from the first virtual terrain, and the terrain height information corresponding to the terrain vertices is determined; a terrain height grayscale map is generated according to the terrain height information corresponding to the terrain vertices; and the terrain is transformed by using the terrain height grayscale map to generate a second virtual terrain. This process reconstructs the obtained virtual terrain. Since the relevant terrain height information of the virtual terrain is obtained during the process of reconstructing the virtual terrain, the already produced virtual terrain can be reconstructed, thereby realizing secondary editing of the virtual terrain, facilitating further optimization and rendering of the terrain structure of the obtained virtual terrain, and meeting various visual requirements of users for the virtual terrain. In addition, solving the problem of secondary editing of the virtual terrain can not only avoid the problem of high performance cost caused by replacing the entire virtual terrain due to changes in the local structure requirements of the virtual terrain, thereby improving the rendering rate of the virtual terrain and saving time and performance costs, but also avoid the problem of decreased frame rate of the screen display caused by the inability of the graphics card to quickly render when the terrain is relatively complex, thereby ensuring the screen display effect of the virtual terrain. Moreover, since this virtual terrain processing method enables the Unreal Engine to perform secondary editing and rendering of the virtual terrain, it can also avoid the problem of decreased frame rate of the screen display caused by the inability to quickly render when the terrain is relatively complex, thereby ensuring the screen display effect of the virtual terrain.
[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0020] Figure 1 Shows a flowchart of a virtual terrain processing method in this exemplary embodiment;
[0021] Figure 2 Shows a flowchart of extracting terrain vertices in this exemplary embodiment;
[0022] Figure 3 Shows a flowchart of determining the terrain height information corresponding to terrain vertices in this exemplary embodiment;
[0023] Figure 4 An example diagram showing a height grayscale image in this exemplary embodiment;
[0024] Figure 5 An example diagram showing a comparison between a first virtual terrain and a second virtual terrain in this exemplary embodiment;
[0025] Figure 6 A structural block diagram showing a virtual terrain processing device in this exemplary embodiment;
[0026] Figure 7 An electronic device for implementing the above method shown in this exemplary embodiment. Detailed implementation manners
[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be used. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.
[0028] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functionally real and do not necessarily correspond to physically or logically independent realities. These functional realities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0029] In this document, "first", "second", etc. are labels for specific objects and do not limit the quantity or order of the objects.
[0030] In the related art, the Unreal Engine cannot edit virtual terrain that has already been created by a third-party terrain production platform. However, during the actual development process, it is inevitable to change the requirements for virtual terrain or iterate on the artistic effects of virtual terrain. If it is necessary to modify the virtual terrain, after modifying the virtual terrain on the third-party terrain production platform that created the virtual terrain, it needs to be re-imported into the Unreal Engine to achieve the replacement operation of the virtual terrain. When the virtual terrain is relatively complex, it will consume a large amount of time and performance costs.
[0031] It should be noted that since the virtual terrain that has already been produced is usually fixed in shape through baking operations, and the Unreal Engine lacks the relevant terrain structure information of the virtual terrain, it is unable to directly perform secondary editing on the virtual terrain that has already been produced.
[0032] In view of one or more of the above problems, the exemplary embodiments of the present disclosure provide a virtual terrain processing method, which can be executed by the Unreal Engine, such as UE4 (Unreal Engine 4), and can be deployed on a virtual scene development platform.
[0033] Taking the development of a game scene as an example, the virtual terrain processing method can be used to process the virtual terrain in the game.
[0034] Figure 1 The figure shows a virtual terrain processing method in this exemplary embodiment, which specifically includes the following steps S110 to S130:
[0035] Step S110, obtain the first virtual terrain that has been created by a third-party terrain production platform;
[0036] Step S120, extract terrain vertices from the first virtual terrain and determine the terrain height information corresponding to the terrain vertices;
[0037] Step S130, generate a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices;
[0038] Step S140, use the terrain height grayscale map to perform terrain conversion to generate a second virtual terrain.
[0039] During the above virtual terrain processing, the obtained virtual terrain is reconstructed. Since the relevant terrain height information of the virtual terrain is obtained during the reconstruction of the virtual terrain, the already completed virtual terrain can be reconstructed, thereby realizing the secondary editing of the virtual terrain, facilitating the further optimization and rendering of the terrain structure of the obtained virtual terrain, and meeting various visual requirements of users for the virtual terrain. In addition, solving the problem of secondary editing of the virtual terrain can not only avoid the problem of high performance cost caused by replacing the entire virtual terrain due to changes in the local structure requirements of the virtual terrain, but also improve the rendering rate of the virtual terrain, saving time and performance costs. Moreover, since this virtual terrain processing method enables the Unreal Engine to perform secondary editing and rendering of the virtual terrain, it can also avoid the decrease in the frame rate of the screen display caused by the inability to quickly render when the terrain is relatively complex, thereby ensuring the screen display effect of the virtual terrain.
[0040] The following will separately Figure 1 describe each step in detail.
[0041] Step S110: Obtain the first virtual terrain that has been completed by a third-party terrain production platform;
[0042] The virtual terrain refers to the surface or ground image data structure, which describes the terrain undulation states such as valleys and ravines.
[0043] The first virtual terrain can be a virtual terrain that has been completed by a third-party terrain production platform and can be directly imported and used from the third-party terrain production platform. The third-party terrain production platform can be various DCC (Digital Content Create) terrain production platforms, such as 3D modeling and animation platforms like MAYA software and C4D (CINEMA 4D) software. The first virtual terrain can be terrain model data in fbx format.
[0044] Step S120: Extract terrain vertices from the first virtual terrain and determine the terrain height information corresponding to the terrain vertices;
[0045] The first virtual terrain contains several terrain vertices, and each terrain vertex can have one or more of the terrain feature parameters such as height, slope, and surface curvature. The terrain height information can refer to the coordinate values of each terrain vertex in the first virtual terrain in the direction perpendicular to the horizontal plane of the first virtual terrain. Within the coordinate value range, the middle value is 0, values lower than this are negative, and values higher than this are positive.
[0046] In an alternative embodiment, extracting terrain vertices from the first virtual terrain includes: parsing the terrain bounding box of the first virtual terrain and parsing the terrain vertices of the first virtual terrain within the range of the terrain bounding box of the first virtual terrain.
[0047] The terrain bounding box here can be a bounding box for framing the terrain, used to define the selection range of terrain vertices, facilitate positioning the relative position information of terrain vertices, and thus accurately obtain the relevant information of terrain vertices.
[0048] In an alternative embodiment, the above-mentioned parsing of the terrain bounding box of the first virtual terrain can be achieved by the following method: framing the first virtual terrain in the horizontal plane direction of the first virtual terrain to obtain the terrain bounding box of the first virtual terrain.
[0049] In the above process, from the perspective parallel to the horizontal plane of the first virtual terrain, the first virtual terrain is framed in the terrain bounding box so that the first virtual terrain does not exceed the range framed by the terrain bounding box.
[0050] Since the first virtual terrain may be a virtual terrain with a three-dimensional structure, determining the bounding box of the first virtual terrain can provide a position reference basis for subsequent determination of relevant terrain parameters, and is also conducive to parsing the relevant height information of the first virtual terrain.
[0051] In an alternative embodiment, when extracting terrain vertices from the first virtual terrain, the first virtual terrain can also be meshed to obtain the terrain mesh of the first virtual terrain; the vertices of the terrain mesh of the first virtual terrain are used as the terrain vertices in the first virtual terrain.
[0052] When parsing terrain vertices, the first virtual terrain within the range of the terrain bounding box can be meshed first to form the terrain mesh of the first virtual terrain, and the terrain vertices are determined from the formed terrain mesh of the first virtual terrain, realizing uniform sampling of the first virtual terrain to extract a specific number of terrain vertices, which is applicable to virtual terrains with relatively gentle terrain undulations and relatively uniform gully distributions. Among them, each terrain mesh can cover multiple pixels on the display device after perspective and projection transformations.
[0053] In an alternative embodiment, when extracting terrain vertices from the first virtual terrain, it can also be achieved through the steps as Figure 2 shown, specifically including the following steps S210 to S220:
[0054] Step S210, parsing the terrain feature information of the first virtual terrain;
[0055] Step S220, determining the terrain vertices of the first virtual terrain according to the terrain feature information of the first virtual terrain.
[0056] Terrain feature information refers to information such as the overall contour, terrain undulation, and trend of the terrain that can determine the terrain.
[0057] When determining the terrain vertices of the first virtual terrain according to the terrain feature information of the first virtual terrain, terrain feature points can be screened out from the terrain vertices of the first virtual terrain according to the terrain feature information of the first virtual terrain, such as mountaintop points, depression points, ridge points, etc. This process realizes non-uniform sampling of the first virtual terrain, is applicable to virtual terrains with large terrain undulations and uneven gully distributions, and is beneficial to improving the subsequent terrain processing efficiency.
[0058] In an alternative implementation, determining the terrain height information corresponding to the terrain vertices can be achieved through the steps shown as follows: Figure 3 Specifically, it includes the following steps S310 to S320:
[0059] Step S310, use a virtual camera set along the vertical direction of the first virtual terrain to obtain the depth information corresponding to the terrain vertices, where the vertical direction is perpendicular to the horizontal plane of the first virtual terrain;
[0060] Step S320, determine the terrain height information corresponding to the terrain vertices according to the depth information corresponding to the terrain vertices.
[0061] The virtual camera set along the vertical direction of the first virtual terrain is located directly above the first virtual terrain, can provide a perspective parallel to the horizontal plane of the first virtual terrain, and the perspective of this virtual camera can cover the range defined by the bounding box of the first virtual terrain. Taking the vertical direction of the first virtual terrain as the Z-axis direction, the virtual camera can perform depth information matching mapping along the Z-axis direction.
[0062] The depth information corresponding to the terrain vertices refers to the distance from each terrain vertex of the first virtual terrain to the virtual camera, which is used to represent the distance relationship between the first virtual terrain and the virtual camera. The depth information can include the longitudinal distance information and the lateral distance from the virtual camera to each terrain vertex. The terrain height information can be characterized according to the depth information between the virtual camera and each terrain vertex.
[0063] In the above process, by determining the height information of the terrain vertices, grayscale pixel values can be provided for the subsequent generated height grayscale map.
[0064] Step S130, generate a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices.
[0065] The terrain height grayscale map refers to a grayscale map representing the height of the terrain, and the brightness of each pixel in this map corresponds to a height value. For example,Figure 4 The height grayscale image shown, where the lowest terrain vertex of the terrain can be represented by black, and the highest terrain vertex of the terrain can be represented by white.
[0066] In an alternative embodiment, according to the terrain height information corresponding to the terrain vertices, a terrain height grayscale image can be generated, and it can also be achieved in the following way: according to the arrangement positions of the terrain vertices in the first virtual terrain, the terrain height information corresponding to each terrain vertex is used to render the terrain height grayscale image.
[0067] The arrangement positions of the terrain vertices can include the arrangement order of the terrain vertices in the terrain grid, the position intervals between adjacent terrain vertices, etc.
[0068] During the execution of the above process, a blank terrain height grayscale image with the same size as the first virtual terrain can be created in advance. According to the arrangement positions of the terrain vertices in the first virtual terrain, the terrain height information corresponding to each terrain vertex is mapped to the corresponding pixels of the blank terrain height grayscale image to generate the terrain height grayscale image required for constructing the second virtual terrain.
[0069] It should be noted that if the determined terrain vertices are not evenly distributed and cannot be in one-to-one correspondence with the blank terrain height grayscale image, the pixel positions that have not been mapped with terrain height information can be subjected to a smoothing transition process based on the terrain height information of adjacent pixel positions to form a complete terrain height grayscale image.
[0070] Step S140, perform terrain conversion using the terrain height grayscale image to generate the second virtual terrain.
[0071] When generating the second virtual terrain based on the terrain height grayscale image in this step, the pixel information of the terrain height grayscale image can be extracted by calling the ImageWrapper->GetWidth() and ImageWrapper->GetHeight() methods in the application programming interface, and mapped to the terrain generation data structures ExpectedResolution.Width and ExpectedResolution.Height, and then the terrain generation component is called for terrain conversion to generate the second virtual terrain.
[0072] The above-mentioned terrain generation component can generate the corresponding terrain structure through the grayscale intensity of the terrain height grayscale image pixels, that is, the terrain height information of the terrain height grayscale image pixels. That is, based on the pixel values representing the terrain height information on the terrain height grayscale image, the height values of the corresponding positions of the second virtual terrain can be determined, and then the second virtual terrain can be constructed.
[0073] In an alternative embodiment, a new second virtual terrain may also be generated in response to an editing operation on the terrain height grayscale map.
[0074] Since, during the process of generating the second virtual terrain, a terrain height grayscale map generated from the relevant terrain height information of the first virtual terrain is obtained, after storing the generated terrain height grayscale map, when it is necessary to adjust the structure of the generated second virtual terrain, the terrain height information corresponding to the relevant pixel values can be changed by editing the pixel values of the terrain height grayscale map, thereby changing the terrain structure of the generated second virtual terrain.
[0075] The above process realizes the conversion operation from the non-editable first virtual terrain to the editable second virtual terrain based on the terrain height grayscale map, so that when it is necessary to modify the first virtual terrain, there is no need to modify and edit it on a third-party terrain production platform and then re-import it into the current virtual scene development platform, which can save time and performance costs and improve the efficiency of virtual terrain production.
[0076] As Figure 5 shown, a comparison diagram of the first virtual terrain and the second virtual terrain is provided. The virtual terrain on the left is used as the unprocessed first virtual terrain. After processing the first virtual terrain using the above virtual terrain processing method, the virtual terrain on the right can be obtained, that is, the processed second virtual terrain. Compared with the first virtual terrain, the second virtual terrain obtained after processing is basically the same in external structure. It not only inherits the terrain structure characteristics of the first virtual terrain, but also can further modify its terrain structure.
[0077] In addition, when parsing the terrain vertices of the first virtual terrain, information such as the color corresponding to the terrain vertices can also be obtained, so that when generating the second virtual terrain according to the terrain height grayscale map, the second virtual terrain can be rendered according to the parsed information such as the color of the first virtual terrain, realizing the optimized rendering of the virtual terrain, and avoiding the decrease in the frame rate of the screen display caused by the inability to quickly render when the terrain is relatively complex, thereby ensuring the screen display effect of the virtual terrain.
[0078] An exemplary embodiment of the present disclosure also provides a virtual terrain processing device. As Figure 6 shown, the virtual terrain processing device 600 may include:
[0079] A first terrain acquisition module 610, configured to acquire a first virtual terrain that has been produced by a third-party terrain production platform;
[0080] A terrain height determination module 620, configured to extract terrain vertices from the first virtual terrain and determine the terrain height information corresponding to the terrain vertices;
[0081] The grayscale map generation module 630 is configured to generate a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices;
[0082] The second terrain generation module 640 is configured to perform terrain transformation using the terrain height grayscale map to generate a second virtual terrain.
[0083] In an alternative embodiment, the terrain height determination module 620 may be configured to: use a virtual camera set along the vertical direction of the first virtual terrain to obtain the depth information corresponding to the terrain vertices, where the vertical direction is perpendicular to the horizontal plane of the first virtual terrain; determine the terrain height information corresponding to the terrain vertices according to the depth information corresponding to the terrain vertices.
[0084] In an alternative embodiment, the grayscale map generation module 630 may be configured to: render a terrain height grayscale map according to the arrangement positions of the terrain vertices in the first virtual terrain, using the terrain height information corresponding to each terrain vertex.
[0085] In an alternative embodiment, the first terrain acquisition module 610 may further include: a first terrain vertex extraction module configured to parse the terrain bounding box of the first virtual terrain and extract the terrain vertices of the first virtual terrain from within the terrain bounding box of the first virtual terrain.
[0086] In an alternative embodiment, the terrain vertex extraction module may be configured to frame the first virtual terrain in the horizontal plane direction of the first virtual terrain to obtain the terrain bounding box of the first virtual terrain.
[0087] In an alternative embodiment, the first terrain acquisition module 610 may further include: a second terrain vertex extraction module configured to grid the first virtual terrain to obtain the terrain grid of the first virtual terrain; use the vertices of the terrain grid of the first virtual terrain as the terrain vertices in the first virtual terrain.
[0088] In an alternative embodiment, the first terrain acquisition module 610 may further include: a third terrain vertex extraction module configured to parse the terrain feature information of the first virtual terrain; determine the terrain vertices of the first virtual terrain according to the terrain feature information of the first virtual terrain..
[0089] The specific details of each part in the above virtual terrain processing 600 have been described in detail in the embodiments of the method section. For the undisclosed details, reference may be made to the content of the embodiments in the method section, and thus will not be elaborated here.
[0090] Exemplary embodiments of the present disclosure also provide a computer-readable storage medium, on which a program product is stored that can implement the above-described virtual terrain processing method of this specification. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. The program product can be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0091] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0092] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0093] The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0094] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).
[0095] Exemplary embodiments of the present disclosure also provide an electronic device capable of implementing the above virtual terrain processing method. The following will refer to Figure 7 to describe the electronic device 700 according to such an exemplary embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0096] As Figure 7 shown, the electronic device 700 may be presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0097] The storage unit 720 stores program code, and the program code can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. For example, the processing unit 710 may execute Figures 1 to 3 any one or more of the method steps.
[0098] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 721 and / or a cache storage unit 722, and may further include a read-only storage unit (ROM) 723.
[0099] The storage unit 720 may also include a program / utilities 724 having a set (at least one) of program modules 725. Such program modules 725 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0100] The bus 730 can represent one or more of several types of bus architectures, including a memory unit bus or memory unit controller, a peripheral bus, an Accelerated Graphics Port, a processing unit, or a local bus using any of the various bus architectures.
[0101] The electronic device 700 can also communicate with one or more external devices 800 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 750. Moreover, the electronic device 700 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 760. As shown in the figure, the network adapter 760 communicates with other modules of the electronic device 700 through the bus 730. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0102] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or can be implemented by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiments of the present disclosure.
[0103] In addition, the above drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, rather than for limiting purposes. It is easy to understand that the processes shown in the above drawings do not indicate or limit the time sequence of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.
[0104] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more of the above-described modules or units can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0105] Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuitry", "module", or "system" here. After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include the well-known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.
[0106] It should be understood that the present disclosure is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only defined by the appended claims.
Claims
1. A virtual terrain processing method, characterized in that, the method includes: Obtain a first virtual terrain that has been completed by a third-party terrain production platform; Extract terrain vertices from the first virtual terrain, and use a virtual camera set along the vertical direction of the first virtual terrain to obtain the depth information corresponding to the terrain vertices. According to the depth information corresponding to the terrain vertices, determine the terrain height information corresponding to the terrain vertices. The vertical direction is perpendicular to the horizontal plane of the first virtual terrain; Generate a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices; Use the terrain height grayscale map for terrain conversion to generate a second virtual terrain; In response to an editing operation on the terrain height grayscale map, generate a new second virtual terrain.
2. The method according to claim 1, characterized in that, the generating a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices includes: Render a terrain height grayscale map according to the terrain height information corresponding to each terrain vertex in the first virtual terrain based on the arrangement positions of the terrain vertices.
3. The method according to claim 1, characterized in that, the extracting terrain vertices from the first virtual terrain includes: Analyze the terrain bounding box of the first virtual terrain, and extract the terrain vertices of the first virtual terrain within the range of the terrain bounding box of the first virtual terrain.
4. The method according to claim 3, characterized in that, the analyzing the terrain bounding box of the first virtual terrain includes: Frame the first virtual terrain in the horizontal plane direction of the first virtual terrain to obtain the terrain bounding box of the first virtual terrain.
5. The method according to claim 1, characterized in that, the extracting terrain vertices from the first virtual terrain includes: Mesh the first virtual terrain to obtain the terrain mesh of the first virtual terrain; Use the vertices of the terrain mesh of the first virtual terrain as the terrain vertices in the first virtual terrain.
6. The method according to claim 1, characterized in that, the extracting terrain vertices from the first virtual terrain further includes: Analyze the terrain feature information of the first virtual terrain; Determine the terrain vertices of the first virtual terrain according to the terrain feature information of the first virtual terrain.
7. A virtual terrain processing device, characterized in that, the device includes: A first terrain acquisition module for acquiring a first virtual terrain that has been completed by a third-party terrain production platform; A terrain height determination module for extracting terrain vertices from the first virtual terrain, and using a virtual camera set along the vertical direction of the first virtual terrain to obtain the depth information corresponding to the terrain vertices. According to the depth information corresponding to the terrain vertices, determine the terrain height information corresponding to the terrain vertices. The vertical direction is perpendicular to the horizontal plane of the first virtual terrain; A grayscale map generation module for generating a terrain height grayscale map according to the terrain height information corresponding to the terrain vertices; A second terrain generation module, configured to perform terrain conversion by using the terrain height grayscale map to generate a second virtual terrain; and further configured to generate a new second virtual terrain in response to an editing operation on the terrain height grayscale map.
8. A computer-readable storage medium, having a computer program stored thereon, wherein, when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device, wherein, comprising: a processor; and a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the method according to any one of claims 1 to 6 by executing the executable instructions.
Citation Information
Patent Citations
Method and device for processing topographical file
CN107358649A
Terrain generation method
CN109887081A