Scene rendering method and apparatus

By obtaining the scene height map and real-time monitoring of the moving target position, and dynamically adjusting the rendering parameters, the complexity of object occlusion rendering in the game scene is solved, achieving a more realistic rain and snow effect and a more efficient rendering process.

CN114053703BActive Publication Date: 2025-07-25ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111443239.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-07-25
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

In the prior art, rendering of objects blocked areas in game scenes is complicated, making it difficult to achieve real rain and snow occlusion effects.

Method used

By obtaining the real-time position information of the scene height map and moving target, deleting the corresponding rendering parameters in the preset renderer, and dynamically adjusting the scene rendering to simulate the occlusion effect.

Benefits of technology

Simplifies the scene rendering process, improves rendering efficiency and authenticity, and enhances the immersion of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114053703B_ABST
    Figure CN114053703B_ABST
Patent Text Reader

Abstract

The present application provides a scene rendering method and apparatus. The scene rendering method includes: obtaining a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene; monitoring real-time position coordinates of a moving target in a preset coordinate system to obtain current height information of the moving target at a target horizontal position; reading first height information of a target scene model at the target horizontal position from the scene height map; deleting first rendering parameters of the moving target whose current height information at the target horizontal position is equal to the first height information from a preset renderer, and using the preset renderer to render the specified scene. This reduces the complexity of scene rendering, makes the scene rendering more realistic, effectively improves the efficiency of scene rendering, and ensures the authenticity of the rendered scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a scene rendering method. This application also relates to a scene rendering device, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of Internet technology and computer technology, various games have emerged in an endless stream, and more and more people relax by playing games through Internet technology. In order to improve the quality of game graphics, enhance the sense of immersion and presence in the game, generating more realistic game scenes has become a key point in the game design process. In order to enhance the immersion of players, most games provide the function of dynamically switching the weather.

[0003] In the prior art, in order to achieve the authenticity that rain and snow particles are blocked by objects when it rains or snows, for example, there are no rain and snow particles inside an umbrella held by a game character, and there is no rain or snow accumulation in the area blocked by eaves or houses. For the blocked area (such as the ground under the eaves), the original material of the object is usually used to represent it, and for the unblocked area (such as the ground outside the house), the material of snow accumulation is used to represent it. In this way, it is necessary for the art to separate the blocked boundary and use different materials for distinction, which is rather cumbersome in production. Therefore, there is an urgent need for an effective solution to solve the above problems. Summary of the Invention

[0004] In view of this, embodiments of this application provide a scene rendering method to solve the technical defects existing in the prior art. Embodiments of this application also provide a scene rendering device, a computing device, and a computer-readable storage medium.

[0005] According to the first aspect of the embodiments of this application, a scene rendering method is provided, including:

[0006] Obtain a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene;

[0007] Monitor the real-time position coordinates of a moving target in a preset coordinate system, and obtain the current height information of the moving target at a target horizontal position;

[0008] Read, from the scene height map, first height information of a target scene model at the target horizontal position;

[0009] Delete, from a preset renderer, first rendering parameters of a moving target whose current height information is equal to the first height information at the target horizontal position, and use the preset renderer to render the specified scene.

[0010] Optionally, after reading the first height information of the target scene model at the target horizontal position from the scene height map, the method further includes:

[0011] Obtaining second height information of the target object at the target horizontal position in the preset coordinate system;

[0012] In the case where the second height information is lower than the first height information, rendering the target object by using the preset renderer based on the initial rendering parameters of the target object at the target horizontal position.

[0013] Optionally, after obtaining the second height information of the target object at the target horizontal position in the preset coordinate system, the method further includes:

[0014] In the case where the second height information is not lower than the first height information, obtaining second rendering parameters of the target object at the target horizontal position according to the first rendering parameters and the initial rendering parameters;

[0015] Rendering the target object by using the preset renderer based on the second rendering parameters.

[0016] Optionally, obtaining the scene height map of the specified scene includes:

[0017] Obtaining the position coordinates of each scene model in the specified scene in the preset coordinate system;

[0018] Determining the height information of each scene model according to the position coordinates of each scene model;

[0019] Constructing a scene height map based on the height information of each scene model.

[0020] Optionally, obtaining the position coordinates of each scene model in the specified scene in the preset coordinate system includes:

[0021] Obtaining the vertex information of each scene model in the specified scene from a preset information library;

[0022] Determining the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model.

[0023] Optionally, determining the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model includes:

[0024] Determining the model coordinate positions of each scene model according to the vertex information of each scene model;

[0025] Perform matrix transformation on the model coordinate positions of each of the scene models respectively to obtain the position coordinates of each scene model in the preset coordinate system.

[0026] Optionally, before obtaining the scene height map of the specified scene, it further includes:

[0027] Determine the target object;

[0028] Construct an orthographic projection within a preset height directly above the target object to obtain the height information of each scene model in the specified scene.

[0029] Optionally, it further includes:

[0030] When the moving distance of the target object is greater than the preset distance, obtain the current position coordinates of the target object in the preset coordinate system;

[0031] Update the specified scene and the scene models within the specified scene according to the current position coordinates and the preset target range.

[0032] According to the second aspect of the embodiments of the present application, there is provided a scene rendering device, including:

[0033] A first acquisition module configured to acquire a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene;

[0034] A monitoring module configured to monitor the real-time position coordinates of a moving target in a preset coordinate system to obtain the current height information of the moving target at a target horizontal position;

