Terrain data generation method and related equipment

By constructing basic model data and combining it with ridge and water erosion data to simulate terrain changes, the problem of low terrain data generation efficiency was solved, and terrain data that conforms to actual terrain and environmental characteristics was generated efficiently.

CN121616784APending Publication Date: 2026-03-06GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511787978.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing technologies are inefficient in generating terrain data suitable for different scenarios and cannot generate terrain data that meets the needs of different scenarios in real time.

Method used

By constructing a basal model based on multiple pixels, generating terrain data using first and second terrain noise, and combining ridge erosion data and water erosion data, the changing trend of terrain and environmental impact are simulated, and the target terrain data is generated by rendering using pre-stored rendering parameters.

Benefits of technology

It improves the efficiency of terrain data generation, ensures that terrain data conforms to the physical form of the terrain and regional environmental characteristics, avoids visual misalignment, and realizes parallel computing of multiple pixels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121616784A_ABST
    Figure CN121616784A_ABST
Patent Text Reader

Abstract

The invention provides a topographic data generation method and related equipment, and the method comprises the steps: determining the basic data of a plurality of pixels based on first topographic noise and second topographic noise corresponding to the plurality of pixels; determining first erosion data based on a relative position between any one of the plurality of pixels and a vertex of the first terrain noise; updating the base type data according to the first erosion data to obtain first topographic data; determining second erosion data based on the position information of any pixel and the third terrain noise and the fourth terrain noise corresponding to any pixel; updating the first topographic data based on the second erosion data to obtain second topographic data; and rendering the second topographic data based on a pre-stored rendering parameter to obtain target topographic data. According to the invention, the accuracy of topographic data generation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of vehicles and relates to terrain rendering technology, and in particular to a terrain data generation method and related equipment. Background Technology

[0002] With the development of intelligent driving technology, the driving environment for motor vehicles is becoming increasingly complex. Currently, terrain data of the area where the vehicle is located is typically collected through onboard sensors, and autonomous driving decisions are made based on this data. To improve the accuracy of autonomous driving decisions, pre-generated terrain data can be used to optimize the vehicle's autonomous driving module, thereby improving autonomous driving performance. However, when constructing terrain data for vehicle operation to optimize autonomous driving functions, it is usually necessary to fuse terrain components of different resolutions as the terrain base, and manually edit these components. Therefore, it is impossible to generate terrain data suitable for different scenarios in real time. Furthermore, there is a problem of low efficiency when batch outputting terrain data suitable for different scenarios. Summary of the Invention

[0003] In view of the above, it is necessary to propose a terrain data generation method and related equipment to solve the technical problem of low efficiency in generating terrain data.

[0004] This application provides a terrain data generation method, the method comprising: constructing primitive data corresponding to multiple pixels based on first terrain noise and second terrain noise corresponding to multiple pixels; determining first erosion data based on the relative position between any pixel and the vertex of the first terrain noise; the first erosion data indicating the changing trend of the primitive data; updating the primitive data according to the first erosion data to obtain first terrain data; determining second erosion data based on the position information of the arbitrary pixel, third terrain noise corresponding to the arbitrary pixel, and fourth terrain noise; the second erosion data indicating the degree of influence of environmental information on the changing trend of the primitive data; updating the first terrain data based on the second erosion data to obtain second terrain data; and rendering the second terrain data based on pre-stored rendering parameters to obtain target terrain data.

[0005] In some embodiments, the first erosion data includes ridge erosion data and water flow erosion data; determining the first erosion data based on the relative position between any pixel and the vertices of the first terrain noise includes: determining a first vertex and a second vertex from the vertices based on the relative position between the arbitrary pixel and the vertices of the first terrain noise; the distance between the first vertex and the arbitrary pixel is less than the distance between the second vertex and the arbitrary pixel; determining the ridge erosion data of the plurality of pixels based on a first distance between the arbitrary pixel and the perpendicular bisector of the line connecting the first vertex and the second vertex; and determining the water flow erosion data of the primitive data based on the first distance and a second distance between the arbitrary pixel and the line connecting the first vertex and the second vertex.

[0006] In some embodiments, determining the water erosion data of the base model data based on the first distance and the second distance between any pixel and the line connecting the first vertex and the second vertex includes: determining the erosion noise of the plurality of pixels based on pre-stored noise parameters; determining the offset of the erosion noise based on the first distance and the second distance; and updating the erosion noise based on the offset to obtain the water erosion data of the base model data.

[0007] In some embodiments, updating the base data based on the first erosion data to obtain first terrain data includes: determining a third vertex from the vertices based on the relative position between the arbitrary pixel and the vertex of the first terrain noise; the distance between the third vertex and the arbitrary pixel is greater than the distance between the second vertex and the arbitrary pixel; determining a third distance between the arbitrary pixel and the perpendicular bisector of the line connecting the first vertex and the third vertex; and updating the base data based on the first distance, the difference between the first distance and the third distance, and the erosion noise to obtain the first terrain data.

[0008] In some embodiments, the second erosion data includes first approximate water flow erosion data and second approximate water flow erosion data, wherein the first approximate water flow erosion data is used for hillside areas and the second approximate water flow erosion data is used for flat areas. Determining the second erosion data based on the location information of any one pixel, the third terrain noise corresponding to the any one pixel, and the fourth terrain noise includes: determining a fourth vertex and a fifth vertex from the vertices of the third terrain noise based on the relative position between the any one pixel and the vertices of the third terrain noise; the distance between the fourth vertex and the any one pixel is less than the distance between the fifth vertex and the any one pixel; determining a fourth distance between the any one pixel and the perpendicular bisector of the line connecting the fourth vertex and the fifth vertex; determining the first approximate water flow erosion data of the base model data based on the fourth distance and the third terrain noise; and determining the second approximate water flow erosion data of the base model data based on the fourth terrain noise.

[0009] In some embodiments, updating the first terrain data based on the second erosion data to obtain the second terrain data includes: determining the normal data of the first terrain data; updating the first terrain data according to the product of the normal data and a pre-stored unit vector, the first approximate water flow erosion data, and the second approximate water flow erosion data to obtain the second terrain data of the plurality of pixels.

[0010] In some embodiments, rendering the second terrain data based on pre-stored rendering parameters to obtain target terrain data includes: determining multiple terrain layers based on the second terrain data; determining rendering parameters corresponding to any one of the multiple terrain layers based on the height parameter of any one of the terrain layers; and rendering the arbitrary terrain layer based on the rendering parameters corresponding to the arbitrary terrain layer to obtain target terrain data of the multiple pixels.

[0011] In some embodiments, determining the primal data of a plurality of pixels based on pre-stored first terrain noise and second terrain noise includes determining the primal data of the plurality of pixels based on the product of the first terrain noise and the second terrain noise.

[0012] This application also provides an electronic device, which includes: a memory storing at least one instruction; and a processor executing the instructions stored in the memory to implement the terrain data generation method.

[0013] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the terrain data generation method.

[0014] As can be seen from the above technical solutions, the embodiments of this application provide vertex and block partitioning through the first terrain noise and smooth transition of landform features through the second terrain noise. This ensures that the basic data of multiple pixels has both clear block partitioning and continuous transitions within the partitions, avoiding visual mechanical segmentation. By simulating structure-driven erosion (e.g., ridge weathering, valley erosion) through the geometric relationships of the terrain itself, the problem of vague basic data structure and lack of geographical features is solved, ensuring that the structure of the first terrain data can conform to the evolution law of the elevation of real terrain and avoiding irregular protrusions / concavities generated by noise alone (e.g., abrupt isolated slopes, unsupported suspended terrain). Furthermore, the third and fourth terrain noises correspond to regional environmental noise, enabling the second erosion data to quantitatively represent the degree of influence of the environment on the terrain in different regions, making the second terrain data exhibit regional differences. This ensures that the second terrain data can conform to the law of environmental determination of terrain morphology in geography, avoiding the uniformity of landform features across the entire region, which would reduce the accuracy of the terrain data. Ultimately, by matching terrain features with rendering parameters, the visual effect of the target terrain data is made to conform to both the physical form of the terrain and the environmental characteristics of the region, avoiding visual misalignment of the terrain data. This allows for independent calculation of the height of each pixel across multiple pixels, ensuring parallel computation of each pixel when processing terrain data corresponding to multiple pixels, thereby improving the efficiency of terrain data generation. Attached Figure Description

[0015] Figure 1 This is an application scenario diagram of a terrain data generation method provided in an embodiment of this application.

