Three-dimensional terrain cutting method, device and equipment and storage medium

By generating a directed distance field and performing clipping based on texture, the problems of boundary jaggedness and accuracy loss in traditional 3D terrain clipping are solved, achieving high-precision and efficient 3D terrain clipping results.

CN121074299APending Publication Date: 2025-12-05BEIJING SUPERMAP SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511237722.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Traditional 3D terrain clipping methods produce pixel-level jagged edges at the boundaries, and suffer severe accuracy loss when the vector surface range is large, making it difficult to meet the requirements of high-precision clipping.

Method used

By acquiring vector surface data of the 3D terrain rendering scene, the minimum bounding rectangle of each vector surface is generated and mapped to a directed distance field to generate a texture. Based on the texture, clipping is performed, and fragment retention or culling operations are performed using the signed distance value of the directed distance field.

Benefits of technology

It achieves high-precision and high-efficiency 3D terrain clipping, improves visual quality and clipping accuracy, reduces boundary unevenness, and improves clipping efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074299A_ABST
    Figure CN121074299A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional terrain cutting method, device and equipment and a storage medium, and relates to the technical field of three-dimensional terrain cutting. The method comprises the steps of firstly obtaining vector surface data to be cut in a three-dimensional terrain rendering scene, then processing the vector surfaces to be cut based on the vector surface data to be cut to obtain a minimum enclosing rectangle of each vector surface to be cut, and then mapping each enclosing rectangle into a directed distance field and generating a texture, and finally, cutting the vector surface based on the texture in the directed distance field so as to realize high-precision and high-efficiency three-dimensional terrain cutting. Therefore, the vector surface is divided into the different terrain tiles to be independently processed, so that massive vector data processing can be carried out simultaneously, and the effect of efficiently processing complex vector surface data is achieved. In this way, the visual quality can be remarkably improved, and meanwhile the cutting accuracy and boundary smoothness are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-dimensional terrain clipping, and in particular to a three-dimensional terrain clipping method, device, equipment and storage medium. BACKGROUND

[0002] In the field of spatial information expression, three-dimensional terrain tiles are widely used to display terrain features and spatial relationships as an efficient and intuitive organization form. With the growing demand for three-dimensional terrain data utilization in various industries, three-dimensional terrain-based applications have emerged and deeply penetrated into many key fields such as tunnel excavation, railway construction, ground excavation and filling, and geological survey. One of the core operations of these applications is to clip polygons of the terrain to accurately extract or terrain information in a specific area.

[0003] In the traditional method, the polygon clipping is generally based on a raster-based processing scheme. First, all the vector faces to be clipped are unified in the same coordinate system, and a rectangular range enclosing all the polygons is used to define the processing area. Then, these vector faces are rasterized to a high-resolution texture, and the color marking (such as the vector face area being white and the remaining area being black) is used to distinguish the parts to be clipped and retained. Finally, the texture is sampled in the terrain fragment shader, and the terrain fragments located in the vector face area are removed according to the color information, thereby achieving the clipping effect.

[0004] However, since the rasterization process uses discrete pixels to express the boundary, when the sampling rate is insufficient, it will produce obvious pixel-level boundary aliasing effect, affecting the smoothness and visual effect of the clipping result. In addition, when the range of the vector face is large, the precision loss in the rasterization process will result in inaccurate clipping results, which cannot meet the demand for high-precision clipping in actual projects. Therefore, the traditional scheme often appears to be inadequate when facing complex and demanding modern three-dimensional terrain applications, and it is difficult to meet the actual project requirements. SUMMARY

[0005] To solve the above problems, the present application provides a three-dimensional terrain clipping method, which includes the following contents:

[0006] In the first aspect, the present application provides a three-dimensional terrain clipping method, which includes:

[0007] Obtaining vector face data to be clipped in a three-dimensional terrain rendering scene;

[0008] Processing the vector face to be clipped based on the vector face data to be clipped to obtain the minimum circumscribed rectangle of each vector face to be clipped;

[0009] Mapping each circumscribed rectangle to a directed distance field and generating a texture;

[0010] clipping the vector surface based on the texture in the directional distance field.

[0011] Optionally, after the minimum circumscribed rectangle of each vector surface to be clipped is obtained based on the vector surface data to be clipped, the method further comprises:

