A display control method and device in a game
By rendering mesh models in the game and capturing texture mask maps with a camera, the high performance consumption caused by terrain depression effects in existing technologies is solved, achieving realistic physical collision effects and improving game performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies for creating terrain depression effects in games suffer from excessive performance consumption due to dynamic decal addition and dual-sided terrain rendering, resulting in effects that are not realistic or physically robust.
By acquiring terrain height and virtual object position, rendering mesh models and deploying cameras to capture texture mask maps, terrain depression effects are rendered directly in the game scene, avoiding the generation of decal objects and custom depth rendering.
It improves rendering efficiency, reduces performance consumption, and creates realistic and physically accurate terrain depressions, enhancing the game's performance.
Smart Images

Figure CN114359467B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graphics processing technology, and in particular to a display control method and a display control device for games. Background Technology
[0002] In game development, it is sometimes necessary to create an effect generated by physical collisions that conforms to the rules of physical collisions, looks realistic and attractive, and has a low performance consumption within an acceptable range. For example, creating an effect where, in soft terrains such as snow, desert, or mud, people, animals, or vehicles leave pits or footprints when they pass through. This is a challenge in game development.
[0003] Currently, most games achieve the desired terrain depression effect by dynamically adding decals to the surface of the terrain, adding a decal for each collision; or by enabling double-sided rendering of the terrain, adding a camera to capture textures on the reverse side of the terrain, and then blending the captured textures with the terrain to produce the corresponding terrain depression effect.
[0004] However, the above methods for achieving terrain depression effects have the following drawbacks: because the dynamic decal addition method requires generating a decal object for each terrain depression effect (such as footprints), and the dual-sided rendering method for terrain requires enabling custom depth rendering for each character, all of these will cause the game's performance consumption to increase continuously. Summary of the Invention
[0005] Given that the dynamic decal application method requires generating a decal object for each terrain depression effect, and the dual-sided terrain rendering method requires custom depth rendering for each character, which leads to a continuous increase in game performance consumption, this invention proposes an embodiment to provide a display control method and corresponding display control device in a game that overcomes or at least partially solves the above problems.
[0006] This invention discloses a display control method in a game, comprising:
[0007] Get the height of the terrain and the position of the virtual object in the game scene of the current frame;
[0008] Based on the height of the terrain and the location of the virtual object, a mesh model is rendered on the terrain, and a camera is deployed below the mesh model;
[0009] The first texture mask image is obtained by capturing the virtual object and the mesh model with the camera.
[0010] The terrain is rendered in the game scene according to the first texture mask map to present the terrain depression effect caused by the virtual object on the terrain.
[0011] Optionally, rendering the terrain in the game scene according to the first texture mask map includes:
[0012] Obtain the second texture mask image captured from the game scene of the previous frame;
[0013] The first texture mask image and the second texture mask image are merged to obtain the target mask image;
[0014] The terrain is rendered in the game scene according to the target mask map to present the effect of terrain depression retention.
[0015] Optionally, obtaining the height of the terrain in the game scene of the current frame includes:
[0016] The height of the terrain is obtained by rendering the height channel of the terrain in the game scene of the current frame using a virtual texture component.
[0017] Optionally, rendering a mesh model on the terrain based on the terrain's height and the virtual object's location includes:
[0018] The height of the terrain is increased by a preset value to obtain the offset height;
[0019] A mesh model is rendered on the terrain based on the offset height and the location of the virtual object.
[0020] Optionally, after the step of rendering a mesh model on the terrain based on the terrain's height and the location of the virtual object, the method further includes:
[0021] Control the mesh model to move along with the virtual object.
[0022] Optionally, controlling the mesh model to move with the virtual object includes:
[0023] When the virtual object moves in the game scene, the position offset of the virtual object is determined;
[0024] The mesh model is controlled to move along with the virtual object according to the stated position offset.
[0025] Optionally, after the step of deploying a camera below the mesh model, the method further includes:
[0026] The objects captured by the camera are set to the virtual object and the mesh model.
[0027] Optionally, the terrain includes one or more of the following: snow, desert, and wetland.
[0028] This invention also discloses a display control device for games, comprising:
[0029] The terrain height acquisition module is used to obtain the height of the terrain and the location of virtual objects in the game scene of the current frame;
[0030] A camera deployment module is used to render a mesh model on the terrain based on the height of the terrain and the location of the virtual object, and to deploy a camera below the mesh model.
[0031] A texture mask image capturing module is used to capture images of the virtual object and the mesh model through the camera to obtain a first texture mask image;
[0032] The terrain rendering module is used to render the terrain in the game scene according to the first texture mask map, so as to present the terrain depression effect caused by the virtual object on the terrain.
[0033] This invention also discloses an electronic device, comprising:
[0034] A processor and a storage medium, the storage medium storing machine-readable instructions executable by the processor, wherein when the electronic device is running, the processor executes the machine-readable instructions to perform the method as described in any one of the embodiments of the present invention.
[0035] This invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method described in any one of the embodiments of this invention.
[0036] The embodiments of the present invention have the following advantages:
[0037] In this embodiment of the invention, a camera is deployed using a mesh model to capture virtual objects. This mesh model can occlude unwanted textures within the virtual objects, allowing only the necessary textures to be captured. For example, if only the texture of the feet needs to be captured, the mesh model occludes the textures of the virtual objects other than the feet, eliminating the need for additional culling of the camera's captured content and saving rendering resources. Furthermore, by directly obtaining the terrain height for rendering, there is no need to generate decal objects or enable custom depth rendering for each virtual object, thus improving rendering efficiency. Rendering costs are not increased by collisions or the number of virtual objects. Moreover, the terrain depression effect produced by this method can be as deep as desired, with excellent physical collision effects, enhancing the game's visual appeal. Attached Figure Description
[0038] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a flowchart of the steps of a display control method in a game provided by an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of a mesh model provided in an embodiment of the present invention;
[0041] Figure 3 This is a flowchart illustrating the steps of rendering a texture mask image according to an embodiment of the present invention.
[0042] Figure 4 This is a schematic diagram illustrating the retention of terrain depression effects provided in an embodiment of the present invention;
[0043] Figure 5 This is a schematic diagram illustrating the height difference between a camera and the terrain, provided in an embodiment of the present invention.
[0044] Figure 6 This is a structural block diagram of a display control device in a game provided by an embodiment of the present invention;
[0045] Figure 7 This is a structural block diagram of an electronic device according to the present invention;
[0046] Figure 8 This is a structural block diagram of a computer-readable storage medium according to the present invention. Detailed Implementation
[0047] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0048] In existing technologies, decals are dynamically added to the surface of the terrain, with one decal added for each collision to achieve the desired terrain effect; alternatively, double-sided rendering is enabled for the terrain, with a camera capturing textures on the reverse side of the terrain and then blending the captured textures with the terrain to produce the corresponding terrain effect. However, for the dynamic decal addition method, each terrain effect (such as footprints) requires the generation of a new decal object, causing a continuous increase in game performance; the shape of each terrain effect (such as footprints) is consistent, requiring the creation of several different types of textures randomly; the pits created by the decals on the terrain are not deep enough or realistic enough; and the physicality is not strong. For the double-sided rendering method, each character needs to enable custom depth rendering, which also causes a continuous increase in game performance; because of the added camera, large terrains require an additional culling calculation.
[0049] To address the aforementioned technical problems, this invention provides a display control method for games. This method involves obtaining the height of the terrain and the position of a virtual object in the game scene of the current frame; rendering a mesh model on the terrain based on the terrain height and the virtual object's position; and deploying a camera below the mesh model; capturing images of the virtual object and the mesh model using the camera to obtain a first texture mask image; and rendering the terrain in the game scene based on the first texture mask image to present the terrain depression effect caused by the virtual object moving on the terrain. By utilizing a mesh model to deploy a camera to capture virtual objects, the mesh model can mask unwanted textures within the virtual object, achieving the goal of capturing only the necessary textures. For example, if only the texture of the feet needs to be captured, the mesh model can mask the textures of the virtual object other than the feet, thus eliminating the need for additional culling of the camera's captured content and saving rendering resources. Moreover, by setting the camera directly according to the height of the terrain to capture texture maps for rendering, there is no need to generate decal objects or enable custom depth rendering for each virtual object that needs to be rendered, thereby improving rendering efficiency. The rendering cost will not increase performance overhead due to collisions or the increase of virtual objects. In addition, the terrain depression effect produced by this method can be as deep as desired, and the physical collision effect is very good, enhancing the game's performance.
[0050] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of a display control method in a game provided by the present invention, which may specifically include the following steps:
[0051] Step 101: Obtain the height of the terrain and the location of the virtual object in the game scene of the current frame;
[0052] In this embodiment of the invention, the height of the terrain and the location of the virtual object in the game scene of the current frame can be obtained by calling the interface provided by the game engine. The virtual object can be a movable virtual unit in the game scene, such as a character, animal, or vehicle.
[0053] In this embodiment of the invention, the terrain may include any one or more of the following: snow, desert and wetland. These terrains are relatively soft and will cause the terrain to sink when virtual objects pass through them. For example, when a person passes through the snow, they will leave footprints or footprints, and when a vehicle passes through the snow, it will leave tire tracks.
[0054] In a preferred embodiment of the present invention, obtaining the height of the terrain in the game scene of the current frame includes:
[0055] The height of the terrain is obtained by rendering the height channel of the terrain in the game scene of the current frame using a virtual texture component.
[0056] The virtual texture component can render the required channels on the terrain material and save them to the hard drive via virtual data output. In this embodiment of the invention, the height value of the terrain is mainly needed. Therefore, by setting basic parameters such as rendering type, rendering size, and rendering texture position, the height channel of the terrain in the game scene of the current frame is used to obtain the height of the terrain.
[0057] Step 102: Based on the height of the terrain and the location of the virtual object, render a mesh model on the terrain and deploy a camera below the mesh model;
[0058] In this embodiment of the invention, a mesh model is rendered on the terrain based on its height and the location of the virtual object, and a camera is deployed below the mesh model. The mesh model can be square, but other shapes such as rhombuses or circles can be used as needed; this embodiment does not impose any limitations on this. It should be noted that the rendered mesh model in this embodiment may not be displayed in the game interface; that is, the mesh model is imperceptible to the user to avoid affecting the display effect of the game interface.
[0059] As an example, such as Figure 2As shown, the mesh model is square. A camera is deployed below the mesh model so that the camera can capture images of the mesh model. At the same time, if a virtual object is located below the mesh model, the virtual object can also be captured by the camera.
[0060] In a preferred embodiment of the present invention, after step 102, the following sub-steps may be included:
[0061] The objects captured by the camera are set to the virtual object and the mesh model.
[0062] In this embodiment of the invention, the objects captured by the camera can be set to virtual objects and mesh models, that is, other models on the terrain are not rendered, thereby reducing the number of models that need to be rendered. In a specific implementation, in the settings interface, you can select "Use only list" in the primitive rendering unit mode, and then add the virtual objects and mesh models that need to be rendered to the "only displayed actor values". For example, you can set the array elements that the camera can capture to include "BP_VVR_Footprint" and "BP_Player_01_MVR", where "BP_VVR_Footprint" corresponds to the mesh model and "BP_Player_01_MVR" corresponds to the virtual object.
[0063] Step 103: Capture the virtual object and the mesh model using the camera to obtain a first texture mask image;
[0064] In this embodiment of the invention, a first texture mask image can be obtained by capturing images of a virtual object and a mesh model using a camera. In one example, the mesh model is captured as white and the virtual object as black, thus forming a black-and-white mask image. This allows the texture of the virtual object to be stored as a single-channel texture, reducing the memory consumed in storing the texture. Of course, the first texture mask image can also be stored as a multi-channel texture image as needed, and this embodiment of the invention does not impose any limitations on this.
[0065] Specifically, during filming, the mesh model can mask unwanted textures in the virtual object, allowing only the necessary textures to be captured. For example, if only the texture of the feet needs to be captured, the mesh model can mask the textures of other parts of the virtual object besides the feet, such as the trouser legs, body, arms, etc., thus eliminating the need for additional culling of the content captured by the camera.
[0066] Step 104: Render the terrain in the game scene according to the first texture mask map to present the terrain depression effect caused by the virtual object on the terrain.
[0067] In this embodiment of the invention, after capturing the first texture mask image, the terrain can be rendered in the game scene based on the first texture mask image to present the terrain depression effect caused by the virtual object on the terrain. Specifically, during rendering, the white areas in the first texture mask image are rendered as the terrain texture, and the black areas are rendered as the texture of the virtual object, such as the texture of a character's feet.
[0068] like Figure 3 As shown, in a preferred embodiment of the present invention, the step of rendering the terrain in the game scene according to the first texture mask map to present the terrain depression effect caused by the virtual object on the terrain may specifically include the following sub-steps:
[0069] Sub-step S11: Obtain the second texture mask image captured from the game scene in the previous frame;
[0070] Sub-step S12: Merge the first texture mask image and the second texture mask image to obtain the target mask image;
[0071] Sub-step S13: Render the terrain in the game scene according to the target mask map to present the effect of terrain depression retention.
[0072] In the real world, when a person or vehicle passes over soft terrain, the resulting depressions don't immediately disappear but remain for a certain period. Since games refresh the rendered terrain depressions (such as footprints) in each frame of the game scene, this embodiment of the invention, in order to simulate the terrain depressions left by virtual objects passing over the terrain in the previous frame and further enhance the game's realism, acquires and merges the texture mask images captured in the current and previous frames of the game scene, and then renders according to the merged texture mask image.
[0073] Specifically, a second texture mask is obtained by capturing the game scene of the previous frame. The game scene of the previous frame refers to the game scene in the frame before the game scene of the current frame. The second texture mask can be the merged mask used when rendering the game scene of the previous frame.
[0074] In this embodiment of the invention, after obtaining the second texture mask image, a target mask image is further obtained by merging the first and second texture mask images. The terrain is then rendered in the game scene based on the target mask image to achieve a terrain depression effect. Figure 4 A schematic diagram illustrating the preservation of terrain depression effects is shown, in which... Figure 4 The virtual object is a person, and the terrain is a desert. When the person passes through the desert, a series of footprints will be left behind the person.
[0075] In a preferred embodiment of the present invention, rendering a mesh model on the terrain based on the height of the terrain and the location of the virtual object includes:
[0076] The height of the terrain is increased by a preset value to obtain the offset height; based on the offset height and the location of the virtual object, a mesh model is rendered on the terrain.
[0077] The preset value can be a pre-set height value used to ensure that the rendered mesh model forms a height difference with the terrain, so that the mesh model can be attached to the terrain. For example, the preset value is 10, etc. This embodiment of the invention does not limit this.
[0078] In this embodiment of the invention, the height of the terrain is increased by a preset value to obtain the offset height. Then, based on the offset height and the position of the virtual object, a mesh model is rendered on the terrain. Consequently, the camera rendered below the mesh model in subsequent steps also forms a height difference with the ground, appearing to float above the terrain. Figure 5 As shown, the virtual object and the mesh model will overlap, allowing the camera to capture the texture of the virtual object that overlaps under the mesh model. For example, a person's foot will overlap under the mesh model, allowing the camera to capture the texture of the person's foot and use the foot texture to create a footprint effect.
[0079] In a preferred embodiment of the present invention, after the step of rendering a mesh model on the terrain based on the height of the terrain and the location of the virtual object, the method further includes:
[0080] Control the mesh model to move along with the virtual object.
[0081] In this embodiment of the invention, after rendering the mesh model, the mesh model can be further configured to move synchronously with the virtual object, thereby ensuring that the movement of the virtual object will not be noticeable.
[0082] In a preferred embodiment of the present invention, controlling the mesh model to move with the virtual object includes:
[0083] When the virtual object moves in the game scene, the position offset of the virtual object is determined; the mesh model is controlled to move with the virtual object according to the position offset.
[0084] In this embodiment of the invention, when a virtual object moves in the game scene, its position offset is determined, and then the mesh model is controlled to move with the virtual object according to the position offset. In a specific implementation, the parameter passing function provided by the game engine (such as Unity) can be used to construct a blueprint in the game engine to pass the position offset of the virtual object. This blueprint obtains the position of the virtual object in real time for each frame, calculates the position offset between the current frame and the previous frame, and then passes the calculated position offset to the terrain material, so that the rendering on the terrain material controls the mesh model to move with the virtual object according to the position offset.
[0085] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0086] Reference Figure 6 The diagram illustrates a structural block diagram of a display control device in a game according to an embodiment of the present invention, which may specifically include the following modules:
[0087] The terrain height acquisition module 601 is used to acquire the height of the terrain and the location of the virtual object in the game scene of the current frame.
[0088] The camera deployment module 602 is used to render a mesh model on the terrain according to the height of the terrain and the location of the virtual object, and deploy a camera below the mesh model;
[0089] The texture mask image capturing module 603 is used to capture the virtual object and the mesh model through the camera to obtain a first texture mask image;
[0090] The terrain rendering module 604 is used to render the terrain in the game scene according to the first texture mask map, so as to present the terrain depression effect caused by the virtual object on the terrain.
[0091] In a preferred embodiment of the present invention, the terrain rendering module 604 includes:
[0092] The second texture mask image acquisition submodule is used to acquire the second texture mask image captured for the game scene in the previous frame;
[0093] The texture mask image merging submodule is used to merge the first texture mask image and the second texture mask image to obtain the target mask image.
[0094] The terrain rendering submodule is used to render the terrain in the game scene according to the target mask map, so as to present the effect of terrain depression retention.
[0095] In a preferred embodiment of the present invention, the terrain height acquisition module 601 includes:
[0096] The terrain height acquisition submodule is used to render the height channel of the terrain in the game scene of the current frame through a virtual texture component to obtain the height of the terrain.
[0097] In a preferred embodiment of the present invention, the camera deployment module 602 includes:
[0098] The height offset submodule is used to add a preset value to the height of the terrain to obtain the offset height.
[0099] The mesh model rendering submodule is used to render a mesh model on the terrain based on the offset height and the location of the virtual object.
[0100] In a preferred embodiment of the present invention, it further includes:
[0101] A mesh model movement control module is used to control the mesh model to move along with the virtual object.
[0102] In a preferred embodiment of the present invention, the mesh model movement control module includes:
[0103] The position offset determination submodule is used to determine the position offset of the virtual object when the virtual object moves in the game scene;
[0104] The movement control submodule is used to control the mesh model to move with the virtual object according to the position offset.
[0105] In a preferred embodiment of the present invention, it further includes:
[0106] The object setting module is used to set the objects to be captured by the camera as the virtual object and the mesh model.
[0107] In a preferred embodiment of the invention, the terrain includes any one or more of the following: snow, desert, and wetland.
[0108] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0109] This invention also provides an electronic device, such as... Figure 7 As shown, it includes:
[0110] The electronic device includes a processor 701 and a storage medium 702, wherein the storage medium 702 stores machine-readable instructions executable by the processor 701. When the electronic device is running, the processor 701 executes the machine-readable instructions to perform the method described in any of the embodiments of the present invention. Specific implementations and technical effects are similar and will not be repeated here.
[0111] This invention also provides a computer-readable storage medium, such as... Figure 8 As shown, the storage medium stores a computer program 801, which, when run by a processor, executes the method described in any of the embodiments of the present invention. The specific implementation and technical effects are similar and will not be repeated here.
[0112] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0113] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0117] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.
[0118] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0119] The above provides a detailed description of a display control method and a display control device in a game provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A display control method in a game, characterized by, The method comprises the following steps: acquiring the height of the terrain in the game scene of the current frame and the position of the virtual object; rendering a mesh model on the terrain according to the height of the terrain and the position of the virtual object, and deploying a camera below the mesh model; taking the virtual object and the mesh model through the camera to obtain a first texture mask image; rendering the terrain in the game scene according to the first texture mask image to present the terrain depression effect caused by the virtual object on the terrain; the acquiring the height of the terrain in the game scene of the current frame comprises: rendering the height channel of the terrain in the game scene of the current frame through a virtual texture component to obtain the height of the terrain.
2. The method of claim 1, wherein, the rendering the terrain in the game scene according to the first texture mask image comprises: acquiring a second texture mask image taken for the game scene of the previous frame; merging the first texture mask image and the second texture mask image to obtain a target mask image; rendering the terrain in the game scene according to the target mask image to present the effect of the terrain depression effect remaining.
3. The method of claim 1, wherein, the rendering a mesh model on the terrain according to the height of the terrain and the position of the virtual object comprises: increasing the height of the terrain by a preset value to obtain an offset height; rendering a mesh model on the terrain according to the offset height and the position of the virtual object.
4. The method of claim 1, wherein, after the step of rendering a mesh model on the terrain according to the height of the terrain and the position of the virtual object, the method further comprises: controlling the mesh model to move with the virtual object.
5. The method of claim 4, wherein, the controlling the mesh model to move with the virtual object comprises: determining the position offset amount of the virtual object when the virtual object moves in the game scene; controlling the mesh model to move with the virtual object according to the position offset amount.
6. The method of claim 1, wherein, after the step of deploying a camera below the mesh model, the method further comprises: setting the object taken by the camera as the virtual object and the mesh model.
7. The method of claim 1, wherein, The terrain comprises any one or more of the following: snow, desert and wetland.
8. A display control device in a game, characterized by comprising: The method comprises the following steps: a terrain height acquisition module is configured to acquire the height of the terrain in the game scene of the current frame and the position of the virtual object; a camera deployment module is configured to render a mesh model on the terrain according to the height of the terrain and the position of the virtual object, and deploy a camera below the mesh model; a texture mask image shooting module is configured to take the virtual object and the mesh model through the camera to obtain a first texture mask image; a terrain rendering module is configured to render the terrain in the game scene according to the first texture mask image to present the terrain depression effect caused by the virtual object on the terrain. the terrain height acquisition module comprises: a terrain height acquisition submodule is configured to render the height channel of the terrain in the game scene of the current frame through a virtual texture component to obtain the height of the terrain.
9. An electronic device, comprising: The method comprises the following steps: A processor and a storage medium storing machine readable instructions executable by the processor for causing the processor to perform the method of any one of claims 1-7 when executed by the electronic device.
10. A computer-readable storage medium, characterized in that, A computer program stored on the storage medium for causing the processor to perform the method of any one of claims 1-7 when executed by the processor.
Citation Information
Patent Citations
Rendering method and device
CN111798504A