[0016] Figure 2 This is a flowchart of a terrain data generation method provided in an embodiment of this application.

[0017] Figure 3 This is a schematic diagram of the basic data of multiple pixels provided in an embodiment of this application.

[0018] Figure 4 This is a schematic diagram of ridge erosion data provided in one embodiment of this application.

[0019] Figure 5 This is a schematic diagram of topographic data after erosion based on ridge erosion data, provided in one embodiment of this application.

[0020] Figure 6 This is a schematic diagram of the lateral offset corresponding to the coordinate points of a tiled texture provided in one embodiment of this application.

[0021] Figure 7 This is a schematic diagram of the vertical offset corresponding to the coordinate points of the tiled texture provided in one embodiment of this application.

[0022] Figure 8 This is a schematic diagram of noise data determined by coordinate points based on tiling texture, provided in one embodiment of this application.

[0023] Figure 9 This is a flowchart of a method for determining first erosion data provided in an embodiment of this application.

[0024] Figure 10 This is a flowchart of a method for determining water erosion data provided in an embodiment of this application.

[0025] Figure 11 This is a schematic diagram of the first terrain data provided in an embodiment of this application.

[0026] Figure 12 This is a flowchart of a method for determining first terrain data provided in an embodiment of this application.

[0027] Figure 13 This is a flowchart of a method for determining second erosion data provided in an embodiment of this application.

[0028] Figure 14 This is a flowchart of a method for determining second terrain data provided in an embodiment of this application.

[0029] Figure 15 This is a flowchart of a method for determining target terrain data provided in an embodiment of this application.

[0030] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0031] To better understand the purpose, features, and advantages of this application, a detailed description of the application is provided below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of this application can be combined with each other. Numerous specific details are set forth in the following description to provide a thorough understanding of this application; the described embodiments are only a part of the embodiments of this application, and not all of them.

[0032] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0034] This application provides a terrain data generation method that can be applied to one or more electronic devices. An electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0035] Electronic devices can be any electronic product that allows human-computer interaction with a customer, such as personal computers, tablets, smartphones, personal digital assistants (PDAs), game consoles, interactive network television (IPTV), smart wearable devices, etc.

[0036] Electronic devices may also include network devices and / or client devices. The network devices include, but are not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.

[0037] The networks in which electronic devices are located include, but are not limited to, the Internet, wide area networks, metropolitan area networks, local area networks, and virtual private networks (VPNs).

[0038] like Figure 1 The diagram illustrates an application scenario of a terrain data generation method according to an embodiment of this application. This method can be applied to an electronic device 100. The electronic device 100 is installed in a vehicle 200 and is communicatively connected to a vehicle component 300 within the vehicle 200. The vehicle component 300 may include an onboard camera, an onboard positioning device, etc., which are not limited in this application.

[0039] In this application, the electronic device 100 determines the location of the vehicle 200 based on data transmitted from the vehicle component 300, and determines multiple pixels in a virtual map corresponding to the area where the vehicle 200 is located based on the location of the vehicle 200. The electronic device 100 also constructs primitive data for multiple pixels based on a first terrain noise and a second terrain noise corresponding to any one of the multiple pixels.

[0040] The electronic device 100 determines first erosion data based on the relative position between any one of the multiple pixels and the vertex of the first terrain noise. The first erosion data indicates the changing trend of the multiple pixels.

[0041] The electronic device 100 also updates the base data based on the first erosion data to obtain the first terrain data.

[0042] The electronic device 100 further determines second erosion data based on the location information of any pixel, the third terrain noise corresponding to any pixel, and the fourth terrain noise. The second erosion data indicates the degree to which the environmental information of the region to which multiple pixels belong affects the change trend of the multiple pixels.

[0043] The electronic device 100 also updates the first terrain data based on the second erosion data to obtain second terrain data. Then, it renders the second terrain data based on preset rendering parameters to obtain the target terrain data. In this way, the terrain data (e.g., the terrain height corresponding to each pixel) of multiple pixels can be calculated independently, ensuring that the calculation of terrain data corresponding to multiple pixels can be performed in parallel, thereby improving the efficiency of generating terrain data.

[0044] like Figure 2 The diagram shown is a flowchart of a terrain data generation method according to an embodiment of this application. The order of steps in the flowchart can be changed, and some steps can be omitted, depending on different requirements. The terrain data generation method provided in this embodiment includes the following steps.

[0045] S20, construct the basic data corresponding to the multiple pixels based on the first terrain noise and the second terrain noise corresponding to the multiple pixels.

[0046] In one embodiment of this application, the virtual terrain of the area where the vehicle is located can be a set of multiple pixels in the space where the terrain map is generated. In order to accurately represent the terrain features in the multiple pixels, the primitive data of the multiple pixels can be constructed based on the first terrain noise and the second terrain noise corresponding to the multiple pixels.

[0047] Among them, the first terrain noise and the second terrain noise are used to indicate the terrain orientation at any one of the multiple pixels.

[0048] The first type of terrain noise can be Berlin noise. The core of Berlin noise is the continuous field of gradient interpolation. Specifically, the space containing multiple pixels is first divided into a regular grid (e.g., a square lattice in two dimensions), and each lattice vertex is assigned a unit gradient vector (e.g., a unit vector with random direction and magnitude of 1). The distribution of the gradient vectors must satisfy isotropy (e.g., uniformly distributed in 8 directions in two dimensions) to avoid directional deviations. For any pixel P among the multiple pixels, the weighted distance vector from that pixel to the four surrounding lattice vertices is calculated, ensuring that the first derivative of the interpolation result is continuous at the lattice boundaries. The gradient dot product results of the four vertices are fused through double interpolation (horizontal first, then vertical), and the final output noise value is in the range [-1, 1].

[0049] To adjust the smoothness of the Burmester noise, fractal Brownian motion can be used to superimpose multiple layers of Burmester noise. For example, different levels of Burmester noise can be controlled by adjusting the fundamental frequency and amplitude decay rate of the Burmester noise.

[0050] The second type of terrain noise can be Voronoi noise. Voronoi noise spatially divides the region where multiple pixels are located based on the nearest neighbor rule.

[0051] Specifically, seed points can be generated in space according to a Poisson disk distribution. The attribute data corresponding to each seed point is used to indicate the height, material, and other information of any point in the region where multiple pixels are located. A triangulation network is constructed using a point-by-point insertion algorithm, ensuring that the circumcircle of each triangle does not contain other points. The perpendicular bisector of each edge is calculated as a Voronoi edge, ultimately forming convex polygon cells. The attributes of all pixels within any cell are determined by the nearest seed point, and boundary transitions can be achieved through distance weighting.

[0052] In one embodiment of this application, the vertices of the Voronoi diagram can be used as lattice points for Perlin noise, enabling a hybrid modeling method that combines the advantages of both types of noise. This preserves the structured partitioning characteristics of Voronoi while achieving a smooth transition through Perlin's continuous interpolation, thus generating topographic maps with structured partition boundaries and natural internal gradations (e.g., terrain containing different landform regions with detailed variations within each region).

[0053] Specifically, a Voronoi diagram can be constructed using seed points to obtain the vertices of all cells (each vertex is an equidistant point of 3 or more seed points). These Voronoi vertices are then used as Perlin lattice points, and a gradient vector is assigned to each Voronoi vertex. Perlin noise is then calculated based on the Voronoi lattice. For any pixel in the space containing multiple pixels, gradient interpolation is performed using the surrounding Voronoi vertices (lattice points) to generate a noise value that combines both characteristics.

[0054] For example, multiple seed points can be generated within a range of multiple pixels according to the accuracy requirements of the terrain data, denoted as S={s_1,s_2,...,s_N}, and the coordinates of each seed point are s_i=(x_i, y_i).

[0055] Voronoi cells are generated using the dual graph of triangulation, and each cell corresponds to a seed point, containing all spatial points closest to that seed point.

[0056] By traversing the circumcenters of all Delaunay triangles, we obtain the Voronoi vertex set V = {v_1, v_2, ..., v_M}, where a Voronoi vertex is the intersection of three or more Voronoi edges, mathematically representing the circumcenter of the three seed points (i.e., a point equidistant from the three seed points). For example, if the seed points are distributed in a 100×100 map, generating 20 seed points will yield approximately 30 Voronoi vertices, which will serve as the lattice points for the Berlin noise.

