Terrain rendering method and device during dynamic operation, electronic equipment and storage medium

By setting up dynamic texture containers and virtual texture page table update mechanisms in the game engine, and optimizing texture management, the problem of unbalanced rendering pressure and performance pressure in RVT technology is solved, efficient and flexible terrain rendering is achieved, and the immersion and smoothness of the game is improved.

CN120268045APending Publication Date: 2025-07-08PERFECT WORLD INTERACTIVE ENTERTAINMENT (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510435869.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, RVT technology has inconsistent rendering pressure and performance pressure in big world games, unbalanced resource consumption, and it is difficult to reduce rendering pressure and performance pressure while ensuring that the tex density is high enough. Terrain rendering is not efficient enough, and flexibility and compatibility are poor.

Method used

By setting up a dynamic texture container in the game engine, dynamically manage virtual textures according to the player's character position, follow the scene view target movement, update the virtual texture page table, optimize texture loading and unloading, ignore low-detail hierarchical texture movement, divide safe areas and pixel units, control texture container offset, and achieve efficient terrain rendering.

Benefits of technology

It significantly reduces the rendering pressure and performance burden, improves the efficiency and flexibility of terrain rendering, enhances compatibility, and makes terrain rendering more efficient and smooth in big world games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120268045A_ABST
    Figure CN120268045A_ABST
Patent Text Reader

Abstract

The invention discloses a terrain rendering method and device during dynamic operation, electronic equipment and a storage medium, relates to the technical field of image processing, can set a smaller virtual texture page table under the condition of achieving the same texel density, and remarkably reduces rendering pressure and performance burden. The method comprises the following steps: determining a target scene, setting a dynamic texture container in the target scene according to the current position of a player character in the target scene, and setting a created dynamic virtual texture in the target scene according to the dynamic texture container; determining a safe area in the dynamic texture container according to the current position of the player character in the target scene; when it is detected that the scene view target of the target scene moves beyond the safety area, controlling the dynamic texture container to move along with the scene view target; and according to the position of the moved dynamic texture container in the target scene, updating the virtual texture page table, and performing terrain rendering on the target scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technologies, and particularly to a terrain rendering method, apparatus, electronic device, and storage medium during dynamic runtime. Background Art

[0002] In the field of electronic games, especially in large-world games, the rendering of the ground is the cornerstone of building an immersive game environment. For example, the terrains of large-scale open-world games such as 4K, 8K, and 64K are vast and complex, posing relatively high requirements for rendering technologies. The ground is not only the basic plane for players to move on, but also carries rich details such as grasslands, stone paths, puddles, etc., and also reflects the fusion and transition effect between the ground and objects. Therefore, in order to achieve realistic terrain rendering, virtual texture technology has emerged. By dynamically managing and optimizing texture resources, while maintaining high image quality, it effectively reduces the rendering burden and improves game performance.

[0003] In related technologies, the UE engine (Unreal Engine, a kind of virtual engine) provides a virtual texture technology called RVT (Runtime Virtual Texture). The upper limit of the PageTable in RVT is 4096x4096. In large-world scenarios, the area covered by each page is too large, so that more objects will be rendered into the RVT each time the page is updated, which will increase the rendering pressure and occupy a large amount of memory. Therefore, the UE engine also provides an Adaptive PageTable as a solution, which redirects the Page Table through the PageTableIndirection process to support an extremely large Page Table.

[0004] However, the applicant has recognized that at least the following technical problems exist in the process of implementing related technologies:

[0005] The redirection of Page Table in RVT technology will increase the number of samplers, the amount of calculation, and frequent remap page, resulting in unstable resource consumption. In large-world games, distant views usually use HLOD (Hierarchical Level of Detail) or LevelOD (Level of Detail) technology to optimize rendering. Too large Volume size will waste memory resources, and changing the Volume size or position will cause the entire RVT process to reset, including clearing all data in the Render thread. All visible pages need to be re-rendered. It is impossible to simply adjust the volume to follow the movement of the protagonist to solve the PageTable size limitation problem. It is difficult to reduce rendering pressure and performance pressure while ensuring that the RVT texel density is high enough. Terrain rendering is not efficient enough, and its flexibility and compatibility are poor. Summary of the invention

[0006] In view of this, the present application provides a terrain rendering method, device, electronic device and storage medium during dynamic runtime, the main purpose of which is to solve the current problems that it is difficult to reduce rendering pressure and performance pressure while ensuring that the RVT texel density is high enough, the terrain rendering is not efficient enough, and the flexibility and compatibility are poor.

[0007] According to a first aspect of the present application, a terrain rendering method during dynamic runtime is provided, the method comprising:

[0008] Determine a target scene for terrain rendering, set a dynamic texture container in the target scene according to the current position of the player character in the target scene, and set the created dynamic virtual texture in the target scene according to the dynamic texture container;

[0009] Determine a safe area in the dynamic texture container according to the current position of the player character in the target scene;

[0010] When it is detected that the scene view target of the target scene moves and the movement exceeds the safety area, controlling the dynamic texture container to move with the scene view target;

[0011] The virtual texture page table is updated with reference to the position of the moved dynamic texture container in the target scene, and the dynamic virtual texture and the updated virtual texture page table are used to perform terrain rendering on the target scene.

[0012] Optionally, setting a dynamic texture container in the target scene according to the current position of the player character in the target scene, and setting the created dynamic virtual texture in the target scene according to the dynamic texture container includes:

[0013] Create the dynamic virtual texture, enable the dynamic page table function, and set to ignore texture movement at low detail levels when the target in the scene view moves, where the number of low detail levels ignored for movement is greater than the number of low detail levels removed from the virtual texture;

[0014] Query the current position of the player character in the target scene and set the dynamic texture container at that position;

[0015] Set the dynamic virtual texture in the dynamic texture container so that the dynamic virtual texture is set in the target scene, and set a set of material parameters in the dynamic texture container.

[0016] Optionally, before determining the safe area in the dynamic texture container according to the current position of the player character in the target scene, the method further includes:

[0017] Set a virtual texture management component on the target of the scene view in the target scene so that the virtual texture management component moves following the target of the scene view, and control the movement of the dynamic texture container according to the movement of the scene view.

[0018] Optionally, determining the safe area in the dynamic texture container according to the current position of the player character in the target scene includes:

[0019] Divide the dynamic texture container into multiple pixel units;

[0020] Obtain a preset quantity threshold, and determine multiple target pixel units that are closest to the player character and have a quantity equal to the quantity threshold in the multiple pixel units with the current position of the player character in the target scene as the center;

[0021] Take the area where the multiple target pixel units are located as the safe area.

[0022] Optionally, dividing the dynamic texture container into multiple pixel units includes:

[0023] Obtain the preset size of the safe area and the pixel value corresponding to the virtual texture page table at the highest detail level, and calculate the division quantity using the size of the safe area and the pixel value;

[0024] Divide the dynamic texture container according to the container size of the dynamic texture container and the number of divisions, so as to obtain the multiple pixel units with the number equal to the number of divisions.

[0025] Optionally, the controlling the dynamic texture container to move following the scene view target includes:

[0026] Determine the original position where the scene view target is located before moving, and determine the changed position where the scene view target is located after moving;

[0027] Identify the moving direction of the scene view target, count the number of unit pixels separated between the original position and the changed position, and offset the dynamic texture container according to the moving direction and the number of units, so that the dynamic texture container moves following the scene view target.

[0028] Optionally, the referring to the position of the moved dynamic texture container in the target scene to update the virtual texture page table, and using the dynamic virtual texture and the updated virtual texture page table to perform terrain rendering on the target scene includes:

[0029] Determine the target position of the moved dynamic texture container in the target scene, and query the target level of detail corresponding to the virtual texture at the target position in the dynamic virtual texture;

[0030] Clear the pixel information greater than the target level of detail in the virtual texture page table to obtain the updated virtual texture page table;

[0031] Use the pixel information less than or equal to the target level of detail in the virtual texture page table as valid pixel information, control the valid pixel information to offset following the dynamic texture container on the dynamic virtual texture, and perform terrain rendering on the target scene in combination with the updated virtual texture page table.

[0032] Optionally, the method further includes:

[0033] When it is detected that the scene view target of the target scene moves and the movement does not exceed the safe area, obtain the current virtual texture page table, and use the dynamic virtual texture and the current virtual texture page to perform terrain rendering on the target scene.

[0034] According to the second aspect of the present application, there is provided a terrain rendering device during dynamic runtime, and the device includes:

[0035] A setting module, configured to determine a target scene for terrain rendering, set a dynamic texture container in the target scene according to the current position of the player character in the target scene, and set the created dynamic virtual texture in the target scene according to the dynamic texture container;

[0036] A determination module, configured to determine a safe area in the dynamic texture container according to the current position of the player character in the target scene;

[0037] A movement module, configured to control the dynamic texture container to move following the scene view target when it is detected that the scene view target of the target scene moves and the movement exceeds the safe area;

[0038] A rendering module, configured to update the virtual texture page table with reference to the position of the moved dynamic texture container in the target scene, and perform terrain rendering on the target scene using the dynamic virtual texture and the updated virtual texture page table.

[0039] Optionally, the setting module is configured to create the dynamic virtual texture, enable the dynamic page table function, and set to ignore the texture movement of the low detail level when the scene view target moves, where the number of low detail levels ignored in the movement is greater than the number of low detail levels removed from the virtual texture; query the current position of the player character in the target scene, and set the dynamic texture container at this position; set the dynamic virtual texture in the dynamic texture container so that the dynamic virtual texture is set in the target scene, and set a set of material parameters in the dynamic texture container.

[0040] Optionally, the setting module is further configured to set a virtual texture management component on the scene view target of the target scene, so that the virtual texture management component moves following the scene view target, and control the movement of the dynamic texture container according to the movement of the scene view.

[0041] Optionally, the determination module is configured to divide the dynamic texture container into multiple pixel units; obtain a preset quantity threshold, and determine, centered on the current position of the player character in the target scene, multiple target pixel units that are the closest to the player character and the quantity is equal to the quantity threshold in the multiple pixel units; and use the area where the multiple target pixel units are located as the safe area.

[0042] Optionally, the determining module is configured to obtain the pixel values corresponding to the preset safety area size and the virtual texture page table at the preset highest level of detail, calculate the number of divisions by using the safety area size and the pixel values; and divide the dynamic texture container with reference to the container size of the dynamic texture container and the number of divisions to obtain the multiple pixel units with the number equal to the number of divisions.

[0043] Optionally, the moving module is configured to determine the original position where the scene view target is located before moving, and determine the changed position where the scene view target is located after moving; identify the moving direction of the scene view target, count the number of pixel units between the original position and the changed position, and offset the dynamic texture container according to the moving direction and the number of units, so that the dynamic texture container moves following the scene view target.

[0044] Optionally, the rendering module is configured to determine the target position where the moved dynamic texture container is located in the target scene, query the target level of detail corresponding to the virtual texture at the target position in the dynamic virtual texture; clear the pixel information greater than the target level of detail in the virtual texture page table to obtain the updated virtual texture page table; use the pixel information less than or equal to the target level of detail in the virtual texture page table as valid pixel information, control the valid pixel information to move following the dynamic texture container on the dynamic virtual texture, and perform terrain rendering on the target scene in combination with the updated virtual texture page table.

[0045] Optionally, the rendering module is further configured to, when it is detected that the scene view target of the target scene moves and the movement does not exceed the safety area, obtain the current virtual texture page table, and perform terrain rendering on the target scene by using the dynamic virtual texture and the current virtual texture page.

[0046] According to a third aspect of the present application, an electronic device is provided, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of the first aspects are implemented.

[0047] According to a fourth aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method according to any one of the first aspects are implemented.

[0048] With the above technical solution, a terrain rendering method, device, electronic device, and storage medium during dynamic runtime provided by the present application determine a target scene to be subjected to terrain rendering, set a dynamic texture container in the target scene according to the current position of the player character in the target scene, and set the created dynamic virtual texture in the target scene according to the dynamic texture container. A safe area is determined in the dynamic texture container according to the current position of the player character in the target scene. When it is detected that the scene view target of the target scene moves and the movement exceeds the safe area, the dynamic texture container is controlled to move following the scene view target. The virtual texture page table is updated with reference to the position where the moved dynamic texture container is located in the target scene, and the target scene is subjected to terrain rendering using the dynamic virtual texture and the updated virtual texture page table. By using a smaller dynamic texture container that can move following the scene camera in a large world, a smaller virtual texture page table can be set under the same texel density, solving the problem of the size limitation of the virtual texture page table, significantly reducing the rendering pressure and performance burden, and making terrain rendering in large world games more efficient, flexible, and compatible.

[0049] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present application more obvious and understandable, the specific embodiments of the present application are specifically given below. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0051] Figure 1 It shows a schematic flowchart of a terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0052] Figure 2A It shows a schematic flowchart of another terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0053] Figure 2B It shows a schematic diagram of a terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0054] Figure 2C It shows a schematic diagram of a terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0055] Figure 2DShows a schematic flowchart of yet another terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0056] Figure 2E Shows a schematic diagram of a terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0057] Figure 2F Shows a schematic diagram of a terrain rendering method during dynamic runtime provided by an embodiment of the present application;

