Landform rendering method, device, equipment, computer readable storage medium and computer program product

By generating terrain stripes based on terrain surface coordinates and normal vectors, automatically determining texture map regions and correcting colors, the problem of insufficient visual diversity and inconsistency in terrain image generation is solved, achieving high-quality natural blending and accurate rendering.

CN122115677APending Publication Date: 2026-05-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-04-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the generation of terrain images relies on manually drawn texture maps, which results in insufficient visual diversity, discontinuity between texture maps and terrain surfaces, and neglect of the complex topological deformation and local semantic structure of terrain surfaces, leading to a lack of spatial logic in the location of texture maps and problems with stretching and deformation.

Method used

Terrain stripes are generated based on the world space coordinates of each pixel on the terrain surface. The texture map region is determined using normal vectors and world space vectors. Texture colors are corrected by controlling parameters. The rendering is then combined with an ambient occlusion map to generate a high-quality terrain image.

Benefits of technology

It improves the sense of depth and natural integration of terrain images, reduces the cost of manual rendering, ensures the physical rationality and color harmony of texture maps under complex terrain surfaces, and improves rendering accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115677A_ABST
    Figure CN122115677A_ABST
Patent Text Reader

Abstract

The application provides a topography rendering method, device, equipment, computer readable storage medium and computer program product; the method comprises the following steps: generating a first terrain stripe based on the first world space coordinates of each first pixel point on a terrain surface, and obtaining a first texture map corresponding to the first terrain stripe; determining a first region corresponding to the first texture map in the terrain surface based on the normal vector of the terrain surface and the world space vector of the terrain surface; determining a first control parameter based on the first region, and correcting the first texture color of the first texture map based on the first control parameter and the region color corresponding to the first region to obtain a second texture map; and rendering the terrain surface based on the second texture map to obtain a topographic image. Through the application, efficient and realistic rendering of the terrain surface can be realized, the level of detail and natural integration of the terrain details in the topographic image obtained by rendering can be improved, and the cost of manually rendering the terrain surface is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to image compositing technology, and more particularly to a terrain rendering method, apparatus, device, computer-readable storage medium, and computer program product. Background Technology

[0002] In the process of generating terrain images, related technologies rely on artists to manually draw texture maps, which are then directly overlaid on the terrain surface to create textured terrain. However, the fixed styles and repetitive details of these manually drawn texture maps result in a severe lack of visual diversity, making it difficult to match the complex and varied terrain of the real world. This leads to a disconnect between the texture map and the terrain surface, ultimately resulting in extremely unnatural textured terrain.

[0003] In addition, related technologies often rely on manual determination of the area covered by texture map on the terrain surface or use geometric projection to determine it, ignoring the complex topological deformation and local semantic structure of the terrain surface. This often leads to a lack of spatial logic in the position of the texture map on the terrain surface and problems such as stretching deformation or edge misalignment. Summary of the Invention

[0004] This application provides a terrain rendering method, apparatus, device, computer-readable storage medium, and computer program product, which can improve the sense of layering and natural integration of terrain details in the rendered terrain image, and significantly reduce the cost of manually rendering terrain surfaces.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides a terrain rendering method, the method comprising: Based on the first world space coordinates of each first pixel on the terrain surface, a first terrain stripe is generated, and a first texture map corresponding to the first terrain stripe is obtained. Based on the normal vector of the terrain surface and the world space vector of the terrain surface, a first region in the terrain surface corresponding to the first texture map is determined; Based on the first region, a first control parameter is determined, and based on the first control parameter and the region color corresponding to the first region, the first texture color of the first texture map is corrected to obtain a second texture map. Based on the second texture map, the terrain surface is rendered to obtain a landform image.

[0006] This application provides a terrain rendering device, including: The generation module is used to generate a first terrain stripe based on the first world space coordinates of each first pixel on the terrain surface, and to obtain a first texture map corresponding to the first terrain stripe. The first region determination module is used to determine a first region in the terrain surface corresponding to the first texture map based on the normal vector of the terrain surface and the world space vector of the terrain surface; The color correction module is used to determine a first control parameter based on the first region, and to correct the first texture color of the first texture map based on the first control parameter and the region color corresponding to the first region to obtain a second texture map. The rendering module is used to render the terrain surface based on the second texture map to obtain a landform image.

[0007] In the above scheme, the generation module is further configured to perform the following processing on each first pixel on the terrain surface: rotate the first world space coordinates of the first pixel to obtain the second world space coordinates; update the second world space coordinates based on the first frequency to obtain the third world space coordinates; update the first ordinate corresponding to the second world space coordinates based on the third world space coordinates, the first amplitude, and the octave band parameter to obtain the second ordinate; combine the second ordinate and the first abscissa corresponding to the second world space coordinates to form the fourth world space coordinates of the first pixel; and use the graphic formed by the fourth world space coordinates of multiple first pixels as the first terrain stripe.

[0008] In the above scheme, the generation module is further configured to generate a first noise value based on the third-world spatial coordinates and the randomly generated first parameter; multiply the first noise value and the first amplitude to obtain a first product result; and fuse the first product result and the first ordinate based on the octave band parameter to obtain a second ordinate.

[0009] In the above scheme, the generation module is further configured to obtain the fractional part of the second abscissa corresponding to the third world spatial coordinates and the fractional part of the third ordinate corresponding to the third world spatial coordinates; perform smooth interpolation on the fractional part of the second abscissa and the fractional part of the third ordinate to obtain a first interpolation result; obtain the integer part of the second abscissa and the integer part of the third ordinate, and randomly generate a plurality of second parameters based on the integer part of the second abscissa, the integer part of the third ordinate and the first parameter; and perform bilinear interpolation on the first interpolation result based on the plurality of second parameters to obtain the first noise value.

[0010] In the above scheme, the generation module is further configured to perform the following processing for each second pixel on the first terrain stripe: based on the color edge smoothing parameter and the fourth ordinate corresponding to the second pixel, generate transition parameters for the third pixel corresponding to the second pixel that satisfy a first condition; wherein, the third pixel is at least one fourth pixel on the ordinate of the coordinate system that satisfies the first condition, the first condition being that the value of the fifth ordinate corresponding to the fourth pixel is not greater than a first value and not less than zero; based on the transition parameters of the second pixel for multiple third pixels, determine a first weight for each preset color corresponding to the second pixel; based on the first weight for each preset color corresponding to the second pixel, mix multiple preset colors to obtain a first texture color corresponding to the second pixel; based on multiple second pixels and the first texture colors corresponding to multiple second pixels, determine the first texture map.

[0011] In the above scheme, the module for determining the first region is further configured to perform the following processing for each first pixel on the terrain surface: determine the cosine value between the normal vector corresponding to the first pixel and the world space vector; when the cosine value is less than the second control parameter, determine that the first pixel has a texture label; and take the region formed by multiple first pixels with the texture label on the terrain surface as the first region.

[0012] In the above scheme, the module for determining the first region is also used to obtain a fourth parameter characterizing the material; based on the numerical range corresponding to the material, the fourth parameter is linearly interpolated to obtain the second control parameter.

[0013] In the above scheme, the color correction module is further configured to perform the following processing for each fifth pixel in the first region: determine the first control parameter corresponding to the fifth pixel based on the second control parameter, the cosine value corresponding to the fifth pixel, and the fifth parameter characterizing the degree of texture transition; mix the region color corresponding to the fifth pixel and the first texture color corresponding to the fifth pixel in the first texture map with the first control parameter corresponding to the fifth pixel as a constraint to obtain the second texture color corresponding to the fifth pixel; update the first texture color corresponding to the multiple fifth pixels in the first texture map based on the second texture colors corresponding to multiple fifth pixels to obtain the second texture map.

[0014] In the above scheme, the rendering module is further configured to obtain an ambient light occlusion map corresponding to the terrain surface; based on the ambient light occlusion map, to correct the brightness of the second texture color of the second texture map to obtain a third texture map; and to render the first region of the terrain surface based on the third texture map to obtain the landform image.

[0015] In the above scheme, the rendering module is further configured to perform the following processing for each sixth pixel in the ambient occlusion map: determine a sixth parameter based on the ray occlusion value and ray occlusion intensity corresponding to the sixth pixel in the ambient occlusion map; multiply the sixth parameter with the value corresponding to the second texture color of the sixth pixel in the second texture map to obtain a second product result; update the second texture color corresponding to multiple sixth pixels in the second texture map based on the second product results corresponding to multiple sixth pixels to obtain the third texture map.

[0016] In the above scheme, the rendering module is further configured to fuse the third texture color corresponding to the first region in the third texture map and the region color corresponding to the first region to obtain a fused color; perform lighting calculation on the fused color, and render the first region of the terrain surface based on the lighting calculation result to obtain the terrain image.

[0017] This application provides an electronic device, the electronic device comprising: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the terrain rendering method provided in the embodiments of this application.

[0018] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the terrain rendering method provided in this application when executed by a processor.

[0019] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the terrain rendering method provided in this application.

[0020] The embodiments of this application have the following beneficial effects: Based on the first world space coordinates of each first pixel on the terrain surface, a first terrain stripe is generated, and a first texture map corresponding to the first terrain stripe is obtained. Directly generating the first terrain stripe and the first texture map using the first world space coordinates automatically and accurately constructs geological features similar to natural rock strata deposition. This significantly reduces the artistic cost of manually drawing the first texture map and improves the automation level of first texture map generation. Based on the normal vector and the world space vector of the terrain surface, a first region corresponding to the first texture map is determined on the terrain surface. Through the geometric relationship between the normal vector and the world space vector, the slope and orientation of the terrain surface can be accurately identified, thereby automatically delineating the first region where the first texture map is applicable. This ensures that the first texture map only appears in the first region that conforms to physical laws, enhancing the rationality of the first texture map distribution. Based on the first region, a first control parameter is determined, and based on the first control parameter and the region color corresponding to the first region, the first texture color of the first texture map is corrected to obtain a second texture map. By correcting the generated first texture color using the region color of the first region itself and the first control parameter determined based on the first region, the resulting second texture map can blend into the overall environmental tone of the terrain surface, ensuring a high degree of uniformity and a natural, smooth transition between the colors of the second texture map and the terrain surface. Based on the second texture map, the terrain surface is rendered to obtain a landform image. This completes the final visual presentation of a high-quality 3D terrain image. Through world space coordinates and world space vectors, the automatic generation of texture maps and the automatic determination of the terrain surface region corresponding to the texture map are achieved, further ensuring the physical rationality and color harmony of the texture map under complex terrain surfaces, significantly improving the accuracy of terrain rendering. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the architecture of the terrain rendering system provided in the embodiments of this application; Figure 2 This is a schematic diagram of the terrain rendering device provided in the embodiments of this application; Figure 3 This is a schematic flowchart of the terrain rendering method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the process for generating the first terrain stripes provided in an embodiment of this application; Figure 5 This is a flowchart illustrating the process of determining the second ordinate according to an embodiment of this application; Figure 6 This is a schematic diagram of the process for determining the first texture map provided in an embodiment of this application; Figure 7 This is a schematic diagram of the process for determining the first region provided in an embodiment of this application; Figure 8This is a schematic diagram of the process for determining the second texture map provided in an embodiment of this application; Figure 9 This is a schematic diagram of the first process for rendering a terrain image according to an embodiment of this application; Figure 10 This is a schematic diagram of the process for determining the third texture map provided in an embodiment of this application; Figure 11 This is a schematic diagram of the second process for rendering a terrain image according to an embodiment of this application; Figure 12 This is a schematic diagram of the Danxia landform provided in the embodiments of this application; Figure 13 This is a schematic diagram of a manually drawn texture map provided in an embodiment of this application; Figure 14 This is a schematic diagram showing the stitching of texture maps from different regions provided in the embodiments of this application; Figure 15 This is a first schematic diagram of the method for generating terrain provided in the embodiments of this application; Figure 16 This is a second schematic diagram illustrating the method for generating terrain provided in this application embodiment; Figure 17 This is a schematic diagram of the landform generated by the related technology provided in the embodiments of this application; Figure 18 This is a schematic diagram of a texture map generated based on fractional Brownian motion according to an embodiment of this application; Figure 19 This is a schematic diagram of a texture map obtained based on fractional Brownian motion provided in an embodiment of this application; Figure 20 This is a schematic diagram of a texture map with color provided in an embodiment of this application; Figure 21 These are comparison images of sharp and soft color edges provided in the embodiments of this application; Figure 22 This is a schematic diagram of a mountain surface with a slope, provided in an embodiment of this application. Figure 23 This is a schematic diagram of the area where the texture map provided in the embodiments of this application appears on the terrain surface; Figure 24 This is a first rendering of the fusion of texture map and terrain surface provided in the embodiments of this application; Figure 25 This is a second effect image showing the fusion of texture map and terrain surface provided in the embodiments of this application; Figure 26 This is a third effect image of the fusion of texture map and terrain surface provided in the embodiments of this application; Figure 27 This is the fourth effect image of the fusion of texture map and terrain surface provided in the embodiments of this application.