[0035] A reading module configured to read first height information of a target scene model at the target horizontal position from the scene height map;

[0036] A first rendering module configured to delete first rendering parameters of a moving target whose current height information is equal to the first height information at the target horizontal position from a preset renderer, and use the preset renderer to render the specified scene.

[0037] Optionally, the device further includes:

[0038] A second acquisition module configured to acquire second height information of a target object at the target horizontal position in the preset coordinate system;

[0039] A second rendering module configured to, when the second height information is lower than the first height information, render the target object based on the initial rendering parameters of the target object at the target horizontal position using the preset renderer.

[0040] Optionally, the device further includes a third rendering module configured to:

[0041] When the second height information is not lower than the first height information, obtain second rendering parameters of the target object at the target horizontal position according to the first rendering parameter and the initial rendering parameter;

[0042] Render the target object by using the preset renderer based on the second rendering parameter.

[0043] Optionally, the first obtaining module is further configured to:

[0044] Obtain the position coordinates of each scene model in the specified scene in the preset coordinate system;

[0045] Determine the height information of each scene model according to the position coordinates of each scene model;

[0046] Construct a scene height map based on the height information of each scene model.

[0047] Optionally, the first obtaining module is further configured to:

[0048] Obtain the vertex information of each scene model in the specified scene from a preset information library;

[0049] Determine the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model.

[0050] Optionally, the first obtaining module is further configured to:

[0051] Determine the model coordinate positions of each scene model according to the vertex information of each scene model;

[0052] Perform matrix transformation on the model coordinate positions of each scene model respectively to obtain the position coordinates of each scene model in the preset coordinate system.

[0053] Optionally, the device further includes a determining module configured to:

[0054] Determine a target object;

[0055] Construct an orthographic projection within a preset height directly above the target object to obtain the height information of each scene model in the specified scene.

[0056] Optionally, the device further includes an updating module configured to:

[0057] When the moving distance of the target object is greater than a preset distance, obtain the current position coordinates of the target object in the preset coordinate system;

[0058] Update the specified scene and the scene model within the specified scene according to the current position coordinates and the preset target range.

[0059] According to the third aspect of the embodiments of the present application, a computing device is provided, including:

[0060] A memory and a processor;

[0061] The memory is used to store computer-executable instructions, and when the processor executes the computer-executable instructions, the steps of the scene rendering method are implemented.

[0062] According to the fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the scene rendering method are implemented.

[0063] The scene rendering method provided by the present application obtains a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene; monitors the real-time position coordinates of a moving target in a preset coordinate system to obtain the current height information of the moving target at a target horizontal position; reads the first height information of the target scene model at the target horizontal position from the scene height map; deletes the first rendering parameters of the moving target whose current height information is equal to the first height information at the target horizontal position from a preset renderer, and uses the preset renderer to render the specified scene. By obtaining the scene height map, comparing the first height information at the target horizontal position in the scene height map with the current height information of the moving target at the target horizontal position in the preset coordinate system, it is determined whether the moving target is occluded, so as to delete and adjust the rendering parameters in the preset renderer, and then perform dynamic rendering on the specified scene. There is no need to rely on art to separate the occluded boundaries and set different materials for differentiation, which simplifies the scene rendering process, reduces the complexity of scene rendering, makes the scene rendering more realistic, effectively improves the efficiency of scene rendering, ensures the authenticity of the rendered scene, realizes the effect when the moving target is occluded, and improves the authenticity and immersion of the scene. Description of the Drawings

[0064] Figure 1 is a flowchart of a scene rendering method provided by an embodiment of the present application;

[0065] Figure 2 is a schematic diagram of height information in a specified scene provided by an embodiment of the present application;

[0066] Figure 3 is a schematic diagram of the effect of a scene rendering method provided by an embodiment of the present application;

[0067] Figure 4 It is a processing flow chart of a scene rendering method applied to a game provided by an embodiment of the present application;

[0068] Figure 5 It is a schematic structural diagram of a scene rendering device provided by an embodiment of the present application;

[0069] Figure 6 It is a structural block diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners

[0070] Many specific details are set forth in the following description in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.

[0071] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to any or all possible combinations including one or more of the associated listed items.

[0072] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.

[0073] In the present application, a scene rendering method is provided. The present application also relates to a scene rendering device, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments.

[0074] Figure 1 The flowchart of a scene rendering method provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0075] Step 102: Obtain a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene.

[0076] Specifically, the specified scenario refers to a scenario within a preset range, such as a scenario within a circle with a certain reference object as the center and a diameter of 20; the scenario model refers to the object model within the specified scenario, such as steps, houses, tables, rockeries, etc.; the height information refers to the information related to the height of each scenario model within the specified scenario, such as the height of the bench surface of a small bench is 10 centimeters.

[0077] In practical applications, when rendering a scenario, it is necessary to determine the scenario to be rendered, that is, to determine the specified scenario. Further, obtain the scene height map of the specified scenario. There are various methods to obtain the scene height map: You can directly obtain the attribute information of each scenario model in the specified scenario, and then determine the height information of each scenario model based on the attribute information of each scenario model, and then determine the scene height map of the specified scenario based on the height information of each scenario model; You can also preset a scene height map library, in which the identifier of the specified scenario is associated with the scene height map of the specified scenario, that is, the identifier of a specified scenario corresponds to the scene height map of the specified scenario, then you can first determine the identifier of the specified scenario to be rendered, and then search for the scene height map of the specified scenario in the scene height map library based on this identifier.