[0058] Figure 3 Shows a schematic structural diagram of a terrain rendering device during dynamic runtime provided by an embodiment of the present application;

[0059] Figure 4 Shows a schematic structural diagram of a device of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0060] Hereinafter, exemplary embodiments of the present application will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be completely conveyed to those skilled in the art.

[0061] An embodiment of the present application provides a terrain rendering method during dynamic runtime. As Figure 1 shown, the method includes:

[0062] 101. Determine a target scene to be subjected to terrain rendering, set a dynamic texture container in the target scene according to the current position of the player character in the target scene, and set the created dynamic virtual texture in the target scene according to the dynamic texture container.

[0063] The embodiment of the present application can be applied to a game rendering engine. The game rendering engine will first determine a target scene to be subjected to terrain rendering. The target scene is also the virtual environment where the player character conducts game activities, such as a forest, a desert, or a city area in an open-world game. To optimize the rendering performance, the game rendering engine will set a dynamic texture container in the target scene according to the current position of the player character in the target scene. The dynamic texture container is used to store and manage dynamically generated dynamic virtual textures. The dynamic virtual texture is a technology that stores high-resolution textures in blocks and dynamically loads them, and is used to optimize the rendering efficiency of large-scale terrains and will be subsequently applied to the ground surface and objects in the target scene.