[0022] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0025] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0026] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0027] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0028] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0029] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0030] (1) Berlin noise: It is a pseudo-random and spatially continuous smooth noise. The principle is to generate random values ​​with natural transitions by distributing random gradients at the grid vertices and performing smooth interpolation. It is used to simulate complex phenomena in nature that are both coherent and full of details, such as terrain undulations, clouds, flames, water waves and the texture of natural materials.

[0031] (2) Fractional Brownian Motion (FBM): is a procedural generation method that generates more complex and natural textures, such as mountain and cloud textures, by superimposing multiple Berlin noises of different frequencies and amplitudes.

[0032] (3) World Space Coordinate System: The world space coordinate system is a global three-dimensional reference system for a scene such as a terrain surface. It is used to represent the position and orientation of objects, vertices and light sources in a unified absolute coordinate system, that is, world space coordinates.

[0033] (4) Danxia landform: A unique geological landscape composed of red sandstone and conglomerate. It was sculpted by the combined effects of long-term crustal uplift, water erosion, weathering and erosion and gravity collapse. The surface of Danxia landform is often characterized by brightly colored red cliffs, isolated peaks and strange rocks.

[0034] (5) Ambient Occlusion Map: This is a grayscale map used in 3D rendering to enhance the sense of depth. It mainly simulates the degree of occlusion of the terrain surface by ambient light, and specifically generates soft transition shadows in areas that are not easily illuminated, such as gaps, wrinkles, and corners on the terrain surface. Through this local darkening process, the ambient occlusion map can significantly enhance the geometric depth, detail, and realistic volume of the 3D terrain surface without increasing the complexity of global illumination calculations.

[0035] In the process of generating terrain images, related technologies rely on artists to manually draw texture maps, which are then directly overlaid on the terrain surface to create textured terrain. However, the fixed styles and repetitive details of these manually drawn texture maps result in a severe lack of visual diversity, making it difficult to match the complex and varied terrain of the real world. This leads to a disconnect between the texture map and the terrain surface, ultimately resulting in extremely unnatural textured terrain.

[0036] In addition, related technologies often rely on manual determination of the area covered by texture map on the terrain surface or use geometric projection to determine it, ignoring the complex topological deformation and local semantic structure of the terrain surface. This often leads to a lack of spatial logic in the position of the texture map on the terrain surface and problems such as stretching deformation or edge misalignment.

[0037] This application provides a terrain rendering method, apparatus, device, computer-readable storage medium, and computer program product, which can improve the sense of layering and natural integration of terrain details in the rendered terrain image, and significantly reduce the cost of manually rendering terrain surfaces. The following describes an exemplary application of the server device provided in this application. The server device provided in this application can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and vehicle terminals, or it can be implemented as a server. The following will describe an exemplary application when the device is implemented as a server.

[0038] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the terrain rendering system provided in this application embodiment. To support a terrain rendering application, in the terrain rendering system 100, the terminal 400 connects to the server 200 via a network 300. The network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both. The server 200 obtains the first world space coordinates of each first pixel on the terrain surface, the normal vector of the terrain surface, the world space vector of the terrain surface, and the region color corresponding to the first region from the database 500. The server 200 executes the terrain rendering method provided in this application embodiment, and the server 200 uploads the obtained terrain image to the network 300. The network 300 uploads the terrain image to the terminal 400 and displays it on the terminal 400. The server 200 uploads the first terrain stripe, the first texture map corresponding to the first terrain stripe, the first region on the terrain surface corresponding to the first texture map, the second texture map, and the terrain image to the database 500.

[0039] Server 200 generates first terrain stripes based on the first world space coordinates of each first pixel on the terrain surface and obtains a first texture map corresponding to the first terrain stripes. Server 200 determines a first region on the terrain surface corresponding to the first texture map based on the normal vector and the world space vector of the terrain surface. Server 200 determines first control parameters based on the first region and corrects the first texture color of the first texture map based on the first control parameters and the region color corresponding to the first region to obtain a second texture map. Server 200 renders the terrain surface based on the second texture map to obtain a landform image. Server 200 sends the landform image to terminal 400 for display.

[0040] In some embodiments, in open-world adventure games, it is necessary to automatically generate realistic rock textures (second texture maps) for tens of thousands of square kilometers of mountains and plateaus (terrain surfaces). As the player moves across the map, the rendering engine renders and displays the rendered terrain image in real time. Specifically, based on the first world space coordinates of each first pixel on the terrain surface, a first terrain stripe is generated, and a first texture map corresponding to the first terrain stripe is obtained. Based on the normal vector and world space vector of the terrain surface, a first region corresponding to the first texture map is determined on the terrain surface. Based on the first region, a first control parameter is determined, and based on the first control parameter and the region color corresponding to the first region, the first texture color of the first texture map is corrected to obtain a second texture map. Based on the second texture map, the terrain surface is rendered to obtain a terrain image. In this way, a first region with a steep slope can be automatically identified, and the second texture map can be integrated into the first region. The resulting terrain image not only greatly improves the realism of the geological landscape but also ensures that terrain features transition naturally with terrain undulations.

[0041] In some embodiments, surveying data can be used to construct high-precision digital twins of landforms to simulate forest cover and soil erosion. To visually display landforms at different altitudes and slopes, a first terrain stripe can be generated based on the first world space coordinates of each first pixel on the terrain surface, and a first texture map corresponding to the first terrain stripe can be obtained. Based on the normal vector and world space vector of the terrain surface, a first region corresponding to the first texture map in the terrain surface is determined. Based on the first region, a first control parameter is determined, and based on the first control parameter and the region color corresponding to the first region, the first texture color of the first texture map is corrected to obtain a second texture map. Based on the second texture map, the terrain surface is rendered to obtain a landform image. The obtained landform image allows researchers to clearly observe that the second texture map appears in the first region of the terrain surface, for example, the first region of the terrain surface may show Danxia landforms; while in non-first regions of the terrain surface, the second texture map does not appear. The rendered landform image can provide highly valuable visual evidence for analyzing the evolution of landforms.

[0042] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0043] See Figure 2 , Figure 2 This is a schematic diagram of the terrain rendering apparatus provided in an embodiment of this application. The server 200 includes at least one processor 210, a memory 250, at least one network interface 220, and a user interface 230. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 2 The general labeled all buses as Bus System 240.

[0044] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0045] User interface 230 includes one or more output devices 231 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0046] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.

[0047] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.

[0048] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0049] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc. Presentation module 253 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 231 associated with user interface 230 (e.g., a display screen, a speaker, etc.). The input processing module 254 is used to detect and translate one or more user inputs or interactions from one or more input devices 232.

[0050] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A terrain rendering apparatus 255 stored in memory 250 is shown. This apparatus can be software in the form of programs and plugins, and includes the following software modules: a generation module 2551, a first region determination module 2552, a color correction module 2553, and a rendering module 2554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0051] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the terrain rendering method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0052] In some embodiments, the terminal or server can implement the terrain rendering method provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0053] The terrain rendering method provided in this application will be described in conjunction with exemplary applications and implementations of the server provided in the embodiments of this application.

[0054] The terrain rendering method provided in the embodiments of this application will be described below. As mentioned above, the electronic device implementing the terrain rendering method of the embodiments of this application can be a terminal, a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.

[0055] See Figure 3 , Figure 3 This is a flowchart illustrating the terrain rendering method provided in this application embodiment, which will be combined with... Figure 3 The steps shown are explained below. Figure 3 The main component of the process is the server.

[0056] In step 101, a first terrain stripe is generated based on the first world space coordinates of each first pixel on the terrain surface.

[0057] In some embodiments, see Figure 4 , Figure 4 This is a schematic diagram of the process for generating the first terrain stripes provided in an embodiment of this application; Figure 3 Step 101 shown can be implemented through steps 1011 to 1015 below, in conjunction with the following... Figure 4 The following explanation is provided. It should be noted that steps 1011 to 1014 are performed for each of the first pixels on the terrain surface.

[0058] In step 1011, the first world space coordinates of the first pixel are rotated to obtain the second world space coordinates.

[0059] As an example, first-world spatial coordinates for Define aspect ratio variable This means assuming the area displaying the first pixel is a square, the rotation control value... , usually arrive Floating-point numbers between, and scaling factor The first step is to calculate the rotation angle conversion: [The input...] The control value is converted to radians. The formula for calculating radians is shown in the following formula (1).

[0060] (1) in, In radians, For the rotation control value, formula (1) will be from arrive The linear rotation control value is mapped to arrive The first step is to adjust the aspect ratio. The first step is to adjust the aspect ratio to prevent stretching during rotation in non-square regions. The sixth ordinate Preprocessing is performed, and the formula for preprocessing is shown in formula (2) below.

[0061] (2) in, For first-world spatial coordinates The sixth ordinate The seventh ordinate obtained after preprocessing. As the aspect ratio variable, since Formula (2) does not mathematically change the world space coordinates. The sixth ordinate The corresponding numerical value exists only as a placeholder to ensure that when Not for This allows for the maintenance of uniform rotation. The first-world spatial coordinates at this point... Transform into Fifth World Space Coordinates The third step is to offset the coordinate system center, using the default fifth-world space coordinates. The origin of rotation is located at If you rotate directly, the fifth-world space coordinates will rotate around the origin. To rotate around the center of the area displaying the fifth-world space coordinates, you need to offset the center of the fifth-world space coordinates to obtain the offset sixth-world space coordinates. Sixth World Spatial Coordinates The origin of rotation is located at The fourth step is to perform a rotation matrix transformation, which is done through rotation matrix multiplication based on radians. ,by For the origin of rotation relative to the sixth world space coordinates Rotate to obtain the seventh world space coordinates. ,in, It is the third horizontal axis The fourth x-coordinate after rotation It is the eighth ordinate The ninth ordinate after rotation. After rotation, the seventh world space coordinate needs to be moved back to its original position, resulting in the eighth world space coordinate. If this is not done, the seventh world spatial coordinates will be calculated. This may contain negative numbers, potentially leading to sampling errors. This step ensures that the seventh-world spatial coordinates return to the normal sampling range. The fifth step is scaling and tiling, which applies the eighth-world spatial coordinates... With scaling factor Multiply to obtain the second world space coordinates. .if The area displaying the first pixel remains unchanged in size. If The area displaying the first pixel will be expanded to This means that the texture of the area displaying the first pixel will be repeatedly tiled on the surface. Secondly, the texture appears more fine.

[0062] In step 1012, the second world space coordinates are updated based on the first frequency to obtain the third world space coordinates.

[0063] As an example, the formula for calculating Third World spatial coordinates is shown in formula (3) below.

[0064] (3) Among them, Third World spatial coordinates Second World Spatial Coordinates , This is the first frequency.

[0065] In step 1013, based on the third world spatial coordinates, the first amplitude, and the octave band parameter, the first ordinate corresponding to the second world spatial coordinates is updated to obtain the second ordinate.

[0066] In some embodiments, see Figure 5 , Figure 5 This is a flowchart illustrating the process of determining the second ordinate according to an embodiment of this application; Figure 4 Step 1013 shown can be implemented through steps 1013A to 1013C as described below. Figure 5 Please provide an explanation.

[0067] In step 1013A, a first noise value is generated based on the third-world spatial coordinates and the randomly generated first parameter.

[0068] In some embodiments, step 1013A can be implemented by the following technical solution: obtaining the fractional part of the second abscissa corresponding to the third world spatial coordinates and the fractional part of the third ordinate corresponding to the third world spatial coordinates; performing smooth interpolation on the fractional part of the second abscissa and the fractional part of the third ordinate to obtain a first interpolation result; obtaining the integer part of the second abscissa and the integer part of the third ordinate, and randomly generating a plurality of second parameters based on the integer part of the second abscissa, the integer part of the third ordinate, and the first parameter; performing bilinear interpolation on the first interpolation result based on the plurality of second parameters to obtain the first noise value.

[0069] As an example, third-world spatial coordinates , Let the second x-coordinate be the spatial coordinate of the Third World. Then the decimal part of the second abscissa corresponding to the third world spatial coordinates The integer part of the second x-coordinate ; The third ordinate corresponding to the third world spatial coordinates, assuming Then the decimal part of the third ordinate corresponding to the third world spatial coordinates The integer part of the third ordinate The calculation formula for smooth interpolation is shown in formula (4) below.

[0070] (4) in, First interpolation result , , The calculation formula for randomly generating multiple second parameters based on the integer part of the second horizontal coordinate, the integer part of the third vertical coordinate, and the first parameter is shown in the following formula (5).