[0078] To improve the accuracy of obtaining the scene height map, a scene height map can be constructed based on the position coordinates of each scenario model within the specified scenario, that is, the scene height map of the specified scenario is obtained. The specific implementation process can be as follows:

[0079] Obtain the position coordinates of each scenario model in the specified scenario in the preset coordinate system;

[0080] Determine the height information of each scenario model according to the position coordinates of each scenario model;

[0081] Construct a scene height map based on the height information of each scenario model.

[0082] Specifically, the preset coordinate system refers to a pre-specified coordinate system, which can be a coordinate system in real life or a world coordinate system specified in the application; the position coordinate refers to the coordinate corresponding to the scenario model in the preset coordinate system.

[0083] In practical applications, the position coordinates of each scenario model in the specified scenario in the preset coordinate system can be obtained from the position coordinate library, and then based on the position coordinates of each scenario model, combined with the preset central position coordinate, the height information of each scenario model can be determined. Then integrate the height information of each scenario model, and then construct the scene height map of the specified scenario.

[0084] In this application, by determining the position coordinates of the scene model and then obtaining the height information based on the position coordinates, the accuracy of obtaining the height information can be improved. Then, based on the height information, a scene height map is constructed, which is beneficial to improving the efficiency and accuracy of determining the scene height map, and further improving the efficiency of rendering the scene based on the scene height map.

[0085] Preferably, when combining the position coordinates of each scene model with the preset central position coordinates to determine the height information of each scene model, the position coordinates of each scene model can be subtracted from the preset central position coordinates, that is, the coordinates of the central position of the scene height map, so as to obtain the coordinate position of each scene model relative to the scene height map, that is, the height information. Since the height information needs to be stored in the scene height map, and a picture (scene height map) generally has four channels, and one of the channels is used to store the height information. When transferring the real height (height information) of each scene model to the scene height map, the range of the height, that is, the value range, is from 0 to 1. Therefore, the value range is set from 0 to 1. And the heights of each scene model are different, that is, the height information of each scene model is different. In order to avoid positive and negative values of the height information and improve the efficiency of constructing the height map, the middle value of the value range can be selected as the center point as the central position. Then, the center point of 0 to 1 - 0.5 is the preset central position coordinates. That is, preferably, the preset central position coordinates are set to 0.5.

[0086] When obtaining the position coordinates of each scene model in a specified scene in the preset coordinate system, in order to improve the acquisition efficiency and obtain accurate position coordinates, the vertex information of each scene model can be obtained first, and then based on the vertex information of each scene model, the coordinate position can be determined. That is, the process of obtaining the position coordinates of each scene model in the specified scene in the preset coordinate system can be specifically implemented as follows:

[0087] Obtain the vertex information of each scene model in the specified scene from the preset information library;

[0088] Determine the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model.

[0089] Specifically, the preset information library refers to a set of attribute information of each scene model constructed in advance, where the attribute information includes vertex information, and the identifier of the scene model in the preset information library is associated with the attribute information of the scene model; the vertex information refers to the information at the place where three or three faces of the scene model are connected or the corner.

[0090] In practical applications, according to the identifiers of each scene model in a specified scene respectively, the attribute information of each scene model is retrieved from a preset information library, and then the vertex information of each scene model is obtained. Then, according to a preset coordinate system, the vertex information of each scene model is transferred to the preset coordinate system, and thus the position coordinates of each scene model in the preset coordinate system are obtained. In this way, the time length for determining the position coordinates of each scene model can be reduced, and thus the efficiency of determining the position coordinates of each scene model can be improved, and the efficiency of scene rendering can be improved.

[0091] In one or more alternative embodiments of this specification, first, according to the vertex information of each scene model, the model coordinate position of each scene model can be determined, and then the model coordinate position is converted into the position coordinates in the preset coordinate system. In this way, the accuracy of the position coordinates of each scene model can be further improved, and thus the accuracy of the scene height map can be improved, and the efficiency of scene rendering can be improved. That is, the process of determining the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model can be as follows:

[0092] According to the vertex information of each scene model, determine the model coordinate position of each scene model;

[0093] Perform matrix transformation on the model coordinate positions of each scene model respectively to obtain the position coordinates of each scene model in the preset coordinate system.

[0094] Specifically, the model coordinate position refers to the coordinate position of each vertex in the scene model relative to a reference point on the scene model.

[0095] In practical applications, on the basis of obtaining the vertex information of each scene model, further, according to the vertex information of each scene model respectively, determine the model coordinate position of each scene model, and then perform matrix transformation on the model coordinate positions of each scene model respectively, and thus obtain the position coordinates of each scene model in the preset coordinate system.

[0096] For example, a certain scene model is an ultra-thin cylinder with a height of 4. Assume that the upper and lower bottom surfaces of the ultra-thin cylinder are each a point, that is, the ultra-thin cylinder is a vertical line segment. Then the ultra-thin cylinder has two vertices and the distance between the two vertices is 4 (vertex information). Then, taking the lower vertex of the ultra-thin cylinder as the reference point, the model coordinate position of the ultra-thin cylinder is [(0, 0, 0), (0, 0, 4)]. Further, perform matrix transformation on [(0, 0, 0), (0, 0, 4)] to obtain the coordinate position of the ultra-thin cylinder in the preset coordinate system. For example, the coordinate position of the ultra-thin cylinder in the preset coordinate system is [(2, 5, 0), (2, 5, 4)].