[0057] A unit gradient vector is randomly assigned to each Voronoi vertex v_j. For example, the eight possible directions in two dimensions are: (1,1), (1,-1), (-1,1), (-1,-1), (1,0), (-1,0), (0,1), (0,-1).

[0058] To enhance the zoning characteristics of terrain data, gradient directions can be correlated with the attributes of Voronoi cells. For example, if the seed points surrounding a Voronoi vertex mostly belong to mountainous regions within multiple pixels, the gradient direction is biased towards the vertical to enhance height variation; if the surrounding seed points belong to plains within multiple pixels, the gradient direction is biased towards the horizontal to reduce height variation. Furthermore, gradients of adjacent Voronoi vertices can be interpolated to avoid significant noise fluctuations caused by abrupt gradient changes.

[0059] When calculating Berlin noise based on Voronoi lattices, unlike the "regular grid lattice" of traditional Berlin noise, the lattice here is an irregular grid composed of Voronoi vertices, so the interpolation logic needs to be adjusted.

[0060] Specifically, for any pixel P(x,y), determine the K nearest Voronoi vertices (e.g., K can be 4 or 6 to ensure the determined Voronoi vertices cover the local area), denoted as v_{j1}, v_{j2}, ..., v_{jK}. Calculate the distance d_k = |P - v_{jk}| from P to each nearest neighbor vertex v_{jk}, and assign weights using a weighting function (e.g., a Gaussian function), ensuring that vertices closer to the pixel have higher weights.

[0061] Specifically, for each nearest neighbor vertex, the dot product of the gradient vector and the vector from P to the vertex can be calculated; all dot products can be summed with weights; multiple layers of noise at different scales can be superimposed (high-frequency layers use denser Voronoi vertices) to generate richer details.

[0062] In one embodiment of this application, this hybrid method combines Voronoi's "partition skeleton" with Perlin's "continuous filling." It can define structured boundaries based on Voronoi vertices, whose distribution is determined by seed points, naturally forming spatial partitions corresponding to cells. For example, if seed points are distributed according to three categories: "mountains," "plains," and "oceans," the density and distribution area of ​​Voronoi vertices will be associated with these categories (mountain areas have dense seed points and dense vertices). When a target point crosses a Voronoi cell boundary, its nearest neighbor vertices will switch to vertices of adjacent cells, causing the noise value's change trend to be synchronized with the partition boundary, creating an effect of "abrupt regional features but smooth internal structure."

[0063] Based on Perlin interpolation, natural gradations within a region are achieved. Target points within the same Voronoi cell have relatively fixed neighboring Voronoi vertices. The noise values ​​generated by gradient interpolation change continuously, avoiding the monotony of "uniform properties within cells" found in pure Voronoi noise. For example, noise values ​​in mountainous areas are interpolated using gradient to create undulating slopes (consistent with natural terrain features); noise values ​​in plains areas change gently, simulating a flat but slightly undulating surface.

[0064] In this application, mixed noise is suitable for generating various terrain data. For example, in the case where multiple pixels represent regional terrain (e.g., a forest area with subtle undulations in tree distribution and a desert area with gradual dune changes), the boundaries of different regions can be controlled by the distribution of Voronoi vertices, while the internal details of different regions are filled by Berlin noise interpolation.

[0065] When multiple pixels represent resource distribution terrain, resource areas (e.g., mining areas, farmland) can be divided based on Voronoi vertices, and resource density can be represented based on Berlin noise values ​​(e.g., density gradient within a region, density abrupt change between regions).

[0066] When multiple pixels form a city planning map, the boundaries of different functional areas (e.g., commercial areas, residential areas) can be defined based on Voronoi vertices, based on the gradient of building density or height within the Berlin noise control zone.

[0067] The generated map will present the effect of "clear large-scale partitioning and natural small-scale details", which avoids the blocky and rigid feel of pure Voronoi and solves the problem of pure Perlin lacking structure.

[0068] In this application, Voronoi vertices are used as Perlin lattice points, enabling the generation of maps that are both structurally sound and natural-looking through a geometric partitioning skeleton and a continuous gradient filling mechanism. The spatial distribution of Voronoi vertices defines a variable skeleton for noise, and Perlin gradient interpolation is then used to fill in the details within the skeleton, ultimately achieving a well-defined partitioned and internally smooth effect.

[0069] In one embodiment of this application, the base data of the plurality of pixels can be determined based on the product of the first terrain noise and the second terrain noise.

[0070] In one embodiment of this application, a schematic diagram of the primitive data of multiple pixels can be found here. Figure 3 .

[0071] S21, based on the relative position between any pixel and the vertex of the first terrain noise, determine the first erosion data; the first erosion data indicates the changing trend of the base data.

[0072] In one embodiment of this application, in order to improve the smoothness of the terrain data corresponding to different pixels among multiple pixels, thereby improving the accuracy of representing the geomorphic features of the area where multiple pixels are located based on the terrain data, first erosion data can be determined based on the relative position between any one of the multiple pixels and the vertex of the first terrain noise. The first erosion data indicates the changing trend of the multiple pixels.

[0073] Specifically, the first erosion data includes ridge erosion data and water flow erosion data. The first and second vertices can be determined from multiple pixels, identifying the vertices closest to any given pixel. Ridge erosion data for multiple pixels is then determined based on the first distance between the perpendicular bisectors of the lines connecting any given pixel to the first and second vertices.

[0074] The ridge erosion data is generated by mapping the ridge structure of multiple pixels using the geometric properties of Voronoi noise. The degree of erosion on the ridge is quantified by the distance between each pixel and the perpendicular bisector of the line connecting the Voronoi vertices, ultimately generating detailed ridge data that conforms to the natural terrain.

[0075] The first and second vertices can be Voronoi vertices in Voronoi noise. Specifically, a Voronoi vertex can be the intersection of three or more Voronoi edges in the Voronoi noise. In multiple pixels, a Voronoi vertex can correspond to a local high or low point of the terrain (e.g., the intersection of a mountain peak or valley).

[0076] In this context, the perpendicular bisector of the line connecting the first and second vertices is the perpendicular bisector of the line connecting any two adjacent Voronoi vertices. Across multiple pixels, the Voronoi perpendicular bisector corresponds to a ridge or valley line of the terrain. Since points on the perpendicular bisector are equidistant from the two seed points, the Voronoi perpendicular bisector serves as a boundary line for changes in terrain elevation. For example, a ridge is a watershed between two sides of the terrain, and a valley is the confluence of watercourses between two sides. Thus, using the Voronoi perpendicular bisector as the original ridge / valley line, the degree of erosion deviation of the ridge can be measured by the distance of a pixel from the perpendicular bisector.

[0077] Specifically, multiple seed points can be generated in the space occupied by multiple pixels according to the Poisson disk distribution, and Voronoi noise can be constructed based on the seed points to obtain the Voronoi cell corresponding to each seed point. Each Voronoi cell corresponds to a different terrain region. For any Voronoi vertex, the Voronoi vertices directly adjacent to it are determined, and the perpendicular bisector of the line connecting each pair of adjacent vertices is calculated. Using Voronoi cells as units, an initial height value is assigned to each cell (e.g., a random height based on the seed point, or a base height combined with Perlin noise), forming multiple pixels in a blocky partition.

[0078] Specifically, the nearest and second nearest Voronoi vertices of any pixel can be located. For any target pixel among multiple pixels, the nearest and second nearest Voronoi vertices are queried using spatial indexing. Voronoi vertices are geometric control points of the terrain, and the nearest and second nearest vertices of P determine the local terrain structure where P is located. For example, if the first and second vertices are both local high points, the perpendicular bisector of the line connecting the two points is likely to be a ridgeline; if both are local low points, the perpendicular bisector may be a valley line.

[0079] Specifically, the first distance from a pixel to the perpendicular bisector of the line connecting two vertices can be calculated. The larger the first distance, the farther any pixel deviates from the perpendicular bisector (the original ridgeline), and the more severe the erosion of the corresponding ridge. The first distance can be transformed into ridge erosion data that can be directly used for terrain modification through a mapping relationship between distance and erosion degree (e.g., a linear or non-linear mapping function). This erosion data is then applied to modify multiple pixels, combining the erosion degree of each pixel with the heights of multiple pixels to generate terrain data after ridge erosion.