[0064] In the embodiments of the present application, the dynamic texture container is a virtual area that can adjust its position in real time as the player character or the scene view target (i.e., the scene camera) moves, so that no matter where the player character or the scene view target moves, the terrain and the objects on the ground surface around it can be updated and rendered with real-time textures. For example, when the player character approaches a certain area, the texture container will move with the player character so that the texture container covers the area to ensure the coverage of high-resolution textures for the area; while when the player moves away, the texture container also moves away with the player character to save resources. Further, in the embodiments of the present application, the size and shape of the dynamic texture container can be set according to actual needs. For example, it can be set as a rectangular or circular area centered on the player character, and dynamic virtual textures are created and applied within this area, and the dynamic virtual textures maintain a consistent resolution throughout the target scene.

[0065] In this way, through the dynamic adjustment mechanism, it is possible to significantly reduce unnecessary texture memory occupancy while maintaining the required texel density, thereby reducing the rendering pressure. For example, in a grassland scene, when the player approaches a certain patch of grass, the texture details of this area will automatically increase, while the grass in the distance maintains lower texture details to optimize performance.

[0066] 102. Determine a safe area in the dynamic texture container according to the current position of the player character in the target scene.

[0067] In the embodiments of the present application, the game rendering engine will determine a safe area (referred to as SafeArea in the following description) in the dynamic texture container according to the current position of the player character in the target scene. The safe area is a specific range around the player character, and in the safe area, it is necessary to ensure that when the player character moves normally, the textures within the field of view will not suddenly disappear due to the boundary of the container or show obvious texture switching traces.

[0068] In the actual application process, the size and shape of the safe area can be set according to game requirements or the movement speed of the player character. For example, for a player character moving quickly, the safe area will be correspondingly enlarged to ensure that when the player quickly turns or accelerates, the textures within the field of view still remain continuous and consistent, effectively avoiding the visual abruptness caused by texture switching and enhancing the immersion and smoothness of the game. In the embodiments of the present application, when setting the safe area, a circular or rectangular area will be circled with the player character as the center as the safe area, and it is ensured that its radius or side length is sufficient to cover the key terrain and objects within the field of view of the player character.

[0069] 103. When it is detected that the scene view target of the target scene moves and the movement exceeds the safe area, control the dynamic texture container to move following the scene view target.