[0012] merging the circumscribed rectangles of the vector surfaces having the overlapping relationship into one circumscribed rectangle of the vector surface, the merged circumscribed rectangle of the vector surface being the minimum circumscribed rectangle of the plurality of circumscribed rectangles of the vector surfaces having the overlapping relationship before merging.

[0013] Optionally, the mapping each circumscribed rectangle into a directional distance field and generating a texture comprises:

[0014] regionally dividing all the circumscribed rectangles so that there is only one circumscribed rectangle in each region after division;

[0015] mapping each circumscribed rectangle into a directional distance field and generating a texture, respectively.

[0016] Optionally, the mapping each circumscribed rectangle into a directional distance field and generating a texture, respectively, comprises:

[0017] starting from each point p in the circumscribed rectangle, calculating the number of intersection points of a ray with edges of the vector surface to be clipped; when the number of intersection points is odd, marking the point p as a point inside the vector surface to be clipped; when the number of intersection points is even, marking the point p as a point outside the vector surface to be clipped;

[0018] calculating the shortest distance between each point p and edges of the vector surface to be clipped;

[0019] for a point inside the vector surface to be clipped, marking the shortest distance as a negative value; for a point outside the vector surface to be clipped, marking the shortest distance as a positive value.

[0020] Optionally, the clipping the vector surface based on the texture in the directional distance field comprises:

[0021] sampling the directional distance field texture to obtain a signed distance value of a current pixel to a boundary of the vector surface, and performing a retaining or discarding operation of the pixel based on the sign of the distance value.

[0022] Optionally, the step of obtaining the three-dimensional terrain rendering scene comprises:

[0023] calculating a screen space error (SSE) based on the distance between the camera position and the terrain tile; when the calculated SSE is greater than a preset threshold, loading more fine level data of the corresponding tile;

[0024] The scheduled tile data is used as the vector surface data to be clipped.

[0025] Optionally, after obtaining the vector surface data to be clipped in the 3D terrain rendering scene, the method further includes:

[0026] The vertex coordinates of the vector surface to be clipped are converted into the relative coordinates of the lower left corner of the tile, which serves as a unified coordinate reference for the subsequent generation of the directed distance field.

[0027] Secondly, this application provides a three-dimensional terrain clipping device, the device comprising:

[0028] The acquisition unit is used to acquire vector surface data to be clipped in the 3D terrain rendering scene;

[0029] The first processing unit is used to process the vector surface to be clipped based on the vector surface data to obtain the minimum bounding rectangle of each vector surface to be clipped.

[0030] The second processing unit is used to map each circumscribed rectangle to a directed distance field and generate a texture.

[0031] A clipping unit is used to clip vector surfaces based on the texture in the directed distance field.

[0032] Optionally, the first processing unit is further configured to, after processing the vector surface to be clipped based on the vector surface data to obtain the minimum bounding rectangle of each vector surface to be clipped, merge the bounding rectangles of the vector surfaces that have an overlapping relationship into a single bounding rectangle, wherein the merged bounding rectangle is the minimum bounding rectangle of the multiple bounding rectangles of the vector surfaces that had an overlapping relationship before merging.

[0033] Optionally, the second processing unit maps each circumscribed rectangle to a directed distance field and generates a texture, including:

[0034] Divide all the bounding rectangles into regions such that each region contains only one bounding rectangle; for each bounding rectangle, map it to a directed distance field and generate a texture.

[0035] Optionally, the step of mapping each circumscribed rectangle to a directed distance field and generating a texture includes:

[0036] Draw a ray starting from each point p in the circumscribed rectangle, and calculate the number of intersections between the ray and the edge of the vector face to be clipped; when the number of intersections is odd, mark point p as a point inside the vector face to be clipped; when the number of intersections is even, mark point p as a point outside the vector face to be clipped.

[0037] calculating the shortest distance between each point p and the vector surface edge to be clipped;

[0038] For the points inside the vector surface to be clipped, the shortest distance is marked as a negative value, and for the points outside the vector surface to be clipped, the shortest distance is marked as a positive value.

[0039] Optionally, the clipping of the vector surface based on the texture in the directional distance field comprises:

[0040] Sampling the directional distance field texture to obtain a signed distance value of the current pixel to the boundary of the vector surface, and performing a retention or rejection operation of the pixel based on the sign of the distance value.