[0080] Specifically, by searching the basalt data for the first and second nearest Voronoi vertices to a single pixel, the distance from that pixel to the nearest edge of its Voronoi cell is calculated and used as the pixel's height. The nearest edge of the pixel's Voronoi cell is the boundary between the cells corresponding to the first and second nearest Voronoi vertices. This allows the output terrain data to have a ridge effect similar to the DLA algorithm. The ridge erosion data obtained after calculating the first distance from any pixel to the perpendicular bisector of the line connecting the first and second nearest Voronoi vertices is as follows: Figure 4 As shown. Topographical data after ridge erosion is as follows. Figure 5 As shown.

[0081] In one embodiment of this application, ridge erosion data generated by quantifying the ridge integrity and gradient changes of the terrain can numerically describe the integrity of the ridge line in the terrain and the height attenuation law from the ridge line to the surrounding terrain, thereby characterizing the degree of ridge erosion of the terrain.

[0082] Specifically, if any pixel is located in the core area of ​​a ridgeline with low erosion and a terrain height close to the initial ridgeline height, corresponding to the top of a complete ridgeline that has not been significantly eroded (e.g., a sharp ridgeline or a summit plateau), then this pixel can be the skeletal support point for multiple pixels. If any pixel is located in the edge area of ​​a ridgeline with moderate erosion and a terrain height that gradually decreases from the ridgeline to the surrounding area, then this pixel corresponds to a partially eroded ridge slope (e.g., a gentle slope or scree slope), and is a "transition zone" between the ridgeline and the gentle terrain. If any pixel is located far from the ridgeline and has extremely high erosion, with a terrain height consistent with the surrounding gentle areas, then it corresponds to a completely eroded gentle terrain (e.g., the bottom of a valley or a plain), and the ridgeline features completely disappear.

[0083] In one embodiment of this application, the spatial attenuation pattern of terrain height can be indicated based on the erosion gradient. The erosion gradient can be the spatial gradient of erosion data (e.g., the difference between adjacent pixels), used to describe the rate of height change from the ridgeline to the surrounding terrain. A large difference between adjacent pixels corresponds to a steep ridge (e.g., a cliff-like ridgeline), indicating that ridge erosion is mainly caused by gravity collapse and has a steep transition. Conversely, a small erosion gradient corresponds to a gentle ridge (e.g., a slope-like ridgeline), commonly found in sedimentary landforms, where ridge erosion is mainly caused by rainwater erosion and has a gentle transition.

[0084] In one embodiment of this application, ridge erosion data can enhance visual realism. Since each cell in a single Voronoi noise-generated pixel array is a highly uniform polygonal region with steep boundaries, terrain data generated based on Voronoi noise may visually present unnatural blocky segmentation. However, by transforming the steep boundaries of Voronoi cells into a continuous gradient from ridgelines to gentler terrain (e.g., hexagonal boundaries eroded into gentle slopes, visually without obvious blocky segmentation), the defects of pure Voronoi terrain—lacking ridgelines and consisting entirely of blocky high points—are avoided. Through perpendicular bisector positioning and erosion degree mapping, continuous and detailed ridgelines (e.g., mountains with smooth boundaries, branching ridges) are generated, conforming to the hierarchical structure of mountains-ridgelines-valleys in reality. By geometrically simulating the framework of geological structures using Voronoi noise and simulating the impact of external erosion on multiple pixels using erosion data, the generated terrain data is ensured to have logical self-consistency. The eroded terrain can support geomorphic features such as water flow direction and vegetation distribution; it can also be used to simulate erosion differences in different climate zones, providing a realistic terrain basis for ecological simulation and disaster prediction.

[0085] In one embodiment of this application, adjusting the parameters of the first noise (e.g., Berlin noise) and the second noise (e.g., Voronoi noise) can adapt to diverse terrain requirements. For example, if generating rugged mountains is required, a smaller erosion gradient can be set to ensure a high ridge core area and a large erosion gradient, forming sharp and steep ridges; if generating gentle hills is required, a larger erosion gradient can be set, causing rapid erosion of the ridge lines and a low height, forming dome-shaped hills. This parameter adjustment mechanism ensures that the generated terrain data adapts to the terrain generation needs of multiple fields, avoiding limitations in the generated terrain data.

[0086] In one embodiment of this application, the water erosion data is obtained by quantizing the first distance between any pixel and the perpendicular bisector of the line connecting the Voronoi vertices and the second distance between any pixel and the Voronoi vertices. This data can characterize the water collection capacity and scouring intensity of multiple pixels, and can generate erosion data that conforms to natural hydrological laws. It can avoid the limitations of unnatural Voronoi topography and ensure that the water erosion effect is closer to the physical process of water flowing downhill and scouring to form gullies in reality.

[0087] Specifically, seed points can be generated based on the Poisson disk distribution within a two-dimensional terrain plane to construct Voronoi noise. An initial height is assigned to each Voronoi cell (e.g., by combining with Berlin noise to make the seed point height fluctuate randomly, simulating terrain undulations), forming multiple pixels composed of block partitions and base heights. The smaller the first distance, the closer any pixel is to the watershed / catchment core line; if it's a catchment line, any pixel is more likely to be in the main water flow channel, resulting in stronger scouring; if it's a watershed line, any pixel is more likely to be at the water flow boundary, resulting in weaker scouring. The larger the second distance, the steeper the terrain slope in the area where any pixel is located. The line connecting two vertices can be considered a gentle terrain baseline; the larger the second distance, the farther any pixel deviates from the baseline, and the greater the height difference.

[0088] Specifically, it can search for the Voronoi control points in the primitive data that are the first and second closest to any pixel; Calculate the distance from the pixel to the line connecting the first and second nearest Voronoi control points; wherein the line connecting the control points of any two adjacent Voronoi cells is perpendicular to the boundary line between the two cells. This distance value, combined with the ridge erosion data corresponding to the pixel, can characterize the pixel's position in an offset coordinate system. This offset coordinate system can be a coordinate system with the nearest Voronoi cell edge of the pixel as the horizontal axis and the line connecting the first and second nearest Voronoi control points as the vertical axis.

[0089] Therefore, this distance value and the corresponding ridge erosion data for that pixel can be used as the coordinate points for tiling textures on the ridge slope. Specifically, the data format corresponding to the x-coordinate value of the coordinate point for tiling textures on the ridge slope is as follows: Figure 6 As shown, the data format corresponding to the ordinate values ​​of the coordinate points of the textured surface on the ridge slope is as follows: Figure 7 As shown.

[0090] An approximate water erosion can be achieved based on noise data determined by the coordinate points of the tiled texture. Figure 8 A schematic diagram of noise data determined by coordinate points based on tiling texture is shown.

[0091] Thus, approximate ridge erosion and water erosion can be generated with only one calculation based on the primitive data, without iterating over terrain data of multiple pixels. Furthermore, the multiple pixels are independent of each other, enabling parallel computation of terrain data across multiple pixels. For example, terrain data of multiple pixels can be computed in real-time using a graphics processor. Since GPU thread scheduling is highly concurrent and unordered, for the algorithm to run on the GPU, the computation process for each pixel must be independent when generating the terrain height map, ensuring that the process of generating terrain data of multiple pixels in this application can be performed efficiently.

[0092] The spatial distribution of water erosion data can be used to define the effective range of water scouring. When the water erosion data indicates a catchment line, the erosion range is banded, extending to both sides from the vertical line as the center, forming a valley corridor; when the water erosion data indicates a watershed line, the water erosion range is planar, spreading to both sides from the vertical line as the center, forming a gentle ridge area; when the water erosion data indicates a neutral line scenario, the erosion range is a unidirectional fan-shaped spread from the high-altitude peak to the low-altitude peak, forming a sloping gentle slope.

[0093] Among them, the spatial gradient of water erosion data can characterize the topographic morphology after erosion. Areas with large gradients correspond to steep valleys with a large height difference between the core and edge areas of the catchment line, which is common in rock landforms. Areas with small gradients correspond to gentle valleys with a small height difference between the core and edge areas of the catchment line, which is common in sedimentary landforms. Gradient fluctuations correspond to irregular valleys, where changes in slope lead to fluctuations in erosion intensity, forming natural valley morphologies with alternating shallows and deep pools.

[0094] Water erosion data enables the generated terrain to possess both hydrological logic and natural realism, avoiding the shortcomings of traditional Voronoi noise which lacks hydrological characteristics and produces unnatural shapes. This ensures that the terrain data is optimized from a geometric block structure to an interactive scenario that conforms to natural hydrological patterns. In one embodiment of this application, the specific method for determining the first erosion data can be found in [link to application]. Figure 9 and Figure 10 The corresponding detailed explanation.