[0097] Optionally, before obtaining the scene height map of a specified scene, the height information of each scene model in the specified scene can be determined first, which can improve the efficiency of determining the obtained scene height map. That is, before obtaining the scene height map of the specified scene, it further includes:

[0098] Determine the target object;

[0099] Construct an orthographic projection within a preset height directly above the target object to obtain the height information of each scene model in the specified scene.

[0100] Specifically, the target object refers to the selected object, which is the standard for determining the specified scene. For example, the scene within a preset range centered on the target object is the specified scene; the orthographic projection refers to a linear transformation that maps from a vector space to itself, which is the formalization and generalization of the concept of "parallel projection" in daily life.

[0101] In practical applications, the target object can be determined first, then an orthographic projection is constructed within a preset height directly above the target object, and a certain range is set, and then rendered from top to bottom to obtain the height information of each scene model within the specified scene. In this way, determining the target object can not only accurately locate the specified scene and each scene model within the specified scene, but also improve the efficiency of determining the height information by constructing the orthographic projection.

[0102] See Figure 2 , Figure 2 shows a schematic diagram of the height information in a specified scene provided by an embodiment of the present application: an orthographic projection is constructed at a certain height directly above the target object, that is, within the preset height, and rendered from top to bottom to obtain the height information of each scene model around the target object, that is, the height information of each scene model within the specified scene.

[0103] Step 104: Monitor the real-time position coordinates of the moving target in the preset coordinate system to obtain the current height information of the moving target at the target horizontal position.

[0104] On the basis of obtaining the scene height map of the specified scene, further monitor the real-time position coordinates of the moving target in the preset coordinate system in the specified scene, and obtain the current height information of the moving target at the target horizontal position.

[0105] Specifically, the moving object refers to an object moving from top to bottom in a specified scene, such as snowflakes, raindrops, hailstones, leaves, etc. There can be one or multiple moving objects; the real-time position coordinates refer to the current position coordinates of the moving object in a preset coordinate system during monitoring; the target horizontal position refers to the coordinates of any point in the horizontal direction in the preset coordinate system. For example, if the coordinates of a certain point on a chair are (3, 5, 2), then the target horizontal position is (3, 5). For example, if the real-time position coordinates of a fallen leaf are (7, 8, 20), then the target horizontal position is (7, 8); the current height information refers to the height coordinate of the moving object in the target horizontal direction in the preset coordinate system.

[0106] In practical applications, it is necessary to monitor the real-time position coordinates of the moving object in the preset coordinate system in real time, and then the current height information of the moving object at the target horizontal position can be determined according to the real-time position coordinates.

[0107] When there is one moving object, for example, it is detected that the real-time position coordinates of a snowflake (the moving object) in the world space (preset coordinate system) are (20, 30, 60), then the target horizontal position of this snowflake is (20, 30), that is, the current height information of this snowflake at (20, 30) is 60.

[0108] When there are multiple moving objects, for example, two water droplets (the moving objects) are detected. The real-time position coordinates of the first water droplet in the world space (preset coordinate system) are (12, 13, 20), then the target horizontal position of the first water droplet is (12, 13), that is, the current height information of the first water droplet at (12, 13) is 20; the real-time position coordinates of the second water droplet in the world space (preset coordinate system) are (3, 9, 27), then the target horizontal position of the second water droplet is (3, 9), that is, the current height information of this second water droplet at (3, 9) is 27.

[0109] Step 106: Read the first height information of the target scene model at the target horizontal position from the scene height map.

[0110] On the basis of monitoring the real-time position coordinates of the moving object in the preset coordinate system in the specified scene and obtaining the current height information of the moving object at the target horizontal position, further, read the first height information of the target scene model at the target horizontal position in the scene height map.

[0111] Specifically, the target scene model is the highest scene model at the target horizontal position in the scene height map; the first height information is the height information of the target scene model at the target horizontal position.

[0112] In practical applications, after obtaining the scene height map and the current height information of the moving target at the target horizontal position, determine the first height information at the target horizontal position where the moving target is located from the scene height map: According to the target horizontal position, determine the target scene model at the target horizontal position in the scene height map, and then determine the first height information according to the target scene model.

[0113] Continuing with the above example, the target horizontal position is (20, 30). In the scene height map, the scene models at the horizontal position (20, 30) include the eaves and the table. That is, the scene models at the target horizontal position in the scene height map include the eaves and the table. Among them, the height information of the eaves at the target horizontal position (20, 30) is 30, and the height information of the table at the target horizontal position (20, 30) is 10. Then the eaves are higher than the table, that is, the eaves are the target scene model, and the first height information is 30.

[0114] Step 108: Delete the first rendering parameters of the moving target whose current height information at the target horizontal position is equal to the first height information from the preset renderer, and use the preset renderer to render the specified scene.

[0115] On the basis of reading the first height information of the target scene model at the target horizontal position in the scene height map, further compare the current height information with the first height information. If they are equal, delete the first rendering parameters of the moving target at the target horizontal position in the preset renderer, and use the preset renderer to render the specified scene.

[0116] Specifically, the preset renderer refers to a tool or shader for rendering a scene; the first rendering parameter refers to the parameter for rendering a moving target.