[0071] (5) Among them, the Ninth World Spatial Coordinates The first parameter , Yes Perform a sine transformation. Is to acquire The integer part, which is the final second parameter. It is in coordinate form. That is... , , Based on different first parameters, multiple second parameters can be obtained. The first parameter is... The second parameter obtained at that time is The first parameter is The second parameter obtained at that time is The first parameter is The second parameter obtained at that time is The first parameter is The second parameter obtained at that time is The first interpolation result is based on multiple second parameters. Perform bilinear interpolation to obtain the first noise value. The calculation formula is shown in the following formula (6).

[0072] (6) in, The first noise value, It is a bilinear interpolation function. The calculation formula for bilinear interpolation is shown in formula (7) below.

[0073] (7) in, , , .

[0074] Through the embodiments of this application, smooth interpolation is performed using the decimal part of the coordinates, ensuring a smooth transition of the first noise between pixels and avoiding abrupt changes in coordinate values ​​that cause the rendered terrain image to have a mosaic-like appearance. Bilinear interpolation further smooths the distribution of random factors in two-dimensional space, ensuring the continuity of the generation of the first noise value from the underlying algorithm. This makes the edges of the first terrain stripes determined based on the first noise value rounded and the transition natural, solving the common problems of creases or jagged edges in terrain rendering. This ensures that even under close observation, the rock texture in the rendered terrain image still maintains a delicate and smooth visual quality.

[0075] In step 1013B, the first noise value and the first amplitude are multiplied to obtain the first product result.

[0076] As an example, the calculation formula for multiplying the first noise value and the first amplitude is shown in the following formula (8).

[0077] (8) in, This is the result of the first product. The first noise value, This is the first amplitude.

[0078] In step 1013C, based on the octave band parameter, the first product result and the first ordinate are fused to obtain the second ordinate.

[0079] As an example, the formula for calculating the second ordinate is shown in formula (9) below.

[0080] (9) in, The second ordinate, This is the result of the first product. It is the first ordinate. It is an octave band parameter. When When, the second ordinate can be obtained through the above formula (9), when , At that time, the first frequency in the above formula (3) Need to expand The first amplitude in the above formula (8) is times the previous amplitude. Need to be reduced times.

[0081] In this embodiment, a first noise value with pseudo-random characteristics is generated by randomly assigning a first parameter. Then, the influence of the first noise value on the first vertical axis is adjusted using a first amplitude, simulating the unevenness of sedimentation in nature. This causes the width and depth of the generated terrain stripes to exhibit random fluctuations. The effect is that it breaks the regularity generated by purely mathematical formulas, producing terrain stripes similar to the undulating patterns of real weathered rock strata. This makes the rendered landform image more realistic in detail and effectively eliminates artificial traces.

[0082] See also Figure 4 In step 1014, the second vertical coordinate and the first horizontal coordinate corresponding to the second world space coordinate are combined to form the fourth world space coordinate of the first pixel.

[0083] As an example, second-world spatial coordinates The second ordinate is The first abscissa corresponding to the second world spatial coordinates is The fourth world space coordinates of the first pixel are obtained. .

[0084] In step 1015, the pattern formed by the fourth world space coordinates of multiple first pixels is used as the first terrain stripe.

[0085] As an example, each first pixel has a corresponding fourth world space coordinate. The pattern formed by multiple fourth world space coordinates in the coordinate system is the first terrain stripe. For example, if the pattern formed by multiple fourth world space coordinates in the coordinate system is a sine wave, then the sine wave is the first terrain stripe.

[0086] In this embodiment, the first world spatial coordinates are rotated to give the first topographic stripe geological layer a controllable tilt angle, meeting the needs of different geological structures. Subsequently, a first frequency, a first amplitude, and octave band parameters are introduced to perturb the second world spatial coordinates, simulating the rock layer compression and deformation caused by crustal movement. This topographic stripe generation method based on world spatial coordinate transformation makes the generated first topographic stripes no longer a simple flat surface, but a graphic with complex topological features, which not only conforms to the macroscopic geological trend but also has rich microscopic details, enhancing the visual diversity of the rendered landform image.

[0087] See also Figure 3 In step 102, a first texture map corresponding to the first terrain stripe is obtained.

[0088] In some embodiments, see Figure 6 , Figure 6 This is a schematic diagram of the process for determining the first texture map provided in an embodiment of this application; Figure 3Step 102 shown can be implemented through steps 1021 to 1024 below, in conjunction with the following... Figure 6 The following explanation is provided. It should be noted that steps 1021 to 1023 are performed for each second pixel on the first terrain stripe.

[0089] In step 1021, based on the color edge smoothing parameter and the fourth ordinate corresponding to the second pixel, the transition parameter of the third pixel corresponding to the second pixel that satisfies the first condition is generated.

[0090] As an example, the third pixel is at least one fourth pixel on the vertical axis of the coordinate system that satisfies the first condition. The first condition is that the value of the fifth vertical coordinate corresponding to the fourth pixel is not greater than a first value, such as 1, and not less than zero. That is, the value range of the vertical coordinate corresponding to the third pixel is [0,1]. First, the fourth vertical coordinate needs to be... The corresponding values ​​are normalized to obtain the normalized fourth ordinate. The value range is [0,1]. The color edge smoothing parameter is used to control whether the transition between two colors is sharp or smooth. The larger the value of the color edge smoothing parameter, the smoother the transition at the boundary between two colors. In other words, the smoothness of the transition at the boundary between two colors is directly proportional to the value of the color edge smoothing parameter. The third pixel will be on the vertical axis... arrive To segment the space, it is necessary to obtain the ordinate of the world space coordinates of multiple third pixels. The formula for determining the transition parameters is shown in formula (10) below.

[0091] (10) in, The second pixel corresponds to the first Transition parameters for the third pixel For the first The ordinate of the world space coordinates of the third pixel. For color edge smoothing parameters, The fourth ordinate after normalization. The process of determining the transition parameters is as follows: when Less than hour, ,when Greater than hour, ,when Not less than and not greater than hour, .

[0092] In step 1022, based on the transition parameters of the second pixel for the plurality of third pixels, a first weight corresponding to each preset color of the second pixel is determined.

[0093] As an example, the formula for determining the first weight of the second pixel for each preset color is shown in the following formula (11).

[0094] (11) in, There are a total of A preset color, specified , , The second pixel corresponds to the first Transition parameters for the third pixel The second pixel corresponds to the first The first weight of a preset color. For example, when When it is 1, ,when When it is 2, ,when When it is N, .

[0095] In step 1023, based on the first weight of each preset color corresponding to the second pixel, multiple preset colors are mixed to obtain the first texture color corresponding to the second pixel.

[0096] As an example, the formula for calculating color mixing is shown in formula (12) below.

[0097] (12) in, This is the numerical value corresponding to the first texture color. For the first The first weight of a preset color For the first The numerical values ​​corresponding to each preset color. This represents the total number of preset colors. For example, the first preset color has a value of 20, the second pixel's weight corresponding to the first preset color is 0.5, and the second preset color has a value of 30, the second pixel's weight corresponding to the second preset color is 0.5, thus resulting in the first texture color. The corresponding value is 25.

[0098] In step 1024, the first texture map is determined based on the plurality of second pixels and the first texture color corresponding to the plurality of second pixels.

[0099] As an example, in the first terrain stripe, each second pixel corresponds to the first texture color. Filling the second pixels in the first terrain stripe with the first texture color yields the first texture map, which is the first terrain stripe with the first texture color. For instance, assuming that multiple second pixels correspond to blue as the first texture color, filling the second pixels in the first terrain stripe with blue will result in the first texture map showing the blue first terrain stripe.

[0100] In this embodiment, a mathematical relationship is established between the fourth ordinate of each second pixel on the first terrain stripe and a color edge smoothing parameter. A first weight corresponding to multiple preset colors is calculated for each second pixel. Based on this first weight, the first texture color corresponding to the second pixel can be accurately determined. This mechanism simulates the color changes caused by different mineral contents in complex rock layers such as Danxia landforms. Based on multiple second pixels and their corresponding first texture colors, the determined first texture map can possess a sedimentary layer texture with extremely high color complexity, and the transitions between colors can be precisely controlled by the color edge smoothing parameter. This can enhance the artistic expressiveness of the rendered terrain image and reproduce the layered and staggered color landscape of the real world.

[0101] See also Figure 3 In step 103, based on the normal vector of the terrain surface and the world space vector of the terrain surface, a first region in the terrain surface corresponding to the first texture map is determined.

[0102] In some embodiments, see Figure 7 , Figure 7 This is a schematic diagram of the process for determining the first region provided in an embodiment of this application; Figure 3 Step 103 shown can be implemented through steps 1031 to 1033 below, in conjunction with the following... Figure 7 The following explanation is provided. It should be noted that steps 1031 to 1032 are performed for each first pixel on the terrain surface.

[0103] In step 1031, the cosine value between the normal vector corresponding to the first pixel and the world space vector is determined.

[0104] As an example, suppose the normal vector corresponding to the first pixel is The world space vector is The formula for determining the cosine value is shown in the following formula (13).

[0105] (13) in, The dot product between the normal vector corresponding to the first pixel and the world space vector is given. The length of the normal vector corresponding to the first pixel. This represents the length of the world space vector. The world space vector is typically (0,1,0). The cosine value ranges from [-1,1]. When the cosine value is 1, the terrain surface corresponding to the first pixel is flat ground or a mountaintop; when the cosine value is 0, the terrain surface corresponding to the first pixel is a vertical cliff; and when the cosine value is -1, the terrain surface corresponding to the first pixel is an overhanging cliff.

[0106] In step 1032, when the cosine value is less than the second control parameter, it is determined that the first pixel has a texture label.

[0107] As an example, when the cosine value is less than the second control parameter, it indicates that the terrain surface corresponding to the first pixel can exhibit texture, meaning the first pixel has a texture label. For instance, if the cosine value is 0 and the second control parameter is 1, the cosine value is less than the second control parameter, and the first pixel corresponding to a cosine value of 0 is a pixel with a texture label.

[0108] In some embodiments, the second control parameter can be determined by the following technical solution: obtaining a fourth parameter characterizing the material; and performing linear interpolation on the fourth parameter based on the numerical range corresponding to the material to obtain the second control parameter.

[0109] As an example, the numerical range of the material is [-1, 1], and the calculation formula for linear interpolation is shown in the following formula (14).

[0110] (14) in, This is the second control parameter. , , This is the fourth parameter, and its value range is usually [0,1]. When the second control parameter = 1, if the cosine value is 0, the terrain surface corresponding to the first pixel is a vertical cliff, and the cosine value is less than the second control parameter, so the first pixel is determined to have a texture label. When the second control parameter = 0, the first pixel with a cosine value of -1 has a texture label, and the terrain surface corresponding to the first pixel is a cliff edge. When the second control parameter = -1, since the cosine value ranges from [-1,1], meaning the cosine value will never be less than the second control parameter, the first pixel does not have a texture label.

[0111] This application's embodiments transform abstract materials into quantifiable numerical ranges, and utilize linear interpolation to establish a mapping relationship from materials to a second control parameter. This provides artists with an intuitive interactive interface, enabling fine-tuning of the distribution range of the first texture map. By changing a single second control parameter, the coverage of the first texture map on different material terrain surfaces can be dynamically controlled, improving flexibility and scalability, and allowing for rapid switching and rendering of various terrain surface styles, from Gobi Desert and barren lands to towering mountains.

[0112] In step 1033, the region formed by multiple first pixels with the texture label on the terrain surface is taken as the first region.

[0113] As an example, the terrain surface is composed of multiple first pixels. The texture will only appear on the terrain surface corresponding to the first pixel with the texture label. The area formed by the multiple first pixels with the texture label in the terrain surface can be regarded as the first region, that is, the texture will appear in the first region of the terrain surface. For example, if both first pixel A and first pixel B have texture labels, then the first region of the terrain surface is composed of the terrain surface corresponding to first pixel A and the terrain surface corresponding to first pixel B.

[0114] In this embodiment, the normal vector of the first pixel represents the orientation of the terrain surface. By calculating the cosine value of the normal vector with respect to the vertical direction (i.e., the world space vector), the slope of the terrain to which the first pixel belongs can be directly quantified. When the cosine value is less than the second control parameter, it is determined that the first pixel has a texture label, indicating that the terrain surface corresponding to the first pixel has a large slope, which conforms to the natural logic of exposed sedimentary rock layers. Multiple first pixels with texture labels form a first region. By identifying the first region, the complex first texture map can be automatically restricted to logically reasonable areas such as cliffs and steep slopes, while the original material of the terrain surface is preserved in plains or mountaintops. This ensures the geographical logic correctness of the rendered landform image and enhances the realism and credibility of the virtual scene.

[0115] See also Figure 3 In step 104, a first control parameter is determined based on the first region, and the first texture color of the first texture map is corrected based on the first control parameter and the region color corresponding to the first region to obtain a second texture map.