[0095] S22, the base data is updated based on the first erosion data to obtain the first terrain data.

[0096] In one embodiment of this application, the base model data can be updated based on the ridge erosion data and water flow erosion data in the first erosion data to obtain the first terrain data. The first terrain data indicates the terrain data corresponding to multiple pixels after they have been subjected to ridge and water flow erosion.

[0097] Specifically, the first terrain data can be determined based on a preset first erosion model, wherein the first erosion model satisfies the following relationship: Where V1 represents the first terrain data; V 基型 Represents basic data; P 山脊 Represents ridge erosion data; P 水流 Represents water erosion data; P 混合 This represents a combined value of ridge erosion data and water flow erosion data. Figure 11 A schematic diagram of the first terrain data is shown.

[0098] For a specific method of determining the first terrain data in one embodiment of this application, please refer to [link to relevant documentation]. Figure 12 The corresponding detailed explanation.

[0099] S23, based on the location information of any one pixel, the third terrain noise corresponding to the any one pixel, and the fourth terrain noise, determine the second erosion data; the second erosion data indicates the degree of influence of environmental information on the change trend of the base data.

[0100] In one embodiment of this application, the second erosion data includes first approximate water flow erosion data and second approximate water flow erosion data. The first approximate water flow erosion data is used for hillside areas, and the second approximate water flow erosion data is used for flat areas. The third terrain noise can be Voronoi noise generated based on high-frequency parameters, and the fourth terrain noise can be Perm noise generated based on high-frequency parameters. The second erosion data can be determined based on the location information of any pixel, the third terrain noise corresponding to the arbitrary pixel, and the fourth terrain noise.

[0101] The second erosion data indicates the degree to which environmental information of the region to which multiple pixels belong affects the changing trend of the virtual terrain.

[0102] Here, frequency refers to the number of variations in the first and second topographic noise values ​​per unit space. A higher frequency results in more concentrated fluctuations in the noise values ​​of both the first and second topographic noise, leading to finer details in the topographic data (e.g., rock textures, small slopes, surface cracks); a lower frequency results in smoother fluctuations and a more macroscopic shape (e.g., mountain outlines, plain undulations). By adjusting the fundamental frequency of the Berlin noise, the first topographic noise can be made to exhibit more concentrated variations per unit space.

[0103] Specifically, in setting up the Burmester noise, the frequency of the Burmester noise can be determined collaboratively based on three key parameters: the fundamental frequency, the number of fractal layers, and the frequency multiplication factor. Among them, the fundamental frequency and the number of fractal layers define the high-frequency level of the first terrain noise, while the frequency multiplication factor controls the superposition pattern of high-frequency details.

[0104] The fundamental frequency defines the basic period of terrain noise, indicating the number of undulations in a unit space. A higher fundamental frequency results in denser undulations and more pronounced high-frequency characteristics. The number of fractal layers allows for the superposition of multiple layers of noise at different frequencies; more layers result in richer high-frequency details. The frequency multiplication factor controls the multiplication ratio of each noise layer relative to the previous layer; a higher value indicates a faster frequency increase at higher levels and denser high-frequency details.

[0105] For example, when generating high-frequency Burmester noise, the fundamental frequency can directly determine the smallest unit of noise fluctuation. The choice of its value needs to be combined with the spatial scale of the terrain (e.g., "pixel-level terrain" or "world-class terrain") to avoid "noising" due to excessively high frequencies or "low-frequency" due to excessively low frequencies.

[0106] For example, if generating a high-frequency texture of a rock surface, the base frequency can be set to 16, indicating 0.16 undulations within 1 pixel, ensuring that the details of the terrain noise are dense enough to match the roughness of the rock surface.

[0107] Because a single layer of Burmester noise, even at a high fundamental frequency, can result in monotonous details, multiple layers of noise can be superimposed to enrich the high-frequency details (each layer superimposed with subtle fluctuations of different frequencies).

[0108] For example, the number of fractal layers can be set to 8, so that the rock surface has large rough textures, small cracks and micro-protrusions, making the terrain data closer to the real rock.

[0109] The frequency multiplication factor controls the multiplication ratio of the frequency of each layer of noise relative to the previous layer, which can affect the rate at which high-frequency details are densed. For example, when the frequency multiplication factor is set to 2, the frequency of each layer doubles, the detail density is increased uniformly, and a sudden over-density or under-density in a certain layer is avoided.

[0110] For a specific method of determining the second erosion data in one embodiment of this application, please refer to [link to relevant documentation]. Figure 13 The corresponding detailed explanation.

[0111] S24, the first terrain data is updated based on the second erosion data to obtain the second terrain data.

[0112] In one embodiment of this application, the first terrain data can be updated based on the fourth terrain noise and the first approximate water flow erosion data in the second erosion data to obtain the second terrain data. The second terrain data indicates the degree of influence of environmental information of the region to which multiple pixels belong on the changing trends of the multiple pixels.

[0113] In one embodiment of this application, the first terrain data can be determined to be height data of multiple pixels, and the normal data of the first terrain data can be determined based on the normal direction information of the height data. The normal data is standardized based on the product of the normal data and a pre-stored unit vector, wherein the unit vector can be (0, 0, 1).

[0114] Specifically, second terrain data can be determined based on a preset second erosion model, wherein the second erosion model satisfies the following relationship: Wherein, V2 represents the second erosion data; V1 represents the first erosion data; V3 represents the third terrain noise; V4 represents the fourth terrain noise; Dis1 represents the product of the normal data and the unit vector of the first terrain data; and Dis2 represents the approximate water flow erosion data in the second erosion data.

[0115] For a specific method of determining the second terrain data in one embodiment of this application, please refer to [link to relevant documentation]. Figure 14 The corresponding detailed explanation.

[0116] S25, the second terrain data is rendered based on preset rendering parameters to obtain target terrain data corresponding to the plurality of pixels.

[0117] In one embodiment of this application, the second terrain data can be determined as updated height data of multiple pixels, and the second terrain data can be divided into multiple terrain layers based on different height ranges. Each terrain layer corresponds to landform features at different altitudes.

[0118] In one embodiment of this application, rendering parameters corresponding to any one of multiple terrain layers can be determined based on the height parameter of any one terrain layer. These rendering parameters can be parameters corresponding to landform features or vegetation; this application does not limit this. Any terrain layer can be rendered based on the rendering parameters corresponding to any one terrain layer to obtain target terrain data of multiple pixels.

[0119] For a specific method of determining target terrain data in one embodiment of this application, please refer to [link to relevant documentation]. Figure 15 The corresponding detailed explanation.

[0120] As can be seen from the above technical solutions, the embodiments of this application provide vertex and block partitioning through the first terrain noise and smooth transition of landform features through the second terrain noise. This ensures that the basic data of multiple pixels has both clear block partitioning and continuous transitions within the partitions, avoiding visual mechanical segmentation. By simulating structure-driven erosion (e.g., ridge weathering, valley erosion) through the geometric relationships of the terrain itself, the problem of vague basic data structure and lack of geographical features is solved, ensuring that the structure of the first terrain data can conform to the evolution law of the elevation of real terrain and avoiding irregular protrusions / concavities generated by noise alone (e.g., abrupt isolated slopes, unsupported suspended terrain). Furthermore, the third and fourth terrain noises correspond to regional environmental noise, enabling the second erosion data to quantitatively represent the degree of influence of the environment on the terrain in different regions, making the second terrain data exhibit regional differences. This ensures that the second terrain data can conform to the law of environmental determination of terrain morphology in geography, avoiding the uniformity of landform features across the entire region, which would reduce the accuracy of the terrain data. Ultimately, by matching terrain features with rendering parameters, the visual effect of the target terrain data is made to conform to both the physical form of the terrain and the environmental characteristics of the region, avoiding visual misalignment of the terrain data. This allows for independent calculation of the height of each pixel across multiple pixels, ensuring parallel computation of each pixel when processing terrain data corresponding to multiple pixels, thereby improving the efficiency of terrain data generation.

[0121] like Figure 9 The diagram shown is a flowchart of a method for determining first erosion data according to an embodiment of this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. The method for determining first erosion data provided in this embodiment includes the following steps.

[0122] S90, based on the relative position between any pixel and the vertex of the first terrain noise, determine a first vertex and a second vertex from the vertices; the distance between the first vertex and any pixel is less than the distance between the second vertex and any pixel.