[0117] In practical applications, when the current height information of the moving target is equal to the first height information of the target scene model, it means that the moving target is blocked by the target scene model. Therefore, there is no moving target under the target scene model. At this time, the first rendering parameters of the moving target under the target scene model in the preset renderer can be deleted, that is, the first rendering parameters of the moving target at the target horizontal position whose current height information is equal to the first height information in the preset renderer are deleted. Then, use the preset renderer to render the moving target at the target horizontal position in the specified scene whose current height information is higher than the first height information. At this time, in the presented specified scene, there is no moving target directly below the target scene model. When the current height information is higher than the first height information, it means that there is no object that can block the movement of the moving target at this time, that is, the target scene model is located below the moving target. At this time, no operation needs to be performed on the first rendering parameters of the moving target in the preset renderer, and the preset renderer can normally render the moving target in the specified scene.

[0118] For example, when raindrops or snowflakes (moving objects) reach under the eaves or on the roof (target scene model), that is, when the current height information is equal to the first height information, the rendering parameters of raindrops or snowflakes under the eaves or on the roof in the preset renderer are removed, so that in the rendered specified scene, there are no raindrops or snowflakes under the eaves or below the roof, achieving the same effect as rain or snow in the real world.

[0119] Another example is that the specified scene contains two scene models: an umbrella and a deck chair, and the deck chair is not blocked by the umbrella in the vertical direction. Assume the first target horizontal position is (0, 0) and the deck chair (the first target scene model) is at the first horizontal position, then the first height information of the target scene model at the first target horizontal position is the height information of the deck chair, which is 5; the second target horizontal position is (3, 6) and the umbrella (the second target scene model) is at the second horizontal position, then the first height information of the target scene model at the second target horizontal position is the height information of the deck chair, which is 10. Delete the rendering parameters of the moving objects whose current height information is equal to 5 at the first target horizontal position (0, 0) in the preset renderer, and the rendering parameters of the moving objects whose current height information is equal to 10 at the first target horizontal position (3, 6), and then use the preset renderer to render the specified scene, so that in the rendered specified scene, when the moving objects move from top to bottom, they are blocked by the deck chair and the umbrella, that is, there are no moving objects directly below the deck chair and there are no moving objects directly below the umbrella.

[0120] It should be noted that since when the current height information is equal to the first height information at the target horizontal position, the first rendering parameters of the moving objects whose current height information is equal to the first height information at the target horizontal position in the preset renderer are deleted, therefore, there is no situation where the current height information of the moving object at the target horizontal position is lower than the first height information, that is, there are no first rendering parameters of the moving objects whose current height information is equal to or lower than the first height information at the target horizontal position in the preset renderer.

[0121] In addition, on the basis of reading the first height information of the target scene model at the target horizontal position in the scene height map, it is also necessary to obtain the second height information of the target object in the preset coordinate system to determine the rendering method of the target object in the specified scene, that is, after reading the first height information of the target scene model at the target horizontal position from the scene height map, it further includes:

[0122] Obtain the second height information of the target object at the target horizontal position in the preset coordinate system;

[0123] When the second height information is lower than the first height information, the target object is rendered using the preset renderer based on the initial rendering parameters of the target object at the target horizontal position.

[0124] Specifically, the target object refers to any scene model located at the target horizontal position in the preset coordinate system; the second height information refers to the height information of the target object at the target horizontal position in the preset coordinate system; the initial rendering parameters refer to the default rendering parameters of the target object, that is, the original rendering parameters.

[0125] In practical applications, in the preset coordinate system, all scene models located at the target horizontal position are first determined. For any one of the scene models, that is, the target object, the second height information of the target object at the target horizontal position is determined. Further, the second height information is compared with the first height information. If the second height information is lower than the first height information, it means that the target object is located below the target scene model at the target horizontal position, that is, the target object is blocked by the target scene model at the target horizontal position, that is, the moving target will not fall on the surface of the target object. Therefore, there is no change in the target object at the target horizontal position, and no operation needs to be performed on the initial rendering parameters of the target object. The target object can be directly rendered using the preset renderer based on the initial rendering parameters of the target object. In this way, the specified scene rendered has the same effect as the real world, improving the authenticity of the specified scene, thereby improving the user's immersion and experience, and increasing user viscosity.

[0126] In addition, the second height information can also be equal to the first height information, which means that the target object is the target scene model, or the target object is not blocked by the target scene model. At this time, the moving target will fall on the surface of the target object, and the rendering parameters of the target object need to be changed. That is, after obtaining the second height information of the target object at the target horizontal position in the preset coordinate system, it further includes:

[0127] When the second height information is not lower than the first height information, the second rendering parameters of the target object at the target horizontal position are obtained according to the first rendering parameters and the initial rendering parameters;

[0128] The target object is rendered using the preset renderer based on the second rendering parameters.

[0129] Specifically, the second rendering parameters refer to the adjusted rendering parameters of the target object.

[0130] In practical applications, in a preset coordinate system, first determine all scene models located at the target horizontal position. For any one of the scene models, that is, the target object, determine the second height information of the target object at the target horizontal position. Further, compare the second height information with the first height information. If the second height information is not lower than the first height information, it means that at the target horizontal position, the target object is the target scene model, or the target object is not blocked by the target scene model, that is, the target object will fall on the surface of the target object. Therefore, the target object will have the effect of being covered by the moving target. At this time, it is necessary to determine the second rendering parameter corresponding to the surface of the target object being covered by the moving target at the target horizontal position based on the initial rendering parameter of the target object and the initial parameter of the moving target, and then use the preset renderer to render the target object based on the second rendering parameter of the target object. In this way, the specified scene rendered has the same effect as the real world, improving the authenticity of the specified scene, thereby enhancing the user's immersion and experience, and increasing user viscosity.

