Terrain effect processing method and device, storage medium, equipment and program product
By acquiring terrain height field data and using preset modification tools, terrain features are automatically modified, solving the problem of low efficiency in traditional terrain creation and achieving efficient, accurate modification of terrain details and non-destructive iteration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU BOGUAN TELECOMM TECH LTD
- Filing Date
- 2026-03-13
- Publication Date
- 2026-05-29
AI Technical Summary
Traditional terrain creation and detail modification heavily rely on artists using the software's built-in hand-carving tools, resulting in a huge workload, low efficiency, and manual judgment for modifications, making automation and non-destructive iteration difficult.
By acquiring terrain height field data, terrain features are determined, and the target area is automatically modified using preset terrain modification tools to ensure that terrain features conform to natural laws, avoid deviations from manual carving, and achieve non-destructive parametric iteration.
It improves the efficiency and accuracy of terrain modification, reduces iteration costs, ensures that terrain feature recognition conforms to natural laws, avoids human judgment bias, and realizes batch and automated terrain detail modification.
Smart Images

Figure CN122097976A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game technology, specifically to a method, apparatus, storage medium, device, and program product for processing terrain effects. Background Technology
[0002] In the development of large-scale AAA games, simulations, and other digital twin projects, creating vast and realistic terrain environments is one of the core aspects. Traditional terrain creation and detail modification heavily rely on artists using the software's built-in hand-sculpting tools, resulting in a huge workload and low efficiency. Summary of the Invention
[0003] This application provides a method, apparatus, storage medium, device, and program product for processing terrain effects. By determining the target area based on terrain height field data and then modifying the target area using a target modification tool, batch, automatic, and refined sculpting of the terrain can be achieved.
[0004] On one hand, embodiments of this application provide a method for processing terrain effects, the method comprising: Obtain the terrain height field data of the target model, and determine the terrain features of the target model based on the terrain height field data; Based on the terrain features, target area information that meets the preset terrain features in the target model is determined. The target area information includes spatial feature information and modification parameter information of the target area. Based on the target area information, a target modification tool is selected from the preset terrain modification tools, and the target modification tool is controlled to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
[0005] On the other hand, embodiments of this application provide a terrain effects processing apparatus, the apparatus comprising: The acquisition module is used to acquire terrain height field data of the target model and determine the terrain features of the target model based on the terrain height field data. The determination module is used to determine, based on the terrain features, target area information in the target model that meets the preset terrain features, wherein the target area information includes spatial feature information and modification parameter information of the target area; The modification module is used to select a target modification tool from the preset terrain modification tools based on the target area information, and control the target modification tool to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
[0006] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program adapted for loading by a processor to perform the terrain effects processing method as described in any of the above embodiments.
[0007] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory, the memory storing a computer program, the processor executing the terrain effects processing method as described in any of the above embodiments by calling the computer program stored in the memory.
[0008] On the other hand, embodiments of this application provide a computer program product, including computer instructions, which, when executed by a processor, implement the terrain effect processing method as described in any of the above embodiments.
[0009] The terrain effects processing method provided in this application obtains terrain height field data of the target model and determines the terrain features of the target model based on the terrain height field data. The terrain height field data ensures that different technicians and different software (whether it is a game engine or special effects software) are processing the same set of height data, avoiding the subjective bias of manual carving. Since the terrain height field data does not involve the modification of the original terrain data of the target model, if adjustments are needed in the future (such as modifying the basic elevation of the terrain), it is only necessary to re-export or read the terrain height field data without deleting or reconstructing the original terrain, thus achieving non-destructive parametric iteration. The terrain features quantify the terrain morphology (such as high curvature as a ridge, high slope as a steep slope), ensuring that the terrain feature recognition conforms to natural laws and avoiding the bias of human judgment.
[0010] Then, based on terrain features, target area information that meets preset terrain features in the target model is determined. The target area information includes spatial feature information and modification parameter information of the target area. The selection is carried out by comparing the terrain features with the preset terrain features, which can greatly improve the selection efficiency (increase efficiency by tens of times) and the positioning accuracy. Finally, based on the target area information, a target modification tool is selected from the preset terrain modification tools, and the target modification tool is controlled to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool. The target modification tool can make the terrain shape, terrain height, terrain material, etc. of the target area consistent with the preset details of the target modification tool.
[0011] Modifications can be completed quickly using the target modification tool, improving modification efficiency. Furthermore, since all target terrain modification tools are generated based on a unified preset terrain modification tool, they all follow the same standards in terms of location, size, and shape (such as the height of the rock stamp and the material texture being completely uniform). Modification records can also be saved in Houdini Asset, enabling precise backtracking without the need for re-sculpting, which greatly reduces iteration costs. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of an example game system provided in an embodiment of this application.
[0014] Figure 2 This is a flowchart illustrating the method for processing terrain effects provided in the embodiments of this application.
[0015] Figures 3 to 14 This is a schematic diagram illustrating an application scenario of the terrain effects processing method provided in the embodiments of this application.
[0016] Figure 15 A schematic diagram of the structure of the terrain effect processing device provided in the embodiments of this application.
[0017] Figure 16 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] This application provides a method, apparatus, storage medium, device, and program product for processing terrain effects. Specifically, the terrain effect processing method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, smart TV, wearable smart device, smart vehicle terminal, etc. The terminal can also include a client, which can be a browser client, instant messaging client, or mini-program, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a distributed system. It can also be a cloud server that provides 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 (CDN), and big data and artificial intelligence platforms.
[0020] For example, when the terrain effect processing method is run on a terminal device, the terminal device may include a display screen and a processor. The display screen is used to present the terrain effect visuals and receive commands from the player interacting with the terrain effect. The processor is used to run the effects software and game engine, generate the terrain effect, respond to commands, and control the display of the terrain effect on the display screen. When the player interacts with the terrain effect through the display screen, the terrain effect can control the local content of the terminal device in response to the received operation commands. The terminal device can provide the graphical user interface to the player in various ways, such as rendering the display on the terminal device's screen or presenting the graphical user interface through holographic projection.
[0021] For example, when the terrain effect processing method runs on a server, it can be implemented and executed based on a cloud modification system. A cloud modification system refers to a terrain effect processing method based on cloud computing. A cloud modification system includes a server and client devices. The game application's main operation and the main display are separate; the storage and execution of the terrain effect processing method are completed on the server. The terrain effect display is completed on the client, which is mainly used for receiving and sending data and displaying the terrain effect. For example, the client can be a display device with data transmission capabilities close to the player, such as a mobile terminal, television, computer, PDA, personal digital assistant, or head-mounted display device. However, the terminal device for processing terrain effect data is the server in the cloud. When modifying terrain effects, the player operates the client to send commands to the server. The server controls the execution of the effects software and game engine according to the commands, encodes and compresses the data, returns it to the client via the network, and finally, the client decodes and outputs the modified terrain effect.
[0022] It should be noted that, in this embodiment, the entity executing the terrain effects processing method can be a terminal device or a server. The terminal device can be a local terminal device or a client device in the aforementioned cloud gaming. This embodiment does not limit the type of the executing entity.
[0023] For example, in conjunction with the above description, Figure 1 This application illustrates a game system 1000 for implementing terrain effects, according to an embodiment of the present application. The game system 1000 may include at least one terminal 1001, at least one server 1002, at least one database 1003, and a network. The user-held terminal 1001 can connect to different servers via the network. The terminal is any device with computing hardware capable of supporting and executing game-related software applications.
[0024] In the aforementioned game system 1000, terminal 1001 is used to install and run special effects software and game engine. In some cases, special effects software and game engine may not be pre-installed on terminal 1001, and players can access it directly through a browser or other client. In possible application scenarios, different terminals 1001 may be served by different servers 1002. Therefore, to distinguish the servers 1002 corresponding to different terminals 1001, the embodiments of this application will use the terms "first" and "second" in their descriptions. In fact, the servers 1002 corresponding to different terminals 1001 can be the same server 1002. Therefore, without distinguishing between "first" and "second", it can be understood that terminals 1001 located in the same scene are served by the same server 1002.
[0025] Furthermore, when system 1000 includes multiple terminals, multiple servers, and multiple networks, different terminals can connect to each other through different networks and servers. The network can be a wireless network or a wired network; for example, wireless networks include Wi-Fi, LAN, cellular networks, 2G, 3G, 4G, and 5G networks. Additionally, different terminals can also connect to other terminals or servers using their own Bluetooth networks or hotspot networks. Furthermore, system 100 can include multiple databases coupled to different servers, and can continuously store game-related information in the databases while different users are playing multiplayer games online.
[0026] It should be noted that in this embodiment, multiple terminal devices run the same special effects software and game engine. Therefore, data interaction between multiple terminal devices can be achieved through the server of the special effects software or game engine. Thus, sending data from terminal device 1 to terminal device 2 can be understood as: terminal device 1 sends data to the server of the special effects software or game engine, and the server sends the data to terminal device 2. Receiving data from terminal device 2 can be understood as: terminal device 1 receives data sent by the server of the special effects software or game engine, which is the data sent by terminal device 2 to the server. Alternatively, there may be no server, and terminal device 1 directly sends terrain data to terminal device 2.
[0027] It should be noted that, Figure 1 The system diagram shown is merely an example. The system 1000 described in this application embodiment is for the purpose of more clearly illustrating the technical solutions of this application embodiment and does not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of game systems and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.
[0028] It should be noted that the triggering operations mentioned in the subsequent detailed description of the terrain effect processing method provided in the embodiments of this application can all be regarded as triggering operations performed by the player through a finger or by controlling a medium such as a mouse, keyboard, or stylus. The specific medium used can be determined according to the type of computer device. For example, when the computer device is a touchscreen device such as a mobile phone, tablet, or game console, the player can operate on the touchscreen using any suitable object or accessory such as a finger or stylus. When the terminal device is a non-touchscreen terminal device such as a desktop computer or laptop, the player can operate using external devices such as a mouse or keyboard.
[0029] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0030] Virtual terrain elements can include, but are not limited to, natural landforms such as land, ocean, lakes, and rivers. Virtual scenes are scenarios where players control virtual characters to complete game logic.
[0031] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for processing terrain effects provided in an embodiment of this application. It should be noted that the steps shown may be executed in a logical order different from that shown in the flowchart. The method may include the following steps: Step 011: Obtain the terrain height field data of the target model, and determine the terrain features of the target model based on the terrain height field data.
[0032] The target model can be a pre-created basic terrain model in the game engine, serving as the terrain carrier for subsequently adding geological details (such as rocks and erosion marks) in the terrain effects processing method. For ease of explanation, this application embodiment uses Unreal Engine 5 (UE5) as the game engine and Houdini (a 3D computer graphics software) as the 3D modeling and effects software as an example.
[0033] Among them, terrain heightfield data can be data that represents the elevation of three-dimensional terrain in a game scene, and can be regarded as a set of elevation values corresponding to each vertex of the target model.
[0034] Among them, terrain features can be parameters used to characterize the physical properties of terrain morphology, and can be used to distinguish terrain types (such as ridges, steep slopes, and plains).
[0035] Optionally, the terrain features include curvature features and slope features. Curvature features are used to characterize the degree of curvature of the terrain, and slope features are used to characterize the degree of change in terrain height. Step 011: Obtain the terrain height field data of the target model, and determine the terrain features of the target model based on the terrain height field data, including: Step 0111: Based on the preset mapping relationship between height value and gray value, map the terrain height field data of the target model into gray value to generate a grayscale image. The gray value of the target pixel in the grayscale image represents the terrain height value of the target vertex position of the target model. The target pixel and the target vertex correspond. Step 0112: Based on the terrain height value corresponding to each pixel and the terrain height value of adjacent pixels, calculate the curvature feature and slope feature of each pixel respectively; Step 0113: Generate a curvature image based on the curvature features of each pixel and a slope image based on the slope features of each pixel; Step 0114: Determine the terrain features of the target model based on the curvature and slope images.
[0036] The grayscale image can be an image that records terrain height information. The grayscale value of each pixel in the grayscale image corresponds to the terrain height value at that pixel location. The higher the grayscale value, the higher the terrain elevation at that location. The grayscale image can also be a height map. Based on the preset mapping relationship between height values and grayscale values, all height values in the terrain height field data of the target model can be mapped to grayscale values, and a grayscale image can be generated based on each grayscale value.
[0037] The adjacent pixels can be the surrounding pixels of the currently calculated pixel on the grayscale image. For example, they can be the 8 neighboring pixels of the currently calculated pixel, that is, the 8 adjacent pixels above, below, left, right and diagonally of the current pixel.
[0038] Optionally, the terrain features may include curvature features and slope features. Curvature features are used to characterize the degree of curvature of the terrain (e.g., high curvature corresponds to ridges, gullies, etc., and low curvature corresponds to plains, gentle slopes, etc.); slope features are used to characterize the degree of change in terrain height (e.g., high slope corresponds to steep slopes, cliffs, etc., and low slope corresponds to valleys, plains, etc.).
[0039] Please refer to Figure 4 and Figure 5 , Figure 4 An example of a curvature image is shown. A curvature image can be the result of visualizing the curvature features of each pixel in grayscale format; please refer to [link to relevant documentation]. Figure 5 , Figure 5 An example of a slope image is shown. A slope image can be the result of visualizing the slope characteristics of each pixel in grayscale format. For example, white pixels indicate that the curvature or slope of that pixel is high, and black pixels indicate that the curvature or slope of that pixel is low. Curvature images and slope images are visualizations of terrain features, allowing technicians to intuitively view the feature distribution and providing structured data for target area selection.
[0040] It is understandable that the steepness (slope feature) and curvature (curvature feature) of the terrain cannot be determined by the height value of a single pixel. Instead, it depends on the height difference between the current pixel and its neighboring pixels. For example, the greater the height difference between neighboring pixels, the steeper the slope of that pixel. The more drastic the change in the height difference between neighboring pixels (such as a large height difference between a pixel and its left neighbor and a small height difference with its right neighbor), the higher the curvature. In Houdini's Heightfield Curvature node or Heightfield Slope node, or via VEX scripts, the average height difference between the current pixel and its 8 neighboring pixels can be calculated. This height difference and pixel physical spacing (e.g., 1 pixel corresponds to 1 meter of terrain distance) can be converted into a slope value in the range of 0-1 (i.e., slope feature). The height gradient vector of the current pixel can then be calculated (the height gradient vector reflects the direction and intensity of height change). The curvature value can then be calculated using the rate of change of the gradient vector (e.g., the angle between the gradient directions of adjacent pixels), and similarly normalized to a curvature value in the range of 0-1 (i.e., curvature feature). The calculated slope and curvature features can then be output as grayscale images (i.e., curvature image and slope image) for visual verification. Furthermore, these can be stored as Houdini terrain layer attributes (@Curvature / @Slope) to provide structured data that can be accessed later.
[0041] Specifically, the target model (terrain model) created in UE5 can be viewed as a height grid composed of a large number of pixels (or vertices). Each pixel (or vertex) has a unique elevation value. UE5 or Houdini can be used to linearly map the terrain elevation range to a grayscale value range, converting the elevation value of each terrain pixel into a unique grayscale value, thus generating a grayscale image. In practical applications, the basic terrain height field generated in UE5 (see, for example, [reference needed]) can be used... Figure 3 Import the grayscale image into Houdini (e.g., .exr or .png), or directly read UE5 terrain data through the Houdini Engine plugin, and determine terrain features based on the data. Then, in Houdini's Heightfield Slope and Heightfield Curvature nodes, or via VEX scripts, determine the terrain features of each pixel based on its corresponding terrain height value. This is done by calculating the difference between the terrain height values of each pixel and its surrounding pixels. The terrain features are then stored as image or terrain layer attributes, allowing technicians to visually view the terrain morphology distribution and providing data support for subsequent target area selection. By automatically calculating terrain features and quantifying terrain morphology based on objective height differences (e.g., high curvature indicates a ridge, high slope indicates a steep slope), the terrain feature recognition is ensured to conform to natural laws, avoiding biases from manual judgment. It is understandable that traditional manual carving requires adjusting the terrain feature judgment criteria, while in the embodiments of this application, the Houdini node parameters (such as adjusting the terrain feature threshold of the Heightfield Slope node) can be directly modified, or the VEX script formula can be modified, without reprocessing the grayscale image, so as to quickly update the terrain feature calculation results and complete non-destructive iteration.
[0042] Traditional terrain effect modification solutions typically require artists to manually sculpt the terrain using basic brush tools. The workflow is as follows: Artists first select different sculpting brushes (such as ridge, erosion, smooth, etc.) in the game engine's terrain editing mode. Then, relying on their personal experience and artistic skills, they manually draw and refine the areas that need modification repeatedly. By continuously adjusting the brush intensity, size, and shape, they gradually approach the desired terrain effect, such as adding rocks at the foot of mountains or carving ravines on plains. Because modifications rely on manual work by artists, the efficiency is extremely low (adjusting a single area can take 2-3 hours), making the manpower and time costs unacceptable for ultra-large-scale maps. Furthermore, manual operation is highly subjective and arbitrary; once brushstroke effects are applied, they are difficult to undo or modify precisely, and it is difficult to maintain consistency in detail across different areas or among different personnel, resulting in irreversible and inconsistent modifications. In addition, the modification process relies entirely on manual judgment, making it impossible to automatically distribute and generate effects based on the physical characteristics of the terrain (such as slope and curvature) in a way that conforms to natural laws, resulting in stiff and unreliable effects. Finally, when any modification in the game engine requires a complete overhaul, non-destructive, parametric iteration is not possible, severely restricting creative flexibility.
[0043] In this embodiment, the grayscale image of the target model is obtained. The export and retrieval speed of the grayscale image is significantly faster than the loading and retrieval of the target model, laying an efficient foundation for subsequent processing. Furthermore, the grayscale image converts terrain height values into brightness values (grayscale values), ensuring that different technicians and different software (whether game engines or special effects software) are processing the same set of height data, avoiding the subjective biases of manual sculpting. Since the grayscale image is generated based on the target model, the original terrain data of the target model is not modified during the export or retrieval process. If adjustments are needed subsequently (such as modifying the basic terrain elevation), only the grayscale image needs to be re-exported or retrieved; there is no need to delete or reconstruct the original terrain, achieving non-destructive parametric iteration.
[0044] Step 012: Based on terrain features, determine the target area information in the target model that meets the preset terrain features. The target area information includes the spatial feature information and modification parameter information of the target area.
[0045] The target area information can be terrain-related data that meets preset terrain features, including spatial feature information and modification parameter information. Spatial feature information (such as pixel coordinates, terrain height values, etc.) can be used to locate the geometric and spatial relationship attributes of the target area, while modification parameter information (such as point cloud coordinates, point cloud attributes, etc.) can include the control logic attributes carried by the point cloud data, which can provide data support for subsequent terrain modification and can be parameters that drive the automated implementation process of terrain modification.
[0046] The preset terrain features can be feature conditions that are adaptively set according to the terrain modification requirements. They can include one or more features and are used to determine whether the terrain area corresponding to the pixel needs to be modified.
[0047] Specifically, different terrain features correspond to different geological detail requirements. Pixels can be filtered based on preset terrain features, and the set of pixels whose terrain features satisfy the preset features is taken as the target area. Compared with the related technologies that manually select the terrain features of each pixel in the modification area (such as manually selecting a ridge on a large map), which is time-consuming and difficult to accurately locate the selection boundary, the implementation method of this application filters based on the comparison of terrain features and preset terrain features, which can significantly improve the filtering efficiency (by tens of times) and the positioning accuracy. That is to say, relying on the curvature, slope, height and other quantitative features of the terrain height field data, the terrain model is automatically filtered through preset threshold conditions to determine the target area that needs to be modified with special effects; at the same time, the positioning data (spatial feature information) and modification data (modification parameter information) of the filtered target area are integrated to obtain the target area information, providing input data for the selection and use of subsequent terrain modification tools. Using the natural laws of terrain physical features as the filtering basis can also ensure the objectivity and accuracy of the target area filtering.
[0048] Step 013: Based on the target area information, select the target modification tool from the preset terrain modification tools, and control the target modification tool to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
[0049] The terrain modification tool can include terrain modification logic and the tools called for terrain modification. The terrain modification tool can be used to batch and automatically complete the modification of terrain details (such as adding rocks and erosion traces) during terrain modification or processing.
[0050] Optionally, the preset terrain modification tool includes preset terrain stamp assets. Preset terrain stamp assets (Stamps) can be reusable terrain modification units pre-created in the game engine, built based on stroke-based interaction logic. They can include terrain parameters and blueprint tools. Terrain parameters can be high-precision height images including terrain detail patterns, and blueprint tools can be blueprint logic. Blueprint logic includes components and interfaces that control the modification of terrain effects so that the terrain stamp assets can be invoked. For example, preset terrain stamp assets can include rock stamps, erosion mark stamps, and rubble pile stamps. Preset terrain stamp assets (Stamps) can be tools used for batch adding terrain details and encapsulating terrain modification logic. For ease of explanation, this application's embodiment uses preset terrain stamp assets as an example for description.
[0051] Specifically, as mentioned earlier, different target areas have different terrain features (such as high curvature, low slope, etc.) corresponding to different detail requirements (rocks, vegetation). By encapsulating the modification requirements and the tools to be called for modification into a preset terrain modification tool (i.e., a preset terrain brush asset), and selecting the target brush asset according to the modification requirements of the target area, the target brush asset can use the game engine's built-in interface (such as the Landmass plugin, Landscape Edit Layer interface, etc.) to convert the concavity and convexity data (elevation data) of its own height map into the actual terrain height changes of the target area. At the same time, the surface material can be updated synchronously through the material blending logic, ultimately achieving the matching of Stamp details and terrain. In other words, by using target brush assets, the terrain shape, height, and texture of the target area can be made consistent with the preset details of the target brush assets. Modifications can be completed quickly using target brush assets, improving efficiency. Furthermore, since target terrain brush assets are all generated based on uniformly preset terrain brush assets, their position, size, and shape all follow the same standards (e.g., the protrusion height and texture of rock stamps are completely uniform). Modification records can also be saved in Houdini Assets, enabling precise backtracking without resculpting, significantly reducing iteration costs. Moreover, all attributes can be adjusted through Houdini parameters, allowing for rapid adjustments to the global effect.
[0052] Thus, by acquiring the terrain height field data of the target model, the terrain features of the target model are determined based on the terrain height field data. The terrain height field data ensures that different technicians and different software (whether game engines or special effects software) are processing the same set of height data, avoiding the subjective bias of manual sculpting. Furthermore, since the terrain height field data does not involve modifying the original terrain data of the target model, if adjustments are needed later (such as modifying the basic terrain elevation), it is only necessary to re-export or re-read the terrain height field data, without deleting or reconstructing the original terrain, achieving non-destructive parametric iteration. The terrain features quantify the terrain morphology (such as high curvature for ridges, high slope for steep slopes), ensuring that the terrain feature recognition conforms to natural laws and avoiding the bias of human judgment. Then, based on the terrain features, the target area information in the target model that meets the preset terrain features is determined. The target area information includes the spatial information of the target area. Feature information and modification parameter information are filtered by comparing terrain features with preset terrain features, which can significantly improve filtering efficiency (by tens of times) and improve positioning accuracy. Finally, based on the target area information, a target modification tool is selected from the preset terrain modification tools, and the target modification tool is controlled to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool. The target modification tool can make the terrain shape, terrain height, terrain material, etc. of the target area consistent with the preset details of the target modification tool. Modification can be completed quickly through the target modification tool, improving modification efficiency. Moreover, since the target terrain modification tools are all generated based on the unified preset terrain modification tools, they all follow the same standards in terms of position, size, and shape (such as the protrusion height and material texture of rock stamps are completely uniform). The modification records can also be saved in Houdini Asset, which can achieve accurate backtracking without re-sculpting, greatly reducing iteration costs.
[0053] Optionally, step 012: Based on terrain features, determine the target area information in the target model that meets the preset terrain features, including: Step 0121: Based on the preset curvature threshold, preset slope threshold and preset height threshold, filter any two of the curvature image, slope image and grayscale image in sequence to determine the first masking area, the second masking area and the third masking area. The masking area matches the preset terrain feature setting. Step 0122: Based on the first masking region, the second masking region, and the third masking region, determine the target region and the spatial feature information of the target region that meet the preset terrain features from the target model.
[0054] The preset curvature threshold, preset slope threshold, and preset height threshold can be adaptively set by the user according to their terrain modification needs. If the curvature feature of a pixel is greater than the preset curvature threshold, the pixel can be considered to correspond to a terrain region with high curvature (such as a ridge or the edge of a ravine). If the slope feature of a pixel is greater than the preset slope threshold, the pixel can be considered to correspond to a terrain region with high slope (such as a steep slope or cliff), and less than the preset slope threshold, it can correspond to a terrain region with low slope (such as a plain or gentle slope). If the height value of a pixel after grayscale mapping is greater than the preset height threshold, the pixel can be considered to correspond to a terrain region with high altitude, and less than the preset height threshold, it can correspond to a terrain region with low altitude.
[0055] The first masking region, the second masking region, and the third masking region can be local areas selected based on different preset terrain features and marked as needing modification (e.g., marked with the attribute mask=1).
[0056] Optionally, the preset terrain features include at least one of the following: curvature attribute greater than a preset curvature threshold and slope attribute greater than a preset slope threshold; slope attribute greater than a preset slope threshold and height attribute greater than a preset height threshold; and slope attribute less than a preset slope threshold. For ease of explanation, this application embodiment uses the following as an example: the preset terrain features include curvature attribute greater than a preset curvature threshold and slope attribute greater than a preset slope threshold; slope attribute greater than a preset slope threshold and height attribute greater than a preset height threshold; and slope attribute less than a preset slope threshold. The first masking region corresponds to a region satisfying both curvature and slope attributes greater than the preset curvature threshold; the second masking region corresponds to a region satisfying both slope and height attributes greater than the preset height threshold; and the third masking region corresponds to a region satisfying both slope attributes less than the preset slope threshold.
[0057] Specifically, relying solely on curvature, slope, or height features to filter target areas may not accurately pinpoint areas requiring added details or modifications (e.g., a low-altitude steep slope might not need added rocks). Therefore, by acquiring any two of the curvature, slope, and grayscale images, a masking region that simultaneously meets natural characteristics (e.g., a ridge needs both high curvature and high slope to conform to natural geological laws) is selected, improving the accuracy of the selection. By setting a first, second, and third masking region to ensure no scene is missed, and after these three regions are generated independently, they are logically merged into a single target region (target_mask=1). For example, please refer to [link to relevant documentation]. Figure 6 , Figure 6The example shows an image after the target region has been extracted. This avoids repeatedly processing overlapping areas and covers all areas that need modification at once, providing a unified operational boundary for subsequent batch projection of target stroke assets without having to process different areas multiple times.
[0058] More specifically, for example, you can open the height field project containing the curvature image, slope image, and grayscale image in Houdini, and add three dedicated mask generation nodes (Houdini Heightfield Mask nodes), named Mask1, Mask2, and Mask3, corresponding to three sets of masking regions. See [link to Houdini documentation]. Figure 6 Then, regions with curvature features greater than a preset curvature threshold are selected by obtaining a curvature image, and regions with slope features greater than a preset slope threshold are selected by obtaining a slope image. By obtaining the intersection of the two regions, pixels that simultaneously satisfy high curvature and high slope are retained, and a first masking region is generated (mask1=1 for target pixels, mask1=0 for non-target pixels). Similarly, a second masking region (mask2=1) is generated (see [link to documentation]). Figure 7 ) and the third masking area (mask3=1) (see Figure 8 Then, by obtaining three masked regions, any pixel with a mask value of 1 is marked as a pixel in the target region (wherein, if a pixel satisfies any two of mask1, mask2, and mask3 simultaneously, it is marked only once to avoid repeated modification). Finally, please refer to... Figure 9 Generate a target region mask map based on the target region pixels (e.g., it can be a binary mask image, including target_mask=1 and target_mask=0), and use target_mask as a new terrain layer attribute (stored as @target_mask), and associate it with the original grayscale image (terrain height map) from step 011.
[0059] In some implementations, the spatial feature information includes pixel coordinates and terrain height values, and the modified parameter information includes point cloud coordinates and point cloud attributes. The method further includes: Step 014: Based on the pixel coordinates and terrain height values corresponding to the pixels in the target area, generate point cloud data for each target area, and determine the point cloud coordinates and point cloud attributes for each point cloud data. The point cloud coordinates are determined based on the pixel coordinates corresponding to the pixels in the target area, and the point cloud attributes are determined based on the terrain height values, curvature features, and slope features corresponding to the pixels in the target area.
[0060] Point cloud data can include point cloud coordinates and point cloud attributes. Point cloud coordinates can be three-dimensional spatial coordinates (x, y, z) formed by combining the 2D coordinates (x, y) of a pixel in the target area with the terrain height value (z) of that pixel. Point cloud attributes can be quantitative information of terrain features attached to each point cloud coordinate, describing the location of the point cloud.
[0061] Specifically, please refer to Figure 10 and Figure 11 In game engines, precise projection of target brush assets requires three-dimensional spatial positioning. Therefore, a three-dimensional point cloud coordinate system can be generated first based on the coordinates of the pixel position and its corresponding height value. This enables accurate positioning when modifying terrain in subsequent brush asset modifications. Since the terrain height, curvature, and slope features corresponding to pixels in the target area are discrete pixel-level features that cannot be directly accessed by the game engine, these features can be attached to the corresponding point cloud coordinates using scripts such as VEX, encapsulating them into standardized attributes. Finally, the point cloud data is output in a format readable by the game engine (.bgeo), ensuring no precision loss during cross-software transmission and providing reliable input for subsequent attribute mapping in the game engine.
[0062] Optionally, each masking region includes a masking identifier, preset terrain features include terrain type, the masking identifier matches the terrain type setting, point cloud attributes include point normal attributes and scaling attributes, and the method further includes: Step 015: Based on the terrain height value of the target pixel in the target region and the terrain height value of the neighboring pixels of the target pixel, calculate the height gradient vector of the target pixel, and normalize the height gradient vector to determine the point normal attribute. The height gradient vector represents the direction and degree of height change of the target pixel. Step 016: Based on the curvature features and the mapping relationship between curvature features, map the curvature features of the target pixels in the target region to determine the scaling attribute; Step 017: Integrate the point normal attributes, scaling attributes, and masking identifiers to obtain the point cloud attributes.
[0063] Among them, the masking identifier can be an identifier attached to the masking area and used to associate the terrain type. It can be defined as the stamp_id attribute, and each masking area corresponds to a unique stamp_id.
[0064] The point normal attribute (@N) can be an attribute used to characterize the orientation of the terrain surface (e.g., the normal slopes along the slope direction on steep slopes).
[0065] The scaling attribute (@pscale) can be a quantized value calculated based on curvature or slope features to control the size of the stamp.
[0066] Among them, the height gradient vector represents the height change between the target pixel and its neighboring pixels. The direction of height change can be the direction of the fastest height increase, and the magnitude of height change can be the degree of height change.
[0067] The mapping relationship between curvature features can be represented by a range mapping function, which can be the fit() function, used to linearly map a numerical range (such as curvature feature 0-1) to another target range (such as mapping to scaling attribute 0.8-1.5).
[0068] Specifically, please refer to Figure 12 The height gradient vector (reflecting the direction and magnitude of height changes) can be calculated using the `volumegradient` function. After normalization to remove amplitude interference, the point normal attribute (@N) representing only the terrain orientation is obtained. This ensures that the subsequent Stamp projection is aligned with the ground surface and fits the terrain without skew. Since the Stamp size needs to adapt to the terrain shape (e.g., a small Stamp is needed for a high-curvature ridge, and a large Stamp is needed for a gentle plain), the curvature features are mapped to the corresponding scaling range using the `fit()` function, forming a natural mapping where the larger the curvature, the smaller the scaling during projection, avoiding the arbitrariness of manually adjusting the Stamp size. Because the point normal attribute and scaling attribute alone cannot achieve accurate Stamp projection, it is also necessary to combine the mask identifier (@stamp_id) with the terrain type (e.g., when stamp_id=0, a rock Stamp from a rock image is selected), the point normal attribute (@N) with the Stamp's rotation, and the scaling attribute with the Stamp's size matching relationship. This provides the game engine with a one-stop data instruction for modifying and projecting terrain based on the target stroke asset.
[0069] For example, you can use the Houdini Heightfield To Points node to obtain the target area and grayscale image, and set the point density in the Houdini node parameter panel (used to define the number of point clouds generated per square meter; the higher the point density, the denser the point cloud, and the more detailed the subsequent stamp). The node can traverse all pixels of the target area (ensuring that the point cloud only covers the terrain area to be modified), and combine the two-dimensional coordinates of each pixel with the corresponding terrain height value to generate three-dimensional point cloud coordinates (x, y, z), which are stored by default as the position coordinates of the point cloud, i.e., the @P attribute (a built-in Houdini position attribute). Then, by calculating the height gradient vector of the target pixel through the Houdini Point Wrangle node and normalizing the height gradient vector, you can obtain the point normal attribute (@N). Furthermore, you can check in the Houdini GeometrySpreadsheet panel whether the direction of the point normal attribute is consistent with the direction of the terrain in the target area (e.g., @N tilts along the slope direction on steep slopes). Next, the curvature features are mapped to the scaling attribute (@pscale) in the Point Wrangle node using the fit() function. Then, the mask identifier (@stamp_id), point normal attribute (@N), and scaling attribute (@pscale) assigned to the target pixel in the Attribute Wrangle node are integrated into the current point cloud attributes in (.bgeo) format and stored in the point cloud data for subsequent integration with the game engine.
[0070] In some implementations, the terrain modification tool includes terrain stroke assets, which include blueprint tools. Step 013: Based on target area information, a target modification tool is selected from a preset set of terrain modification tools, and the target modification tool is controlled to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool, including: Step 0131: Select the target stroke asset from the preset terrain stroke assets according to the masking identifier, and modify the terrain of the target area using the blueprint tool of the target stroke asset so that the terrain of the target area matches the terrain image of the target stroke asset.
[0071] The modified parameter information includes point cloud attributes, which include masking identifiers (point cloud attributes are obtained by integrating point normal attributes, scaling attributes, and masking identifiers).
[0072] Among them, the blueprint tool can be a Stamp blueprint (Blueprint Actor) that encapsulates terrain interaction logic, used to receive external parameters and drive applications that drive terrain images.
[0073] In UE5, each preset Stamp (terrain stroke asset) has a corresponding asset path (i.e., it can be considered a unique storage identifier). The asset path is used to determine the location of the stroke asset in the game engine's resource manager, ensuring that Houdini Engine can accurately locate and call it. Therefore, by using the mapping relationship between the mask identifier and the asset path, a target stroke asset can be selected from the preset terrain stroke assets to achieve dynamic mapping of the Stamp stroke asset. Finally, the terrain of the target area is modified using the Blueprint tool of the target stroke asset to match the terrain image of the target area with that of the target stroke asset.
[0074] In some implementations, step 0131: Modifying the terrain of the target area using the blueprint tool of the target stroke asset to match the terrain image of the target area with that of the target stroke asset includes: Step 01311: Assign a value to the first parameter of the Blueprint tool based on the point cloud position to determine the projection position of the target stroke asset; assign a value to the second parameter of the Blueprint tool based on the point normal attribute to determine the rotation angle of the target stroke asset; and assign a value to the third parameter of the Blueprint tool based on the scaling attribute to determine the stroke radius of the target stroke asset. Step 01312: Generate multiple blueprint instances based on the values of the first, second, and third parameters. Each blueprint instance includes the terrain image of the target brushstroke asset and the terrain modification logic. Step 01313: Based on the terrain image of the target brush asset, modify the terrain of the target area by calling the modification interaction logic of the blueprint instance, so that the terrain of the target area matches the terrain image of the target brush asset, and the number of blueprint instances matches the number of point clouds at the point cloud location.
[0075] The projection position can be the final placement coordinates of the target stamp asset in the UE5 terrain. The projection position matches the point cloud position @P to ensure that the stamp accurately covers the pixels to be modified in the target area and avoids position offset.
[0076] The rotation angle can be the tilt angle of the stamp to prevent the stamp from being placed horizontally on non-flat terrain.
[0077] The scaling attribute can be used to characterize the overall scaling ratio of the Stamp, which is directly related to the stroke radius.
[0078] The brushstroke radius can be the effective modification radius of the target brushstroke asset on the terrain.
[0079] Specifically, by matching the point cloud position and the projection position, it is ensured that each pixel to be modified has a corresponding Stamp cover, and the tilt angle of the Stamp projection is determined according to the point normal attribute to ensure that the Stamp tilts along the terrain direction to avoid shape inconsistency of the Stamp. According to the scaling attribute, it is ensured that the size of the Stamp adapts to the terrain shape and conforms to the natural detail distribution law.
[0080] More specifically, for example, see Figure 13 and Figure 14High-precision geological detail models, such as rock blocks, erosion marks, and gravel piles, can be created in UE5's Modeling Mode or Blender / Maya and exported as heightmaps as preset terrain stroke assets. Stamps can be configured in the game engine using Blueprint Actors. A Stamp Blueprint includes a root component (Scene Component) that receives projection position, rotation angle parameters, etc., and a MultiLandscapeTexturePatch component that references the Stamp's terrain image (heightmap). The Blueprint can also expose the projection position (Location parameter), rotation angle (Rotation parameter), and stroke radius (Scale parameter). Next, the mapping between point cloud attributes and the Stamp is completed in Houdini AssetActor in UE5: First, the point cloud coordinates are read and directly assigned to the Location parameter (first parameter) of the blueprint to determine the projection position. Then, using UE5's vector to rotation matrix tool, the point normal attribute @N is converted into the Rotation parameter (second parameter) of the Stamp blueprint. Finally, the scaling attribute @pscale is assigned to the Scale parameter (third parameter) of the Stamp blueprint, and the stroke radius is calculated through the blueprint's built-in logic. Houdini Engine generates Stamp instances (i.e., blueprint instances) in batches at the projection position based on the number of point clouds at the same point cloud location. Each instance automatically triggers the terrain modification logic (terrain interaction logic) in the blueprint when it is generated. In other words, the MultiLandscapeTexturePatch component of the Stamp blueprint calls the Landmass plugin interface or the Landscape Edit Layer interface to read the terrain image (height image or grayscale image) built into the Stamp, parses the grayscale value of each pixel, and converts the grayscale value of the grayscale image into the actual height change of the target area terrain with the projection position as the center and the stroke radius as the range, realizing batch modification of the terrain. In addition, the Virtual Texture or Material Layer Blend tools can be used to blend the materials associated with the Stamp (such as rock texture) with the original terrain material of the target area to achieve material matching, so that the shape and material of the target area terrain are completely consistent with the Stamp, without manual intervention. Since the original terrain data remains unchanged, all modifications are controlled through the Houdini node network, and the Stamp generation record is stored in Houdini Asset, which can realize a non-destructive workflow without manual management. After modifying the parameters in Houdini (such as point cloud density, attribute calculation formula), the data can be directly regenerated by the engine. When modifying, the old Stamp instance in the game engine is cleared, and the new instance is generated according to the updated point cloud, realizing rapid modification.
[0081] In some implementations, the method further includes: Step 018: In response to the user's input, update at least one of the following: point cloud attributes, number of points at the point cloud location, preset curvature threshold, preset slope threshold, and preset height threshold; Step 019: Clear the blueprint instance, and after clearing, re-enter the steps of assigning values to the first parameter of the blueprint tool based on the point cloud position to determine the projection position of the target stroke asset, assigning values to the second parameter of the blueprint tool based on the point normal property to determine the rotation angle of the target stroke asset, and assigning values to the third parameter of the blueprint tool based on the scaling property to determine the stroke radius of the target stroke asset.
[0082] Specifically, when terrain effects need to be adjusted, users can update the corresponding parameters by inputting at least one of the following on the interactive display screen: point cloud attributes, the number of points at the point cloud location, a preset curvature threshold, a preset slope threshold, and a preset height threshold. Then, the previously generated blueprint instance is cleared, and after clearing, the point cloud data is regenerated based on the updated parameters, and the process returns to step 01311 to generate a blueprint instance again. In other words, when terrain effects need to be adjusted, modifying the parameterized configuration in Houdini triggers a point cloud data regeneration command. The regenerated point cloud data is synchronized to UE5 via Houdini. UE5 automatically clears the old blueprint instances within the current target area and, based on the updated point cloud data, regenerates a new blueprint instance according to the projection position, rotation angle, and stroke radius, completing the real-time update of the terrain effects. During the iteration process, the original terrain data is always traceable, eliminating the need to rebuild the target model or re-execute terrain feature calculations and target area selection steps, achieving non-destructive and efficient iterative optimization.
[0083] In other words, when the terrain effects are processed using point cloud data in this embodiment, the point cloud-driven approach can achieve tens of thousands to millions of Stamp instantiations, which can greatly improve production efficiency. Furthermore, the attributes of each Stamp instance are precisely calculated by Houdini to ensure that the effect conforms to natural laws. The parametric workflow allows terrain editing to be quickly adjusted and repeatedly tested, reducing the cost of creative trial and error. Artists can macroscopically control the overall effect by adjusting Houdini parameters, while retaining complete artistic control over individual Stamp assets, thus achieving a combination of artistic controllability and procedural efficiency.
[0084] To facilitate better implementation of the terrain effect processing method of the embodiments of this application, the embodiments of this application also provide a terrain effect processing apparatus. Please refer to... Figure 15 , Figure 15A schematic diagram of the terrain effect processing apparatus provided in this application embodiment. The terrain effect processing apparatus 200 may include: The acquisition module 201 is used to acquire the terrain height field data of the target model and determine the terrain features of the target model based on the terrain height field data; The determination module 202 is used to determine the target area information in the target model that meets the preset terrain features based on terrain features. The target area information includes the spatial feature information and modification parameter information of the target area. Modification module 203 is used to select a target modification tool from a preset set of terrain modification tools based on the target area information, and control the target modification tool to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
[0085] Each unit in the aforementioned terrain effects processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each unit.
[0086] The terrain effects processing device 200 can be integrated into a terminal or server that has storage and a processor and thus computing power, or the terrain effects processing device 200 can be the terminal or server.
[0087] Optionally, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0088] Figure 16 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be a terminal or a server. Figure 16 As shown, the computer device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will understand that the computer device structure shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0089] The processor 301 is the control center of the computer device 300. It connects various parts of the computer device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it performs various functions of the computer device 300 and processes data, thereby performing overall processing of the computer device 300.
[0090] In this embodiment, the processor 301 in the computer device 300 loads the instructions corresponding to the processes of one or more computer programs into the memory 302 according to the following steps, and the processor 301 runs the computer programs stored in the memory 302 to realize various functions: Obtain the terrain height field data of the target model, and determine the terrain features of the target model based on the terrain height field data; Based on the terrain features, target area information that meets the preset terrain features in the target model is determined. The target area information includes spatial feature information and modification parameter information of the target area. Based on the target area information, a target modification tool is selected from the preset terrain modification tools, and the target modification tool is controlled to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
[0091] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0092] Optional, such as Figure 16 As shown, the computer device 300 also includes: a display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 16 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0093] The display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs) of the computer device. These GUIs can be composed of graphics, text, icons, video, and any combination thereof. The touch panel can be used to collect user touch operations on or near the touch panel (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation instructions, and execute the corresponding program. Optionally, the touch panel may include a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel may cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel according to the type of touch event. In this embodiment, the touch panel and display panel can be integrated into the display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and display panel can be implemented as two independent components to achieve input and output functions. That is, the display screen 303 can also be used as part of the input unit 306 to achieve input functions.
[0094] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.
[0095] Audio circuitry 305 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and output to processor 301 for processing. The audio data is then transmitted via radio frequency circuitry 304 to, for example, another computer device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.
[0096] The input unit 306 can be used to receive input numbers, characters, or object feature information (such as fingerprints, irises, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0097] Power supply 307 is used to supply power to various components of computer device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0098] although Figure 16 As not shown in the diagram, computer equipment 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0099] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the terrain effects processing method of the embodiments of this application; for the sake of brevity, these will not be elaborated further here.
[0100] This application also provides a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the terrain effects processing method described in the embodiments of this application. For simplicity, further details are omitted here.
[0101] This application also provides a computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the terrain effects processing method of this application; for brevity, further details are omitted here.
[0102] It should be understood that the processor in this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0103] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0105] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0106] 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.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] In addition, the functional units in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0110] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0111] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for processing terrain effects, characterized in that, include: Obtain the terrain height field data of the target model, and determine the terrain features of the target model based on the terrain height field data; Based on the terrain features, target area information that meets the preset terrain features in the target model is determined. The target area information includes spatial feature information and modification parameter information of the target area. Based on the target area information, a target modification tool is selected from the preset terrain modification tools, and the target modification tool is controlled to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
2. The method for processing terrain effects according to claim 1, characterized in that, The terrain features include curvature features and slope features. The curvature features characterize the degree of curvature of the terrain, and the slope features characterize the degree of change in terrain height. Acquiring terrain height field data of the target model and determining the terrain features of the target model based on the terrain height field data includes: According to the preset mapping relationship between height value and gray value, the terrain height field data of the target model is mapped to gray value to generate a grayscale image. The gray value of the target pixel on the grayscale image represents the terrain height value of the target vertex position of the target model. The target pixel and the target vertex correspond to each other. Based on the terrain height value corresponding to each pixel and the terrain height value of adjacent pixels, the curvature feature and slope feature of each pixel are calculated respectively. A curvature image is generated based on the curvature features of each pixel, and a slope image is generated based on the slope features of each pixel. Based on the curvature image and the slope image, the terrain features of the target model are determined.
3. The method for processing terrain effects according to claim 1, characterized in that, The step of determining the target area information in the target model that satisfies the preset terrain features based on the terrain features includes: Based on preset curvature threshold, preset slope threshold and preset height threshold, any two of the curvature image, slope image and grayscale image are filtered in sequence to determine the first masking area, the second masking area and the third masking area, wherein the masking area matches the preset terrain feature setting; Based on the first masking region, the second masking region, and the third masking region, a target region that meets the preset terrain features and the spatial feature information of the target region are determined from the target model.
4. The method for processing terrain effects according to claim 3, characterized in that, The preset terrain features include at least one of the following: the curvature attribute is greater than the preset curvature threshold and the slope attribute is greater than the preset slope threshold; the slope attribute is greater than the preset slope threshold and the height attribute is greater than the preset height threshold; and the slope attribute is less than the preset slope threshold.
5. The method for processing terrain effects according to claim 3 or 4, characterized in that, The spatial feature information includes pixel coordinates and terrain height values, the modified parameter information includes point cloud coordinates and point cloud attributes, and the method further includes: Based on the pixel coordinates and terrain height values corresponding to the pixels of the target region, point cloud data for each target region is generated, and the point cloud coordinates and point cloud attributes of each point cloud data are determined. The point cloud coordinates are determined based on the pixel coordinates corresponding to the pixels of the target region, and the point cloud attributes are determined based on the terrain height values, curvature features, and slope features corresponding to the pixels of the target region.
6. The method for processing terrain effects according to claim 5, characterized in that, Each of the masking areas includes a masking identifier, the preset terrain features include a terrain type, the masking identifier matches the terrain type setting, and the method further includes: Based on the terrain height value of the target pixel in the target region and the terrain height value of the neighboring pixels of the target pixel, the height gradient vector of the target pixel is calculated, and the height gradient vector is normalized to determine the point normal attribute. The height gradient vector represents the height change direction and the degree of height change of the target pixel. Based on the curvature features and the mapping relationship between the curvature features, the curvature features of the target pixels in the target region are mapped to determine the scaling attributes; The point normal attribute, the scaling attribute, and the masking identifier are integrated to obtain the point cloud attribute.
7. The method for processing terrain effects according to claim 6, characterized in that, The terrain modification tool includes terrain stroke assets, which include blueprint tools. The step of selecting a target modification tool from a preset set of terrain modification tools based on the target area information, and controlling the target modification tool to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool, includes: Based on the masking identifier, a target brushstroke asset is selected from the preset terrain brushstroke assets, and the terrain of the target area is modified using the blueprint tool of the target brushstroke asset so that the terrain of the target area matches the terrain image of the target brushstroke asset.
8. The method for processing terrain effects according to claim 7, characterized in that, The step of modifying the terrain of the target area using the blueprint tool of the target brushstroke asset to match the terrain image of the target area with the terrain image of the target brushstroke asset includes: The first parameter of the blueprint tool is assigned a value based on the point cloud position to determine the projection position of the target stroke asset; the second parameter of the blueprint tool is assigned a value based on the point normal attribute to determine the rotation angle of the target stroke asset; and the third parameter of the blueprint tool is assigned a value based on the scaling attribute to determine the stroke radius of the target stroke asset. Based on the values of the first parameter, the second parameter, and the third parameter, multiple blueprint instances are generated, each blueprint instance including the terrain image and terrain modification logic of the target brushstroke asset; Based on the terrain image of the target brushstroke asset, the terrain of the target area is modified by calling the modification interaction logic of the blueprint instance, so that the terrain of the target area matches the terrain image of the target brushstroke asset, and the number of blueprint instances matches the number of point clouds at the point cloud location.
9. The method for processing terrain effects according to claim 8, characterized in that, Also includes: In response to user input, at least one of the point cloud attributes, the number of points at the point cloud location, the preset curvature threshold, the preset slope threshold, and the preset height threshold is updated. Clear the blueprint instance, and after clearing, re-enter the steps of assigning a first parameter to the blueprint tool based on the point cloud position to determine the projection position of the target stroke asset, assigning a second parameter to the blueprint tool based on the point normal attribute to determine the rotation angle of the target stroke asset, and assigning a third parameter to the blueprint tool based on the scaling attribute to determine the stroke radius of the target stroke asset.
10. A terrain effects processing device, characterized in that, include: The acquisition module is used to acquire the terrain height field data of the target model and determine the terrain features of the target model based on the terrain height field data. The determination module is used to determine, based on the terrain features, target area information in the target model that meets the preset terrain features, wherein the target area information includes spatial feature information and modification parameter information of the target area; The modification module is used to select a target modification tool from the preset terrain modification tools based on the target area information, and control the target modification tool to modify the terrain of the target area so that the terrain of the target area matches the terrain of the target modification tool.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the terrain effects processing method as described in any one of claims 1-9.
12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the terrain effects processing method according to any one of claims 1-9 by calling the computer program stored in the memory.
13. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the terrain effect processing method according to any one of claims 1-9.