[0070] In the embodiment of the present application, the game rendering engine will monitor the position and orientation of the scene camera in the target scene in real time. When the movement of the scene camera causes the field of view to exceed the safe area of the current texture container, it is determined that the scene view target of the target scene has moved and the movement exceeds the safe area. In this case, the game rendering engine will control the dynamic texture container to move following the scene view target, while ensuring that the textures within the field of view are always covered by the dynamic texture container, and minimizing unnecessary texture loading and unloading operations to the greatest extent. For example, when the player character climbs from the bottom of the valley to the top of the mountain, the dynamic texture container will move upward accordingly to cover the new field of view, ensuring that the terrain and vegetation textures of the top of the mountain can be presented to the player immediately and clearly.

[0071] 104. Refer to the position of the moved dynamic texture container in the target scene to update the virtual texture page table, and use the dynamic virtual texture and the updated virtual texture page table to perform terrain rendering on the target scene.

[0072] In the embodiment of the present application, after the dynamic texture container moves, the game rendering engine will refer to the position of the moved dynamic texture container in the target scene to update the virtual texture page table. The virtual texture page table is a key data structure for managing the mapping of virtual textures to actual physical memory, and is used to record the physical memory addresses and states (such as loaded, unloaded) of each texture page in the dynamic texture container. Specifically, the game rendering engine will recalculate which texture pages need to be loaded into memory, which can be unloaded or replaced, and update the virtual texture page table according to the calculation results, ensuring that while maintaining the required texture details, the limited memory resources are utilized to the greatest extent. After completing the update of the virtual texture page table, the game rendering engine will use the updated virtual texture page table and the dynamic virtual texture to perform terrain rendering on the target scene. By updating the virtual texture page table, it is possible to significantly reduce the rendering pressure and performance burden while ensuring a high texel density, making terrain rendering in large world games more efficient and flexible.

[0073] The method provided by the embodiment of the present application determines a target scene to be subjected to terrain rendering, sets a dynamic texture container in the target scene according to the current position of the player character in the target scene, and sets the created dynamic virtual texture in the target scene according to the dynamic texture container. A safe area is determined in the dynamic texture container according to the current position of the player character in the target scene. When it is detected that the scene view target of the target scene moves and the movement exceeds the safe area, the dynamic texture container is controlled to move following the scene view target. The virtual texture page table is updated with reference to the position of the moved dynamic texture container in the target scene, and the target scene is subjected to terrain rendering using the dynamic virtual texture and the updated virtual texture page table. By using a smaller dynamic texture container that can move following the scene camera in a large world, a smaller virtual texture page table can be set under the same texel density, solving the problem of the size limit of the virtual texture page table, significantly reducing the rendering pressure and performance burden, and making the terrain rendering in large world games more efficient, flexible, and compatible.

[0074] Further, as a refinement and extension of the specific implementation manner of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the embodiment of the present application provides another terrain rendering method during dynamic runtime, as Figure 2A shown. This method includes:

[0075] 201. Determine a target scene to be subjected to terrain rendering, create a dynamic virtual texture, enable the dynamic page table function, and set to ignore the texture movement of the low detail level when the scene view target moves.

[0076] The embodiment of the present application can be applied to a game rendering engine. The game rendering engine will first determine a target scene to be subjected to terrain rendering. The target scene is also the virtual environment where the player character conducts game activities, such as a forest, desert, or urban area in an open world game.

[0077] Next, the game rendering engine creates dynamic virtual textures. The dynamic virtual textures store texture information of various objects in the target scene at different levels of detail, which is the basis for efficient terrain rendering. In actual applications, the created dynamic virtual textures can be RuntimeVirtualTextures (runtime virtual textures). Further, to manage texture data more effectively, while creating the dynamic virtual textures, the game rendering engine enables the dynamic page table function. Enabling the dynamic page table function allows the dynamic virtual textures to more intelligently adapt to scene changes, dynamically load and unload texture pages as needed, ensure the best texture details can be provided at any time, avoid unnecessary memory occupancy, and improve the flexibility and efficiency of texture management. In actual applications, when creating a RuntimeVirtualTexture, "Enable dynamic page table" can be checked simultaneously to successfully enable the dynamic page table function.

[0078] In addition, the game rendering engine also sets to ignore the texture movement of low levels of detail when the target in the scene view moves. Specifically, the number of low levels of detail ignored during movement is greater than the number of low levels of detail removed from the virtual texture. So when the target in the scene view (such as the player character or the camera) moves, it automatically ignores the movement of textures that are far away and have a lower level of detail, and focuses on updating the textures that are close and have a higher level of detail, significantly reducing the update cost of peak virtual textures because it is not necessary to frequently update those low-level detail textures that have little impact on the visual effect, thus achieving performance optimization. In actual applications, the parameter "Movement Ignore Low Mips" can be set while enabling the dynamic page table function, and the value of this parameter can be set to be greater than "Number of low mips to remove from the virtual texture" to achieve the effect of automatically ignoring the movement of textures that are far away and have a lower level of detail, allocate more rendering resources to the textures that are close and have a higher level of detail, and while allowing players to enjoy a more delicate and realistic visual effect when moving, reduce the update frequency of low-level detail textures and improve rendering performance.

[0079] 202. Query the current position of the player character in the target scene, set a dynamic texture container at the position, set a dynamic virtual texture in the dynamic texture container so that the dynamic virtual texture is set in the target scene, and set a material parameter set in the dynamic texture container.

[0080] In the embodiments of the present application, in order to optimize texture management and improve rendering efficiency, the game rendering engine will set a dynamic texture container in the scene. In the actual application process, the dynamic texture container can be an ADynamicRuntimeVirtualTextureVolume (Dynamic Runtime Virtual Texture Volume), which is a dynamic and configurable area for managing and applying dynamic virtual textures in real-time rendering.