[0116] In some embodiments, see Figure 8 , Figure 8 This is a schematic diagram of the process for determining the second texture map provided in an embodiment of this application; Figure 3 Step 104 shown can be implemented through steps 1041 to 1043 below, in conjunction with the following. Figure 8The following explanation is provided. It should be noted that steps 1041 to 1042 are performed for each fifth pixel in the first region.

[0117] In step 1041, the first control parameter corresponding to the fifth pixel is determined based on the second control parameter, the cosine value corresponding to the fifth pixel, and the fifth parameter characterizing the degree of texture transition.

[0118] As an example, the formula for calculating the first control parameter is shown in the following formula (15).

[0119] (15) in, The first control parameter, This is the second control parameter. The cosine value corresponding to the fifth pixel. The fifth parameter is a random number other than 0. The value of the fifth parameter is positively correlated with the degree of texture transition. The larger the value of the fifth parameter, the more intense the texture transition, which means that the texture edges are clearer and the transition is crisper. The smaller the value of the fifth parameter, the smoother the texture transition, which means that the texture edges are blurred, the connection is natural and has a soft transition with a real sense of ecological penetration. Its underlying calculation logic lies in the control mechanism of division scaling on bilinear interpolation in formula (16) in formula (15). When the fifth parameter ( The larger the value of the fifth parameter, the more it will compress the difference between the second control parameter and the cosine value, resulting in a decrease in the calculated value of the first control parameter. The value of the first control parameter increases extremely slowly and is generally low. When performing color mixing according to formula (16), this first control parameter, which increases extremely slowly and is generally low, will make the second texture color corresponding to the fifth pixel point closer to the area color corresponding to the fifth pixel point, making it difficult to generate a delicate intermediate transition color level; only when the terrain slope of the surface changes greatly will the texture visually present a sharp edge and crisp transition effect. Conversely, when the value of the fifth parameter is smaller, the fifth parameter as the denominator will significantly amplify the difference between the second control parameter and the cosine value, making the first control parameter ( The numerical growth is faster and the overall value is higher. When performing color mixing in formula (16), the first control parameter with faster numerical growth and higher overall value will make the second texture color corresponding to the fifth pixel point closer to the first texture color corresponding to the fifth pixel point. It can fully render countless intermediate mixing states between the area color and the first texture color, thereby stretching the visual fusion zone in space and presenting a soft transition effect with blurred texture edges, natural connection and real ecological penetration.

[0120] In step 1042, the region color corresponding to the fifth pixel and the first texture color corresponding to the fifth pixel in the first texture map are mixed, with the first control parameter corresponding to the fifth pixel as a constraint, to obtain the second texture color corresponding to the fifth pixel.

[0121] As an example, the formula for calculating the second texture color is shown in formula (16) below.

[0122] (16) in, The fifth pixel The value of the first texture color corresponding to the first texture map. The fifth pixel The corresponding value of the second texture color. The fifth pixel The corresponding area color, The fifth pixel The corresponding first control parameter is that the above mixture is a bilinear interpolation. The process of bilinear interpolation is described in Formula (17) below.

[0123] (17) in, , , .

[0124] In step 1043, based on the second texture color corresponding to the plurality of fifth pixels, the first texture color corresponding to the plurality of fifth pixels in the first texture map is updated to obtain the second texture map.

[0125] As an example, for each fifth pixel, assuming the second texture color corresponding to the fifth pixel is blue, and the first texture color corresponding to the fifth pixel in the first texture map is green, the update is to change the fifth pixel in the first texture map from green to blue. After traversing and updating all the fifth pixels in the first region, the second texture map is obtained. At this time, the color of the fifth pixel in the second texture map is blue, which is the second texture color.

[0126] Through the embodiments of this application, a non-uniform fusion of the first texture color and the area color is achieved within a first region using a first control parameter, eliminating the texture mapping effect between the second texture map and the terrain surface. By fusing the area color with the first texture color of the generated first texture map, and dynamically adjusting the ratio of the fused first texture color to the area color according to a fifth parameter characterizing the texture transition degree, the second texture color of the resulting second texture map achieves seamless nesting with the first region of the terrain surface. This ensures that the rendered terrain image maintains a high degree of uniformity in lighting and hue, significantly enhancing the immersive experience of the scene.

[0127] See also Figure 3 In step 105, the terrain surface is rendered based on the second texture map to obtain a landform image.

[0128] In some embodiments, see Figure 9 , Figure 9 This is a schematic diagram of the first process for rendering a terrain image according to an embodiment of this application; Figure 3 Step 105 shown can be implemented through steps 1051 to 1053 below, in conjunction with the following. Figure 9 Please provide an explanation.

[0129] In step 1051, an ambient light occlusion map corresponding to the terrain surface is obtained.

[0130] As an example, an ambient occlusion map is a grayscale map specifically designed to enhance the three-dimensional effect. Its core function is to simulate the degree to which terrain surfaces block ambient light. On a specific terrain surface, the ambient occlusion map can accurately identify and mark areas that are difficult for direct light to reach, such as gaps between rock layers, folds in mountains, and deep corners. Adjusting the second texture map based on the ambient occlusion map can significantly enhance its geometric depth and detail without increasing complex global illumination calculations. This transforms the originally flat second texture map into a visually appealing image with varying shades and layers, greatly improving the realism of the terrain rendering.

[0131] In step 1052, based on the ambient light occlusion map, the brightness of the second texture color of the second texture map is corrected to obtain the third texture map.

[0132] In some embodiments, see Figure 10 , Figure 10 This is a schematic diagram of the process for determining the third texture map provided in an embodiment of this application; Figure 9 Step 1052 shown can be implemented through steps 1052A to 1052C as described below. Figure 10 The following explanation is provided. It should be noted that steps 1052A to 1052B are performed for each sixth pixel in the ambient light occlusion map.

[0133] In step 1052A, the sixth parameter is determined based on the light occlusion value and light occlusion intensity corresponding to the sixth pixel in the ambient light occlusion map.

[0134] As an example, the formula for determining the sixth parameter is shown in formula (18) below.

[0135] (18) in, The sixth parameter, It is the sixth pixel. The corresponding ray occlusion value in the ambient occlusion map is obtained by sampling the ambient occlusion map. It refers to the light shading intensity, which can be customized.

[0136] In step 1052B, the sixth parameter is multiplied with the value corresponding to the second texture color of the sixth pixel in the second texture map to obtain the second product result.

[0137] As an example, the formula for calculating the second product result is shown in formula (19) below.

[0138] (19) in, This is the result of the second product. This is the value corresponding to the second texture color of the sixth pixel in the second texture map. This is the sixth parameter.

[0139] In step 1052C, the second texture color corresponding to the sixth pixel in the second texture map is updated based on the second product result corresponding to the sixth pixel to obtain the third texture map.

[0140] As an example, the second product result obtained in step 1052B is the value corresponding to the updated texture color of the sixth pixel. Updating the second texture color of the second texture map based on the second product results corresponding to multiple sixth pixels involves modifying the value of the second texture color corresponding to the sixth pixel in the second texture map to the second product result corresponding to the sixth pixel. This update is performed on all sixth pixels in the second texture map, and finally, a third texture map is obtained. The value of the texture color corresponding to the sixth pixel in the third texture map is the second product result.

[0141] Through the embodiments of this application, since the ambient light occlusion map is essentially a grayscale map reflecting the degree of light occlusion caused by the microstructure of the terrain, such as cracks, folds, and corners, combining the light occlusion value and the light occlusion intensity, the attenuation law of light in complex rock strata fissures can be accurately simulated, i.e., the second product result. Multiplying the second product result directly with the value corresponding to the second texture color essentially performs pixel-level brightness correction on the second texture color of the second texture map without increasing the performance-intensive global illumination calculation. The resulting third texture map can automatically and accurately generate weak shadows and fade-in / fade-out brightness contrasts in depressions and cracks, improving the three-dimensionality of the third texture map.

[0142] See also Figure 9 In step 1053, the first region of the terrain surface is rendered based on the third texture map to obtain the terrain image.

[0143] In some embodiments, see Figure 11 , Figure 11 This is a schematic diagram of the second process for rendering a terrain image according to an embodiment of this application; Figure 9 Step 1053 shown can be implemented through steps 1053A to 1053B as described below. Figure 11 Please provide an explanation.

[0144] In step 1053A, the third texture color corresponding to the first region in the third texture map and the region color corresponding to the first region are merged to obtain a merged color.

[0145] As an example, the formula for calculating the blended color is shown in the following formula (20).

[0146] (20) in, It is the numerical value corresponding to the blended color. This is the numerical value corresponding to the color of the first region. This refers to the value corresponding to the third texture color of the first region in the third texture map. These are the blending control parameters, used to control the proportion of the region color corresponding to the first region and the third texture color corresponding to the first region in the final blended color. The above blending is a bilinear interpolation. The process of bilinear interpolation is described in Formula (21) below.

[0147] (twenty one) in, , , .

[0148] In step 1053B, lighting calculations are performed on the blended colors, and the first region of the terrain surface is rendered based on the lighting calculation results to obtain the terrain image.

[0149] As an example, assume the current virtual scene is set to dusk, with the main light source being a warm-toned sunset. In step 1053B, the rendering engine uses the blended color obtained in the previous steps as the base color for the rock material and inputs it into the shader to perform real-time global or local lighting calculations. During this process, the incident angle of the sunset sunlight, the intensity of the light source, and the normal orientation and material roughness of the first area's terrain surface are all considered. After calculation by the physically based lighting model, the sunlit Danxia cliffs, facing the sunset, will reflect a warm, bright, and rough rock luster in conjunction with the blended color; while the deep, backlit ravines, lacking direct light, will present deep, natural shadows. Finally, based on the lighting calculation results including dynamic shading, reflection, and shadows, the first area of ​​the terrain surface is rendered pixel-wise, resulting in a richly layered, physically realistic, and highly immersive landscape image.

[0150] Through the embodiments of this application, the modified third texture color is blended with the corresponding area color of the first region to obtain a blended color, which can achieve an extremely smooth and natural gradient transition at the boundary between two distinctly different terrains. Lighting calculations are performed on the blended color and the final rendering is completed, significantly improving the natural blending and physical realism of the generated terrain image with the real environment. Lighting calculations ensure that the rendered terrain image can correctly respond to sunlight, dynamic light sources, and material roughness in the virtual world, making the terrain image more realistic.

[0151] Through the embodiments of this application, the light occlusion information of the terrain surface, i.e., the ambient light occlusion map, is obtained. This ambient light occlusion map is used as a correction factor to adjust the brightness of the second texture color in the second texture map. The resulting third texture map enhances the shadow representation in gaps and folds. Without increasing large-scale global illumination calculations, the three-dimensionality of the third texture map is enhanced procedurally. This gives the rock layer details in the terrain image a greater sense of depth and volume, especially in areas with complex terrain undulations, where strong contrasts in light and dark can be generated by simulating local shadows, thereby significantly enhancing the three-dimensional layering of the terrain image.

[0152] In this embodiment, a first terrain stripe is generated based on the first world space coordinates of each first pixel on the terrain surface, and a first texture map corresponding to the first terrain stripe is obtained. By directly generating the first terrain stripe and the first texture map using the first world space coordinates, geological features resembling natural rock strata deposition can be automatically and accurately constructed. This significantly reduces the artistic cost of manually drawing the first texture map and improves the automation level of first texture map generation. Based on the normal vector and the world space vector of the terrain surface, a first region corresponding to the first texture map in the terrain surface is determined. Through the geometric relationship between the normal vector and the world space vector, the slope and orientation of the terrain surface can be accurately identified, thereby automatically delineating the first region applicable to the first texture map. This ensures that the first texture map only appears in the first region that conforms to physical laws, enhancing the rationality of the first texture map distribution. Based on the first region, a first control parameter is determined, and based on the first control parameter and the region color corresponding to the first region, the first texture color of the first texture map is corrected to obtain a second texture map. By correcting the generated first texture color using the region color of the first region itself and the first control parameter determined based on the first region, the resulting second texture map can blend into the overall environmental tone of the terrain surface, ensuring a high degree of uniformity and a natural, smooth transition between the colors of the second texture map and the terrain surface. Based on the second texture map, the terrain surface is rendered to obtain a landform image. This completes the final visual presentation of a high-quality 3D terrain image. Through world space coordinates and world space vectors, the automatic generation of texture maps and the automatic determination of the terrain surface region corresponding to the texture map are achieved, further ensuring the physical rationality and color harmony of the texture map under complex terrain surfaces, significantly improving the accuracy of terrain rendering.

[0153] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0154] In today's wave of games pursuing the ultimate experience, the construction of virtual world terrain has moved beyond simple functional terrain, no longer limited to the basic needs of "walkable and interactive." Unique and spectacular natural landscapes are becoming core elements for enhancing game quality and strengthening immersion, and are also key tools for game developers to create differentiated competitiveness. From the vast worlds of open-world games to the scene creation of linear narrative games, the use of special terrain is redefining how players interact with the virtual world, making every exploration full of unknowns and surprises. Special terrain is far more than just visual embellishment; it is an important element deeply integrated into the game design system, its value permeating the three core dimensions of realism, playability, and memorable moments, comprehensively empowering the upgrade of the game experience.

[0155] In terms of authenticity, these unique terrains are not fabricated out of thin air, but are deeply rooted in real geological laws. Whether it is the red rock walls of Danxia landform, the wind-eroded ridges of Yardang landform, or the cave peaks of karst landform, they all restore the formation logic and visual characteristics of real nature. This kind of creation based on reality can quickly dispel the player's sense of unfamiliarity and anchor them in a believable and regionally distinctive virtual environment, allowing the player to have a strong sense of immersion when exploring. In terms of gameplay, the unique terrain naturally defines the gameplay, becoming a natural carrier for gameplay design: the steep cliffs and ravines of the Danxia landform not only outline a unique visual contour but also form natural path guides, vertical interactive scenes, and exploration puzzles. Players need to use climbing, jumping, and other actions to traverse the terrain and unlock hidden areas; the wind-eroded mushroom rocks and sand dunes in the desert can serve as natural cover, testing players' tactical planning abilities; the crimson fissures and flowing lava on the lava surface not only create a tense atmosphere but also bring a high-difficulty platforming challenge, requiring precise control of every step, greatly enhancing the game's fun and challenge. In addition, the deep snow in the snowfield affects movement speed, and the dense vegetation in the rainforest obstructs vision. These terrain characteristics further enrich the layers of gameplay, making the exploration process more strategic. Ultimately, these extraordinary terrains become powerful "landmark memory points," deeply imprinted in the players' minds with their magnificent, bizarre, or exquisite forms, becoming an indispensable chapter in the players' adventure stories.

[0156] These iconic terrain features not only become core points of interest within the game but also serve as important material for players to share and spread, greatly enhancing the game's reach and artistic value. Therefore, possessing and successfully presenting these iconic and unique landforms has become a clear pursuit for high-quality games in terms of content depth and technological innovation, and a significant manifestation of the game industry's shift from "functional fulfillment" to "experience enhancement."

[0157] See Figure 12 , Figure 12 This is a schematic diagram of Danxia landform provided in the embodiments of this application; Danxia landform is a unique geological landscape composed of red sandstone and conglomerate. It was sculpted by the combined effects of long-term crustal uplift, water erosion, weathering, and gravitational collapse. The surface of Danxia landform is often characterized by brightly colored red cliffs, isolated peaks, and strangely shaped rocks.

[0158] In fields such as game scenes and virtual simulations, creating natural terrains like Danxia landforms, which combine macroscopic consistency with microscopic richness, is key to enhancing the realism and immersion of scenes. However, under the traditional manual production process, this goal faces insurmountable bottlenecks in both efficiency and quality. It not only consumes a lot of manpower and resources but also makes it difficult to balance the scale, detail, and naturalness of the terrain, becoming the core problem restricting the progress of projects.

[0159] From the perspective of terrain texture mapping, the core workflow for artists involves using professional texture mapping tools, combined with the unfolded world coordinates of the terrain, to sample textures to present the desired rock textures, color gradations, and erosion marks. (See also...) Figure 13 , Figure 13 This is a schematic diagram of a manually drawn texture map provided in an embodiment of this application. Manually drawing the texture map is required for example... Figure 13 202 in the middle to generate Figure 13 The image corresponding to 201. Currently, the mainstream production tools in the industry include general image editing software and game industry-specific texture mapping software. Regardless of which tool is used, the core logic of purely manual drawing remains unchanged. This mode is not only cumbersome, but also has fundamental limitations that cannot be avoided, directly affecting the efficiency and final effect of terrain creation.

[0160] If artists rely solely on manually operating the aforementioned tools to create textures, the workload and process limitations are mainly reflected in three core aspects, severely restricting project progress efficiency and creative implementation.

[0161] Firstly, the lengthy creative verification cycle severely slows down the iteration speed. The charm of Danxia landforms lies in the gradual changes in the color of its rock layers, the differences in grain density, and the irregular traces left by natural erosion. These details all need to be achieved through the superposition of "random layers." Each new "random layer" effect, whether it's adjusting the basic hue of the rock layers, the density distribution of rock grains, or the subtle traces formed by rainwater erosion and wind erosion, requires artists to start drawing from scratch, layering, and repeatedly adjusting parameters. More importantly, any modification in any direction, even just a minor adjustment to the color distribution of a certain area or an optimization of the shape of a local texture, may mean redrawing multiple texture maps. Because the layers of texture maps are highly interconnected, local modifications often destroy the overall sense of hierarchy and harmony, leading to the need to repeatedly create texture maps. This significantly extends the creative verification cycle, and design ideas that could have been quickly iterated are constrained by tedious manual drawing work, seriously affecting the project's progress.

[0162] Secondly, generating diversity is challenging and prone to repetition and artificial appearance. As a large-scale natural landform, Danxia landforms possess a strong degree of natural randomness in their rock textures and color distribution. Theoretically, a massive number of unique texture map variations are needed to recreate this organic and rich, non-repetitive variation. However, the limitation of manual drawing lies in the difficulty for artists to systematically generate a large number of differentiated texture maps. They can only create variations by copying and fine-tuning existing texture maps, which easily leads to the trap of "copy-paste" repetition. For example, rock textures in the same area may appear repeatedly, and the changes in rock layers in different areas may lack natural transitions. The final landform appears monotonous and dull, with obvious signs of artificial sculpting, failing to recreate the natural irregular beauty and diversity of Danxia landforms and severely affecting the realism of the scene.

[0163] Thirdly, high-quality texture mapping is time-consuming, forcing compromises between quality and efficiency. High-quality Danxia landform textures require accurate reproduction of the mineral textures, color gradations, and erosion details of rock layers. Each high-precision texture map can take hours or even days to create. Open-world scenes often need to cover tens or even hundreds of kilometers of terrain. Producing a sufficiently rich variety of Danxia landform types for the entire game world to meet the terrain differences of different areas poses a severe challenge to the art team's manpower and time. Under the premise of limited project timelines, art teams are often forced to compromise between content diversity and detail density—either reducing the number of texture map variations, sacrificing the richness of the terrain, or reducing texture map precision, sacrificing the expressiveness of details, ultimately making it difficult to achieve the ideal production effect.

[0164] In short, traditional manual texture mapping methods have always struggled to balance the core contradictions between "scale," "variety," and "production efficiency": pursuing large-scale coverage sacrifices detail and variety; pursuing high-quality detail significantly reduces production efficiency and extends project cycles; and pursuing variety increases labor costs and production difficulty. The difficulty in achieving all three has become the core pain point of traditional production processes.

[0165] Beyond the efficiency and quality bottlenecks in texture mapping, the more fundamental challenge lies in the fact that traditional texture mapping methods are almost unable to achieve scientifically consistent geological structures in a vast open world—which is precisely the core charm of natural terrains such as Danxia landforms and an important cornerstone for building the credibility of scene environments.

[0166] Taking the sedimentary rock layers of Danxia landforms as an example, their most distinctive feature is the massive, continuous, and uniformly oriented stratification structure spanning several kilometers. These strata are a direct record of crustal movement and sedimentation millions of years ago. The orientation, dip angle, and thickness of each rock layer follow strict geological logic, connecting and extending continuously to form a unified and complete geological system. However, the texture maps manually drawn by artists are essentially "localized" creations—both the drawing area of ​​a single texture map and the perspective during creation are limited to a local area, failing to take into account the macroscopic geological logic of the entire open world. When these local texture maps are repeatedly laid out and spliced ​​onto the terrain model of the entire open world, a series of logical and visual problems inevitably arise.

[0167] First, there's a logical inconsistency, which undermines the sense of realism in geographical space. (See also...) Figure 14 , Figure 14 This is a schematic diagram showing the stitching of texture maps from different regions provided in this application embodiment. Manually drawn texture maps cannot pre-plan the orientation, dip angle, and thickness of the rock layers throughout the open world, resulting in the inability to maintain continuity and logical consistency in the orientation of the rock layers after stitching texture maps from different regions. For example, the rock layers on one side of a mountain are horizontal, while the rock layers on the other side are vertical, or the dip angle of the rock layers on the same mountain varies greatly, which completely does not conform to the laws of natural geological evolution, making the entire terrain look geographically illogical and seriously damaging the realism and immersion of the scene.

[0168] Secondly, the repetition and abnormal texture seams or display breaks create a "fragmented" visual effect. To avoid the monotony of repetitive textures, artists need to create numerous texture variations. However, the creation of these variations lacks a unified geological logic, resulting in only minor adjustments to details. This leads to a lack of correlation between the layering patterns of different variations. When these variations are randomly pieced together in an open world, incongruous and random layering patterns appear, making the entire world look like it's pieced together from unrelated fragments, rather than a complete geological whole that has evolved continuously over millions of years. This results in obvious visual problems, such as abnormal texture seams or display breaks, reducing the quality of the scene.

[0169] Finally, the texture maps are disconnected from the terrain geometry, resulting in an artificial visual effect at close range. Traditional hand-drawn texture maps are completely decoupled from the three-dimensional form of the terrain—the texture map depicts a two-dimensional texture, while the terrain is a three-dimensional structure, with no direct connection between the two. This leads to a situation where, on grand landmark terrains (such as Danxia cliffs and rock-layered canyons), the orientation and distribution of rock textures may not match the geometry and slope of the cliff itself. For example, on vertical cliffs, rock textures may be horizontally distributed, making the grand terrain appear artificial and flat upon close observation, failing to present the awe-inspiring three-dimensional stratification of Danxia landforms, and severely impacting the visual experience.

[0170] In summary, under the traditional production process, both the efficiency and diversity bottlenecks in texture mapping and the challenge of ensuring scientific consistency in geological structures pose significant challenges to the production of terrains like Danxia landforms, which possess both macroscopic and microscopic aesthetics. This makes it difficult to meet the high-quality demands of open-world scenes for realism and immersion, and a more efficient and scientific production method is urgently needed to overcome this predicament.

[0171] The method provided in this application offers a scheme for procedurally generating special layered rocks, such as Danxia landforms (texture maps), and naturally integrating the generated Danxia landforms into the terrain surface. By using fractional Brownian motion and controllable random numbers as generation seeds, theoretically infinitely diverse texture maps can be generated. This ensures the uniformity and integrity of the landforms rendered based on the texture maps and terrain surfaces, and supports seamless tiling. The texture maps and terrain surfaces can be naturally integrated. Simultaneously, because the texture maps are entirely procedurally generated, performance can be guaranteed in real-time shader calculations and cache optimization; parametric styles and colors facilitate artistic control. It is easily integrated into rendering and art pipelines, improving efficiency and controllability. The method provided in this application can solve the problems existing in related technologies, allowing the geological structures of the virtual world to possess a unified, coherent, and traceable life cycle, just like in reality.

[0172] The method provided in this application uses controllable random numbers as the generation seed, ensuring that the generated texture maps have infinite diversity and reproducibility. It employs fractional Brownian motion as the skeleton for constructing complex textures, automatically generating detailed, natural, and realistic texture maps. By utilizing parameter mapping values, the colors and details of different rock layers can be dynamically combined, thereby driving the generation of a massive number of diverse texture maps from a single general algorithm. Simultaneously, by combining world-space computation with fractional Brownian motion, it forms continuous, directional texture maps, breaking through the limitations of existing art toolchains and creating rich and realistic terrain. See also... Figure 15 , Figure 15 This is a first schematic diagram illustrating the method for generating terrain according to an embodiment of this application. See also... Figure 16 , Figure 16 This is a second schematic diagram illustrating the landform generated by the method provided in this application embodiment. The Danxia landform generated using the method provided in this application embodiment exhibits consistent orientation across all rock layers, resulting in a more realistic appearance. See also... Figure 17 , Figure 17 This is a schematic diagram of the landform generated by the related technology provided in the embodiments of this application. The rock strata of the Danxia landform generated by the related technology are inconsistent in direction, which does not conform to the characteristics of Danxia landform in the real world.

[0173] The method provided in this application includes, on the technical side: forming a layered rock effect, i.e., a texture map, through fractional Brownian motion; assigning color to the texture map through a color algorithm, i.e., simulating the color of Danxia landform; determining the area on the terrain surface where Danxia landform can appear, and adjusting the target mixed color of the texture map based on the original base color of the area where Danxia landform can appear, to generate a color-adjusted texture map; and combining the color-adjusted texture map with the terrain surface to generate a terrain surface with Danxia landform.

[0174] The effect of layered rocks, or texture map, is created through fractional Brownian motion: Fractional Brownian motion is a procedural generation method that uses multiple layers of Burmester noise with different frequencies and amplitudes to create more complex and natural textures (such as mountains and clouds). The number of noise layers in the fractional Brownian motion is determined by different octaves, i.e., the number of iterations. By continuously increasing the frequency and decreasing the noise amplitude according to regular intervals, i.e., the frequency multiplication factor, finer noise granularity and more detailed texture maps can be obtained.

[0175] Assume the noise in the first octave has a fundamental frequency of 100Hz and an amplitude of 1.0. This will generate a macroscopic, smooth, large-scale waveform, like the basic outline of a mountain. Moving to the next octave, adjustments are made based on the values ​​corresponding to the gaps (e.g., 2.0) and the amplitudes (e.g., 0.5). The new frequency becomes 100Hz. 2.0 = 200Hz, while the amplitude decreases to 1.0. 0.5 = 0.5. This higher-frequency, lower-amplitude noise is superimposed, adding denser secondary undulations to the texture map. Continuing the iteration, the third octave will have a frequency of 400Hz and an amplitude of 0.25, which will further add finer texture details, such as the rough texture of a rock surface. Finally, the texture map is obtained by adding these different levels of noise waveforms. See also Figure 18 , Figure 18 This is a schematic diagram of a texture map generated based on fractional Brownian motion provided in an embodiment of this application.

[0176] The simplest form of fractional Brownian motion can be created as follows: Octaves, or the number of iterations, determines the number of noise layers; here, octaves=1. Acunarity, the frequency multiplication factor, is set to 2.0, meaning the frequency of each noise layer is twice that of the previous one. Gain, the amplitude reduction factor, is set to 2.0; setting it to 0.5 means the intensity of each noise layer is only half that of the previous one. Amplitude, the waveform height or intensity of the texture map corresponding to the current noise layer, is set to 0.5; setting it to 0.5 indicates the fluctuation range of the waveform of the texture map corresponding to the first noise layer, and this value will decrease as the loop continues. Frequency, the waveform density of the texture map corresponding to the current noise layer. The initial value is set to 1, and this value will increase as the loop continues, meaning the ripples in the texture map will become denser. For the first octave, the following processing is performed: y1=y+amplitude noise (frequency) x), where (x,y) are the world coordinates (second world space coordinates) of a pixel on the terrain surface, x is the abscissa (first abscissa), y is the ordinate (first ordinate), y1 is the updated ordinate (second ordinate) corresponding to the first octave, amplitude is the amplitude (first amplitude), frequency is the frequency (first frequency), and noise() is the function to generate Burmester noise, noise(frequency) x) generates Burmester noise (first noise value) based on frequency and the x-axis. After obtaining the updated y-axis y1 corresponding to the first octave, frequency1 = frequency. lacunarity (multiplying the frequency by the gap to prepare for the second octave cycle of processing, making the waveform corresponding to the generated texture map denser), and amplitude1=amplitude `gain` (multiplies the amplitude by the amplitude to prepare for the processing performed in the second octave, making the fluctuation range of the generated texture map smaller, i.e., the waveform smoother), where `frequency` is the frequency, `frequency1` is the updated frequency corresponding to the first octave, `amplitude` is the amplitude, `amplitude1` is the updated amplitude corresponding to the first octave, `lacunarity` is the gap, and `gain` is the amplitude reduction factor. The processing performed for the second octave is the same as that performed for the first octave, until the processing performed for the last octave is the same as that performed for the first octave, obtaining the updated ordinate `yn` corresponding to the last octave, and updating the world coordinates (x, y) of the pixels on the terrain surface to (x, yn). The above processing is performed on the world coordinates of each pixel on the terrain surface, and the function image composed of the updated coordinates (fourth world space coordinates) generated for each pixel is used as the texture map. See the example texture map. Figure 18 Here, it is necessary to adjust the frequency, amplitude, and noise seed corresponding to the function that generates the Berlin noise, and map the waveform to a range of 0-1. This will form a waveform with random shape and random width of stripes, which is the waveform corresponding to the texture map, serving as the basis for the Danxia landform rock strata.