[0131] For example, the target horizontal position is (20, 30). In the preset coordinate system, the scene models located at the target horizontal position of (20, 30) are the eaves and the table. The height information of the eaves is 30, and the height information of the table is 10. The target scene model in the scene height map is the eaves and the first height information is 30. When the target object is the table, the first height information is 10, and 10 is less than 30, indicating that the second height information is lower than the first height information, that is, the eaves block the table. At this time, no operation is required on the initial rendering parameter of the table, and the table can be directly rendered using the preset renderer based on the initial rendering parameter of the table. When the target object is the eaves, the first height information is 30, and 30 is equal to 30, indicating that the second height information is not lower than the first height information. The target object and the target scene model are both the eaves, and the surface of the eaves will have the effect of being covered by the moving target. At this time, it is necessary to determine the second rendering parameter of the surface of the eaves based on the initial rendering parameter of the target object and the initial parameter of the eaves, and then use the preset renderer to render the eaves based on the second rendering parameter of the eaves, reflecting the effect of the eaves being covered by the moving target.

[0132] See Figure 3 , Figure 3 FIG. shows the effect schematic diagram of a scene rendering method provided by an embodiment of the present application: where the moving target is snowflakes, that is, when it is snowing, there are no snowflakes falling under the eaves, and the ground, table, etc. blocked by the eaves are not covered by snowflakes, that is, there is no snow accumulation, while the eaves and the ground not blocked by the eaves are covered by snowflakes, having the effect of snow accumulation.

[0133] It should be noted that the specified scene will change as the target object moves. Therefore, it is necessary to update the specified scene according to the moving distance of the target object, as follows:

[0134] When the moving distance of the target object is greater than a preset distance, obtain the current position coordinates of the target object in the preset coordinate system;

[0135] Update the specified scene and the scene model within the specified scene according to the current position coordinates and the preset target range.

[0136] Specifically, the moving distance refers to the straight-line distance from the initial position of the target object to another position; the preset distance is a criterion set in advance for measuring whether the moving distance of the target object will trigger the update of the specified scene; the current position coordinates refer to the position coordinates of the target object in the preset coordinate system at present; the preset target range refers to the range delimiting the specified scene, such as a circle with a radius of 10 meters.

[0137] In practical applications, the current position coordinates of the target object are monitored in real time. When the distance between the current position coordinates of the target object and the initial position coordinates is greater than the preset threshold, obtain the current position coordinates of the target object in the preset coordinate system, and determine the current position coordinates as the new initial position coordinates. With the current position coordinates as the center point, determine the scene within the preset target range of the center point as the new specified scene, and update all the scene models within the specified scene. In this way, the specified scene can be updated in a timely manner according to the movement of the target object, so that the rendered specified scene changes with the movement of the target object, improving the authenticity of the specified scene, thereby enhancing the user's immersion and experience, and increasing user viscosity.

[0138] The scene rendering method provided by this application obtains the scene height map of the specified scene, where the scene height map includes the height information of at least one scene model in the specified scene; monitors the real-time position coordinates of the moving target in the preset coordinate system to obtain the current height information of the moving target at the target horizontal position; reads the first height information of the target scene model at the target horizontal position from the scene height map; deletes the first rendering parameters of the moving target whose current height information at the target horizontal position is equal to the first height information from the preset renderer, and uses the preset renderer to render the specified scene. By obtaining the scene height map, comparing the first height information at the target horizontal position in the scene height map with the current height information of the moving target at the target horizontal position in the preset coordinate system, it is determined whether the moving target is blocked, so as to delete and adjust the rendering parameters in the preset renderer, and then perform dynamic rendering on the specified scene. There is no need to rely on artists to separate the blocked boundaries and set different materials for distinction, which simplifies the scene rendering process, reduces the complexity of scene rendering, and makes the scene rendering more realistic, effectively improving the efficiency of scene rendering, ensuring the authenticity of the rendered scene, realizing the effect when the moving target is blocked, and enhancing the authenticity and substitution sense of the scene.

[0139] The following, in conjunction with the accompanying Figure 4 , taking the scene rendering method provided in this application for a game application as an example, further describes the scene rendering method. Among them, Figure 4 FIG. shows a processing flow chart of a scene rendering method applied to a game provided by an embodiment of the present application, specifically including the following steps:

[0140] Step 402: Obtain the vertex information of each scene model in the specified game scene from the preset information library.

[0141] Step 404: Determine the model coordinate positions of each scene model according to the vertex information of each scene model.

[0142] Step 406: Perform matrix transformation on the model coordinate positions of each scene model respectively to obtain the position coordinates of each scene model in the preset coordinate system.

[0143] Step 408: Determine the height information of each scene model according to the position coordinates of each scene model.

[0144] Optionally, a target game character can also be determined, and an orthographic projection is constructed within a preset height directly above the target game character to obtain the height information of each scene model in the specified game scene.

[0145] Step 410: Construct a scene height map based on the height information of each scene model.

[0146] Step 412: Monitor the real-time position coordinates of the moving target in the preset coordinate system to obtain the current height information of the moving target at the target horizontal position.

[0147] Among them, the moving target can be snowflakes or raindrops in the specified game scene.