[0123] In one embodiment of this application, the first vertex and the second vertex can be Voronoi vertices in Voronoi noise. Specifically, a Voronoi vertex can be the intersection of three or more Voronoi edges in the Voronoi noise. In multiple pixels, a Voronoi vertex can correspond to a local high point or low point of the terrain (e.g., the intersection of a mountain peak or valley).

[0124] S91, determine the ridge erosion data corresponding to the basic data based on the first distance between any pixel and the perpendicular bisector of the line connecting the first vertex and the second vertex.

[0125] In one embodiment of this application, the perpendicular bisector of the line connecting the first vertex and the second vertex refers to the perpendicular bisector of the line connecting any two adjacent Voronoi vertices. In multiple pixels, the Voronoi perpendicular bisector corresponds to a ridge or valley line of the terrain. Since points on the perpendicular bisector are equidistant from the two seed points, the Voronoi perpendicular bisector serves as a boundary line for changes in terrain elevation. For example, a ridge is a watershed between two sides of the terrain, and a valley is a confluence of watercourses between two sides. Thus, using the Voronoi perpendicular bisector as the original ridge / valley line, the degree of erosion deviation of the ridge can be measured by the distance between a pixel and the perpendicular bisector.

[0126] S92, based on the first distance and the second distance between any pixel and the line connecting the first vertex and the second vertex, determine the water erosion data of the base data.

[0127] In one embodiment of this application, the water erosion data is obtained by quantizing the first distance between any pixel and the perpendicular bisector of the line connecting the Voronoi vertices and the second distance between any pixel and the Voronoi vertices. This data can characterize the water collection capacity and scouring intensity of multiple pixels, and can generate erosion data that conforms to natural hydrological laws. It can avoid the limitations of unnatural Voronoi topography and ensure that the water erosion effect is closer to the physical process of water flowing downhill and scouring to form gullies in reality.

[0128] Specifically, seed points can be generated based on the Poisson disk distribution within a two-dimensional terrain plane to construct Voronoi noise. An initial height is assigned to each Voronoi cell (e.g., by combining with Berlin noise to make the seed point height fluctuate randomly, simulating terrain undulations), forming multiple pixels composed of block partitions and base heights. The smaller the first distance, the closer any pixel is to the watershed / catchment core line; if it's a catchment line, any pixel is more likely to be in the main water flow channel, resulting in stronger scouring; if it's a watershed line, any pixel is more likely to be a water flow boundary point, resulting in weaker scouring. The larger the second distance, the steeper the terrain slope in the area where any pixel is located. The line connecting two vertices can be considered a gentle terrain baseline; the larger the second distance, the farther any pixel deviates from the baseline, the greater the height difference, the faster the water flow, and the stronger the scouring ability.

[0129] like Figure 10 The diagram shown is a flowchart of a method for determining water erosion data according to an embodiment of this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. The method for determining water erosion data provided in this embodiment includes the following steps.

[0130] S100, based on pre-stored noise parameters, determine the erosion noise of the plurality of pixels.

[0131] In one embodiment of this application, seed points can be generated in a two-dimensional terrain plane according to the Poisson disk distribution to construct Voronoi noise; and an initial height is assigned to each Voronoi cell (for example, by combining with Berlin noise, the height of the seed point fluctuates randomly to simulate terrain undulations), forming multiple pixels composed of block partitions and base heights. The smaller the first distance, the closer any pixel is to the watershed / catchment core line; if it is a catchment line, any pixel is more likely to be in the main water flow channel, resulting in stronger scouring; if it is a watershed line, any pixel is more likely to be a water flow boundary point, resulting in weaker scouring. The larger the second distance, the steeper the terrain slope in the area where any pixel is located. The line connecting two vertices can be regarded as a gentle terrain baseline; the larger the second distance, the farther any pixel deviates from the baseline, the greater the height difference, the faster the water flow velocity, and the stronger the scouring ability.

[0132] S101, Based on the first distance and the second distance, determine the offset of the erosion noise.

[0133] In one embodiment of this application, the type of watershed / catchment line can be determined to ascertain the direction of water erosion. Specifically, if the initial heights of both the first and second vertices are lower than the heights of the surrounding Voronoi vertices, then the perpendicular bisector of the line connecting the first and second vertices is a catchment line, and the water flow on both sides converges towards the perpendicular bisector of the line connecting the first and second vertices, forming a valley / stream channel; if the heights of both the first and second vertices are higher than the heights of the surrounding vertices, then the perpendicular bisector of the line connecting the first and second vertices is a watershed line, and the water flow on both sides diffuses in opposite directions; if the height of the first vertices is higher than the height of the second vertices, then the perpendicular bisector of the line connecting the first and second vertices is a neutral transition line, and the water flow is unidirectional towards the second vertices, with the erosion intensity between the two.

[0134] A mapping model between distance and erosion intensity can be constructed to quantify the degree of erosion. Specifically, the first and second distances can be converted into water flow erosion intensity by combining hydrophysical laws. When water flows towards the vertical, the smaller the first distance (closer to the catchment line) and the larger the second distance (steeper slope), the greater the erosion intensity. A smaller first distance indicates more concentrated water flow and a stronger erosion base. When water flows disperse, the erosion intensity is weaker. A larger first distance indicates less erosion intensity, which conforms to the law that water flows are dispersed and erosion is gentle near the watershed.

[0135] This process combines the height of multiple pixels to calculate the final eroded terrain height. The erosion intensity is then converted into a modification of the actual terrain height. Water erosion causes a decrease in terrain height. The first distance is small, the second distance is large, and due to strong erosion, the height is further reduced, forming deep gullies and gentle slopes characteristic of streams / valleys. Dispersed water flow causes the terrain height to flatten, and protruding terrain near the watershed (such as small slopes) is smoothed out, forming gentle ridges and slopes, avoiding sharp protrusions.

[0136] This system iteratively simulates the cumulative effect of long-term water erosion, updating terrain height after multiple rounds of erosion. The first iteration forms initial gullies, while subsequent iterations deepen and widen them, resulting in the long-term evolution of narrow gullies, wide valleys, and plains. It can overlay small-scale Berlin noise to simulate microscopic details such as gravel and shallows at the gully bottom, preventing the terrain from becoming too smooth after erosion. The system also limits the erosion intensity at map edges to ensure the continuity of the overall terrain.

[0137] S102, update the erosion noise based on the offset to obtain the water flow erosion data of the base data.

[0138] In one embodiment of this application, water erosion data can also be used to quantify the intensity, range, and morphology of water erosion. It can numerically describe the concentration of water flow, erosion capacity, and morphological characteristics of the eroded terrain across multiple pixels.

[0139] Among them, water erosion data can characterize the intensity of water erosion on the terrain in the area where multiple pixels are located. It is an energy index of water scouring. Strong erosion areas correspond to the main channels of streams / valleys, where the water flow is fast and has a strong scouring effect on the terrain, significantly reducing the terrain height and forming deep gullies and riverbeds; moderate erosion areas correspond to the gentle slopes on both sides of the valley, where the water flow is moderate and the terrain height decreases slowly, forming gully slopes and shallow water features; weak erosion areas correspond to gentle terrain / ridges, where the water flow is slow and the scouring effect is weak, with minimal changes in terrain height, only slight flattening, and no obvious gully features.

[0140] The spatial distribution of water erosion data can be used to define the effective range of water scouring. When the water erosion data indicates a catchment line, the erosion range is banded, extending to both sides from the vertical line as the center, forming a valley corridor; when the water erosion data indicates a watershed line, the water erosion range is planar, spreading to both sides from the vertical line as the center, forming a gentle ridge area; when the water erosion data indicates a neutral line scenario, the erosion range is a unidirectional fan-shaped spread from the high-altitude peak to the low-altitude peak, forming a sloping gentle slope.

[0141] Among them, the spatial gradient of water erosion data can characterize the topographic morphology after erosion. Areas with large gradients correspond to steep valleys with a large height difference between the core and edge areas of the catchment line, which is common in rock landforms. Areas with small gradients correspond to gentle valleys with a small height difference between the core and edge areas of the catchment line, which is common in sedimentary landforms. Gradient fluctuations correspond to irregular valleys, where changes in slope lead to fluctuations in erosion intensity, forming natural valley morphologies with alternating shallows and deep pools.

[0142] Water erosion data enables the generated terrain to possess both hydrological logic and natural realism, avoiding the shortcomings of traditional Voronoi noise which lacks hydrological characteristics and has unnatural shapes. This ensures that the terrain data is optimized from a geometric block structure to an interactive scene that conforms to natural hydrological laws.