[0177] The method provided in this application uses the world space coordinates of the terrain surface, i.e., the mountain, to calculate and ensure that the orientation of the entire terrain is consistent. Furthermore, the method provided in this application rotates the world space coordinates of the mountain within the vertex shader and opens up parameters, allowing artists to freely control the orientation of the Danxia landform rock layers.

[0178] The steps for rotation are as follows: Before UV rotation, the world space coordinates (first-world space coordinates) of the pixels on the mountain are: `rotate` (rotation control value, usually a value between 0 and 1, such as a slider value, which needs to be converted to angles); `tiling` (scaling factor), used to control texture density; the larger the value, the denser the texture; `aspect` (aspect ratio variable), also known as the aspect ratio. `aspect=1.0`, assuming the texture area is square; and the final calculated rotation angle, in radians, is calculated as `angle=(rotate-0.5)`. 3.1415 Version 2.0 can convert the input rotate (0~1) to radians. (π~π). Based on the aspect ratio, the ordinate (uv.y) of the pixel on the mountain before rotation in world space coordinates is adjusted. The calculation steps are: uv.y1 = uv.y aspect-aspect 0.5-0.5, where uv.y1 is the ordinate (seventh ordinate) of the world space coordinates of the pixels on the mountain before rotation, adjusted according to the aspect ratio. Since aspect is 1.0 here, adjusting the ordinate of the world space coordinates of the pixels on the mountain before rotation according to the aspect ratio does not mathematically change any value; it is merely a "placeholder" for the standard algorithm. If aspect is not 1, adjusting the ordinate of the world space coordinates of the pixels on the mountain before rotation according to the aspect ratio will prevent rotation stretching. The default rotation is around the origin, i.e., (0,0). To rotate around the center of the entire mountain, the coordinate system needs to be shifted as a whole (sixth world space coordinate), making the center of the mountain (0.5,0.5) the origin of rotation. The world space coordinates of the pixels on the offset mountain (sixth world space coordinates) are transformed using rotation matrix multiplication and rotation angle, with the center of the mountain as the origin of rotation, to obtain the world space coordinates of the pixels on the rotated mountain (seventh world space coordinates). These world space coordinates are then moved back to their original positions (eighth world space coordinates), that is, the origin of rotation is returned to (0,0). If the original positions are not moved back, the calculated world space coordinates of the pixels on the rotated mountain will contain negative numbers, potentially leading to sampling errors. Finally, a scaling factor is used to adjust the world space coordinates of the pixels on the rotated mountain, that is, multiplying the world space coordinates of the pixels on the rotated mountain by the scaling factor to obtain the final world space coordinates of the pixels on the rotated mountain (second world space coordinates). `tiling=1` ensures that the generated texture size remains unchanged. If `tiling=10`, it means that the texture will be repeated (tiled) 10 times on the surface, resulting in a finer texture. The above rotation steps ensure that the scale of the world space coordinates of the pixels on the rotated mountain remains unchanged.