[0148] Step 414: Read the first height information of the target scene model at the target horizontal position from the scene height map.

[0149] Step 416: Delete the first rendering parameter of the moving target whose current height information is equal to the first height information at the target horizontal position from the preset renderer, and use the preset renderer to render the specified game scene.

[0150] Step 418: Obtain the second height information of the target object at the target horizontal position in the preset coordinate system.

[0151] Among them, Step 416 and Step 418 are two parallel steps, which can be executed simultaneously, or Step 416 can be executed first and then Step 418, or Step 418 can be executed first and then Step 416. In this application, the example of executing Step 416 and Step 418 simultaneously is used for illustration.

[0152] Step 420: When the second height information is lower than the first height information, based on the initial rendering parameters of the target object at the target horizontal position, use a preset renderer to render the target object.

[0153] Step 422: When the second height information is not lower than the first height information, obtain the second rendering parameters of the target object at the target horizontal position according to the first rendering parameters and the initial rendering parameters.

[0154] Step 424: Based on the second rendering parameters, use a preset renderer to render the target object.

[0155] Among them, Step 420 and Steps 422 to 424 are execution steps in two different situations, and the corresponding steps can be selected according to the actual situation.

[0156] Optionally, it is also necessary to update the specified game scene:

[0157] When the moving distance of the target game character is greater than the preset distance, obtain the current position coordinates of the target game character in the preset coordinate system;

[0158] According to the current position coordinates and the preset target range, update the specified game scene and the scene model in the specified game scene.

[0159] The scene rendering method provided by this application obtains the scene height map, compares the first height information at the target horizontal position in the scene height map with the current height information of the moving target at the target horizontal position in the preset coordinate system to determine whether the moving target is blocked, thereby deleting and adjusting the rendering parameters in the preset renderer, and then performing dynamic rendering on the specified scene. It does not require artists to separate the blocked boundaries and set different materials for distinction, simplifies the scene rendering process, reduces the complexity of scene rendering, makes the scene rendering more realistic, effectively improves the efficiency of scene rendering, ensures the authenticity of the rendered scene, realizes the effect when the moving target is blocked, and improves the authenticity and immersion of the scene.

[0160] Corresponding to the above method embodiment, this application also provides an embodiment of a scene rendering device. Figure 5 The structural schematic diagram of a scene rendering device provided by an embodiment of this application is shown. As Figure 5 shown, the device includes:

[0161] The first acquisition module 502 is configured to acquire the scene height map of the specified scene, where the scene height map includes the height information of at least one scene model in the specified scene;

[0162] The monitoring module 504 is configured to monitor the real-time position coordinates of a moving target in a preset coordinate system, and obtain the current height information of the moving target at the target horizontal position;

[0163] The reading module 506 is configured to read the first height information of the target scene model at the target horizontal position from the scene height map;

[0164] The first rendering module 508 is configured to delete the first rendering parameters of the moving target whose current height information is equal to the first height information at the target horizontal position from a preset renderer, and use the preset renderer to render the specified scene.

[0165] Optionally, the device further includes:

[0166] The second obtaining module is configured to obtain the second height information of the target object at the target horizontal position in the preset coordinate system;

[0167] The second rendering module is configured to, when the second height information is lower than the first height information, render the target object using the preset renderer based on the initial rendering parameters of the target object at the target horizontal position.

[0168] Optionally, the device further includes a third rendering module, which is configured to:

[0169] When the second height information is not lower than the first height information, obtain the second rendering parameters of the target object at the target horizontal position according to the first rendering parameters and the initial rendering parameters;

[0170] Render the target object using the preset renderer based on the second rendering parameters.

[0171] Optionally, the first obtaining module 502 is further configured to:

[0172] Obtain the position coordinates of each scene model in the specified scene in the preset coordinate system;

[0173] Determine the height information of each scene model according to the position coordinates of each scene model;

[0174] Construct a scene height map based on the height information of each scene model.

[0175] Optionally, the first obtaining module 502 is further configured to:

[0176] Obtain the vertex information of each scene model in the specified scene from a preset information library;

[0177] Determine the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model.

[0178] Optionally, the first acquisition module 502 is further configured to:

[0179] Determine the model coordinate positions of each scene model according to the vertex information of each scene model;

[0180] Perform matrix transformation on the model coordinate positions of each scene model respectively to obtain the position coordinates of each scene model in the preset coordinate system.

[0181] Optionally, the device further includes a determination module, configured to:

[0182] Determine the target object;

[0183] Construct an orthographic projection within a preset height directly above the target object to obtain the height information of each scene model in the specified scene.

[0184] Optionally, the device further includes an update module, configured to:

[0185] When the moving distance of the target object is greater than the preset distance, acquire the current position coordinates of the target object in the preset coordinate system;

[0186] Update the specified scene and the scene models within the specified scene according to the current position coordinates and the preset target range.

[0187] The scene rendering device provided by this application obtains a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene; monitors the real-time position coordinates of a moving target in a preset coordinate system to obtain the current height information of the moving target at a target horizontal position; reads the first height information of a target scene model at the target horizontal position from the scene height map; deletes the first rendering parameters of the moving target whose current height information is equal to the first height information at the target horizontal position from a preset renderer, and uses the preset renderer to render the specified scene. By obtaining the scene height map, comparing the first height information at the target horizontal position in the scene height map with the current height information of the moving target at the target horizontal position in the preset coordinate system, it is determined whether the moving target is occluded, so as to delete and adjust the rendering parameters in the preset renderer, and then perform dynamic rendering on the specified scene. There is no need to rely on artists to separate the occluded boundaries and set different materials for distinction, which simplifies the scene rendering process, reduces the complexity of scene rendering, makes the scene rendering more realistic, effectively improves the efficiency of scene rendering, ensures the authenticity of the rendered scene, realizes the effect when the moving target is occluded, and improves the authenticity and immersion of the scene.