[0081] Specifically, when setting the dynamic texture container, the game rendering engine will query the current position of the player character in the target scene, which is usually a three-dimensional world coordinate representing the exact position of the player character in the virtual world. In order to make the texture rendering more conform to the player's perspective, the game rendering engine will set the position of the dynamic texture container to the current coordinate position value of the player character, ensuring that the dynamic texture container always surrounds the player character, thereby improving the real-time and accuracy of rendering.

[0082] Next, in the dynamic texture container, the game rendering engine will set dynamic virtual textures in the dynamic texture container for use during the rendering process. In addition, the game rendering engine will also configure the corresponding set of material parameters, which includes a series of properties affecting the rendering effect such as the texture mapping method, filtering mode, roughness, reflectivity, etc., so as to ensure that the dynamic virtual textures can be correctly mapped onto the objects in the target scene, presenting a realistic rendering effect.

[0083] 203. Set a virtual texture management component on the scene view target of the target scene, so that the virtual texture management component moves along with the scene view target, and controls the dynamic texture container to move according to the movement of the scene view.

[0084] In the embodiments of the present application, in order to achieve efficient and dynamic texture management, the game rendering engine will set a virtual texture management component on the scene view target, so that the virtual texture management component moves along with the scene view target, tracks the position change of the scene view target, and controls the dynamic texture container to move according to the movement of the scene view, ensuring that no matter how the scene view target moves, the dynamic texture container can be moved in real-time according to its position according to the preset rules.

[0085] In the actual application process, the virtual texture management component can be the UDynamicRuntimeVirtualTextureComponent component. Specifically, this component can be attached to the ViewTarget of the target scene. In this way, when the ViewTarget moves, the component can obtain its position information in real time and control the Volume (i.e., the dynamic texture container) to move following the ViewTarget, so as to ensure that the dynamic texture container is always synchronized with the player's perspective. No matter which position the player character moves to in the target scene, the Volume can always contain the most important texture information in the player's current field of view in real time, ensuring that the player can obtain a smooth and realistic visual experience.

[0086] 204. Divide the dynamic texture container into multiple pixel units.

[0087] In the embodiments of the present application, in order to more efficiently utilize and optimize virtual texture resources, the game rendering engine will divide the dynamic texture container into multiple pixel units. This division process is based on the preset safety area size and the pixel values corresponding to the virtual texture page table of the highest level of detail.

[0088] Specifically, when dividing, the game rendering engine will first obtain the preset safety area size and the pixel values corresponding to the virtual texture page table of the preset highest level of detail. The safety area size refers to the size of the area in the target scene where the highest texture detail is desired to be maintained; the pixel values corresponding to the virtual texture page table of the highest level of detail determine the highest resolution that the texture needs to reach within the safety area. That is, in the actual application process, when the parameter "Movement Ignore Low Mips" is set, the game rendering engine will ignore the low-precision Mip levels and directly use the pixel values corresponding to the PageTable of the maximum Mip level as the reference resolution for texture rendering in the safety area.

[0089] Next, the game rendering engine will use the safety area size and the pixel values to calculate the number of divisions. Specifically, the game rendering engine will divide the safety area size by the pixel values of the highest level of detail, and the integer part of the obtained value is the number of divisions. The number of divisions is used to determine how many pixel units the dynamic texture container will be divided into.

[0090] Then, the game rendering engine divides the dynamic texture container according to the container size and the number of divisions of the dynamic texture container, obtaining a plurality of pixel units equal in number to the number of divisions. Specifically, a pixel unit can be represented by Cell, and in the actual application process, ADynamicRuntimeVirtualTextureVolume can be used to manage the dynamic texture container, which can perform real-time scheduling on the dynamic virtual texture to ensure efficient loading and updating of texture data. Therefore, the game rendering engine can divide the dynamic texture container into multiple Cells through ADynamicRuntimeVirtualTextureVolume, VolumeSize (container size), and Movement Ignore Mips, so that each Cell corresponds to the corresponding pixel of the PageTable at the maximum mip level after calculating Movement Ignore Low Mips, thereby more finely managing the texture resources in the dynamic texture container.

[0091] It should be noted that in the embodiments of the present application, each pixel unit can independently load, unload, and update textures, thereby improving the efficiency and flexibility of texture rendering. In addition, since the division is based on the preset safe area size and the pixel values at the highest level of detail, the embodiments of the present application can ensure that the most important areas in the target scene always maintain the highest texture detail.

[0092] 205. Obtain a preset quantity threshold, and with the position where the player character is currently located in the target scene as the center, determine a plurality of target pixel units that are the closest to the player character and equal in number to the quantity threshold among the plurality of pixel units, and use the area where the plurality of target pixel units are located as the safe area.

[0093] In the embodiments of the present application, the game rendering engine first obtains a preset quantity threshold, and then with the position where the player character is currently located in the target scene as the center, determines a plurality of target pixel units that are the closest to the player character and equal in number to the quantity threshold among the plurality of pixel units, and uses the area where the plurality of target pixel units are located as the safe area. Specifically, it can start from the position of the player character and expand outwards by the quantity threshold number of cells, and use the area of the several cells around the player that are close as the safe area. The safe area can be represented by SafeArea, and the expansion process can be square, circular, or any other preset shape. The present application does not specifically limit the expansion method and the shape of the safe area.

[0094] Specifically, such as Figure 2BAs shown in the figure, assume that the outermost square frame is the dynamic texture container. The dynamic texture container is divided into multiple small squares, which are the obtained pixel units. Further, according to the current position of the player character, the area composed of 4 small squares in the central region is used as the safe area.

[0095] 206. When it is detected that the scene view target of the target scene moves and the movement exceeds the safe area, control the dynamic texture container to move following the scene view target.