[0041] Optionally, the method for rendering a three-dimensional terrain scene comprises:

[0042] calculating a screen space error (SSE) based on the distance between the camera position and the terrain tile; and when the calculated SSE is greater than a preset threshold, loading more detailed level data of the corresponding tile;

[0043] using the scheduled tile data as the vector surface data to be clipped.

[0044] Optionally, the apparatus further comprises a coordinate processing unit configured to, after obtaining the vector surface data to be clipped in the three-dimensional terrain rendering scene, convert the vertex coordinates of the vector surface to be clipped into relative coordinates of the lower left corner point of the tile where the vector surface to be clipped is located, to provide a uniform coordinate reference for subsequent generation of the directional distance field.

[0045] In a third aspect, the present application provides an apparatus, the apparatus comprising a memory and a processor, the memory being configured to store instructions or codes, and the processor being configured to execute the instructions or codes to cause the apparatus to perform the three-dimensional terrain clipping method introduced in any of the implementation manners of the first aspect.

[0046] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing codes, when the codes are executed, an apparatus executing the codes implements the three-dimensional terrain clipping method introduced in any of the implementation manners of the first aspect.

[0047] The application provides a three-dimensional terrain clipping method. In the execution of the method, first, vector surface data to be clipped in a three-dimensional terrain rendering scene is acquired, then a minimum circumscribed rectangle of each vector surface to be clipped is obtained based on the vector surface data to be clipped, then each circumscribed rectangle is mapped into a directional distance field and a texture is generated, and finally, vector surface clipping is performed based on the texture in the directional distance field, so as to realize high-precision and high-efficiency three-dimensional terrain clipping. In this way, by dividing the vector surfaces into different terrain tiles for separate processing, massive vector data processing can be simultaneously performed, and the effect of efficiently processing complex vector surface data is achieved. In this way, the visual quality can be significantly improved, while the accuracy and boundary smoothness of clipping are ensured. BRIEF DESCRIPTION OF DRAWINGS

[0048] To make the technical solutions in the embodiments or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the application, and other accompanying drawings can be obtained by those skilled in the art without any creative effort on the basis of the accompanying drawings.

[0049] Figure 1 A flowchart of a three-dimensional terrain clipping method provided by the embodiments of the application;

[0050] Figure 2 A schematic view of a vector surface to be clipped in a three-dimensional terrain rendering scene provided by the embodiments of the application;

[0051] Figure 3 A schematic view of a circumscribed rectangle constructed based on a vector surface in a three-dimensional terrain rendering scene provided by the embodiments of the application;

[0052] Figure 4 A schematic view of a vector surface after the circumscribed rectangle of the vector surface is merged in a three-dimensional terrain rendering scene provided by the embodiments of the application;

[0053] Figure 5 A schematic view of a vector surface after the circumscribed rectangle of the vector surface is divided in a three-dimensional terrain rendering scene provided by the embodiments of the application;

[0054] Figure 6 A structural schematic view of a three-dimensional terrain clipping device provided by the embodiments of the application. DETAILED DESCRIPTION

[0055] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort fall within the protection scope of the present application.

[0056] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0057] Figure 1 A flowchart of a three-dimensional terrain clipping method provided by an embodiment of the present application is shown in FIG. 1. In combination with FIG. 1, the three-dimensional terrain clipping method provided by the embodiment of the present application can include the following steps. Figure 1

[0058] S101, acquiring vector surface data to be clipped in a three-dimensional terrain rendering scene.

[0059] The acquisition process of acquiring the three-dimensional terrain rendering scene includes first calculating a screen space error (SSE) based on the distance between the camera position and the terrain tile. Specifically, SSE is used to measure the degree of detail of the terrain tile in the current view. When the calculated SSE is greater than a preset threshold, the system will load more detailed level data of the corresponding tile. This process utilizes the scheduling mechanism of the terrain tile, that is, according to the distance between the current camera and the tile, the detail level of the tile is dynamically adjusted to ensure that appropriate terrain details can be provided under different viewing distances.