[0179] The fractional Brownian motion is created in the method provided in this application embodiment as follows: `st(key, value)` represents the world space coordinates (second world space coordinates) of the pixels on the rotated mountain. Multiple pixels on the rotated mountain need to be randomly selected, and the final ordinate `value1` (second ordinate) corresponding to each x-coordinate (first x-coordinate) is determined. The function graph formed by the (key, value1) coordinates of multiple pixels on the mountain is the generated texture map (first terrain stripe). `amplitude` represents the amplitude, `frequency` represents the frequency, and `hash` is the seed (first parameter) passed to the random function. Different hash values ​​will generate completely different texture maps. Initially, it is assumed that the value of the ordinate `value` corresponding to each x-coordinate is 0.0. Octaves are defined as 1, meaning the fractional Brownian motion only cycles once to ensure controllable performance during game execution. `value1 = value + amplitude`. danxia_noise(st (frequency, hash), where danxia_noise is the noise value function, danxia_noise(st The frequency (hash) is the noise value (first noise value).

[0180] The noise value function is calculated as follows: st frequency is used to magnify the world space coordinates of pixels on the mountain after the final rotation, and the magnified coordinates are (key). frequency, value (frequency) (Third World spatial coordinates). Obtain the integer part i (the integer part of the second x-coordinate and the integer part of the third y-coordinate) of the magnified coordinates, which is used to determine which cell in the coordinate system the magnified coordinates are in, and the decimal part f (the decimal part of the second x-coordinate and the decimal part of the third y-coordinate), which is used to determine the specific position of the magnified coordinates in the cell in the coordinate system. For example, if the magnified coordinates are (1.2, 3.5), then the integer part is (1, 3) and the decimal part is (0.2). Then, four random numbers a, b, c, and d (the second parameter) are generated using the random function danxia_random: a = danxia_random(i,hash); b = danxia_random(i + (1.0, 0.0),hash); c = danxia_random(i + (0.0, 1.0),hash); d = danxia_random(i + (1.0, 1.0),hash); The fractional part is linearly interpolated using the smoothing curve formula (smoothing interpolation) to obtain the interpolation result (the first interpolation result): u = 3f² - 2f³. If f is directly used for linear interpolation, the generated texture map will appear to have creases. The smoothing curve formula for linear interpolation of the fractional part makes f change more slowly when it approaches 0 and 1, resulting in a smoother and more natural transition in the texture map. Finally, the bilinear interpolation function lerp is used to generate a smooth noise value between 0.0 and 1.0 (the first noise value). The calculation formula is lerp(a,b,key). frequency)+(ca) value frequency (1.0-key frequency) + (dB) key frequency value frequency.

[0181] Taking a random number 'a' as an example, the random function danxia_random is calculated as follows: a = Here, 43758.545312 is a large number scaling factor. Multiplying the result of sine by a huge non-integer causes the numerical value to fluctuate wildly, exceeding the precision limits of floating-point numbers. sin() is the sine function used to convert numerical values ​​into wave-like patterns (between -1 and 1). It is the x-coordinate of the integer part i. It is the ordinate of the integer part i. It is the x-coordinate value corresponding to the seed hash. This is the value of the y-coordinate corresponding to the seed hash, and frac() is used to process the decimal part of the value. This step is crucial for generating the random texture map. Because the preceding numbers are very large and vary drastically, their decimal parts appear to be completely random (between 0.0 and 1.0).

[0182] See Figure 19 , Figure 19 This is a schematic diagram of a texture map obtained based on fractional Brownian motion provided in an embodiment of this application. Figure 19 The game features horizontal lines on the mountainside, symbolizing Danxia landforms. These lines rise and fall, varying in depth and shape. This form became the prototype of the Danxia landform in the game.

[0183] The texture map is colored using a color algorithm, which simulates the colors of the Danxia landform. Specifically: Danxia landforms possess rich color characteristics, and this algorithm supports custom color assignment for texture maps. Five intervals are established, with the interval range controllable by the artists. Each interval is assigned a specific color (a preset color). Simultaneously, for each x-coordinate corresponding to the final y-coordinate value1 within the 0-1 interval generated by fractional Brownian motion, a smooth interpolation function is used to ensure natural and smooth color transitions. See also... Figure 20 , Figure 20 This is a schematic diagram of a texture map with color provided in an embodiment of this application. Figure 20 Each texture in the text has a corresponding color, and the transitions between colors are natural, exhibiting characteristics of Danxia landforms.

[0184] The steps to customize the color of a texture map are as follows: Input value p. This is typically the final ordinate value1 (fourth ordinate) corresponding to each x-coordinate, ranging from 0 to 1. It represents the "position" of the current pixel within the entire height or rock stratum section. BandSmooth (color edge smoothing parameter). Controls whether the boundary between two colors is a "sharp line" or a "soft gradient." The larger the value, the smoother the transition. Thresholds: Four threshold boundary points (the ordinates of the world space coordinates of multiple third pixels), located in x, y, z, and w respectively. For example, (0.2, 0.4, 0.6, 0.8). These four points divide the 0~1 space into five intervals. That is, these four points are points on the y-axis. A, B, C, D, and E are the five colors (preset colors) of the Danxia landform rock strata, corresponding to five spatial segments. For example, A is dark red, B is orange, C is light gray, etc. The input value p is forcibly restricted (clamped) within the range [0.0, 1.0]. The bandSmooth value is assigned to a short local variable w. A transition factor is generated for each threshold boundary point, calculated as follows: s1 = smoothstep(thresholds.xw, thresholds.x+w, p); s2 = smoothstep(thresholds.yw, thresholds.y+w, p); s3 = smoothstep(thresholds.zw, thresholds.z+w, p); s4 = smoothstep(thresholds.ww, thresholds.w+w, p); Here, smoothstep() is the smooth interpolation function. The calculation principle of smoothstep(min, max, x) is: return 0 when x is less than min; return 1 when x is greater than max; and return x when x is greater than min and less than max. Determine the weight (first weight) of the input value p relative to each interval to ensure a smooth transition between adjacent colors. The weight of each interval is calculated as follows: w0 = 1 - s1; w1 = s1 (1-s2);w2=s2 (1-s3);w3=s3 (1-s4); w4=s4; where w0 is the weight of color A. If the input value p does not cross the threshold boundary point x, then the color corresponding to the input value p is 100% color A. If the input value p crosses the threshold boundary point x, then the color corresponding to the input value p is 100% not color A. w1 is the weight of color B, which must simultaneously satisfy two conditions: it has crossed the threshold boundary point x, and it has not yet crossed the threshold boundary point y. At this time, the color corresponding to the input value p is 100% color B. w2 and w3 ensure that colors C and D are only displayed within their own intervals. w4 is the weight of color E. As long as the input value p crosses the threshold boundary point z, the color corresponding to the input value p is 100% color E. The color col (first texture color) corresponding to the input value p is determined according to the weight of each interval above, and the calculation method is: col=colorA.rgb w0+colorB.rgb w1+colorC.rgb w2+colorD.rgb w3+colorE.rgb w4; where rgb represents the numerical value of the corresponding color. If the input value p is in the solid color region: only one weight is 1, and all others are 0, so the output is a solid color (e.g., colorB). 1+0+0+...). If the input value p is in the boundary region of the threshold boundary point: there will be two weights with values ​​at the same time (for example, w1 is 0.3 and w2 is 0.7). At this time, color B and color C will be mixed together (30% B + 70% C) to form a gradient color.