[0096] Since the game rendering engine will always maintain the highest texture detail in the safe area and does not maintain the highest texture detail in the area outside the safe area, in the embodiment of the present application, the game rendering engine will continuously monitor the movement of the scene view target (such as the player character), so as to ensure that when its movement exceeds the safe area, the safe area is re-determined, and the highest texture detail is continued to be maintained in the re-determined safe area.

[0097] Specifically, in the actual application process, it is possible to continuously detect whether the ViewTarget in the target scene moves, and when it is detected that the ViewTarget moves and exceeds the SafeArea, it is determined that the scene view target of the target scene moves and the movement exceeds the safe area. The game rendering engine will control the dynamic texture container to move following the scene view target, so as to keep the important texture information in the player's field of view always within the visible range. Among them, when controlling the movement of the dynamic texture container, the game rendering engine will first determine the original position where the scene view target is located before moving, and determine the changed position where the scene view target is located after moving, identify the movement direction of the scene view target, and count the number of pixel units separated between the original position and the changed position. The number of units is used to indicate the offset, which determines how far the dynamic texture container needs to move to re-include the scene view target. It should be noted that in order to avoid the situation of discontinuous texture, in the embodiment of the present application, the number of units needs to be an integer multiple, so that the movement of the dynamic texture container is in units of pixel units, which helps to maintain the continuity and consistency of the texture.

[0098] After determining the movement direction and the number of units, the game rendering engine will offset the dynamic texture container according to the movement direction and the number of units, so that the dynamic texture container moves following the scene view target, so as to keep the important texture information in the player's field of view always within the visible range, ensuring that when the player moves, they can always see the key texture information in the safe area where they are located, and enhancing the immersion and realism of the game.

[0099] 207. Update the virtual texture page table with reference to the position of the dynamic texture container after movement in the target scene, and perform terrain rendering on the target scene using the dynamic virtual texture and the updated virtual texture page table.

[0100] In the embodiment of the present application, after the dynamic texture container moves with the scene view target, the game rendering engine will update the virtual texture page table (i.e., PageTable) with reference to the new position of the moved dynamic texture container in the target scene to ensure the accuracy and efficiency of terrain rendering. Specifically, the game rendering engine will first determine the specific position of the moved dynamic texture container in the target scene, use this specific position as the target position, and query the corresponding level of detail of the virtual texture corresponding to this target position in the dynamic virtual texture, and use it as the target level of detail.

[0101] After determining the target level of detail, the game rendering engine will clear the pixel information greater than the target level of detail in the virtual texture page table because these levels of detail are not needed in the current view, and retaining them will only increase the rendering burden, thereby obtaining the updated virtual texture page table. The updated virtual texture page table only contains the pixel information useful for the current view.

[0102] Next, the game rendering engine will process the pixel information less than or equal to the target level of detail in the virtual texture page table and regard them as valid pixel information. The valid pixel information needs to be offset accordingly with the movement of the dynamic texture container to ensure that they can be correctly mapped to the corresponding positions in the scene during rendering. Therefore, the game rendering engine will control the offset of the valid pixel information on the dynamic virtual texture according to the offset determined when moving the dynamic texture container before. For details, see Figure 2C , and the effects before and after the offset are as Figure 2C shown.

[0103] Finally, the game rendering engine will perform terrain rendering on the target scene by combining the updated virtual texture page table and the offset valid pixel information. By dynamically updating the virtual texture page table and offsetting the valid pixel information, avoiding rendering unnecessary details, it can not only ensure the accuracy and authenticity of rendering, but also significantly reduce the rendering pressure and performance burden, and improve the rendering efficiency and performance.

[0104] To summarize the above content, in fact, after offsetting the dynamic texture container (that is, Volume), the game rendering engine will synchronously clear the information exceeding the maximum mip level in the PageTable, and offset the valid pixels less than or equal to the maximum mip level in the Volume offset direction. The offset is also based on the offset calculated when offsetting the Volume above. After completing the update and offset, use RVT to perform ground rendering in real time, so that players can see real and smooth rendering effects.

[0105] The above steps 206 and 207 mainly deal with the situation where the scene view target moves beyond the safe area. In the actual application process, the movement of the scene view target does not always exceed the safe area. Therefore, when it is detected that the scene view target of the target scene moves and the movement does not exceed the safe area, the game rendering engine will directly obtain the current virtual texture page table. The virtual texture page table contains the detail level and pixel information of each texture in the safe area. Because the movement does not exceed the safe area, there is no need to update the virtual texture page table. The game rendering engine will directly use the dynamic virtual texture and the current virtual texture page to render the terrain of the target scene, presenting a realistic and smooth game screen. In addition, if the rendering effect of the safe area has been obtained, then if there is no movement beyond the safe area, the current rendering effect of the safe area can be maintained, thereby avoiding unnecessary texture loading and updating operations and improving rendering efficiency and performance.

[0106] In summary, the technical solution of the embodiment of the present application can be used as follows in practical application: Figure 2D, first, create a RuntimeVirtualTexture (i.e., dynamic virtual texture), and then place a DynamicRuntimeVirtualTextureVolume (i.e., dynamic texture container) inside the target scene. Next, add a DynamicRuntimeVirtualTextureComponent component (i.e., virtual texture management component) to the ViewTarget (i.e., scene view target). Subsequently, divide the entire dynamic texture container into multiple Cells (i.e., pixel units), and calculate the SafeArea (i.e., safe area). When the ViewTarget moves, detect whether it exceeds the SafeArea. If it exceeds the SafeArea, calculate and offset the Volume position, then offset and update the PageTable, and finally use the RVT to perform real-time ground rendering; if it does not exceed the SafeArea, directly use the current RVT to perform real-time ground rendering. Thus, based on the use of RuntimeVirtualTexture, the update strategy of the RVT is optimized, resulting in a significant improvement in performance while also greatly enhancing the texel density and optimizing the rendering accuracy performance of the ground. For the specific rendering effect of the embodiments of this application, please refer to Figure 2E and Figure 2F .