[0060] The specific formula is as follows: SSE = function (camera position, tile position, tile detail level), when SSE > threshold, load more detailed tile data. The rectangular geographic range of the terrain tile is represented by Rectangle (west, south, east, north), which records the geographic coordinates (west, south) of the lower left corner of the terrain tile and the geographic coordinates (east, north) of the upper right corner. The vector surface is given in the form of geographic coordinates, with the format [lon, lat, lon, lat, lon, lat, …], which records the geographic coordinates of each vertex of the vector surface. Through the terrain tile scheduling mechanism based on the screen space error (SSE), appropriate terrain detail levels can be dynamically loaded according to the distance between the camera and the tile, so as to optimize the performance while ensuring the rendering quality.

[0061] ​Next, all the vector faces to be cropped, which are the vector faces intersecting with the current terrain tile rectangle range, are traversed. This is because in three-dimensional terrain rendering, only those vector faces that have overlapping parts with the geographical range of the current terrain tile need to be cropped to ensure that they can correctly fit the display range of the terrain. By filtering out these intersecting vector faces, unnecessary processing of irrelevant vector faces can be avoided, thereby improving the efficiency of the clipping and reducing the waste of computing resources. Find the array of vector faces that intersect with the terrain tile rectangle range, for example, the filtering result is [polygon1, polygon2, polygon3, polygon4], as shown in Figure 2 Figure 2 A schematic diagram of the vector faces to be cropped in a three-dimensional terrain rendering scene provided by an embodiment of the present application is shown in the figure. The outer frame in the figure is the terrain tile rectangle range, and polygons 1, 2, 3, and 4 are the vector faces to be cropped.

[0062] In order to generate a directed distance field subsequently, the vertex coordinates of the vector faces to be cropped need to be converted into relative coordinates of the lower left corner point of the tile as a unified coordinate reference. The specific conversion formula is as follows: lon' = lon - west lat' = lat - south. After conversion, the coordinates of the vector faces to be cropped become [lon', lat', lon', lat', lon', lat', …].

[0063] By converting the vertex coordinates of the vector faces into relative coordinates with respect to the lower left corner point of the terrain tile, it can be ensured that the coordinates of all vector faces are processed under the same reference. This provides a unified coordinate reference for generating a directed distance field subsequently, avoiding calculation errors caused by inconsistent coordinate systems. When generating a directed distance field, using relative coordinates can simplify the calculation process. Relative coordinates make the calculation more intuitive and efficient, especially when dealing with a large number of vector faces, which can significantly reduce the computational complexity and improve the clipping efficiency.

[0064] S102, based on the vector face data to be cropped, processing the vector faces to be cropped to obtain the minimum circumscribed rectangle of each vector face to be cropped.

[0065] In order to improve the clipping efficiency and accuracy, the vector faces to be cropped need to be processed based on the vector face data to be cropped to obtain the minimum circumscribed rectangle of each vector face to be cropped, i.e., the originally irregular polygons are arranged into regular rectangular shapes. Figure 3 A schematic diagram of the circumscribed rectangle constructed based on the vector faces in a three-dimensional terrain rendering scene provided by an embodiment of the present application is shown in Figure 3 ​In each original polygonal vector plane (such as 1, 2, 3, 4), a minimum circumscribed rectangle is used to cover it. These rectangles precisely cover the respective vector planes, ensuring that only the parts intersecting these rectangles are operated in the subsequent clipping process, thereby optimizing the clipping process and improving the accuracy of processing. In order to optimize the clipping operation, the range of each vector plane circumscribed rectangle is calculated using relative coordinates, and the range of each vector plane circumscribed rectangle is recorded as extent(x, y, z, w), where x, y are the x, y coordinates of the lower left corner of the vector plane circumscribed rectangle, and z and w are the width and height of the vector plane circumscribed rectangle. In this way, an explicit area can be defined for each circumscribed rectangle, which facilitates subsequent clipping and texture generation operations. These range information (extents) are used to determine the specific area of each vector plane that needs to be processed in the clipping process, thereby avoiding unnecessary processing of the entire vector plane.

[0066] In order to improve the efficiency and performance of vector plane clipping in the process of three-dimensional terrain rendering, it is necessary to merge the circumscribed rectangles of vector planes with overlapping relationship into one circumscribed rectangle, and the merged circumscribed rectangle is the minimum circumscribed rectangle of the multiple circumscribed rectangles of vector planes with overlapping relationship before merging. Figure 4 As shown in the figure. Figure 4 A schematic diagram of merging the circumscribed rectangles of vector planes in a three-dimensional terrain rendering scene is provided for the embodiments of the present application, in which the original rectangle 2 and rectangle 3 are merged into one rectangle as the new rectangle 2. The merged area is recorded as [extent1, extent2, extent3]. By merging vector planes with overlapping relationship, the number of vector planes to be processed can be reduced, thereby improving the clipping efficiency.