[0185] See Figure 21 , Figure 21 These are comparison images of sharp and soft color edges provided in embodiments of this application. Figure 21 The 301 in the image refers to a texture map with sharp color edges. Figure 21 302 in the image refers to a texture map with soft color edges.

[0186] Identify the areas on the terrain surface where Danxia landforms can appear (first area), and adjust the target blending color of the texture map based on the original base color (area color) of the areas where Danxia landforms can appear, to generate a color-adjusted texture map; The rock strata of Danxia landforms are formed by geological accumulation over thousands of years, so theoretically they should be distributed on mountain walls; that is, Danxia landforms are mostly distributed on mountains with a certain slope. Therefore, the characteristics of the terrain surface need to be considered, and Danxia landforms need to appear on mountain surfaces with slopes. By determining the angle between the world space normal and the upward vector of the mountain, and using a custom threshold, it is possible to distinguish mountain surfaces with slopes to represent the characteristics of Danxia landforms. See also Figure 22 , Figure 22 This is a schematic diagram of a mountain surface with a slope, provided in an embodiment of this application. First, the normal vector (the normal vector corresponding to the first pixel) of each pixel constituting the mountain is calculated. For example... Figure 22 The cosine values ​​between pixels 401, 402, and 403 and the upward vector (world space vector) 404, where the upward vector is (0,1,0). The cosine value slope is between -1 and 1: slope=1 indicates that the pixel is on flat ground or a mountaintop; slope=0 indicates that the pixel is on a vertical cliff; slope=-1 indicates that the pixel is at the top of a precipice.

[0187] A threshold center (second control parameter) is obtained by linearly interpolating lerp(1, -1, DanXiaAreaLevel) between 1 and -1 according to the preset first material parameter (fourth parameter) DanXiaAreaLevel (usually 0 to 1). Here, lerp is calculated as lerp(a,b,t)=a+t (ba). When DanXiaAreaLevel=0, the threshold center obtained by linear interpolation is 1. Even slight unevenness (slope less than 1) is considered steep. When DanXiaAreaLevel=0.5, the threshold center obtained by linear interpolation is 0. Only cliff edges show Danxia landforms. When DanXiaAreaLevel=1, the threshold center obtained by linear interpolation is -1. No matter how steep or overhanging the terrain, no area within the mountain is covered by the Danxia effect. Subtracting the cosine value of slope from the obtained threshold center yields a relative difference value (threshold). A relative difference greater than 0 indicates that the current pixel is covered by the Danxia effect. Dividing the relative difference by the preset second material parameter (fifth parameter) DanXiaAreaSlope (a random number other than 0) yields a control parameter (first control parameter) that controls the width / steepness of the Danxia effect transition: a smaller DanXiaAreaSlope results in a more abrupt color transition (faster from 0 to 1), while a larger DanXiaAreaSlope results in a smoother color transition. The control parameters apply to each pixel seen by the user, specifically the pixels on the mountain, and do not have coordinates. The area comprised of multiple pixels on the mountain that can be covered by the Danxia effect is defined as the Danxia area (danxiaArea). Finally, the original base color (originalColor) of the Danxia area (the color of the mountain part where the Danxia landform appears) is linearly blended with the target mix color (danxiaColor), which is the color in the texture image (first texture color). The larger the danxiaArea, the more the color leans towards the mixColor (second texture color). A larger danxiaArea means a larger proportion of the texture image color (Danxia landform color) during blending. For example, if the Danxia landform color accounts for 90% and the original base color accounts for 10%, the blending method is mixColor=lerp(originalColor,danxiaColor,_control parameter). This blending step only applies to the Danxia landform, i.e., the texture image, ensuring the original base color remains on the Danxia landform, making it appear more natural. See also... Figure 23 , Figure 23 This is a schematic diagram of the area where the texture map appears on the terrain surface according to the embodiments of this application. The non-white part of the terrain surface is the area where the texture map appears on the terrain surface, and the white part is the color of the terrain surface to facilitate the observation of the color of the texture map.

[0188] The method combines a color-adjusted texture map with the terrain surface to generate a terrain surface with Danxia landforms. The method provided in this application uses `lerp()` to fuse the texture map and the terrain surface, and overlays an ambient occlusion map to create a fade-in / fade-out effect for the terrain at cracks.

[0189] First, an ambient occlusion map is overlaid on the color-adjusted texture map, aodanxiaColor=danxiaColor. pow(AOTex,DanXiaAOPower); danxiaColor: This is a color variable. It stores the color of the Danxia landform texture (second texture color) at the current pixel of the color-adjusted texture map before any lighting effects are added. AOTex: This variable represents the value sampled from an ambient occlusion map (light occlusion value). An ambient occlusion map is a grayscale image that is pre-calculated or drawn by an artist to simulate the faint shadows in places where light cannot directly reach, such as gaps and corners of objects. Its value: usually between 0 (pure black) and 1 (pure white). Black (0) areas represent areas where light is completely blocked, such as deep cracks in a mountain. White (1) areas represent flat surfaces that are fully exposed and can receive sufficient ambient light. Gray (values ​​between 0 and 1) represent different degrees of occlusion. DanXiaAOPower: This is a floating-point variable, an adjustable parameter (light occlusion intensity). It acts as an exponent to control the intensity or contrast of the ambient occlusion map effect. `pow` calculates AOTex raised to the power of `DanXiaAOPower` (the sixth parameter). If `DanXiaAOPower` > 1.0 (e.g., 2.0), it darkens the shadows (gray areas with values ​​less than 1) in the ambient occlusion map, enhancing shadow contrast and making cracks appear deeper. If `DanXiaAOPower` = 1.0, it's equivalent to using the original AOTex value directly. If `DanXiaAOPower` < 1.0, it brightens the shadows in the ambient occlusion map, reducing shadow effects. danxiaColor In computer graphics, `pow(AOTex, DanXiaAOPower)` multiplies `danxiaColor` (the second texture color) with a value between 0 and 1 (the second product). The effect is to darken `danxiaColor`. `aodanxiaColor` is the result of overlaying an ambient occlusion map onto the color-adjusted texture map. If `AOTex` is 1.0 (white, no occlusion), multiplying `danxiaColor` by 1 leaves the color unchanged. If `AOTex` is 0.5 (gray, half-occlusion), multiplying `danxiaColor` by 0.5 darkens the color by half. If `AOTex` is 0.0 (black, full occlusion), multiplying `danxiaColor` by 0 makes the color black.

[0190] Next, the ambient occlusion map is overlaid onto the color-adjusted texture map and then superimposed onto the Danxia area on the terrain surface. The color of the Danxia area is set to `mixColor=lerp(originalColor, aodanxiaColor, DanXiaColorMixAlpha);`. `mixColor` is not the final color to be displayed for the Danxia area, but rather the base color (blended color) of the final object used for lighting calculations. Lighting calculations require information such as the base color, metallicity, and roughness. `originalColor` (area color): This is the original color of the Danxia area on the terrain surface before the texture map is overlaid. It may come from a base rock map, soil map, or the result of mixing multiple terrain maps.

[0191] DanXiaColorMixAlpha (Blending Control Parameter): This is another parameter controllable by the artist. Its value ranges from 0.0 to 1.0, acting as a blending mask or blending scale. It determines how much of the texture map color should be included in the final color of the Danxia area of ​​the terrain surface. lerp(a, b, t) is a linear interpolation function. Its function is to take an intermediate value between a and b based on a scale t (between 0 and 1). The formula is: result = a (1-t)+b t, when t=0.0, the result is exactly a. When t=1.0, the result is exactly b. When t=0.5, the result is the average of a and b. If DanXiaColorMixAlpha is 0.0, mixColor will be exactly equal to originalColor. This means that the area does not display any Danxia effect, i.e., texture map. If DanXiaColorMixAlpha is 1.0, mixColor will be exactly equal to aodanxiaColor (third texture color). This means that the area is completely covered by the Danxia effect, i.e., texture map. DanXiaColorMixAlpha determines the intensity / transparency of the Danxia effect, i.e., texture map displayed on the terrain surface. If DanXiaColorMixAlpha is a value between 0 and 1 (e.g., 0.7), then the final color is a mixture of 30% of the original color of the terrain surface corresponding to the Danxia area and 70% of the Danxia color, i.e., the texture map color, thus forming a smooth transition at the boundary between the two landforms. See also Figure 24 , Figure 24 This is a first rendering of the fusion of the texture map and the terrain surface provided in this application embodiment. See also... Figure 25 , Figure 25This is a second effect image showing the fusion of a texture map and a terrain surface, as provided in an embodiment of this application. In this case, the terrain surface has a texture map, but no ambient occlusion map is superimposed; therefore, the terrain surface differs somewhat from the actual landform. See also... Figure 26 , Figure 26 This is a third rendering of the texture map and terrain surface fusion provided in the embodiments of this application. See also... Figure 27 , Figure 27 This is the fourth effect image of the fusion of texture map and terrain surface provided in the embodiments of this application. At this time, the terrain surface has texture map and ambient light occlusion map superimposed. Therefore, the terrain surface is almost consistent with the real landform and has shadows of varying depths, which can simulate the faint shadows of places that are difficult to be directly illuminated by light, such as gaps and corners of objects.

[0192] In the current field of real-time rendering, high-quality visual effects heavily rely on a large number of texture maps manually drawn by artists. This process not only consumes enormous manpower and storage costs but also limits the diversity and dynamic change capabilities of content. This application addresses these problems by proposing improvements. The key technical points are: using controllable random numbers as generation seeds ensures the infinite diversity and reproducibility of generated texture maps; employing fractional Brownian motion noise as the skeleton for constructing complex texture maps, automatically generating detailed, natural, and realistic texture maps through multiple frequency superpositions; and dynamically controlling the scale, intensity, and form of noise representation through parameter mapping, thereby driving the generation of a massive number of diverse texture maps from a single general algorithm. The method provided in this application frees artists from repetitive labor, allowing them to focus on higher-level parameter optimization and style design, greatly improving the efficiency and potential of content production. Simultaneously, it overcomes the limitations of texture maps by using world space coordinates as input to the noise algorithm, achieving a unified and natural effect for open-world terrain graphics. This application provides a core technological foundation for building a truly dynamic and infinitely rich virtual world. The method provided in this embodiment can cover all similar sedimentary rock terrains and is not limited to Danxia landforms.

[0193] It is understood that in the embodiments of this application, data related to terrain surface and so on are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.

[0194] The following description continues to illustrate the exemplary structure of the terrain rendering device 255 provided in this application embodiment as a software module. In some embodiments, see [link to relevant documentation]. Figure 2 The software modules stored in the terrain rendering device 255 in the memory 250 may include: The generation module 2551 is used to generate a first terrain stripe based on the first world space coordinates of each first pixel on the terrain surface, and to obtain a first texture map corresponding to the first terrain stripe. The first region determination module 2552 is used to determine a first region in the terrain surface corresponding to the first texture map based on the normal vector of the terrain surface and the world space vector of the terrain surface; Color correction module 2553 is used to determine a first control parameter based on the first region, and to correct the first texture color of the first texture map based on the first control parameter and the region color corresponding to the first region to obtain a second texture map. The rendering module 2554 is used to render the terrain surface based on the second texture map to obtain a landform image.

[0195] In some embodiments, the generation module 2551 is further configured to perform the following processing for each first pixel on the terrain surface: rotate the first world space coordinates of the first pixel to obtain second world space coordinates; update the second world space coordinates based on a first frequency to obtain third world space coordinates; update the first ordinate corresponding to the second world space coordinates based on the third world space coordinates, a first amplitude, and an octave band parameter to obtain a second ordinate; combine the second ordinate and the first abscissa corresponding to the second world space coordinates to form the fourth world space coordinates of the first pixel; and use the pattern formed by the fourth world space coordinates of multiple first pixels as the first terrain stripe.