[0107] The method provided by the embodiments of this application uses a smaller dynamic texture container that can move with the scene camera in a large world, enabling a smaller virtual texture page table to be set under the same texel density, solving the problem of the size limit of the virtual texture page table, significantly reducing the rendering pressure and performance burden, and making terrain rendering in large world games more efficient, flexible, and compatible.

[0108] Furthermore, as Figure 1 a specific implementation of the method, the embodiments of this application provide a terrain rendering device during dynamic runtime, as Figure 3 shown. The device includes: a setting module 301, a determination module 302, a movement module 303, and a rendering module 304.

[0109] The setting module 301 is used to determine the target scene for terrain rendering, set a dynamic texture container in the target scene according to the current position of the player character in the target scene, and set the created dynamic virtual texture in the target scene according to the dynamic texture container;

[0110] The determination module 302 is used to determine the safe area in the dynamic texture container according to the current position of the player character in the target scene;

[0111] The mobile module 303 is configured to control the dynamic texture container to move following the scene view target when it is detected that the scene view target of the target scene moves and the movement exceeds the safe area.

[0112] The rendering module 304 is configured to update the virtual texture page table with reference to the position of the moved dynamic texture container in the target scene, and perform terrain rendering on the target scene using the dynamic virtual texture and the updated virtual texture page table.

[0113] In a specific application scenario, the setting module 301 is configured to create the dynamic virtual texture, enable the dynamic page table function, and set to ignore the texture movement of the low detail level when the scene view target moves, where the number of low detail levels ignored for movement is greater than the number of low detail levels removed from the virtual texture; query the current position of the player character in the target scene, and set the dynamic texture container at this position; set the dynamic virtual texture in the dynamic texture container so that the dynamic virtual texture is set in the target scene, and set the material parameter set in the dynamic texture container.

[0114] In a specific application scenario, the setting module 301 is further configured to set a virtual texture management component on the scene view target of the target scene so that the virtual texture management component moves following the scene view target, and control the movement of the dynamic texture container according to the movement of the scene view.

[0115] In a specific application scenario, the determination module 302 is configured to divide the dynamic texture container into multiple pixel units; obtain a preset quantity threshold, and determine, centered on the current position of the player character in the target scene, multiple target pixel units in the multiple pixel units that are closest to the player character and the quantity of which is equal to the quantity threshold; and use the area where the multiple target pixel units are located as the safe area.

[0116] In a specific application scenario, the determination module 302 is configured to obtain a preset safe area size and the pixel value corresponding to the virtual texture page table of the preset highest detail level, calculate the division quantity using the safe area size and the pixel value; and divide the dynamic texture container with reference to the container size of the dynamic texture container and the division quantity to obtain the multiple pixel units with the quantity equal to the division quantity.

[0117] In a specific application scenario, the mobile module 303 is configured to determine the original position where the scene view target is located before moving, and determine the changed position where the scene view target is located after moving; identify the moving direction of the scene view target, count the number of pixel units separated between the original position and the changed position, and offset the dynamic texture container according to the moving direction and the number of units, so that the dynamic texture container moves following the scene view target.

[0118] In a specific application scenario, the rendering module 304 is configured to determine the target position where the moved dynamic texture container is located in the target scene, query the target level of detail corresponding to the virtual texture at the target position in the dynamic virtual texture; clear the pixel information greater than the target level of detail in the virtual texture page table to obtain the updated virtual texture page table; use the pixel information less than or equal to the target level of detail in the virtual texture page table as valid pixel information, control the valid pixel information to move following the dynamic texture container on the dynamic virtual texture, and perform terrain rendering on the target scene in combination with the updated virtual texture page table.

[0119] In a specific application scenario, the rendering module 304 is further configured to, when it is detected that the scene view target of the target scene moves and the movement does not exceed the safe area, obtain the current virtual texture page table, and perform terrain rendering on the target scene by using the dynamic virtual texture and the current virtual texture page.

[0120] The device provided by the embodiment of the present application determines a target scene to be subjected to terrain rendering, sets a dynamic texture container in the target scene according to the current position of the player character in the target scene, and sets the created dynamic virtual texture in the target scene according to the dynamic texture container. A safe area is determined in the dynamic texture container according to the current position of the player character in the target scene. When it is detected that the scene view target of the target scene moves and the movement exceeds the safe area, the dynamic texture container is controlled to move following the scene view target, the virtual texture page table is updated with reference to the position where the moved dynamic texture container is located in the target scene, and terrain rendering is performed on the target scene by using the dynamic virtual texture and the updated virtual texture page table. By using a smaller dynamic texture container that can move following the scene camera in a large world, a smaller virtual texture page table can be set when reaching the same texel density, solving the problem of the size limit of the virtual texture page table, significantly reducing the rendering pressure and performance burden, and making terrain rendering in large world games more efficient, flexible, and compatible.

[0121] It should be noted that for other corresponding descriptions of the various functional units involved in the terrain rendering device during dynamic runtime provided in the embodiments of the present application, reference can be made to Figure 1 and Figures 2A to 2D the corresponding descriptions in, which will not be elaborated here.