[0067] S103, mapping each circumscribed rectangle to a directed distance field and generating a texture.

[0068] Signed Distance Field (SDF) is a commonly used technique in computer graphics, which is used to represent the boundary of a shape. In the signed distance field, each point has a value associated with it, which represents the distance from the point to the nearest shape boundary. If the point is inside the shape, the value is negative; if the point is outside the shape, the value is positive. In computer graphics, texture refers to an image mapped to the surface of a three-dimensional model, used to increase the visual detail and realism of the model. In this example, the texture is used to represent the signed distance field, thereby guiding the clipping of vector planes in the rendering process.

[0069] In an implementation form of the embodiment of the application, before each bounding rectangle is mapped to a signed distance field and a texture is generated, all the bounding rectangles need to be regionally divided so that there is only one bounding rectangle in each divided region. This division method is similar to dividing vector planes into different terrain tiles for separate processing, which ensures that the processing accuracy is high enough and a large amount of vector data can be processed at the same time. Regardless of the complexity of the vector plane, the accuracy of the clipping can be ensured.

[0070] In an implementation form of the embodiment of the application, in the process of regionally dividing all the bounding rectangles, the SDF texture is divided into corresponding regions according to the number of the merged regions. Specifically, each bounding rectangle is mapped to a specified region of an SDF texture. Assuming that there are A, B, C, D, E, F, six vector planes, A, B, and C exist in the first terrain tile, and D, E, and F exist in the second terrain tile, the two terrain tiles correspond to one SDF texture respectively. For each SDF texture, the texture is equally divided into regions according to the number of the vector planes contained, for example, if there are three bounding rectangles (bounds) after merging, the texture is divided into 2x2 regions, obtaining four regions, and then the vector planes are mapped to the SDF information and written into the specified region of the texture. This division helps to improve the parallelism and efficiency of processing, because each region can be processed independently. Figure 5 A schematic diagram of the bounding rectangle of the vector plane after division in the three-dimensional terrain rendering scene provided by the embodiment of the application is provided. In this way, the vector plane can be more effectively managed and processed.

[0071] The process of mapping each bounding rectangle to a signed distance field and generating a texture is described below. For each terrain tile, an SDF texture is first pre-generated. The resolution of the texture is set to 256x256, that is, a 256x256 grid is generated in each bounding rectangle, and the signed distance of each grid point to the vector plane boundary is calculated.

[0072] The winding number parity rule is used to determine whether a point is inside a polygon. A ray is drawn from each point p in the bounding rectangle, and the number of intersection points of the ray with the edges of the vector plane to be clipped is calculated. When the number of intersection points is odd, the point p is marked as inside the vector plane to be clipped; when the number of intersection points is even, the point p is marked as outside the vector plane to be clipped. In this way, the ray method and the winding number parity rule can accurately determine whether a point is inside a vector plane, thereby ensuring the accuracy of the signed distance field.

[0073] Then the shortest distance of each point p and the vector face edge to be clipped is calculated. For points inside the vector face to be clipped, the shortest distance is marked as a negative value, and for points outside the vector face to be clipped, the shortest distance is marked as a positive value. In this way, by calculating the shortest distance of the point to each edge and taking the minimum value, the shortest distance of the point to the vector face edge can be quickly obtained, thereby improving the efficiency of the directional distance field generation.

[0074] The directional distance field texture generated by the above process can be used to guide the clipping of the vector face, thereby generating high-quality textures and improving the visual effect of three-dimensional terrain rendering. By mapping the circumscribed rectangle to the directional distance field and generating the texture, the clipping of the vector face can be processed more efficiently, unnecessary calculations are reduced, and the overall processing efficiency is improved. Through this method, efficient and accurate vector face clipping can be achieved in the three-dimensional terrain rendering scene, thereby improving the rendering quality and performance.

[0075] S104, clipping the vector face based on the texture in the directional distance field.