[0188] The above is a schematic solution of a scene rendering device according to an embodiment of the present application. It should be noted that the technical solution of this scene rendering device and the technical solution of the above scene rendering method belong to the same concept. For the details not described in detail in the technical solution of the scene rendering device, reference can be made to the description of the technical solution of the above scene rendering method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method. Each functional module is not an actual functional division or separation limitation. The device claim defined by such a set of functional modules should be understood as mainly implementing the functional module architecture of the solution through the computer program recorded in the specification, rather than being understood as mainly implementing the physical device of the solution through hardware means.

[0189] Figure 6 FIG. shows a structural block diagram of a computing device 600 according to an embodiment of the present application. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to store data.

[0190] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, Worldwide Interoperability for Microwave Access (Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, and so on.

[0191] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 6 the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0192] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 600 can also be a mobile or stationary server.

[0193] Wherein, the processor 620 is used to execute the computer-executable instructions of the scene rendering method.

[0194] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above scene rendering method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above scene rendering method.

[0195] An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions that are used for the scene rendering method when executed by a processor.

[0196] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above scene rendering method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above scene rendering method.

[0197] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0198] The computer instructions include computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0199] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0200] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0201] The preferred embodiments of the present application disclosed above are only used to help illustrate the present application. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principle and practical application of the present application, so that those skilled in the art can understand and utilize the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A scene rendering method, characterized in that, Including: Obtain a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene; Monitor the real-time position coordinates of a moving target in a preset coordinate system to obtain the current height information of the moving target at a target horizontal position, where the moving target is an object moving in the specified scene; Read the first height information of a target scene model at the target horizontal position from the scene height map; Delete the first rendering parameters of the moving target whose current height information is equal to the first height information at the target horizontal position from a preset renderer, and use the preset renderer to render the specified scene. In the preset renderer after deleting the first rendering parameters, there is no first rendering parameter whose current height information is equal to or lower than the first height information.

2. The method according to claim 1, wherein After reading the first height information of the target scene model at the target horizontal position from the scene height map, it further includes: Obtain the second height information of a target object at the target horizontal position in the preset coordinate system; When the second height information is lower than the first height information, render the target object using the preset renderer based on the initial rendering parameters of the target object at the target horizontal position.

3. The method according to claim 2, wherein After obtaining the second height information of the target object at the target horizontal position in the preset coordinate system, it further includes: When the second height information is not lower than the first height information, obtain the second rendering parameters of the target object at the target horizontal position according to the first rendering parameters and the initial rendering parameters; Render the target object using the preset renderer based on the second rendering parameters.

4. The method according to claim 1, wherein The obtaining of the scene height map of the specified scene includes: Obtain the position coordinates of each scene model in the specified scene in the preset coordinate system; Determine the height information of each scene model according to the position coordinates of each scene model; Construct a scene height map based on the height information of each scene model.

5. The method according to claim 4, characterized in that, The obtaining of the position coordinates of each scene model in the specified scene in the preset coordinate system includes: Obtain the vertex information of each scene model in the specified scene from a preset information library; Determine the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model.

6. The method according to claim 5, characterized in that, The determining of the position coordinates of each scene model in the preset coordinate system according to the vertex information of each scene model includes: Determine the model coordinate positions of each scene model according to the vertex information of each scene model; Perform matrix transformation on the model coordinate positions of each scene model respectively to obtain the position coordinates of each scene model in the preset coordinate system.

7. The method according to claim 1, wherein Before obtaining the scene height map of the specified scene, it further includes: Determine a target object; Construct an orthographic projection within a preset height directly above the target object to obtain the height information of each scene model in the specified scene.

8. The method according to claim 7, wherein It further includes: When the moving distance of the target object is greater than a preset distance, obtain the current position coordinates of the target object in the preset coordinate system; Update the specified scene and the scene model within the specified scene according to the current position coordinates and the preset target range.

9. A scene rendering device, characterized in that, Including: A first acquisition module configured to acquire a scene height map of a specified scene, where the scene height map includes height information of at least one scene model in the specified scene; A monitoring module configured to monitor the real-time position coordinates of a moving target in a preset coordinate system and obtain the current height information of the moving target at a target horizontal position, where the moving target is an object moving in the specified scene; A reading module configured to read first height information of a target scene model at the target horizontal position from the scene height map; A first rendering module configured to delete first rendering parameters of a moving target whose current height information at the target horizontal position is equal to the first height information from a preset renderer, and use the preset renderer to render the specified scene, where in the preset renderer after deleting the first rendering parameters, there is no first rendering parameter whose current height information is equal to or lower than the first height information.

10. A computing device, characterized in that, Including: A memory and a processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the scene rendering method according to any one of claims 1 to 8.

11. A computer-readable storage medium storing computer instructions, characterized in that, When the instruction is executed by the processor, the steps of the scene rendering method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Game scene generation method and device, computer equipment and readable storage medium

    CN113470169A