[0143] like Figure 12 The diagram shown is a flowchart of a method for determining first terrain data according to an embodiment of this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. The method for determining first terrain data provided in this embodiment includes the following steps.

[0144] S120, based on the relative position between any pixel and the vertex of the first terrain noise, determine a third vertex from the vertices; the distance between the third vertex and any pixel is greater than the distance between the second vertex and any pixel.

[0145] In one embodiment of this application, the nearest and third nearest Voronoi vertices of any pixel can be located. For any target pixel among multiple pixels, the nearest and third nearest Voronoi vertices are queried using a spatial index. Voronoi vertices are geometric control points of the terrain, and the nearest and second nearest vertices of P determine the local terrain structure where P is located. For example, if the first and second vertices are both local high points, the perpendicular bisector of the line connecting the two points is likely to be a ridgeline; if both are local low points, the perpendicular bisector may be a valley line.

[0146] S121, determine the third distance between any pixel and the perpendicular bisector of the line connecting the first vertex and the third vertex.

[0147] In one embodiment of this application, a third distance can be calculated from a pixel to the perpendicular bisector of the line connecting two vertices. A larger third distance indicates that any pixel deviates further from the perpendicular bisector (the original ridgeline), and thus the ridgeline is more severely eroded. The first distance can be converted into ridge erosion data that can be directly used for terrain modification through a mapping relationship between distance and erosion degree (e.g., a linear or non-linear mapping function). The erosion data is then applied to modify multiple pixels, combining the erosion degree of each pixel with the height of multiple pixels to generate terrain data after ridge erosion.

[0148] The perpendicular bisector of the line connecting the first and third vertices is the perpendicular bisector of the line connecting any two adjacent Voronoi vertices. Within a given number of pixels, the Voronoi perpendicular bisector corresponds to a ridge or valley line of the terrain. Since points on the perpendicular bisector are equidistant from the two seed points, the Voronoi perpendicular bisector serves as a boundary between changes in terrain elevation. For example, a ridge is a watershed between two adjacent terrain features, and a valley is the confluence of watercourses between two adjacent terrain features. Thus, using the Voronoi perpendicular bisector as the original ridge / valley line, the degree of erosion deviation of the ridge can be measured by the distance of a pixel from the perpendicular bisector.

[0149] S122, the base data is updated based on the first distance, the difference between the first distance and the third distance, and the erosion noise to obtain the first terrain data.

[0150] In one embodiment of this application, first terrain data can be determined based on a preset first erosion model, wherein the first erosion model satisfies the following relationship: Where V1 represents the first terrain data; V 基型 Represents basic data; P 山脊 Represents ridge erosion data; P 水流 Represents water erosion data; P 混合 This represents a combined value of ridge erosion data and water flow erosion data.

[0151] like Figure 13 The diagram shown is a flowchart of a method for determining second erosion data according to an embodiment of this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. The method for determining second erosion data provided in this embodiment includes the following steps.

[0152] S130, based on the relative position between the arbitrary pixel and the vertex of the third terrain noise, determine the fourth vertex and the fifth vertex from the vertices of the third terrain noise; the distance between the fourth vertex and the arbitrary pixel is less than the distance between the fifth vertex and the arbitrary pixel.

[0153] In one embodiment of this application, the first vertex and the second vertex can be Voronoi vertices in Voronoi noise. Specifically, a Voronoi vertex can be the intersection of three or more Voronoi edges in the Voronoi noise. In multiple pixels, a Voronoi vertex can correspond to a local high point or low point of the terrain (e.g., the intersection of a mountain peak or valley).

[0154] S131, determine the fourth distance between any pixel and the perpendicular bisector of the line connecting the fourth vertex and the fifth vertex.

[0155] In one embodiment of this application, the perpendicular bisector of the line connecting the first vertex and the second vertex refers to the perpendicular bisector of the line connecting any two adjacent Voronoi vertices. In multiple pixels, the Voronoi perpendicular bisector corresponds to a ridge or valley line of the terrain. Since points on the perpendicular bisector are equidistant from the two seed points, the Voronoi perpendicular bisector serves as a boundary line for changes in terrain elevation. For example, a ridge is a watershed between two sides of the terrain, and a valley is a confluence of watercourses between two sides. Thus, using the Voronoi perpendicular bisector as the original ridge / valley line, the degree of erosion deviation of the ridge can be measured by the distance between a pixel and the perpendicular bisector.

[0156] The first distance from a pixel to the perpendicular bisector of the line connecting two vertices can be calculated. A larger first distance indicates that any pixel deviates further from the perpendicular bisector (the original ridgeline), and thus the ridgeline is more severely eroded. This first distance can be converted into ridge erosion data that can be directly used for terrain modification through a mapping relationship between distance and erosion degree (e.g., a linear or non-linear mapping function). This erosion data is then applied to modify multiple pixels, combining the erosion degree of each pixel with the heights of multiple pixels to generate terrain data after ridge erosion.

[0157] S132, Based on the fourth distance and the third terrain noise, determine the first approximate water erosion data of the basic data.

[0158] In one embodiment of this application, seed points can be generated in a two-dimensional terrain plane according to the Poisson disk distribution to construct Voronoi noise; and an initial height is assigned to each Voronoi cell (for example, by combining with Berlin noise, the height of the seed point fluctuates randomly to simulate terrain undulations), forming multiple pixels composed of block partitions and base heights. The smaller the first distance, the closer any pixel is to the watershed / catchment core line; if it is a catchment line, any pixel is more likely to be in the main water flow channel, resulting in stronger scouring; if it is a watershed line, any pixel is more likely to be a water flow boundary point, resulting in weaker scouring. The larger the second distance, the steeper the terrain slope in the area where any pixel is located. The line connecting two vertices can be regarded as a gentle terrain baseline; the larger the second distance, the farther any pixel deviates from the baseline, the greater the height difference, the faster the water flow velocity, and the stronger the scouring ability.

[0159] S133, based on the fourth terrain noise, determine the second approximate water erosion data of the basic data.

[0160] In one embodiment of this application, the fourth terrain noise can be determined as a second approximate water erosion data of multiple pixels.

[0161] like Figure 14 The diagram shown is a flowchart of a method for determining second terrain data according to an embodiment of this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. The method for determining second terrain data provided in this embodiment includes the following steps.

[0162] S140, Determine the normal data of the first terrain data.

[0163] In one embodiment of this application, the first terrain data can be determined to be the height data of multiple pixels, and the normal data of the first terrain data can be determined based on the normal direction information of the height data.

[0164] S141, the first terrain data is updated based on the product of the normal data and the pre-stored unit vector, the first approximate water erosion data, and the second approximate water erosion data to obtain the second terrain data of the plurality of pixels.

[0165] In one embodiment of this application, second terrain data can be determined based on a preset second erosion model, wherein the second erosion model satisfies the following relationship: Wherein, V2 represents the second erosion data; V1 represents the first erosion data; V3 and V4 represent the first approximate water flow erosion data; Dis1 represents the product of the normal data of the first terrain data and the unit vector; and Dis2 represents the second approximate water flow erosion data in the second erosion data.

[0166] like Figure 15 The diagram shown is a flowchart of a method for determining target terrain data according to an embodiment of this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. The method for determining target terrain data provided in this embodiment includes the following steps.

[0167] S150, Based on the second terrain data, determine multiple terrain layers.

[0168] In one embodiment of this application, the second terrain data can be determined as updated height data of multiple pixels, and the second terrain data can be divided into multiple terrain layers based on different height ranges. Each terrain layer corresponds to landform features at different altitudes.

[0169] S151, Based on the height parameter of any one of the multiple terrain layers, determine the rendering parameters corresponding to the arbitrary terrain layer.

[0170] In one embodiment of this application, the rendering parameters corresponding to any one terrain layer can be determined based on the height parameter of any one terrain layer among multiple terrain layers. The rendering parameters can be parameters corresponding to landform features or parameters corresponding to vegetation; this application does not limit this.

[0171] S152, Render the arbitrary terrain layer based on the rendering parameters corresponding to the arbitrary terrain layer to obtain the target terrain data of the multiple pixels.

[0172] In one embodiment of this application, any terrain layer can be rendered based on the rendering parameters corresponding to any terrain layer to obtain target terrain data of multiple pixels.

[0173] Please see Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 100 includes a memory 12 and a processor 13. The memory 12 is used to store computer-readable instructions, and the processor 13 executes the computer-readable instructions stored in the memory to implement a terrain data generation method as described in any of the above embodiments.