[0076] Sampling the directional distance field texture to obtain the signed distance value of the current pixel to the vector face boundary is the key step to realize vector face clipping, as it directly determines whether each pixel should be retained or discarded. In the shader, the directional distance field texture is sampled for each pixel to obtain the distance value of each point p to the vector face boundary. According to the sign of the distance value obtained by sampling, the retention or discarding operation of the pixel is performed. If the distance value is negative (indicating that the pixel is inside the vector face), the pixel is retained; if the distance value is positive (indicating that the pixel is outside the vector face), the pixel is discarded.

[0077] Through sampling and sign judgment based on the directional distance field texture, accurate vector face clipping can be achieved to ensure that only pixels located inside the vector face are retained. This method can significantly improve the clipping accuracy.

[0078] The above is some specific implementation of the three-dimensional terrain clipping method provided by the embodiments of the present application. Based on this, the present application also provides a corresponding device. The device provided by the embodiments of the present application will be introduced from the perspective of functional modularization.

[0079] Figure 6 A structural diagram of a three-dimensional terrain clipping device provided by an embodiment of the present application is shown. In combination with Figure 6 The three-dimensional terrain clipping device 600 provided by the embodiments of the present application includes:

[0080] The acquisition unit 610 is configured to acquire vector face data to be clipped in a three-dimensional terrain rendering scene.

[0081] The first processing unit 620 is configured to process the to-be-clipped vector surface based on the to-be-clipped vector surface data to obtain a minimum circumscribed rectangle of each to-be-clipped vector surface.

[0082] The second processing unit 630 is configured to map each circumscribed rectangle into a directional distance field and generate a texture.

[0083] The clipping unit 640 is configured to clip the vector surface based on the texture in the directional distance field.

[0084] In an implementation manner of the embodiment of the present application, after the first processing unit processes the to-be-clipped vector surface based on the to-be-clipped vector surface data to obtain the minimum circumscribed rectangle of each to-be-clipped vector surface, the circumscribed rectangles of the vector surfaces having the overlapping relationship are merged into one vector surface circumscribed rectangle, and the merged vector surface circumscribed rectangle is the minimum circumscribed rectangle of the plurality of vector surface circumscribed rectangles having the overlapping relationship before the merging.

[0085] In an implementation manner of the embodiment of the present application, the second processing unit maps each circumscribed rectangle into a directional distance field and generates a texture, including:

[0086] regionally dividing all the circumscribed rectangles so that only one circumscribed rectangle is in each divided region; and respectively mapping each circumscribed rectangle into a directional distance field and generating a texture.

[0087] In an implementation manner of the embodiment of the present application, the respectively mapping each circumscribed rectangle into a directional distance field and generating a texture includes:

[0088] calculating the number of intersection points of a ray starting from each point p in the circumscribed rectangle and the edges of the to-be-clipped vector surface; when the number of the intersection points is odd, marking the point p as a point inside the to-be-clipped vector surface; and when the number of the intersection points is even, marking the point p as a point outside the to-be-clipped vector surface.

[0089] calculating the shortest distance between each point p and the edges of the to-be-clipped vector surface;

[0090] for the point inside the to-be-clipped vector surface, marking the shortest distance as a negative value; and for the point outside the to-be-clipped vector surface, marking the shortest distance as a positive value.

[0091] In an implementation manner of the embodiment of the present application, the clipping the vector surface based on the texture in the directional distance field includes:

[0092] sampling the directional distance field texture to obtain a signed distance value of a current pixel to the boundary of the vector surface, and performing a retaining or discarding operation of the pixel based on the sign of the distance value.

[0093] In an implementation form of the embodiment of the application, the obtaining the three-dimensional terrain rendering scene comprises:

[0094] calculating a screen space error SSE based on the distance between the camera position and the terrain tile; and loading finer level data of the corresponding tile when the calculated SSE is greater than a preset threshold value.

[0095] The scheduled tile data is used as the vector surface data to be cropped.

[0096] In an implementation form of the embodiment of the application, the device further comprises a coordinate processing unit configured to, after obtaining the vector surface data to be cropped in the three-dimensional terrain rendering scene, convert vertex coordinates of the vector surface to be cropped into relative coordinates of a lower left corner point of a tile where the vector surface to be cropped is located, as a uniform coordinate reference for subsequent generation of a directed distance field.

