A terrain splicing method, device, electronic device and storage medium
Through cropping and height difference splicing transformation processing, the problem of unnatural splicing of terrain is solved, the visual experience and editing efficiency are improved, and resource conflicts are avoided.
Patent Information
- Application Number
- CN202111057769.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-09
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-09-09
AI Technical Summary
When the existing terrain splicing method is edited by multiple people, it leads to resource update conflicts and management chaos, and the transition of the splicing area is unnatural and the visual experience is poor.
By determining the overlapping area between the target sub-terrain and the sub-terrain to be spliced, cropping and height difference splicing transformation are performed, and combined with expansion processing, a more natural transition area is generated.
It effectively solves the naturalness problem of splicing areas, improves visual experience and operation convenience, avoids resource update conflicts, and improves the management efficiency of multiple editors.
Smart Images

Figure CN113744401B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a terrain splicing method, device, electronic equipment and storage medium. Background Art
[0002] In the process of editing the terrain of the game scene, since the scale of the terrain is usually large, multiple people can be allowed to edit a single piece of terrain at the same time. However, simultaneous editing by multiple people is prone to cause resource update conflicts and management confusion during the update process. Moreover, the terrain edited by each different user will have different contour shapes according to needs during editing. In the simultaneous editing mode of multiple people, the terrain is usually divided into multiple square structures, so multiple pieces of terrain will inevitably be staggered.
[0003] However, the existing terrain splicing method only merges the square structures together, resulting in a stiff and unnatural transition in the splicing area and a poor visual experience. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a terrain splicing method to alleviate the technical problem of unnatural texture transition after splicing in the existing terrain splicing method.
[0005] In a first aspect, an embodiment of the present invention provides a terrain stitching method, including: determining an overlapping area between a target sub-terrain and a sub-terrain to be stitched; clipping the sub-terrain to be stitched based on the overlapping area to obtain a target stitching sub-terrain; performing a stitching transformation on the target stitching sub-terrain based on a height difference between the boundary edges of the target sub-terrain and the target stitching sub-terrain; and performing expansion processing on the target stitching sub-terrain after the stitching transformation to obtain a stitched terrain.
[0006] In some optional implementations, determining the overlapping area between the target sub-terrain and the sub-terrain to be stitched includes:
[0007] Projecting the edge line of the target sub-terrain onto the sub-terrain to be spliced to obtain a projected edge line;
[0008] The area enclosed by the projection edge line and the sub-terrain to be spliced, which is close to the target sub-terrain, is determined as the overlapping area.
[0009] In some optional implementations, performing a splicing transformation on the target splicing sub-terrain based on a height difference between a boundary edge of the target sub-terrain and the target splicing sub-terrain includes:
[0010] Determine the height difference between the boundary edge of the target sub-terrain and the target spliced sub-terrain;
[0011] Determine a height transformation value of the sampling point on the target splicing sub-terrain based on the distance between the sampling point on the target splicing sub-terrain and the edge boundary line, wherein the closer the distance between the sampling point on the target splicing sub-terrain and the edge boundary line is, the closer the height transformation value is to the height difference;
[0012] Perform stitching transformation on the sampling points on the target stitching sub-terrain based on the height transformation value.
[0013] In some optional implementations, performing a stitching transformation on the sampling points on the target stitching sub-terrain based on the height transformation value includes:
[0014] The target sub-terrain and the target splicing sub-terrain are interpolated and mixed based on the height transformation value by using the blending mask to obtain the sampling points after the splicing transformation on the target splicing sub-terrain.
[0015] In some optional implementations, the sampling point includes position information and mapping information; the transformed position information and the transformed mapping information of the splicing sampling point on the target splicing sub-terrain are determined by difference blending.
[0016] In some optional implementations, determining a height transformation value of a sampling point on a target stitching sub-terrain based on a distance between the sampling point on the target stitching sub-terrain and an edge boundary line includes:
[0017] Determining a preset transformation amplitude value;
[0018] Based on a preset transformation amplitude value and a distance between a sampling point on a target splicing sub-terrain and an edge boundary line, a height transformation value of the sampling point on the target splicing sub-terrain is determined.
[0019] In some optional implementations, the method further includes:
[0020] In response to a setting operation on a transform amplitude value, determining a new transform amplitude value;
[0021] Based on the new transformation amplitude value, adjust the height transformation value of the sampling point on the target spliced sub-terrain.
[0022] In some optional implementations, in response to a setting operation on a transform amplitude value, determining a new transform amplitude value includes:
[0023] In response to a drag operation on a sampling point on a target spliced sub-terrain, a displacement of the drag operation is determined; and a new transformation amplitude value is determined based on the magnitude of the displacement.
[0024] In some optional implementations, the target spliced sub-terrain after the splicing transformation is expanded to obtain a spliced terrain, including:
[0025] Performing at least one expansion process on the first target area in the target spliced sub-terrain after the splicing transformation to obtain the expanded first target area;
[0026] The spliced terrain includes the target sub-terrain and the expanded target spliced sub-terrain, and the expanded target spliced sub-terrain includes the expanded first target area.
[0027] In some optional implementations, at least one expansion process is performed on the first target area in the target spliced sub-terrain after the splicing transformation, including:
[0028] Determine expansion parameters, which include expansion times and expansion distance;
[0029] At least one expansion process is performed on the first target area in the target spliced sub-terrain after the splicing transformation based on the expansion parameter.
[0030] In some optional implementations, the number of expansions is determined based on the distance between the sampling point of the target sub-terrain and the sampling point on the target spliced sub-terrain after the splicing transformation.
[0031] In some optional implementations, the number of expansions is determined based on the LOD strength.
[0032] In the second aspect, a terrain splicing device is also provided, including: a determination module, used to determine the overlapping area between the target sub-terrain and the sub-terrain to be spliced; a clipping module, used to clip the sub-terrain to be spliced based on the overlapping area to obtain the target splicing sub-terrain; a transformation module, used to perform splicing transformation on the target splicing sub-terrain based on the height difference between the boundary edge of the target sub-terrain and the target splicing sub-terrain; and an expansion module, used to perform expansion processing on the target splicing sub-terrain after the splicing transformation to obtain the spliced terrain.
[0033] In some optional implementations, the determination module is specifically used to:
[0034] Projecting the edge line of the target sub-terrain onto the sub-terrain to be spliced to obtain a projected edge line;
[0035] The area enclosed by the projection edge line and the sub-terrain to be spliced, which is close to the target sub-terrain, is determined as the overlapping area.
[0036] In some optional implementations, the transformation module is specifically used to:
[0037] Determine the height difference between the boundary edge of the target sub-terrain and the target spliced sub-terrain;
[0038] Determine a height transformation value of the sampling point on the target splicing sub-terrain based on the distance between the sampling point on the target splicing sub-terrain and the edge boundary line, wherein the closer the distance between the sampling point on the target splicing sub-terrain and the edge boundary line is, the closer the height transformation value is to the height difference;
[0039] Perform stitching transformation on the sampling points on the target stitching sub-terrain based on the height transformation value.
[0040] In some optional implementations, the transformation module is further configured to:
[0041] The target sub-terrain and the target splicing sub-terrain are interpolated and mixed based on the height transformation value by using the blending mask to obtain the sampling points after the splicing transformation on the target splicing sub-terrain.
[0042] In some optional implementations, the sampling point includes position information and mapping information; the transformed position information and the transformed mapping information of the splicing sampling point on the target splicing sub-terrain are determined by difference blending.
[0043] In some optional implementations, the transformation module is further configured to:
[0044] Determining a preset transformation amplitude value;
[0045] Based on a preset transformation amplitude value and a distance between a sampling point on a target splicing sub-terrain and an edge boundary line, a height transformation value of the sampling point on the target splicing sub-terrain is determined.
[0046] In some optional implementations, the transformation module is further configured to:
[0047] In response to a setting operation on a transform amplitude value, determining a new transform amplitude value;
[0048] Based on the new transformation amplitude value, adjust the height transformation value of the sampling point on the target spliced sub-terrain.
[0049] In some optional implementations, the transformation module is further configured to:
[0050] In response to a drag operation on a sampling point on a target spliced sub-terrain, a displacement of the drag operation is determined; and a new transformation amplitude value is determined based on the magnitude of the displacement.
[0051] In some optional implementations, the extension module is specifically used to:
[0052] Performing at least one expansion process on the first target area in the target spliced sub-terrain after the splicing transformation to obtain the expanded first target area;
[0053] The spliced terrain includes the target sub-terrain and the expanded target spliced sub-terrain, and the expanded target spliced sub-terrain includes the expanded first target area.
[0054] In some optional implementations, the extension module is further used to:
[0055] Determine expansion parameters, which include expansion times and expansion distance;
[0056] At least one expansion process is performed on the first target area in the target spliced sub-terrain after the splicing transformation based on the expansion parameter.
[0057] In some optional implementations, the number of expansions is determined based on the distance between the sampling point of the target sub-terrain and the sampling point on the target spliced sub-terrain after the splicing transformation.
[0058] In some optional implementations, the number of expansions is determined based on the LOD strength.
[0059] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the method in the first aspect, and the processor is configured to execute the program stored in the memory.
[0060] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method in the first aspect are executed.
[0061] In an embodiment of the present invention, a terrain splicing method, device, electronic device and storage medium are provided. The overlapping area between the target sub-terrain and the sub-terrain to be spliced is determined; the sub-terrain to be spliced is cropped based on the overlapping area to obtain the target splicing sub-terrain; the target splicing sub-terrain is spliced and transformed based on the height difference between the boundary edge of the target sub-terrain and the target splicing sub-terrain; the target splicing sub-terrain after the splicing transformation is expanded to obtain the spliced terrain. In this way, the overlapping area between the spliced terrains can be cropped first, the splicing transformation can be performed based on the height difference between the cropped terrain areas, and the transformed terrain area can be expanded. The above method makes the transition area more natural, without obvious seams, with a better visual experience and convenient operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0063] Figure 1 A flow chart of a terrain splicing method provided by an embodiment of the present invention;
[0064] Figure 2 A schematic diagram of an editing interface for terrain editing provided by an embodiment of the present invention;
[0065] Figure 3 A schematic diagram of an interface for selecting content generation nodes at different levels provided by an embodiment of the present invention;
[0066] Figure 4 An example of terrain splicing provided by an embodiment of the present invention;
[0067] Figure 5 Another example of terrain splicing provided by an embodiment of the present invention;
[0068] Figure 6 Another example of terrain splicing provided by an embodiment of the present invention;
[0069] Figure 7 Another example of terrain splicing provided by an embodiment of the present invention;
[0070] Figure 8 Another example of terrain splicing provided by an embodiment of the present invention;
[0071] Fig. 9 A schematic diagram of a terrain splicing device provided by an embodiment of the present invention;
[0072] Fig.10 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] According to an embodiment of the present invention, an embodiment of a terrain splicing method 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.
[0075] Considering that 3D design software has many mature and convenient processing solutions, Houdini (a 3D design software) is the only 3D software with a sufficiently rich scene editing tool chain among the current mainstream 3D software, such as terrain calculation, scattered cluster placement of vegetation models, and automated tool processes. However, due to its unique resource format, the Messiah engine architecture (Messiah Server, which can be referred to as Messiah) needs to write customized input and output interfaces when interacting with other software, so it cannot interact directly with Houdini. Therefore, when processing the existing scene terrain of Messiah, artists are usually required to manually edit the terrain. However, the current scene terrain processing method often brings a lot of repetitive work to artists, resulting in low efficiency of terrain processing and low user experience. Based on this, the embodiment of the present invention provides a terrain splicing method, device, electronic terminal and storage medium, which improves the processing efficiency and convenience of artists when performing scene processing, thereby effectively improving the user experience.
[0076] Figure 1 A flow chart of a terrain splicing method provided by an embodiment of the present invention. A graphical user interface is provided through a terminal, and the graphical user interface includes a terrain editing interface, and the terrain editing interface includes a terrain to be edited. For example, the method can be applied to a terminal device that can run 3D design software, and the graphical user interface can be an interactive interface provided by the 3D design software. Among them, the 3D design software can be Houdini, such as Figure 1 As shown, the method may mainly include the following steps:
[0077] S110: Determine the overlapping area between the target sub-terrain and the sub-terrain to be spliced.
[0078] The target sub-terrain and the sub-terrain to be spliced may refer to terrains that have completed texture layering and terrain height editing.
[0079] Generally, a piece of terrain is edited by multiple art editors separately, so when the editing is completed, the terrain needs to be spliced.
[0080] The present application may be a splicing operation triggered after a user submits a splicing request, and the splicing request may include a terrain that has been edited. The splicing request may be used to instruct to splice the completed terrain into the entire terrain.
[0081] In the embodiment of the present application, the target sub-terrain and the sub-terrain to be spliced can be terrains edited by different users, or can be terrains edited by the same user. For example, since the scale of terrain is usually large, the terrain to be edited can be divided into multiple sub-terrains to be edited, and the multiple sub-terrains to be edited can be assigned to one or more users for editing. After the editing is completed, the multiple terrains that have been edited can be spliced, and one of any two adjacent terrains in the multiple terrains that have been edited is the target sub-terrain, and the other is the sub-terrain to be spliced; or, the first one submitted in any two adjacent terrains in the multiple terrains that have been edited is the target sub-terrain, and the later one submitted is the sub-terrain to be spliced.
[0082] For example, the terrain that needs to be spliced includes the first terrain processed by the first art editing user, the second terrain processed by the second art editing user, and the third terrain processed by the third art editing user, wherein the second terrain and the third terrain both need to be spliced with the first terrain. At this time, the first terrain is the target sub-terrain, and the second terrain and the third terrain are the sub-terrains to be spliced.
[0083] Therefore, during the resource update process, the second art editing user and the third art editing user only need to update the voxel data resources in the second terrain and the third terrain respectively according to the first terrain, and there is no need to update the voxel data resources in the first terrain, thereby ensuring that there will be no conflicts in resource updates.
[0084] There are many ways to determine the overlapping area. Generally, only the edge areas of the target sub-terrain and the terrain to be stitched will overlap. Although the two surfaces use the same layered blending map in the transition area before processing, it is impossible to guarantee whether the edge transition is natural when the two terrains are put together during different art editing. At the same time, in this example, the height difference between the two terrains is also relatively large, but in the example project, there will be a plan to prevent the blending transition between the two terrains from being so strong.
[0085] The edge area of one terrain can be modified to match the edge height and layering data of the other terrain. As an example, the edge line of the target sub-terrain can be projected onto the sub-terrain to be spliced to obtain the projected edge line; the area enclosed by the projected edge line and the sub-terrain to be spliced and close to the side of the target sub-terrain is determined as the overlapping area. In other words, the overlapping area can be an area on the sub-terrain to be spliced, and the overlapping area is the projection of the target sub-terrain on the sub-terrain to be spliced.
[0086] S120 , clipping the sub-terrain to be spliced based on the overlapping area to obtain the target sub-terrain.
[0087] After determining the overlapping area, the overlapping area may be cut from the sub-terrain to be spliced, so as to align the edge between the target sub-terrain and the sub-terrain to be spliced.
[0088] By clipping the overlapping areas, the performance required for data processing can be saved.
[0089] After determining the overlapping area, it is necessary to first determine the edge boundary line between the target sub-terrain and the terrain to be spliced. The edge boundary line is located on the sub-terrain to be spliced. The sub-terrain to be spliced can be cropped according to the edge boundary line to crop the overlapping area from the sub-terrain to be spliced to obtain the target splicing sub-terrain, thereby saving the resources and performance required for the subsequent splicing of the target sub-terrain with the target splicing sub-terrain.
[0090] S130 , performing a splicing transformation on the target splicing sub-terrain based on the height difference between the boundary edges of the target sub-terrain and the target splicing sub-terrain.
[0091] The splicing transformation is mainly for smooth transition between the target sub-terrain and the target splicing sub-terrain. There are many specific splicing transformation methods.
[0092] For example, the height difference between the boundary edge of the target sub-terrain and the target stitching sub-terrain can be determined; based on the distance between the sampling point on the target stitching sub-terrain and the edge boundary line, the height transformation value of the sampling point on the target stitching sub-terrain is determined, wherein the closer the distance between the sampling point on the target stitching sub-terrain and the edge boundary line is, the closer the height transformation value is to the height difference; and the sampling point on the target stitching sub-terrain is stitched and transformed based on the height transformation value.
[0093] Among them, the mixed mask can be used to interpolate and mix the target sub-terrain and the target splicing sub-terrain based on the height transformation value to obtain the sampling points after the splicing transformation on the target splicing sub-terrain.
[0094] The sampling point may include position information and texture information; the transformed position information and transformed texture information of the splicing sampling point on the target splicing sub-terrain may be determined by difference blending. That is, the height value of the sampling point on the target splicing sub-terrain and the color value of the texture may be updated based on the height transformation value.
[0095] In some embodiments, a preset transformation amplitude value may also be determined; based on the preset transformation amplitude value and the distance between the sampling point on the target spliced sub-terrain and the edge boundary line, the height transformation value of the sampling point on the target spliced sub-terrain is determined.
[0096] The transformation amplitude value may be determined according to actual needs or may be configured in advance. For example, in response to a setting operation for the transformation amplitude value, a new transformation amplitude value is determined; based on the new transformation amplitude value, the height transformation value of the sampling point on the target splicing sub-terrain is adjusted. For example, the transformation amplitude value may be set by a drag operation. Based on this, in response to a drag operation for a sampling point on the target splicing sub-terrain, the displacement of the drag operation may be determined; and a new transformation amplitude value may be determined based on the size of the displacement.
[0097] The transformation amplitude value is used to indicate the change amplitude of the position information and the mapping information between adjacent sampling points. The larger the transformation amplitude value, the larger the change amplitude, and the more drastic the transition in appearance. Correspondingly, the smaller the transformation amplitude value, the smaller the change amplitude, and the smoother the transition in appearance. A suitable value can be selected based on experience. The transformation amplitude value can also affect the area that needs to be spliced. Among them, the area that needs to be spliced can be only on the target splicing sub-terrain. The larger the transformation amplitude value, the smaller the area that needs to be spliced, and the smaller the transformation amplitude value, the larger the area that needs to be spliced, so as to meet the splicing requirements.
[0098] In some embodiments, when setting the transformation amplitude value, only the transformation amplitude of the position information may be set, and the transformation amplitude of the mapping information is determined based on the transformation amplitude of the position information. The transformation amplitude value may be a transformation ratio for the height difference, and the transformation ratio may be applied to the transformation of the mapping information.
[0099] S140, performing expansion processing on the target spliced sub-terrain after the splicing transformation to obtain a spliced terrain.
[0100] In an embodiment of the present invention, the height between the target sub-terrain and the area corresponding to the sub-terrain to be spliced in the target spliced sub-terrain after the splicing transformation has a gradual transition over a distance, but there may still be an obvious seam between the two areas. For example, when the viewing distance is far away, if the terrain may have seams again due to multiple levels of detail (LOD) processing. Based on this, the first target area in the target spliced sub-terrain after the splicing transformation can be expanded at least once to obtain the expanded first target area; the spliced terrain includes the target sub-terrain and the expanded target spliced sub-terrain, and the expanded target spliced sub-terrain includes the expanded first target area.
[0101] Among them, an expansion parameter may be determined, the expansion parameter including the number of expansions and the expansion distance; and based on the expansion parameter, at least one expansion process is performed on the first target area in the target splicing sub-terrain after the splicing transformation.
[0102] The number of expansions can be determined based on the distance between the sampling point of the target sub-terrain and the sampling point on the target spliced sub-terrain after the splicing transformation. The number of expansions is determined based on the LOD strength. The stronger the LOD strength, the more expansions there are, so as to produce a better display effect.
[0103] Through the embodiments of the present invention, the overlapping area between the target sub-terrain and the sub-terrain to be spliced can be determined; the sub-terrain to be spliced is clipped based on the overlapping area to obtain the target spliced sub-terrain; the target spliced sub-terrain is spliced and transformed based on the height difference between the boundary edges of the target sub-terrain and the target spliced sub-terrain; the target spliced sub-terrain after the splicing transformation is expanded to obtain the spliced terrain. In this way, the overlapping area between the spliced terrains can be clipped first, the splicing transformation is performed based on the height difference between the cropped terrain areas, and the transformed terrain area is expanded. Through the above method, the transition area is more natural, there is no obvious seam, the visual experience is better, and the operation is convenient.
[0104] Considering that as an artist, you may need to manually adjust the effect in the view, in order to improve convenience and efficient interactive experience, and try to simplify operations and reduce unnecessary calculations. Figure 2 The figure shows a schematic diagram of an editing interface for terrain editing processing on a terminal device running Houdini. The left side is a terrain editing area for displaying the current scene terrain, which may be a large scene terrain of a game scene. Figure 2 The right side of the middle is the node selection area, which is used to match the node where the current terrain to be processed is located. As can be seen from the figure, the node contains child nodes, that is, the node of the embodiment of the present invention can quickly browse the existing scene, classification, scene entity (Entity) and other information through the hierarchical tree, and import, edit, update and export the selected content. Artists can select the corresponding node according to the actual processing needs.
[0105] For ease of understanding, an example of an interface diagram for generating interactive nodes by selecting content at different levels is shown in Figure 3 As shown in the figure, the interface can also be used to quickly generate nodes and encapsulate nodes at the specified network position by dragging and selecting different levels of content. Since each resource has many related parameters, by dragging and selecting to generate nodes and presetting the parameters, the operation can be simplified as much as possible so that artists can quickly use each interactive node without even knowing these parameters, and no longer need to manually configure the path on the node.
[0106] The above method can greatly improve the IO speed through multi-threaded management through C++HDK. The GUI interface has been greatly simplified. Through the hierarchy tree, you can quickly browse existing scenes, levels, scene entities and other information, and import, edit, update and export the selected content.
[0107] However, in the process of editing a large world in Messiah (a terrain editing engine), multiple people editing a single terrain at the same time can easily cause resource update conflicts and management confusion. Each different zone (plot) will have different outline shapes according to artistic requirements during editing, and Messiah's terrain can only maintain a square structure, so multiple terrains will inevitably be staggered. However, in the existing technology, the edge transition of the terrain is mixed and matched according to the adjacent terrain, which is only aligned in height, and the texture allocation transition is unnatural. In view of the above problems, the following solutions are proposed.
[0108] like Figure 4 As shown, Figure 4 Two terrains that have been edited in messiah are shown (a first terrain 401 and a second terrain 402, wherein the first terrain 401 is the target sub-terrain and the second terrain 402 is the sub-terrain to be spliced), and the art editors of the two terrains have edited the texture layering and terrain height according to the zone planning, and hollowed out the terrain outside the zone according to the shape of the zone.
[0109] In this example, the two terrains only partially overlap with each other at the edges. Before processing, although the two surfaces used the same layered blending map in the transition area, it is impossible to guarantee whether the edge transition is natural when the two terrains are put together during different art editing. At the same time, in this example, the height difference between the two terrains is also relatively large, but in the example project, there will be a plan in advance to prevent the blending transition between the two terrains from being so strong.
[0110] Based on the solution provided by the embodiment of the present invention, the edge area of one zone can be modified to match the edge height and layered data of another zone.
[0111] First, if Figure 5 As shown, it is necessary to determine the overlapping area 501 and perform clipping on the overlapping area to save performance, and obtain the following Figure 6 The terrain shown.
[0112] Based on the overlapping area 501, the distance to the edge boundary line 502 is calculated for clipping, and the subsequent transition blending can be used as an interpolation value based on the distance from the sampling point to the boundary line.
[0113] According to Figure 7The mixed mask shown is used to interpolate the height and layer values of the two terrains, and then the terrain is exported to messiah to obtain Figure 8 The terrain shown.
[0114] exist Figure 8 You will find that the height between the two zones has a gradual transition over a distance, but there is still an obvious seam. We need to expand the zones at the intersection for edge protection. The expansion distance can be calculated based on the distance between two adjacent sampling points of the terrain.
[0115] The above functions can be integrated into a single Houdini function node. After completing the blending planning, the artist only needs to let Houdini automatically update the edge blending after their respective scenes are updated, thereby achieving fast area planning and iteration.
[0116] The embodiment of the present invention further provides a terrain splicing device, which is used to execute the terrain splicing method provided in the above content of the embodiment of the present invention. The following is a detailed introduction to the terrain splicing device provided in the embodiment of the present invention.
[0117] Fig. 9 A schematic diagram of the structure of a terrain splicing device provided by an embodiment of the present invention. Fig. 9 As shown, the device may include:
[0118] A determination module 901 is used to determine the overlapping area between the target sub-terrain and the sub-terrain to be spliced;
[0119] A clipping module 902, configured to clip the sub-terrains to be spliced based on the overlapping area to obtain a target sub-terrain;
[0120] A transformation module 903, configured to perform a splicing transformation on the target splicing sub-terrain based on a height difference between the boundary edges of the target sub-terrain and the target splicing sub-terrain;
[0121] The expansion module 904 is used to expand the target spliced sub-terrain after the splicing transformation to obtain the spliced terrain.
[0122] In some embodiments, the determination module 901 is specifically used to:
[0123] Projecting the edge line of the target sub-terrain onto the sub-terrain to be spliced to obtain a projected edge line;
[0124] The area enclosed by the projection edge line and the sub-terrain to be spliced, which is close to the target sub-terrain, is determined as the overlapping area.
[0125] In some embodiments, the transformation module 903 is specifically used to:
[0126] Determine the height difference between the boundary edge of the target sub-terrain and the target spliced sub-terrain;
[0127] Determine a height transformation value of the sampling point on the target splicing sub-terrain based on the distance between the sampling point on the target splicing sub-terrain and the edge boundary line, wherein the closer the distance between the sampling point on the target splicing sub-terrain and the edge boundary line is, the closer the height transformation value is to the height difference;
[0128] Perform stitching transformation on the sampling points on the target stitching sub-terrain based on the height transformation value.
[0129] In some embodiments, the transformation module 903 is further configured to:
[0130] The target sub-terrain and the target splicing sub-terrain are interpolated and mixed based on the height transformation value by using the blending mask to obtain the sampling points after the splicing transformation on the target splicing sub-terrain.
[0131] In some embodiments, the sampling point includes position information and mapping information; the transformed position information and the transformed mapping information of the splicing sampling point on the target splicing sub-terrain are determined by difference blending.
[0132] In some embodiments, the transformation module 903 is further configured to:
[0133] Determining a preset transformation amplitude value;
[0134] Based on a preset transformation amplitude value and a distance between a sampling point on a target splicing sub-terrain and an edge boundary line, a height transformation value of the sampling point on the target splicing sub-terrain is determined.
[0135] In some embodiments, the transformation module 903 is further configured to:
[0136] In response to a setting operation on a transform amplitude value, determining a new transform amplitude value;
[0137] Based on the new transformation amplitude value, adjust the height transformation value of the sampling point on the target spliced sub-terrain.
[0138] In some embodiments, the transformation module 903 is further configured to:
[0139] In response to a drag operation on a sampling point on a target spliced sub-terrain, a displacement of the drag operation is determined; and a new transformation amplitude value is determined based on the magnitude of the displacement.
[0140] In some embodiments, the expansion module 904 is specifically used to:
[0141] Performing at least one expansion process on the first target area in the target spliced sub-terrain after the splicing transformation to obtain the expanded first target area;
[0142] The spliced terrain includes the target sub-terrain and the expanded target spliced sub-terrain, and the expanded target spliced sub-terrain includes the expanded first target area.
[0143] In some embodiments, the expansion module 904 is further configured to:
[0144] Determine expansion parameters, which include expansion times and expansion distance;
[0145] At least one expansion process is performed on the first target area in the target spliced sub-terrain after the splicing transformation based on the expansion parameter.
[0146] In some embodiments, the number of expansions is determined based on the distance between the sampling point of the target sub-terrain and the sampling point on the target spliced sub-terrain after the splicing transformation.
[0147] In some embodiments, the number of expansions is determined based on the LOD strength.
[0148] The scene terrain editing device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the scene terrain editing device, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0149] The electronic terminal of this embodiment may be, for example, a smart phone, a PC, a laptop computer, and the like. Fig.10 A schematic diagram of the structure of an electronic terminal is shown, which includes a processor and a storage device; a computer program is stored on the storage device, and when the computer program is run by the processor, any method of the above implementation methods is executed.
[0150] like Fig.10 As shown, an electronic device 1000 provided in an embodiment of the present application, for example, the electronic device 1000 can be a preprocessing server, including: a processor 1001, a memory 1002 and a bus, the memory 1002 stores machine-readable instructions executable by the processor 1001, when the electronic device is running, the processor 1001 and the memory 1002 communicate through the bus, and the processor 1001 executes the machine-readable instructions to perform the steps of the above-mentioned terrain splicing method.
[0151] The processor 1001 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 can be a central processing unit (CPU), a graphics processing unit (GPU), or one or a combination of other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device 1000 to perform desired functions.
[0152] The memory 1002 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1001 may run the program instructions to implement the client functions (implemented by the processor) and / or other desired functions in the embodiments of the present invention described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.
[0153] Specifically, the above-mentioned memory 1002 and processor 1001 can be general-purpose memory and processor, which are not specifically limited here. When the processor 1001 runs the computer program stored in the memory 1002, the above-mentioned terrain stitching method can be executed.
[0154] In addition, the electronic device 1000 may also include an input device and an output device. The input device is mainly used to realize human-computer interaction. The input device may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, and a touch screen. The output device may output various information (e.g., images or sounds) to the outside (e.g., a user), and may include one or more of a display, a speaker, etc. The output device may be used to display the graphical user interface of the above-mentioned launcher.
[0155] Corresponding to the above-mentioned terrain splicing method, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned terrain splicing method.
[0156] The terrain splicing device provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present application has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0157] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only 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 communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0158] 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0159] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0160] In addition, each functional unit in the embodiments provided in the present application 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.
[0161] If the function 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 application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions for an electronic device to perform all or part of the steps of the mobile control method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0162] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0163] Finally, it should be noted that the above embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application. They should all be covered within the protection scope of the present application.
Claims
1. A terrain splicing method, characterized in that: include: Determine the overlapping area between the edge local area of the target sub-terrain and the edge local area of the sub-terrain to be spliced; The sub-terrain to be spliced is clipped based on the overlapping area, and the overlapping area is clipped from the sub-terrain to be spliced to obtain a target sub-terrain; the overlapping area is a projection of the target sub-terrain on the sub-terrain to be spliced; Determine a height transformation value of the sampling point on the target splicing sub-terrain based on a distance between the sampling point on the target splicing sub-terrain and a boundary edge of the target splicing sub-terrain, and perform splicing transformation on the sampling point on the target splicing sub-terrain; The target spliced sub-terrain after the splicing transformation is subjected to at least one expansion process based on the expansion times and the expansion distance to obtain a spliced terrain.
2. The method according to claim 1, characterized in that Determine the overlapping area between the target sub-terrain and the sub-terrain to be stitched, including: Projecting the edge line of the target sub-terrain onto the sub-terrain to be spliced to obtain a projected edge line; An area enclosed by the projection edge line and the sub-terrain to be spliced and close to one side of the target sub-terrain is determined as an overlapping area.
3. The method according to claim 2, characterized in that Performing a splicing transformation on the target splicing sub-terrain based on a height difference between a boundary edge of the target sub-terrain and the target splicing sub-terrain includes: Determine the height difference between the boundary edge of the target sub-terrain and the target spliced sub-terrain; Determine, based on the distance between the sampling point on the target splicing sub-terrain and the edge boundary line, a height transformation value of the sampling point on the target splicing sub-terrain, wherein the closer the distance between the sampling point on the target splicing sub-terrain and the edge boundary line is, the closer the height transformation value is to the height difference; Performing a splicing transformation on the sampling points on the target splicing sub-terrain based on the height transformation value.
4. The method according to claim 3, characterized in that Performing a splicing transformation on the sampling points on the target splicing sub-terrain based on the height transformation value includes: The target sub-terrain and the target splicing sub-terrain are interpolated and mixed based on the height transformation value by using a blending mask to obtain sampling points on the target splicing sub-terrain after splicing transformation.
5. The method according to claim 3, characterized in that: The sampling point includes position information and mapping information; the transformed position information and the transformed mapping information of the splicing sampling point on the target splicing sub-terrain are determined by difference blending.
6. The method according to claim 3, characterized in that Determining a height transformation value of the sampling point on the target splicing sub-terrain based on a distance between the sampling point on the target splicing sub-terrain and an edge boundary line includes: Determining a preset transformation amplitude value; Based on the preset transformation amplitude value and the distance between the sampling point on the target splicing sub-terrain and the edge boundary line, the height transformation value of the sampling point on the target splicing sub-terrain is determined.
7. The method according to claim 6, characterized in that Also includes: In response to a setting operation on a transform amplitude value, determining a new transform amplitude value; Based on the new transformation amplitude value, the height transformation value of the sampling point on the target spliced sub-terrain is adjusted.
8. The method according to claim 7, characterized in that In response to a setting operation on a transform amplitude value, a new transform amplitude value is determined, including: In response to a drag operation on a sampling point on the target spliced sub-terrain, a displacement of the drag operation is determined; and a new transformation amplitude value is determined based on the magnitude of the displacement.
9. The method according to claim 3, characterized in that: The target spliced sub-terrain after the splicing transformation is expanded to obtain a spliced terrain, including: Performing at least one expansion process on the first target area in the target spliced sub-terrain after the splicing transformation to obtain the expanded first target area; The spliced terrain includes the target sub-terrain and the expanded target spliced sub-terrain, and the expanded target spliced sub-terrain includes the expanded first target area.
10. The method according to claim 6, characterized in that Performing at least one expansion process on the first target area in the target spliced sub-terrain after the splicing transformation, including: Determine expansion parameters, wherein the expansion parameters include the number of expansions and the expansion distance; At least one expansion process is performed on the first target area in the target spliced sub-terrain after the splicing transformation based on the expansion parameter.
11. The method according to claim 10, characterized in that The number of expansions is determined based on the distance between the sampling point of the target sub-terrain and the sampling point on the target spliced sub-terrain after the splicing transformation.
12. The method according to claim 10, characterized in that The number of expansions is determined based on the level of detail (LOD) strength.
13. A terrain splicing device, characterized in that: include: A determination module, used to determine the overlapping area between the edge local area of the target sub-terrain and the edge local area of the sub-terrain to be spliced; A clipping module, used for clipping the sub-terrain to be spliced based on the overlapping area, clipping the overlapping area from the sub-terrain to be spliced, and obtaining a target sub-terrain; the overlapping area is a projection of the target sub-terrain on the sub-terrain to be spliced; A transformation module, used to determine a height transformation value of the sampling point on the target splicing sub-terrain based on a distance between the sampling point on the target splicing sub-terrain and a boundary edge of the target splicing sub-terrain, and perform splicing transformation on the sampling point on the target splicing sub-terrain; The expansion module is used to perform at least one expansion process on the target spliced sub-terrain after the splicing transformation based on the expansion number and the expansion distance to obtain the spliced terrain.
14. An electronic terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine executable instructions. When the computer executable instructions are called and executed by a processor, the computer executable instructions prompt the processor to execute the method according to any one of claims 1 to 12.
