Game scene terrain rendering method and device, electronic equipment and storage medium
By identifying the visible area of the scene and a specified grid in SLG games, and utilizing grid caching rendering technology, the problems of untimely updates and blurry display of RVT technology in SLG games are solved, achieving higher performance accuracy and real-time update effect.
Patent Information
- Application Number
- CN202511864551.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-02-13
AI Technical Summary
In SLG games, when using RVT technology to render ground textures, there are problems with untimely updates and blurry display, especially when the camera moves quickly in the game's large map, resulting in poor accuracy.
By identifying whether the visible area of the game scene meets the preset trigger conditions, the system traverses the specified grid, reads the material texture data from the grid cache, renders the specified grid, and overlays it onto the virtual terrain scene to achieve the terrain rendering effect.
It improves the timeliness and accuracy of surface texture updates, reduces blurring caused by RVT refresh, and supports gradient transitions and real-time texture updates.
Smart Images

Figure CN121527282A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer application, and particularly relates to a terrain rendering method and device for a game scene, an electronic device and a storage medium. BACKGROUND
[0002] In the open world terrain rendering of a UE (Unreal Engine), a RVT (Runtime Virtual Texture) technology is generally used to render a terrain surface texture, so that performance can be saved.
[0003] However, in an SLG (Simulation and Strategy Game) game, if the RVT technology is used to render a ground surface texture for a game map, problems such as untimely updating and blurred display are likely to occur. SUMMARY
[0004] Therefore, the embodiments of the present application provide at least a terrain rendering method and device for a game scene, an electronic device and a storage medium to overcome at least one of the above problems.
[0005] In a first aspect, the exemplary embodiments of the present application provide a terrain rendering method for a game scene, which comprises: identifying whether a scene visible area corresponding to a game scene meets a preset trigger condition, the scene visible area comprising a virtual terrain scene, and the virtual terrain scene being generated based on terrain texture data stored in a terrain cache; when the preset trigger condition is met, traversing the scene visible area and identifying at least one specified grid, the grid being used to form a specific area on a ground surface of the scene visible area; reading material texture data from a grid cache to render the at least one specified grid, the grid cache being used to store material texture data of the specified grid; and superimposing the rendered at least one specified grid onto the virtual terrain scene to present a terrain rendering effect of the scene visible area.
[0006] In a second aspect, the embodiments of the present application further provide a device for rendering a terrain of a game scene. The device comprises: a region identification module configured to identify whether a scene visible region corresponding to the game scene meets a preset triggering condition, the scene visible region comprising a virtual terrain scene, the virtual terrain scene being generated based on terrain texture data stored in a terrain cache; a grid identification module configured to, when the preset triggering condition is met, traverse the scene visible region and identify at least one specified grid, the grid being used to form a specific region on a ground surface of the scene visible region; a material rendering module configured to read material texture data from a grid cache to render the at least one specified grid, the grid cache being used to store the material texture data of the specified grid; and a presentation module configured to superimpose the rendered at least one specified grid onto the virtual terrain scene to present a terrain rendering effect of the scene visible region.
[0007] In a third aspect, the embodiments of the present application further provide an electronic device, a processor, a storage medium and a bus. The storage medium stores machine readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium through the bus. The processor executes the machine readable instructions to perform the steps of the terrain rendering method of the game scene.
[0008] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the terrain rendering method of the game scene are performed.
[0009] The terrain rendering method, device, electronic device and storage medium of the game scene in a game provided by the embodiments of the present application can improve the timeliness of updating the ground surface texture rendering and help improve the performance precision.
[0010] In order to make the above objectives, characteristics and advantages of the present application more apparent and easy to understand, the following will describe preferred embodiments in detail, and the accompanying drawings will be described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be considered as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0012] Figure 1 A flowchart of the terrain rendering method of the game scene provided by the exemplary embodiments of the present application is shown; Figure 2A diagram showing terrain texture data used for setting a terrain is shown. Figure 3 A diagram showing terrain rendering effects provided by the example embodiments of the present application is shown. Figure 4 A diagram showing creating and setting material texture data provided by the example embodiments of the present application is shown. Figure 5 A diagram showing setting a mesh that needs to be written into a terrain provided by the example embodiments of the present application is shown. Figure 6 A flowchart showing steps of rendering a specified mesh provided by the example embodiments of the present application is shown. Figure 7 A flowchart showing terrain rendering provided by the example embodiments of the present application is shown. Figure 8 A structural diagram of a terrain rendering apparatus of a game scene provided by the example embodiments of the present application is shown. Figure 9 A structural diagram of an electronic device provided by the example embodiments of the present application is shown. DETAILED DESCRIPTION
[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description, and are not used to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn according to the actual proportions. The flowcharts show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can not be implemented in sequence, and the steps without logical context relationship can be reversed in sequence or implemented simultaneously. In addition, one or more other operations can be added to the flowcharts or one or more operations can be removed from the flowcharts under the guidance of the content of the present application.
[0014] The terms “one”, “an”, “the”, and “said” are used in the present specification to denote the presence of one or more elements / components / etc.; the terms “include” and “have” are used in the present specification to denote an open-ended inclusion in the meaning of comprising in addition to the listed elements / components / etc. there can be additional elements / components / etc.; the terms “first” and “second” are used only as labels, and are not a limitation on the number of objects.
[0015] It should be understood that in the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it. "Including A, B and / or C" means including any 1 or any 2 or 3 of A, B and C.
[0016] It should be understood that in the embodiments of the present application, "B corresponding to A", "B corresponding to A", "A corresponding to B" or "B corresponding to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, but also can be determined according to A and / or other information.
[0017] In addition, the described embodiments are only part of the embodiments of the present application, not all. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0018] In the open world terrain rendering of the UE, the rendering of the terrain surface texture is generally performed using the RVT technology, which can save performance. However, for SLG type games, there are a large number of overhead views and / or rapid movements of the camera in the game process. If the traditional RVT technology is used to render the ground surface texture for the game map, the problem of poor performance precision such as updating not in time and display blur is prone to occur.
[0019] To solve the problem of the RVT native solution not refreshing in time to cause display blur performance precision, the present application proposes a terrain rendering method for a game scene.
[0020] First, the names involved in the embodiments of the present application are introduced.
[0021] Terminal device: The terminal device involved in the embodiments of the present application mainly refers to an electronic device capable of providing a user interface (User Interface) to realize human-computer interaction. In an exemplary application scenario, the terminal device can be a smart device used to provide a game screen (e.g., an interface presenting a game scene) and capable of performing control operations on a virtual character. The terminal device can include, but is not limited to, any one of the following devices: a smart phone, a tablet computer, a portable computer, a desktop computer, a game console, a personal digital assistant (PDA), an e-book reader, an MP4 (Moving Picture Experts Group Audio Layer IV) player, and the like. The terminal device has installed and running therein an application program supporting a game scene, such as an application program supporting a three-dimensional game scene. The application program can include, but is not limited to, any one of a virtual reality application program, a three-dimensional map program, a military simulation program, a MOBA game (Multiplayer Online Battle Arena), a multiplayer gun battle survival game, and a third-person shooting game (TPS, Third-Personal Shooting Game). Alternatively, the application program can be a stand-alone application program, such as a stand-alone 3D game program, or a network online application program.
[0022] In one case, the terminal device has a display, a game console body independent of the display, and an input unit, e.g., a mouse, a keyboard, a handle, independent of the game console body, and a plurality of input buttons are arranged on the input unit. In another case, for a portable terminal device, there is a game console body, a liquid crystal display arranged at a substantially central portion of the game console body, and an input unit, e.g., a plurality of input buttons, arranged on both sides of the liquid crystal display, or it can be a portable terminal device having a touch screen, and the touch screen serves as the input unit. In the above terminal device, by operating the input unit, various commands can be indicated to a game character displayed on the display.
[0023] Graphical user interface: is an interface display format for communication between a human and a computer, allowing a user to manipulate icons, labels, or menu options on a screen using an input device such as a mouse, a keyboard, and / or a game handle, and also allowing the user to manipulate icons or menu options on a screen by performing a touch operation on a touch screen of a touch terminal to select a command, start a program, or perform some other task. In a game scene, a game scene interface and a game configuration interface can be displayed in the graphical user interface.
[0024] Game scene: This is a virtual environment displayed (or provided) by an application while it is running on a terminal device or server. Optionally, the game scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. The game scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual environment, and can include elements such as sky, land, and ocean. The game scene is where the user controls a virtual character to complete game logic. Optionally, the game scene can also be used for virtual environment battles between at least two virtual characters, and it contains virtual resources available for use by at least two virtual characters.
[0025] Virtual characters: The virtual character can be a player-controlled virtual character in a virtual environment, including but not limited to at least one of virtual characters, virtual animals, anime characters, virtual warships, virtual vehicles, virtual aircraft, and virtual ships. It can also be a non-player-controlled virtual character (NPC). Optionally, when the game environment is a three-dimensional virtual environment, the virtual character can be a three-dimensional virtual model. Each virtual character has its own shape and volume in the three-dimensional virtual environment and occupies a portion of the space in the three-dimensional virtual environment. Optionally, the virtual character is a three-dimensional character constructed based on three-dimensional human skeleton technology, or a three-dimensional object constructed based on three-dimensional technology. The virtual character achieves different external appearances by being given different skins. In some implementations, the virtual character can also be implemented using a 2.5D or 2D model; this application does not limit this.
[0026] Multiple virtual characters can exist in a game scene. These virtual characters can be player-controlled (i.e., objects controlled by the player through input devices or touchscreens) or artificial intelligence (AI) trained and configured for virtual combat. Optionally, these virtual characters are the objects of combat in the game scene. Optionally, the number of virtual characters in the game scene combat is preset or dynamically determined based on the number of terminal devices joining the virtual combat; this application embodiment does not limit this. In one possible implementation, the user can control the virtual character to move within the game scene and can also control the virtual character to use skills, virtual items, etc., provided by the application to fight other virtual characters.
[0027] In one embodiment of this application, the terrain rendering method for a game scene can run on a local terminal device or a server. When the method runs on a server, it can be implemented and executed based on a cloud interaction system, which includes a server and client devices.
[0028] In an optional embodiment, various cloud applications can be run under the cloud interaction system, such as cloud gaming. Taking cloud gaming as an example, cloud gaming refers to a game mode based on cloud computing. In the running mode of cloud gaming, the running subject of the game program and the presentation subject of the game picture are separated, and the storage and running of the control method of the virtual role are completed on the cloud gaming server. The client device is used for receiving and sending data and presenting the game picture. For example, the client device can be a display device close to the user side with data transmission function, such as a mobile terminal, a television, a computer, a palm computer, etc. However, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation instructions to the cloud gaming server, the cloud gaming server runs the game according to the operation instructions, encodes and compresses the game picture and other data, returns the data to the client device through the network, and finally decodes and outputs the game picture through the client device.
[0029] In an optional embodiment, taking a game as an example, the local terminal device stores a game program and is used for presenting a game picture. The local terminal device is used for interacting with the player through a graphical user interface, that is, a conventional game program is downloaded and installed on an electronic device and is run. The way in which the local terminal device provides the graphical user interface to the player can include various ways, for example, the graphical user interface can be rendered and displayed on the display screen of the terminal, or the graphical user interface can be provided to the player through holographic projection. For example, the local terminal device can include a display screen used for presenting a graphical user interface including a game picture, and a processor used for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
[0030] In a possible embodiment, the embodiment of the present application provides a terrain rendering method of a game scene, which provides a graphical user interface through a terminal device. The terminal device can be the local terminal device (such as the local touch terminal) mentioned above, or the client device in the cloud interaction system mentioned above.
[0031] To facilitate the understanding of the present application, the game scene terrain rendering method, device, electronic device and storage medium provided by the embodiment of the present application are described in detail below.
[0032] Please refer to Figure 1 , Figure 1 The flow of the game scene terrain rendering method provided by the exemplary embodiment of the present application provides a graphical user interface corresponding to a virtual role through a terminal device, and at least part of the game scene is displayed in the graphical user interface. The method specifically includes the following steps. Step S101: identifying whether a scene visible area corresponding to the game scene satisfies a preset triggering condition.
[0033] In the embodiments of the present application, the game scene can be a two-dimensional virtual environment and / or a three-dimensional virtual environment. For example, the game scene in the game can be presented in the form of an electronic map. The scene map corresponding to the game scene can be a two-dimensional map and / or a three-dimensional map, including but not limited to a virtual reality map, a military simulation map, and a map in the game.
[0034] The scene visible area can refer to a range area of the scene map of the game scene that can be seen through the screen of the terminal device. For example, the game scene can be observed in the first person or third person perspective. In this case, the scene visible area can be a range area of the scene map that can be seen when the game scene is observed in the first person or third person perspective.
[0035] Here, the content of the scene map of the game scene displayed on the screen of the terminal device can be changed (or the display content of the scene visible area can be changed). In an example, in response to a zoom instruction for the scene map of the game scene, the scene map of the game scene is controlled to be zoomed in or zoomed out. At this time, the map size of the scene map of the game scene displayed on the screen of the terminal device also changes accordingly. That is, the map zoom ratio is negatively correlated with the map size of the scene map displayed in the graphical user interface. For example, the larger the map zoom ratio, the smaller the map size of the scene map, and the smaller the map zoom ratio, the larger the map size of the scene map.
[0036] In another example, in response to a sliding operation (e.g., panning the map) for the scene map of the game scene, the scene map of the game scene can be controlled to move in the screen of the terminal device, so that the display content displayed on the screen of the terminal device changes synchronously.
[0037] In the embodiments of the present application, the scene map can be a picture obtained by observing the game scene at a preset height with a preset observation perspective. For example, a picture obtained by observing the game scene with an observation perspective having a preset lens height and taking a preset virtual object or a preset coordinate position in the game scene as the observation center. In this case, as the observation perspective changes or as the observation center changes, the display content of the scene map of the game scene displayed on the screen of the terminal device also changes.
[0038] In the example embodiments of the present application, the preset triggering condition can include an event that the texture data of a local region in the scene visible region changes. For example, a difference between the image to be rendered in the current frame and the rendered image in the previous frame can be detected to determine whether the texture data of the local region in the scene visible region changes. If there is a change, it is determined that the scene visible region meets the preset triggering condition. If there is no change, it is determined that the scene visible region does not meet the preset triggering condition. For example, the local region can include a region in which a virtual object is arranged in the game scene.
[0039] In an optional example, the event that the texture data of the local region in the scene visible region changes can include at least one of the following: a change in lighting in the game scene, a change in the position of the virtual lens (e.g., a change in any of the lens height, the viewing angle, or the viewing center), a change in the material of the local region. Here, a virtual light source is usually arranged in the game scene. The virtual light source is a "light source" arranged in the computer animation software or the virtual engine. The virtual light source plays a role in the animation production that is equivalent to the physical light source in the traditional sense. The virtual light source and the physical light source have completely different objects of illumination, but have similar functions. The physical light source illuminates real people or actual scenes, while the virtual light source illuminates models built in three-dimensional software, which can achieve infinite possibilities. The change in lighting in the game scene can include at least one of the following: a change in the light source position (or light source direction) of the virtual light source, a change in the brightness (or intensity) of the virtual light source, and a change in the color temperature of the virtual light source.
[0040] In addition, in another example embodiment of the present application, the preset triggering condition can include the appearance (refresh) of a new virtual object in the scene visible region. For example, as the position of the virtual lens changes (e.g., the scene map of the game scene is zoomed or the scene map of the game scene is translated), the display content of the scene visible region changes accordingly. Whether a new virtual object appears in the scene visible region can be determined by comparing two images before and after zooming (or before and after translation). For example, if a new virtual object is detected in the image to be rendered in the current frame compared to the rendered image in the previous frame, it can be determined that the scene visible region meets the preset triggering condition.
[0041] Step S102: When the preset triggering condition is met, the scene visible region is traversed, and at least one specified mesh is identified.
[0042] In the example embodiments of the present application, the scene visible region can include but is not limited to a virtual terrain scene. For example, the virtual terrain scene can include but is not limited to any of the following: a forest terrain, a flowing water terrain, an alpine terrain, a glacier terrain, and a hilly terrain.
[0043] Here, when it is identified that the scene visible area corresponding to the game scene does not satisfy the preset triggering condition, various existing ways can be used to obtain the terrain texture data corresponding to the virtual terrain scene, so as to render the virtual terrain scene. The rendering way of the virtual terrain scene is not limited in the present application.
[0044] The following will be described in combination with Figure 2 a rendering way of the virtual terrain scene. It should be understood that Figure 2 the way shown in the figure is only an example, and other ways can also be used by those skilled in the art to perform terrain rendering.
[0045] Figure 2 A schematic diagram of using terrain texture data to set the terrain is shown.
[0046] As Figure 2 shown, a graphical user interface 10 is provided by the terminal device, and a setting page 20 of the RVT Volume component is displayed in the graphical user interface 10. Exemplarily, the RVT volume can be placed first, and the material is configured. For example, the yellow boxed part JG shown in the figure represents the control range of the RVT Volume component. The write and read nodes of the RVT are set in the material configuration interface, that is, the terrain (for example, the green grass shown in the figure) of the boxed part JG in the map level is set to use the terrain texture data. Exemplarily, the RVT_Landscape texture is set to be used, so that the terrain material of the boxed part JG samples the RVT_Landscape (that is, the terrain cache). Figure 3
[0047] In an optional example, the RVT can generate terrain texel data on demand by the GPU at runtime, so that the terrain texture data (pre-compiled material effect, such as terrain material) of the above-mentioned boxed part JG is identified by the virtual engine to be written into the RVT_Landscape and reused as a cache, which can avoid repeated complex material calculation. Exemplarily, the virtual terrain scene can be rendered based on the RVT_Landscape when the scene visible area does not satisfy the preset triggering condition or satisfies the preset triggering condition. For example, in the rendering stage, the write node for the boxed part JG is identified. At this time, the virtual engine writes the terrain texture data corresponding to the boxed part JG into the RVT_Landscape. Then, when the display content of the scene visible area changes with the position change of the virtual camera, the terrain texture data is read from the RVT_Landscape to render the virtual terrain scene.
[0048] Here, the content displayed in the scene's visible area is updated as the virtual camera's position changes. Whenever the virtual camera's position changes, it can identify whether there is terrain texture data in RVT_Landscape corresponding to the scene range of the virtual terrain scene included in the current scene's visible area. If it exists, the terrain texture data is read from RVT_Landscape to render the virtual terrain scene. If it does not exist, the terrain texture data in RVT_Landscape is updated.
[0049] In a preferred example, the RVT_Landscape texture creation format (i.e., the RVT sampling parameters) may include, but is not limited to, at least one of the following: YCbCr base color, normal, roughness, specular highlight, mask, world height, inverse transparency, and world position (see coordinate indicators shown in the figure). Further, RVT attributes can be set, optionally including, but not limited to: RVT size (e.g., 2048*2048), RVT block size (e.g., divided into multiple blocks of 512*512), and block edge pixels (or border padding, e.g., an additional 4 pixels at the edge of each block). It should be understood that the specific values listed above are merely examples, and this application does not impose any limitations on them.
[0050] In a preferred embodiment of this application, the aforementioned scene visibility area may further include at least one designated grid. Here, at least one virtual object may be set on the virtual terrain scene of the game scene, wherein the area occupied by a virtual object within the scene visibility area may include one or more designated grids.
[0051] by Figure 3 Taking the terrain rendering effect shown as an example, multiple meshes (such as the green box 106 shown in the figure, which may or may not carry height information) can be pre-configured for the game scene. When the game is running, at least one specified mesh is identified within the current scene's visible area 21. In this example, the virtual terrain scene is a green grass terrain, and a virtual object (i.e., the city CC) is set on the green grass in the scene's visible area 21. At this time, at least one specified mesh is a set of multiple meshes that overlap with the area where the red circle 107 is located.
[0052] In this example, the aforementioned preset trigger condition may refer to the appearance of a new city CC in the image to be rendered in the current frame. The refresh of a new city CC may include the refresh of all or part of the city CC.
[0053] The following is combined Figure 4 and Figure 5 This section introduces a rendering method for a specific mesh. It should be understood that... Figure 4 andFigure 5 The illustrated manner is only an example, and other manners can also be adopted by those skilled in the art to perform material rendering.
[0054] Figure 4 An example of creating and setting a schematic diagram using material texture data is shown.
[0055] As Figure 4 As shown, a graphical user interface 10 is provided by the terminal device, and a setting page 20 of the RVT Volume component is displayed in the graphical user interface 10. An example is that the RVT Volume is placed first, and the material is configured, for example, the yellow boxed portion 103 shown in the figure represents the control range of the RVT Volume component, and a virtual texture RVT_Mat is created and set, that is, the material of the boxed portion 103 is set to use the material texture data, so that the material of the boxed portion 103 samples RVT_Mat (that is, the mesh cache).
[0056] In a preferred example, the RVT_Mat texture creation format can include but is not limited to at least one of the following: YCbCr base color, normal, roughness, highlight, mask, world height, opacity, world position, and further, RVT properties can be set, which will not be described herein.
[0057] Figure 4 The gray boxed portion 102 shown can refer to an RVT Volume that is not currently configured by being selected, or can also refer to other created Volumes.
[0058] Figure 5 An example of setting a mesh that needs to write a terrain is shown.
[0059] In this example, the yellow box 104 represents the edge of the mesh, and the material of the mesh can be set to be transparent. Alternatively, the shape of the mesh can be set according to design requirements, for example, quadrilateral, pentagon, hexagon, circle, triangle, etc., which will not be limited herein.
[0060] An example is that the mesh is dragged into the game scene, that is, a range is determined in the game scene, and the mesh is assigned a material, that is, the mesh that needs to write a terrain is set, so that the rendering data of the mesh is recognized by the virtual engine to be written to RVT_Mat, RVT_Mat is created for the mesh, and the RVT node is written in the material used by the mesh, so that the material texture data of the mesh is written to RVT_Mat. An example is that the mesh is set with a write identifier, and the mesh after the above configuration is determined as a specified mesh.
[0061] Based on this, in the rendering stage, the scene visible area is traversed to identify whether there is a mesh with a write identifier set in the scene visible area. If a mesh with a write identifier set is identified, the virtual engine writes the material texture data of the virtual object corresponding to the mesh into RVT_Mat. Then, the material texture data is read from RVT_Mat to render the mesh (i.e., the virtual object) as the position of the virtual camera changes. Optionally, if no mesh with a write identifier set is identified, the related processing for RVT_Mat can not be performed.
[0062] Return Figure 1 Step S103: Read the material texture data from the mesh cache to render the at least one specified mesh.
[0063] In a preferred embodiment, the above preset trigger condition can only trigger the refreshing of the mesh cache, i.e., trigger the refreshing of RVT_Mat alone, such as triggering only the update of the cache content in the mesh cache to read the material texture data to refresh and render the specified mesh. At this time, the refreshing of RVT_Landscape is not triggered when new virtual objects are refreshed in the scene visible area.
[0064] For example, RVT_Landscape is created for the virtual terrain scene, and RVT_Mat is created for the specified mesh, where RVT_Landscape and RVT_Mat are two independent RVTs.
[0065] The rendering method of the at least one specified mesh will be introduced below in combination with Figure 6 It should be understood that Figure 6 the rendering method shown is only an example, and the present application is not limited thereto.
[0066] Figure 6 A flowchart showing the steps of rendering the specified mesh provided by the exemplary embodiments of the present application is shown.
[0067] As Figure 6 shown, in step S201, the corresponding decal component is generated in the specified mesh area.
[0068] Taking the example shown in the above Figure 3 Each specified mesh identified from the scene visible area is a mesh configured with a write identifier in the game scene, and the write identifier is used to indicate that the material texture data of the specified mesh needs to be written into the mesh cache, i.e., the specified mesh is the Mesh with the specified material in the above Figure 5 .
[0069] For example, a decal component can be created in advance, such as setting a RVT reading node for the material of the decal component, which is used to read the material texture data of RVT_Mat for the material of the decal component in the rendering stage.
[0070] In Figure 3 the example shown, it is assumed that the city CC of the red circle area 107 occupies 5 green boxes 106. After identifying the green boxes occupied by the city CC, the corresponding decal component is generated in the occupied green boxes, i.e., the corresponding decal component of the occupied green box is enabled.
[0071] In step S202, the decal component is refreshed and the material texture data of the mesh cache is read to render the specified mesh.
[0072] Here, the decal component can refresh and read the material texture data of RVT_Mat separately and perform rendering, such as the decal component rendering part as Figure 3 the ground texture of the red circle area 107 in the middle, which is superimposed on the virtual terrain (such as green grass).
[0073] Returning Figure 1 to step S104, the rendered at least one specified mesh is superimposed on the virtual terrain scene to present the terrain rendering effect of the scene visible area.
[0074] In an optional example, the process of terrain rendering is introduced in combination with the flow shown in Figure 7 .
[0075] As shown in Figure 7 , in step S301, RVT_Landscape is set in the terrain material.
[0076] For example, based on the settings in the above Figure 2 , the terrain material settings can be made for the RVT volume placed in the game scene.
[0077] In step S302, RVT_Landscape is cached.
[0078] When it is identified that the scene visible area meets the preset triggering condition, if it is identified that the terrain material in the scene visible area is set to use RVT_Landscape, at this time, RVT_Landscape is not triggered to refresh, and the terrain texture data corresponding to the virtual terrain scene in the scene visible area is cached into RVT_Landscape.
[0079] In step S303, the terrain material is refreshed and RVT_Landscape is read.
[0080] Here, the RVT_Landscape caches terrain texture data on a larger region, and the region range of the larger region is greater than the region range of the visual region of the scene that the terminal device can see on the screen. Thus, when the display content displayed on the screen of the terminal device changes (i.e., the preset triggering condition is met), the terrain texture data in the RVT_Landscape can be reused.
[0081] In step S304, the terrain material is rendered.
[0082] For example, the terrain texture data in the RVT_Landscape is used to render the virtual terrain scene.
[0083] In step S305, the RVT_Mat is set in the Mesh material.
[0084] For example, the Mesh material of the RVT volume placed in the game scene can be set based on the settings in the above Figure 4 and Figure 5 .
[0085] In step S306, the RVT_Mat is cached.
[0086] When it is identified that the visual region of the scene meets the preset triggering condition, the RVT_Mat is refreshed alone, that is, the virtual engine caches the material texture data of the at least one specified mesh corresponding material into the RVT_Mat.
[0087] In step S307, the decal component is read.
[0088] For example, the decal component corresponding to each specified mesh is enabled, so that the material of the decal component reads the material texture data of the RVT_Mat.
[0089] In step S308, the decal material is rendered.
[0090] Here, the at least one specified mesh is rendered using the material texture data of the RVT_Mat.
[0091] In step S309, the final terrain effect.
[0092] For example, the rendering part of the decal component is superimposed on the virtual terrain scene to form a final terrain effect for presentation.
[0093] The present application aims to solve the following technical problems of terrain rendering based on RVT in the existing UE: fast lens movement causes RVT refreshing to be not timely and to be displayed as blurred mapping, terrain material based on RVT does not support gradual transition (fade in and out) and real-time mapping update. The overall rendering process described above avoids frequent RVT refreshing caused by dynamic updating of the Mesh of the ground surface (such as swamp mapping, castle ground surface mapping, etc. in the game) by writing an additional separate RVT, avoids blurring, and renders the decals component to be superimposed on the ground surface to form a complete terrain effect. The processing method of the present application reduces the RVT update of the game, avoids blurring caused by RVT refreshing, and can realize gradual transition, real-time update and other artistic effects through unified management of the decals component.
[0094] Based on the same application concept, the embodiments of the present application also provide a device corresponding to the method provided in the above embodiments. Since the principle of solving problems in the device of the embodiments of the present application is similar to the terrain rendering method of the game scene of the above embodiments of the present application, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described here.
[0095] Please refer to Figure 8 , Figure 8 The structure schematic diagram of the terrain rendering device of the game scene provided in the exemplary embodiments of the present application is shown in FIG. 2. As shown in FIG. 2, the device 200 comprises: Figure 8 a region identification module 210, which identifies whether a scene visible region corresponding to a game scene meets a preset trigger condition, the scene visible region comprising a virtual terrain scene, the virtual terrain scene being generated based on terrain texture data stored in a terrain cache; a grid identification module 220, which, when the preset trigger condition is met, traverses the scene visible region and identifies at least one specified grid, the grid being used to form a specific region on the ground surface of the scene visible region; a material rendering module 230, which reads material texture data from a grid cache to render the at least one specified grid, the grid cache being used to store material texture data of the specified grid; a presentation module 240, which superimposes the at least one rendered specified grid on the virtual terrain scene to present a terrain rendering effect of the scene visible region.
[0096] In a possible implementation of the present application, the terrain cache is created for the virtual terrain scene, the grid cache is created for the specified grid, and the terrain cache and the grid cache are two independent caches.
[0097] In a possible implementation of the present application, the preset trigger condition includes an event that texture data of a local region in the scene visible region changes or a new virtual object appears in the scene visible region, and the preset trigger condition triggers the grid cache to update only to read the material texture data to refresh and render the specified grid.
[0098] In a possible implementation of the present application, the material rendering module 230 is further configured to: generate a corresponding decal component in the specified grid region; and control the decal component to refresh and read the material texture data in the grid cache to render the specified grid.
[0099] In a possible implementation of the present application, the decal component is configured to set a read node in the material of the decal component, and the read node is used to read the material texture data in the grid cache in a rendering stage.
[0100] In a possible implementation of the present application, the material rendering module 230 creates the specified grid by: determining a region range in the game scene; assigning a material to the region range and setting a write identifier to form the specified grid, where the write identifier is used to indicate that the material texture data of the region range needs to be written into the grid cache.
[0101] In a possible implementation of the present application, the grid identification module 220 is further configured to: identify whether there is a grid with the write identifier set in the scene visible region; determine that the specified grid exists if the grid with the write identifier set is identified; and write the material texture data corresponding to the specified grid into the grid cache.
[0102] In a possible implementation of the present application, the rendering module 240 is further configured to: update display content of the scene visible region in response to a change in the position of the virtual camera, where the display content of the scene visible region is obtained by observing the game scene through the virtual camera; identify whether there is terrain texture data corresponding to a scene range of a virtual terrain scene included in the scene visible region in the terrain cache; read the terrain texture data from the terrain cache to render the virtual terrain scene if the terrain texture data exists; and update the terrain texture data in the terrain cache to render the virtual terrain scene if the terrain texture data does not exist.
[0103] In a possible implementation of the present application, the rendering module 240 is further configured to: read the material texture data from the grid cache to render the at least one specified grid in response to a change in the position of the virtual camera, if the changed scene visible region includes the specified grid.
[0104] Based on the above device, the problem of performance precision caused by the display blur due to the un-timely update of the rendered ground texture can be solved.
[0105] Please refer to Figure 9 , Figure 9 The structural schematic diagram of an electronic device is provided for the exemplary embodiments of the present application. As shown in Figure 9 The electronic device 300 includes a processor 310, a memory 320 and a bus 330.
[0106] The memory 320 stores machine readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 through the bus 330. When the machine readable instructions are executed by the processor 310, the steps of the interactive processing method in any of the above embodiments can be performed, specifically as follows: Identify whether a scene visual area corresponding to a game scene meets a preset trigger condition, the scene visual area including a virtual terrain scene, the virtual terrain scene being generated based on terrain texture data stored in a terrain cache; when the preset trigger condition is met, traverse the scene visual area and identify at least one specified mesh, the mesh being used to form a specific area on a ground surface of the scene visual area; read material texture data from a mesh cache to render the at least one specified mesh, the mesh cache being used to store material texture data of the specified mesh; and superimpose the rendered at least one specified mesh onto the virtual terrain scene to present a terrain rendering effect of the scene visual area.
[0107] Based on the above electronic device, the problem of performance precision caused by the display blur due to the un-timely update of the rendered ground texture can be solved.
[0108] The present application also provides a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the interactive processing method in any of the above embodiments can be performed, specifically as follows: Identify whether a scene visual area corresponding to a game scene meets a preset trigger condition, the scene visual area including a virtual terrain scene, the virtual terrain scene being generated based on terrain texture data stored in a terrain cache; when the preset trigger condition is met, traverse the scene visual area and identify at least one specified mesh, the mesh being used to form a specific area on a ground surface of the scene visual area; read material texture data from a mesh cache to render the at least one specified mesh, the mesh cache being used to store material texture data of the specified mesh; and superimpose the rendered at least one specified mesh onto the virtual terrain scene to present a terrain rendering effect of the scene visual area.
[0109] Based on the above computer readable storage medium, the problem of performance precision caused by the display blur due to the late update of the rendered terrain texture can be solved.
[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system and device can refer to the corresponding process in the foregoing method embodiments, which will not be described here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other ways. The above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.
[0111] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0112] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.
[0113] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art or the part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0114] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for rendering terrain in a game scene, characterized in that, The method comprises: identifying whether a scene visual area corresponding to a game scene meets a preset triggering condition, the scene visual area comprising a virtual terrain scene, the virtual terrain scene being generated by rendering based on terrain texture data stored in a terrain cache; when the preset triggering condition is met, traversing the scene visual area and identifying at least one specified mesh, the mesh being used to form a specific area on the ground surface of the scene visual area; reading material texture data from a mesh cache to render the at least one specified mesh, the mesh cache being used to store material texture data of the specified mesh; superimposing the rendered at least one specified mesh on the virtual terrain scene to present a terrain rendering effect of the scene visual area.
2. The method of claim 1, wherein, The terrain cache is created for the virtual terrain scene, and the mesh cache is created for the specified mesh, and the terrain cache and the mesh cache are two independent caches.
3. The method of claim 1, wherein, The preset triggering condition comprises an event of a change in texture data of a local area in the scene visual area or appearance of a new virtual object in the scene visual area. The preset triggering condition only triggers updating of the mesh cache to read material texture data to refresh render the specified mesh.
4. The method of claim 1, wherein, The method of reading material texture data from the mesh cache to render the at least one specified mesh comprises: generating a corresponding decal component in the specified mesh area; controlling the decal component to refresh and read material texture data of the mesh cache to render the specified mesh.
5. The method of claim 4, wherein, The decal component is configured to set a reading node in the material of the decal component, the reading node being used to make the material of the decal component read material texture data in the mesh cache in a rendering stage.
6. The method of claim 1, wherein, The specified mesh is created in the following manner: determining a range of an area in a game scene; specifying a material for the range of the area and setting a write identifier to form a specified mesh, the write identifier being used to indicate that material texture data of the range of the area needs to be written into a mesh cache.
7. The method of claim 6, wherein, The method of traversing the scene visual area and identifying at least one specified mesh comprises: identifying whether there is a mesh with the write identifier set in the scene visual area; if the mesh with the write identifier set is identified, determining that there is the specified mesh; writing material texture data corresponding to the specified mesh into the mesh cache.
8. The method of claim 1, wherein, The method further comprises: updating display content of the scene visual area in response to a change in a position of a virtual lens, the display content of the scene visual area being obtained by observing the game scene through the virtual lens; identifying whether there is terrain texture data corresponding to a scene range of a virtual terrain scene included in the scene visual area in the terrain cache; if there is, reading terrain texture data from the terrain cache to render the virtual terrain scene; if there is not, updating terrain texture data in the terrain cache to render the virtual terrain scene.
9. The method of claim 8, wherein, The method further comprises: In response to a change in the position of the virtual camera, if the changed scene viewable area includes the specified grid, read the material texture data from the grid cache to render the at least one specified grid.
10. A terrain rendering device for a game scene, characterized in that, The method comprises the steps of: a region identification module, identifying whether a scene viewable area corresponding to a game scene meets a preset trigger condition, the scene viewable area including a virtual terrain scene, the virtual terrain scene being generated by rendering based on terrain texture data stored in a terrain cache; a grid identification module, when the preset trigger condition is met, traversing the scene viewable area and identifying at least one specified grid, the grid being used to form a specific region on the ground surface of the scene viewable area; a material rendering module, reading material texture data from a grid cache to render the at least one specified grid, the grid cache being used to store material texture data of the specified grid; a presentation module, superimposing the rendered at least one specified grid onto the virtual terrain scene to present a terrain rendering effect of the scene viewable area.
11. An electronic device, comprising: The method comprises the steps of: a processor, a storage medium and a bus, the storage medium storing machine readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, the processor executes the machine readable instructions to perform the steps of any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program is run by the processor, the steps of any one of claims 1 to 9 are executed.