[0097] The embodiment of the application also provides a corresponding device and a computer storage medium for implementing the scheme provided by the embodiment of the application.

[0098] The device comprises a memory and a processor, the memory is configured to store instructions or codes, and the processor is configured to execute the instructions or codes to enable the device to perform the method described in any embodiment of the application.

[0099] The computer storage medium stores codes, and when the codes are executed, a device executing the codes implements the method described in any embodiment of the application.

[0100] As can be clearly understood by a person skilled in the art from the description of the above embodiments, all or part of the steps of the above-mentioned embodiment methods can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solutions of the application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in the various embodiments or some parts of the embodiments of the application.

[0101] It can be understood that, in the specific embodiments of the application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved need to obtain user permission or consent, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of countries and regions.

[0102] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0103] It should also be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and apparatus embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0104] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of three-dimensional terrain clipping, characterized by, The method comprises: acquiring vector face data to be clipped in a three-dimensional terrain rendering scene; processing the vector face to be clipped based on the vector face data to be clipped to obtain a minimum circumscribed rectangle of each vector face to be clipped; mapping each circumscribed rectangle to a directional distance field and generating a texture; clipping the vector face based on the texture in the directional distance field.

2. The method of claim 1, wherein, After the processing of the vector face to be clipped based on the vector face data to be clipped to obtain a minimum circumscribed rectangle of each vector face to be clipped, the method further comprises: merging the circumscribed rectangles of vector faces with overlapping relationship into one circumscribed rectangle of vector face, and the merged circumscribed rectangle of vector face being the minimum circumscribed rectangle of the multiple circumscribed rectangles of vector face with overlapping relationship before merging.

3. The method of claim 1, wherein, The mapping of each circumscribed rectangle to a directional distance field and the generation of a texture comprises: regionally dividing all the circumscribed rectangles so that there is only one circumscribed rectangle in each divided region; respectively mapping each circumscribed rectangle to a directional distance field and generating a texture.

4. The method of claim 3, wherein, The respectively mapping of each circumscribed rectangle to a directional distance field and the generation of a texture comprises: starting from each point p in the circumscribed rectangle, calculating the number of intersection points of a ray with edges of the vector face to be clipped, marking the point p as a point inside the vector face to be clipped when the number of intersection points is odd, and marking the point p as a point outside the vector face to be clipped when the number of intersection points is even; calculating the shortest distance of each point p from the edges of the vector face to be clipped; marking the shortest distance as a negative value for a point inside the vector face to be clipped, and marking the shortest distance as a positive value for a point outside the vector face to be clipped.

5. The method of claim 1, wherein, The clipping of the vector face based on the texture in the directional distance field comprises: sampling the directional distance field texture to obtain a signed distance value of a current pixel to the boundary of the vector face, and performing a retaining or discarding operation of the pixel based on the sign of the distance value.

6. The method of claim 1, wherein, The acquisition of the three-dimensional terrain rendering scene comprises: calculating a screen space error SSE based on the distance between the camera position and the terrain tile, loading more fine level data of the corresponding tile when the calculated SSE is greater than a preset threshold value; using the scheduled tile data as the vector face data to be clipped.

7. The method according to any of claims 1 or 6, characterized in that, After the acquisition of the vector face data to be clipped in the three-dimensional terrain rendering scene, the method further comprises: converting the vertex coordinates of the vector face to be clipped into relative coordinates of the lower left corner point of the tile where the vector face to be clipped is located, to provide a uniform coordinate reference for subsequent generation of the directional distance field.

8. A three-dimensional terrain clipping device, characterized by, The device comprises: an acquisition unit configured to acquire vector face data to be clipped in a three-dimensional terrain rendering scene; a first processing unit configured to process the vector face to be clipped based on the vector face data to be clipped to obtain a minimum circumscribed rectangle of each vector face to be clipped; a second processing unit configured to map each circumscribed rectangle to a directional distance field and generate a texture; a clipping unit configured to clip the vector face based on the texture in the directional distance field.

9. A computing device, comprising: The computing device comprises a memory and a processor; the memory is configured to store a computer program. The processor is configured to implement the method according to any one of claims 1 to 7 when the computer program is executed.

10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium and is configured to implement the method according to any one of claims 1 to 7 when executed by the processor.