[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties.

[0123] The above embodiments and the various technical features in the embodiments can be combined with each other arbitrarily. For the sake of concise description, not all possible combinations of the various technical features in the above embodiments are described. However, as long as the combinations of these technical features do not conflict, they should all be considered as within the scope described in this specification.

[0124] The above-described embodiments only represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

[0125] In an exemplary embodiment, referring to Figure 4 , an electronic device is further provided. The electronic device includes a bus, a processor, a memory, and a communication interface, and may further include an input / output interface and a display device. Among them, the various functional units can complete mutual communication through the bus. The memory stores a computer program, and the processor is used to execute the program stored on the memory to execute the terrain rendering method during dynamic runtime in the above embodiments.

[0126] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the terrain rendering method during dynamic runtime are implemented.

[0127] Through the description of the above implementation manners, those skilled in the art can clearly understand that the present application can be implemented through hardware, or can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes several instructions for causing an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various implementation scenarios of the present application.

[0128] Those skilled in the art can understand that the attached drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the drawings are not necessarily essential for implementing the present application.

[0129] Those skilled in the art can understand that the modules in the devices in the implementation scenarios can be distributed in the devices of the implementation scenarios according to the description of the implementation scenarios, or can be correspondingly changed to be located in one or more devices different from the present implementation scenario. The modules of the above implementation scenarios can be combined into one module, or can be further split into multiple sub-modules.

[0130] The above serial numbers of the present application are only for description and do not represent the advantages or disadvantages of the implementation scenarios.

[0131] The above disclosure only shows several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present application.

Claims

1. A terrain rendering method during dynamic runtime, characterized in that, Including: Determine a target scene to perform terrain rendering, set a dynamic texture container in the target scene according to the current position of the player character in the target scene, and set the created dynamic virtual texture in the target scene according to the dynamic texture container; Determine a safe area in the dynamic texture container according to the current position of the player character in the target scene; When it is detected that the scene view target of the target scene moves and the movement exceeds the safe area, control the dynamic texture container to move following the scene view target; With reference to the position of the moved dynamic texture container in the target scene, update the virtual texture page table, and use the dynamic virtual texture and the updated virtual texture page table to perform terrain rendering on the target scene.

2. The method according to claim 1, wherein The step of setting a dynamic texture container in the target scene according to the current position of the player character in the target scene and setting the created dynamic virtual texture in the target scene according to the dynamic texture container includes: Create the dynamic virtual texture, enable the dynamic page table function, and set to ignore the texture movement of the low detail level when the scene view target moves, where the number of low detail levels ignored by the movement is greater than the number of low detail levels removed from the virtual texture; Query the current position of the player character in the target scene and set the dynamic texture container at this position; Set the dynamic virtual texture in the dynamic texture container so that the dynamic virtual texture is set in the target scene, and set a set of material parameters in the dynamic texture container.

3. The method according to claim 1, wherein Before determining the safe area in the dynamic texture container according to the current position of the player character in the target scene, the method further includes: Set a virtual texture management component on the scene view target of the target scene so that the virtual texture management component moves following the scene view target, and control the dynamic texture container to move according to the movement of the scene view.

4. The method according to claim 1, wherein The step of determining the safe area in the dynamic texture container according to the current position of the player character in the target scene includes: Divide the dynamic texture container into a plurality of pixel units; Obtain a preset quantity threshold, and determine a plurality of target pixel units that are closest to the player character and have a quantity equal to the quantity threshold in the plurality of pixel units with the current position of the player character in the target scene as the center; Use the area where the plurality of target pixel units are located as the safe area.

5. The method according to claim 4, wherein The step of dividing the dynamic texture container into a plurality of pixel units includes: Obtain a preset safe area size and the pixel value corresponding to the virtual texture page table of the preset highest detail level, and calculate the division quantity using the safe area size and the pixel value; With reference to the container size of the dynamic texture container and the division quantity, divide the dynamic texture container to obtain the plurality of pixel units with a quantity equal to the division quantity.

6. The method according to claim 4, characterized in that The step of controlling the dynamic texture container to move following the scene view target includes: Determine the original position where the scene view target was located before moving, and determine the changed position where the scene view target is located after moving; Identify the moving direction of the scene view target, count the number of pixel units between the original position and the changed position, and offset the dynamic texture container according to the moving direction and the number of units, so that the dynamic texture container moves following the scene view target.

7. The method according to claim 1, characterized in that, With reference to the position where the dynamic texture container is located in the target scene after moving, update the virtual texture page table, and use the dynamic virtual texture and the updated virtual texture page table to perform terrain rendering on the target scene, including: Determine the target position where the dynamic texture container is located in the target scene after moving, and query the target level of detail corresponding to the virtual texture at the target position in the dynamic virtual texture; Clear the pixel information greater than the target level of detail in the virtual texture page table to obtain the updated virtual texture page table; Use the pixel information less than or equal to the target level of detail in the virtual texture page table as valid pixel information, control the valid pixel information to offset following the dynamic texture container on the dynamic virtual texture, and perform terrain rendering on the target scene in combination with the updated virtual texture page table.

8. The method according to claim 1, wherein The method further includes: When it is detected that the scene view target of the target scene moves and the movement does not exceed the safe area, obtain the current virtual texture page table, and use the dynamic virtual texture and the current virtual texture page to perform terrain rendering on the target scene.

9. A terrain rendering device during dynamic runtime, characterized in that, Including: A setting module for determining a target scene to be subjected to terrain rendering, setting a dynamic texture container in the target scene according to the current position of the player character in the target scene, and setting the created dynamic virtual texture in the target scene according to the dynamic texture container; A determining module for determining a safe area in the dynamic texture container according to the current position of the player character in the target scene; A moving module for controlling the dynamic texture container to move following the scene view target when it is detected that the scene view target of the target scene moves and the movement exceeds the safe area; A rendering module for updating the virtual texture page table with reference to the position where the dynamic texture container is located in the target scene after moving, and performing terrain rendering on the target scene using the dynamic virtual texture and the updated virtual texture page table.

10. An electronic device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.