[0196] In some embodiments, the generation module 2551 is further configured to generate a first noise value based on the third-world spatial coordinates and a randomly generated first parameter; multiply the first noise value and the first amplitude to obtain a first product result; and fuse the first product result and the first ordinate based on the octave band parameter to obtain a second ordinate.

[0197] In some embodiments, the generation module 2551 is further configured to: obtain the fractional part of the second abscissa corresponding to the third world spatial coordinates and the fractional part of the third ordinate corresponding to the third world spatial coordinates; perform smooth interpolation on the fractional part of the second abscissa and the fractional part of the third ordinate to obtain a first interpolation result; obtain the integer part of the second abscissa and the integer part of the third ordinate, and randomly generate a plurality of second parameters based on the integer part of the second abscissa, the integer part of the third ordinate and the first parameter; and perform bilinear interpolation on the first interpolation result based on the plurality of second parameters to obtain the first noise value.

[0198] In some embodiments, the generation module 2551 is further configured to perform the following processing for each second pixel on the first terrain stripe: based on the color edge smoothing parameter and the fourth ordinate corresponding to the second pixel, generate transition parameters for a third pixel corresponding to the second pixel that satisfies a first condition; wherein the third pixel is at least one fourth pixel on the ordinate of the coordinate system that satisfies the first condition, the first condition being that the value of the fifth ordinate corresponding to the fourth pixel is not greater than a first value and not less than zero; based on the transition parameters of the second pixel for multiple third pixels, determine a first weight for each preset color corresponding to the second pixel; based on the first weight for each preset color corresponding to the second pixel, mix multiple preset colors to obtain a first texture color corresponding to the second pixel; and based on multiple second pixels and the first texture colors corresponding to multiple second pixels, determine the first texture map.

[0199] In some embodiments, the first region determination module 2552 is further configured to perform the following processing for each first pixel on the terrain surface: determine the cosine value between the normal vector corresponding to the first pixel and the world space vector; when the cosine value is less than a second control parameter, determine that the first pixel has a texture label; and take the region formed by multiple first pixels with the texture label in the terrain surface as the first region.

[0200] In some embodiments, the first region determination module 2552 is further configured to obtain a fourth parameter characterizing the material; and to perform linear interpolation on the fourth parameter based on the numerical range corresponding to the material to obtain the second control parameter.

[0201] In some embodiments, the color correction module 2553 is further configured to perform the following processing for each fifth pixel in the first region: determine a first control parameter corresponding to the fifth pixel based on the second control parameter, the cosine value corresponding to the fifth pixel, and a fifth parameter characterizing the degree of texture transition; mix the region color corresponding to the fifth pixel and the first texture color corresponding to the fifth pixel in the first texture map with the first control parameter corresponding to the fifth pixel as a constraint to obtain a second texture color corresponding to the fifth pixel; update the first texture color corresponding to the multiple fifth pixels in the first texture map based on the second texture colors corresponding to multiple fifth pixels to obtain the second texture map.

[0202] In some embodiments, the rendering module 2554 is further configured to obtain an ambient light occlusion map corresponding to the terrain surface; based on the ambient light occlusion map, to perform brightness correction on the second texture color of the second texture map to obtain a third texture map; and to render the first region of the terrain surface based on the third texture map to obtain the landform image.

[0203] In some embodiments, the rendering module 2554 is further configured to perform the following processing for each sixth pixel in the ambient occlusion map: determining a sixth parameter based on the ray occlusion value and ray occlusion intensity corresponding to the sixth pixel in the ambient occlusion map; multiplying the sixth parameter with the value corresponding to the second texture color of the sixth pixel in the second texture map to obtain a second product result; updating the second texture color corresponding to multiple sixth pixels in the second texture map based on the second product results corresponding to multiple sixth pixels to obtain the third texture map.

[0204] In some embodiments, the rendering module 2554 is further configured to fuse the third texture color corresponding to the first region in the third texture map and the region color corresponding to the first region to obtain a fused color; perform lighting calculations on the fused color, and render the first region of the terrain surface based on the lighting calculation results to obtain the terrain image.

[0205] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the terrain rendering method described above in this application.

[0206] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the terrain rendering method provided in this application.

[0207] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0208] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0209] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0210] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0211] In summary, this application's embodiments generate first terrain stripes based on the first world space coordinates of each first pixel on the terrain surface, and obtain a first texture map corresponding to the first terrain stripes. By directly generating the first terrain stripes and the first texture map using the first world space coordinates, geological features resembling natural rock strata deposition can be automatically and accurately constructed. This significantly reduces the artistic cost of manually drawing the first texture map and improves the automation level of first texture map generation. Based on the normal vector and the world space vector of the terrain surface, a first region corresponding to the first texture map is determined on the terrain surface. Through the geometric relationship between the normal vector and the world space vector, the slope and orientation of the terrain surface can be accurately identified, thereby automatically delineating the first region applicable to the first texture map. This ensures that the first texture map only appears in the first region that conforms to physical laws, enhancing the rationality of the first texture map's distribution. Based on the first region, a first control parameter is determined, and based on the first control parameter and the region color corresponding to the first region, the first texture color of the first texture map is corrected to obtain a second texture map. By correcting the generated first texture color using the region color of the first region itself and the first control parameter determined based on the first region, the resulting second texture map can blend into the overall environmental tone of the terrain surface, ensuring a high degree of uniformity and a natural, smooth transition between the colors of the second texture map and the terrain surface. Based on the second texture map, the terrain surface is rendered to obtain a landform image. This completes the final visual presentation of a high-quality 3D terrain image. Through world space coordinates and world space vectors, the automatic generation of texture maps and the automatic determination of the terrain surface region corresponding to the texture map are achieved, further ensuring the physical rationality and color harmony of the texture map under complex terrain surfaces, significantly improving the accuracy of terrain rendering.

[0212] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A terrain rendering method, characterized in that, The method includes: Based on the first world space coordinates of each first pixel on the terrain surface, a first terrain stripe is generated, and a first texture map corresponding to the first terrain stripe is obtained. Based on the normal vector of the terrain surface and the world space vector of the terrain surface, a first region corresponding to the first texture map in the terrain surface is determined; a first control parameter is determined based on the first region, and the first texture color of the first texture map is corrected based on the first control parameter and the region color corresponding to the first region to obtain a second texture map. Based on the second texture map, the terrain surface is rendered to obtain a landform image.

2. The method according to claim 1, characterized in that, The generation of the first terrain stripe based on the first world space coordinates of each first pixel on the terrain surface includes: For each of the first pixels on the terrain surface, the following processing is performed: Rotate the first world space coordinates of the first pixel to obtain the second world space coordinates; The second world space coordinates are updated based on the first frequency to obtain the third world space coordinates; Based on the third-world spatial coordinates, the first amplitude, and the octave band parameter, the first ordinate corresponding to the second-world spatial coordinates is updated to obtain the second ordinate. The second vertical coordinate and the first horizontal coordinate corresponding to the second world space coordinate are combined to form the fourth world space coordinate of the first pixel. The pattern formed by the fourth world space coordinates of multiple first pixels is used as the first terrain stripe.

3. The method according to claim 2, characterized in that, The step of updating the first ordinate corresponding to the second world spatial coordinates based on the third world spatial coordinates, the first amplitude, and the octave band parameter to obtain the second ordinate includes: Based on the third-world spatial coordinates and the randomly generated first parameters, a first noise value is generated; The first noise value and the first amplitude are multiplied to obtain the first product result; Based on the octave band parameter, the first product result and the first ordinate are fused to obtain the second ordinate.

4. The method according to claim 3, characterized in that, The step of generating a first noise value based on the third-world spatial coordinates and randomly generated first parameters includes: Obtain the decimal part of the second abscissa and the decimal part of the third ordinate corresponding to the third world spatial coordinates; Smooth interpolation is performed on the decimal parts of the second horizontal axis and the third vertical axis to obtain the first interpolation result; Obtain the integer part of the second horizontal coordinate and the integer part of the third vertical coordinate, and randomly generate a plurality of second parameters based on the integer part of the second horizontal coordinate, the integer part of the third vertical coordinate and the first parameter; The first noise value is obtained by bilinear interpolation of the first interpolation result based on multiple second parameters.

5. The method according to claim 1, characterized in that, The step of obtaining the first texture map corresponding to the first terrain stripe includes: For each second pixel on the first terrain stripe, perform the following processing: Based on the color edge smoothing parameters and the fourth ordinate corresponding to the second pixel, the transition parameters of the third pixel corresponding to the second pixel that satisfies the first condition are generated. Wherein, the third pixel point is at least one fourth pixel point on the vertical axis of the coordinate system that satisfies the first condition, the first condition being that the value of the fifth vertical coordinate corresponding to the fourth pixel point is not greater than a first value and not less than the value of zero. Based on the transition parameters of the second pixel for the multiple third pixels, a first weight of the second pixel for each preset color is determined; Based on the first weight of each preset color corresponding to the second pixel, multiple preset colors are mixed to obtain the first texture color corresponding to the second pixel; The first texture map is determined based on a plurality of second pixels and the first texture color corresponding to the plurality of second pixels.

6. The method according to claim 1, characterized in that, The step of determining the first region in the terrain surface corresponding to the first texture map based on the normal vector of the terrain surface and the world space vector of the terrain surface includes: For each first pixel on the terrain surface, the following processing is performed: Determine the cosine value between the normal vector corresponding to the first pixel and the world space vector; When the cosine value is less than the second control parameter, it is determined that the first pixel has a texture label; The region formed by multiple first pixels with the texture label on the terrain surface is defined as the first region.

7. The method according to claim 6, characterized in that, The method further includes: Obtain the fourth parameter characterizing the material; Based on the numerical range corresponding to the material, the fourth parameter is linearly interpolated to obtain the second control parameter.

8. The method according to claim 6, characterized in that, The step of determining a first control parameter based on the first region, and correcting the first texture color of the first texture map based on the first control parameter and the region color corresponding to the first region to obtain a second texture map includes: For each fifth pixel in the first region, perform the following processing: Based on the second control parameter, the cosine value corresponding to the fifth pixel, and the fifth parameter representing the degree of texture transition, the first control parameter corresponding to the fifth pixel is determined; Using the first control parameter corresponding to the fifth pixel as a constraint, the region color corresponding to the fifth pixel and the first texture color corresponding to the fifth pixel in the first texture map are mixed to obtain the second texture color corresponding to the fifth pixel. Based on the second texture color corresponding to the multiple fifth pixels, the first texture color corresponding to the multiple fifth pixels in the first texture map is updated to obtain the second texture map.

9. The method according to claim 1, characterized in that, The step of rendering the terrain surface based on the second texture map to obtain a landform image includes: Obtain the ambient light occlusion map corresponding to the terrain surface; Based on the ambient light occlusion map, the brightness of the second texture color in the second texture map is corrected to obtain the third texture map; The first region of the terrain surface is rendered based on the third texture map to obtain the terrain image.

10. The method according to claim 9, characterized in that, The step of correcting the brightness of the second texture color in the second texture map based on the ambient occlusion map to obtain the third texture map includes: For each sixth pixel in the ambient occlusion map, the following processing is performed: The sixth parameter is determined based on the light occlusion value and light occlusion intensity corresponding to the sixth pixel in the ambient light occlusion map. The sixth parameter is multiplied with the value of the second texture color corresponding to the sixth pixel in the second texture map to obtain the second product result. The second texture color corresponding to the sixth pixel in the second texture map is updated based on the second product result corresponding to the sixth pixel in the second texture map to obtain the third texture map.

11. The method according to claim 9, characterized in that, The step of rendering the first region of the terrain surface based on the third texture map to obtain the landform image includes: The third texture color corresponding to the first region in the third texture map and the region color corresponding to the first region are merged to obtain a merged color; Lighting calculations are performed on the blended colors, and the first region of the terrain surface is rendered based on the lighting calculation results to obtain the terrain image.

12. A terrain rendering device, characterized in that, The device includes: The generation module is used to generate a first terrain stripe based on the first world space coordinates of each first pixel on the terrain surface, and to obtain a first texture map corresponding to the first terrain stripe. The first region determination module is used to determine a first region in the terrain surface corresponding to the first texture map based on the normal vector of the terrain surface and the world space vector of the terrain surface; The color correction module is used to determine a first control parameter based on the first region, and to correct the first texture color of the first texture map based on the first control parameter and the region color corresponding to the first region to obtain a second texture map. The rendering module is used to render the terrain surface based on the second texture map to obtain a landform image.

13. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 11.

14. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method described in any one of claims 1 to 11.

15. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method according to any one of claims 1 to 11.