[0174] In one embodiment of this application, the electronic device 100 further includes a bus and a computer program stored in the memory 12 and executable on the processor 13, such as a terrain data generation program.

[0175] Figure 16 Only an electronic device 100 with memory 12 and processor 13 is shown; those skilled in the art will understand that... Figure 16The structure shown does not constitute a limitation on the electronic device 100, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0176] Combination Figure 2 The memory 12 in the electronic device 100 stores a plurality of computer-readable instructions to implement the terrain data generation method. The processor 13 can execute the plurality of instructions to implement: constructing primitive data corresponding to the plurality of pixels based on first terrain noise and second terrain noise corresponding to the plurality of pixels; determining first erosion data based on the relative position between any pixel and the vertex of the first terrain noise; the first erosion data indicating the changing trend of the primitive data; updating the primitive data according to the first erosion data to obtain first terrain data; determining second erosion data based on the position information of the arbitrary pixel, third terrain noise corresponding to the arbitrary pixel, and fourth terrain noise; the second erosion data indicating the degree of influence of environmental information on the changing trend of the primitive data; updating the first terrain data based on the second erosion data to obtain second terrain data; and rendering the second terrain data based on preset rendering parameters to obtain target terrain data corresponding to the plurality of pixels.

[0177] Specifically, the processor 13's implementation method for the above instructions can be found in [reference needed]. Figure 2 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0178] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 100 and does not constitute a limitation on the electronic device 100. The electronic device 100 may be a bus-type structure or a star-type structure. The electronic device 100 may also include more or fewer other hardware or software than shown in the diagram, or different component arrangements. For example, the electronic device 100 may also include input / output devices, network access devices, etc.

[0179] It should be noted that electronic device 100 is only an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.

[0180] The memory 12 includes at least one type of readable storage medium, which can be non-volatile or volatile. The readable storage medium includes flash memory, portable hard drives, multimedia cards, card-type memory (e.g., SD or DX memory), magnetic storage, magnetic disks, optical disks, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 100, such as the portable hard drive of the electronic device 100. In other embodiments, the memory 12 can also be an external storage device of the electronic device 100, such as a plug-in portable hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 100. The memory 12 can be used not only to store application software and various types of data installed on the electronic device 100, such as the code of a terrain data generation program, but also to temporarily store data that has been output or will be output.

[0181] In some embodiments, the processor 13 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 13 is the control unit of the electronic device 100, connecting various components of the electronic device 100 via various interfaces and lines. It executes programs or modules stored in the memory 12 (e.g., executing terrain data generation programs) and calls data stored in the memory 12 to perform various functions of the electronic device 100 and process data.

[0182] The processor 13 executes the operating system of the electronic device 100 and various installed applications. The processor 13 executes these applications to implement the steps in the various terrain data generation method embodiments described above, for example... Figure 2 The steps are shown.

[0183] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete this application. The one or more modules / units may be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device 100.

[0184] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute portions of the terrain data generation method described in the various embodiments of this application.

[0185] If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware devices. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above.

[0186] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, and other memory.

[0187] Furthermore, the computer-readable storage medium may primarily include a stored program area and a stored data area, wherein the stored program area may store the operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of blockchain nodes, etc.

[0188] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, in... Figure 16 The symbol is represented by only one arrow, but this does not indicate that there is only one bus or one type of bus. The bus is configured to enable communication between the memory 12 and at least one processor 13, etc.

[0189] This application also provides a computer-readable storage medium (not shown), which stores computer-readable instructions that are executed by a processor in an electronic device to implement the terrain data generation method described in any of the above embodiments.

[0190] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The modules described as separate components may or may not be physically separate, and the components shown as modules 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 this embodiment according to actual needs.

[0191] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0192] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in the specification may also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.

Claims

1. A method of generating terrain data, characterized by, The method comprises: constructing base data corresponding to the plurality of pixels based on first and second terrain noises corresponding to the plurality of pixels; determining first erosion data based on a relative position between an arbitrary pixel and a vertex of the first terrain noise; the first erosion data indicating a variation trend of the base data; updating the base data according to the first erosion data to obtain first terrain data; determining second erosion data based on position information of the arbitrary pixel, third and fourth terrain noises corresponding to the arbitrary pixel; the second erosion data indicating an influence degree of environmental information on the variation trend of the base data; updating the first terrain data based on the second erosion data to obtain second terrain data; rendering the second terrain data based on preset rendering parameters to obtain target terrain data corresponding to the plurality of pixels.

2. The terrain data generation method according to claim 1, characterized by, The first erosion data comprises ridge erosion data and water flow erosion data; and the determining of the first erosion data based on the relative position between the arbitrary pixel and the vertex of the first terrain noise comprises: determining a first vertex and a second vertex from the vertex based on the relative position between the arbitrary pixel and the vertex of the first terrain noise; the distance between the first vertex and the arbitrary pixel is less than the distance between the second vertex and the arbitrary pixel; determining ridge erosion data corresponding to the base data according to a first distance between the arbitrary pixel and a perpendicular bisector of a line connecting the first vertex and the second vertex; determining water flow erosion data of the base data based on the first distance and a second distance between the arbitrary pixel and the line connecting the first vertex and the second vertex.

3. The terrain data generation method according to claim 2, characterized by, The determining of the water flow erosion data of the base data based on the first distance and the second distance between the arbitrary pixel and the line connecting the first vertex and the second vertex comprises: determining erosion noises of the plurality of pixels based on pre-stored noise parameters; determining an offset of the erosion noises based on the first distance and the second distance; updating the erosion noises based on the offset to obtain the water flow erosion data of the base data.

4. The terrain data generation method according to claim 3, characterized by, The updating of the base data according to the first erosion data to obtain the first terrain data comprises: determining a third vertex from the vertex based on the relative position between the arbitrary pixel and the vertex of the first terrain noise; the distance between the third vertex and the arbitrary pixel is greater than the distance between the second vertex and the arbitrary pixel; determining a third distance between the arbitrary pixel and a perpendicular bisector of a line connecting the first vertex and the third vertex; updating the base data according to the first distance, a difference between the first distance and the third distance, and the erosion noises to obtain the first terrain data.

5. The terrain data generation method according to claim 1, characterized by, The second erosion data includes first approximate water flow erosion data and second approximate water flow erosion data, the first approximate water flow erosion data is used for a mountain slope region, and the second approximate water flow erosion data is used for a flat region. The second erosion data is determined based on position information of the arbitrary pixel, third terrain noise corresponding to the arbitrary pixel, and fourth terrain noise, and includes the following steps: Fourth and fifth vertices are determined from a vertex of the third terrain noise based on a relative position between the arbitrary pixel and the vertex of the third terrain noise. The distance between the arbitrary pixel and the fourth vertex is less than the distance between the arbitrary pixel and the fifth vertex. A fourth distance between the arbitrary pixel and a perpendicular bisector of a line connecting the fourth vertex and the fifth vertex is determined. First approximate water flow erosion data of the base data is determined according to the fourth distance and the third terrain noise. Second approximate water flow erosion data of the base data is determined based on the fourth terrain noise.

6. The terrain data generation method according to claim 5, characterized by, The first terrain data is updated based on the second erosion data to obtain second terrain data, and includes the following steps: Normal data of the first terrain data is determined. The first terrain data is updated based on a product of the normal data and a pre-stored unit vector, the first approximate water flow erosion data, and the second approximate water flow erosion data to obtain second terrain data of the plurality of pixels.

7. The terrain data generation method according to claim 1, characterized by, The second terrain data is rendered based on pre-stored rendering parameters to obtain target terrain data, and includes the following steps: A plurality of terrain layers is determined based on the second terrain data. A rendering parameter corresponding to an arbitrary terrain layer of the plurality of terrain layers is determined based on a height parameter of the arbitrary terrain layer. The arbitrary terrain layer is rendered based on the rendering parameter corresponding to the arbitrary terrain layer to obtain target terrain data of the plurality of pixels.

8. The terrain data generation method according to claim 1, characterized by, The base data of the plurality of pixels is determined based on first terrain noise and second terrain noise, and includes the following steps: The base data of the plurality of pixels is determined based on a product of the first terrain noise and the second terrain noise.

9. An electronic device, comprising: The electronic device includes a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the terrain data generation method according to any one of claims 1 to 8.

10. A vehicle characterized by comprising: The electronic device according to claim 9 is provided. The electronic device according to claim 9 is provided.