Data rendering method and apparatus
By acquiring the light source display ratio and ambient lighting parameters of the game scene and processing the rendering data, the problem of unclear lighting rendering in existing technologies is solved, the realism of the game scene and the lighting effects are improved, and the gaming experience is enhanced.
Patent Information
- Application Number
- CN202211227967.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-09
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-10-09
AI Technical Summary
Existing technologies cannot simulate realistic physical lighting effects in game scene lighting rendering, resulting in unclear shadow effects and reduced gaming experience.
By determining the current position of the target object and the light source display ratio, ambient lighting parameters are obtained. The initial rendering data is then processed using the light source display ratio and ambient lighting parameters to generate target rendering data that is closer to physical lighting, and then rendered.
It improves the realism of game scenes and the clarity of lighting effects, enhancing the gaming experience.
Smart Images

Figure CN115487495B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of games, and in particular to a data rendering method. BACKGROUND
[0002] With the continuous development of game technology, in order to improve the game experience of the game, when rendering the game scene, the lighting parameters in the game scene are rendered to increase the realism of the game scene. However, in the process of light rendering in the prior art, the light algorithm is used to simulate the light changes in the game scene, but when the prior art performs light rendering, it cannot simulate the real physical light effect, and the shadow effect in the scene will exist unclear problem, which has a large difference with the real physical light, thereby leading to poor realism of the game scene and reducing the game experience. SUMMARY
[0003] Therefore, the embodiments of the present specification provide a data rendering method. One or more embodiments of the present specification also relate to a data rendering device, a computing device, a computer readable storage medium and a computer program to solve the technical defects in the prior art.
[0004] According to a first aspect of the embodiments of the present specification, a data rendering method is provided, comprising:
[0005] determining the current position of the target object, and determining the initial rendering data corresponding to the current position and the light source display ratio corresponding to the current position;
[0006] obtaining the ambient lighting parameters of the current position, processing the initial rendering data based on the ambient lighting parameters and the sky display ratio to obtain target rendering data, and rendering the target rendering data.
[0007] According to a second aspect of the embodiments of the present specification, a data rendering device is provided, comprising:
[0008] a determining module configured to determine the current position of the target object, and determine the initial rendering data corresponding to the current position and the light source display ratio corresponding to the current position;
[0009] a rendering module configured to obtain the ambient lighting parameters of the current position, process the initial rendering data based on the ambient lighting parameters and the sky display ratio to obtain target rendering data, and render the target rendering data.
[0010] According to a third aspect of the embodiments of the present specification, a computing device is provided, comprising:
[0011] a memory and a processor;
[0012] The memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the data rendering method.
[0013] According to a fourth aspect of an embodiment of the present specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, implement the steps of the data rendering method.
[0014] According to a fifth aspect of an embodiment of the present specification, a computer program is provided, which, when executed in a computer, causes the computer to perform the steps of the data rendering method.
[0015] An embodiment of the present specification provides a data rendering method, comprising: determining a current position of a target object, and determining initial rendering data corresponding to the current position and a light source display ratio corresponding to the current position; obtaining an ambient light parameter of the current position, processing the initial rendering data based on the ambient light parameter and the sky display ratio to obtain target rendering data, and rendering the target rendering data.
[0016] Specifically, in the process of rendering the rendering data, the influence of the light source display ratio on the light rendering is considered, so that the initial rendering data is processed by using the light source display ratio and the ambient light parameter and other data, so as to obtain the target rendering data closer to the physical light, and the target rendering data is rendered, so as to obtain the rendering result with better effect, increase the reality of the game scene, avoid the problem that the shadow effect in the scene is not clear due to the inability to simulate the real physical light effect, and improve the game experience. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is an application schematic diagram of a data rendering method provided by an embodiment of the present specification;
[0018] Figure 2 is a flowchart of a data rendering method provided by an embodiment of the present specification;
[0019] Figure 3 is a schematic diagram of a 3D map in a data rendering method provided by an embodiment of the present specification;
[0020] Figure 4 is a schematic diagram of a shadow probe in a data rendering method provided by an embodiment of the present specification;
[0021] Figure 5is a schematic diagram of application of a shielding probe in a data rendering method provided by an embodiment of the present specification;
[0022] Figure 6 is a schematic diagram of light rendering in a data rendering method provided by an embodiment of the present specification;
[0023] Figure 7 is a process flow diagram of a data rendering method provided by an embodiment of the present specification;
[0024] Figure 8 is a process schematic diagram of revising spherical harmonic parameters in a data rendering method provided by an embodiment of the present specification;
[0025] Figure 9 is a structural schematic diagram of a data rendering apparatus provided by an embodiment of the present specification;
[0026] Figure 10 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION
[0027] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples provided herein, and it is understood that the scope of the present specification is not limited to the details below.
[0028] The terminology used in one or more embodiments of the present specification is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in one or more embodiments of the present specification and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0029] It is to be understood that although the terms first, second, etc. can be employed in one or more embodiments of the present specification, these terms are used to distinguish one information from another and are not intended to denote or create limitations, unless otherwise noted. For example, without departing from the scope of one or more embodiments of the present specification, first can be termed second, and similarly, second can be termed first. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination."
[0030] First, the noun terms related to one or more embodiments of the present specification are explained.
[0031] Occlusion Probe: also known as a shadow probe, which stores a sky visibility value in the format of float32 floating point number and between 0 and 1; there can be multiple shadow probes in a game scene.
[0032] 3D Texture: a three-dimensional texture, which contains pixels in three-dimensional space (also known as VolumeTexture).
[0033] G Buffer: a shading technique that can be used in image filtering and object masking based on layer events in Video Post, and users can get dedicated image channels by marking object IDs or material IDs.
[0034] Video Post: a video compositor, which is a tool for editing, compositing and special effect processing.
[0035] In the present specification, a data rendering method is provided, and the present specification also relates to a data rendering device, a computing device, and a computer readable storage medium, which are described in detail one by one in the following embodiments.
[0036] Reference is made to Figure 1 , Figure 1 An application schematic diagram of a data rendering method provided according to an embodiment of the present specification is shown, in which a game scene is displayed on a client display interface of a client, and the game scene is a game scene within a camera field of view. However, since the size of the sky visibility is not considered in the process of rendering the game scene, the influence of the sky visibility on the ambient light global illumination data and the reflection light intensity data in the current game scene is not considered, for example, the smaller the sky visibility of the current game scene, the more blurred the shadow in the game scene, and the smaller the reflection light intensity difference; on the contrary, the larger the sky visibility of the current game scene, the clearer the shadow in the game scene, and the larger the reflection light intensity difference. Therefore, since the influence of the sky visibility on the ambient light data and the reflection light intensity is not considered, the shadow part of the game scene is relatively blurred, the reflection light intensity in the game scene is greatly different from the real physical reflection light intensity, thereby resulting in poor reality of the game scene, and there is a problem of light leakage.
[0037] Based on this, the data rendering method provided by the present specification is used to overcome the above problems. After determining the current position of the camera, the game scene map corresponding to the current position needs to be rendered to the display interface of the client. The game scene within the current camera field of view (for example, a game forest scene containing game models such as trees, stones and sky) will be displayed on the display interface.
[0038] After the game scene textures are rendered, the client renders the 3D texture corresponding to the camera's current position onto the game's display interface. This 3D texture stores a normalized sky visibility of [0.0, 1.0]. This sky visibility represents the percentage of the field of view that the point (the camera's current position) can observe that is the skybox.
[0039] After the 3D texture rendering is complete, the client obtains the sky visibility value in screen space and performs the lighting calculation phase. During the lighting calculation phase, the client determines the skybox visibility of the occlusion probe corresponding to the current location. Then, using the sky visibility value and the spherical harmonic parameters of the ambient light probe, it calculates the ambient global illumination data and reflected light intensity data for the camera's current location.
[0040] The client then inputs the ambient light global illumination data, reflected light intensity data, and the model textures of the current game scene into the GPU, which renders them onto the client's game display interface. This makes the game scene displayed in the game display interface more realistic, and the lighting data and reflected light intensity in the game scene are closer to the real physical environment.
[0041] It should be noted that the camera can be the target object, the current game scene texture can be the initial rendering data, the sky visibility value can be the light source display ratio, the spherical harmonic parameter can be the ambient lighting parameter, and the target rendering data can be ambient light global illumination data, reflected light intensity data, and model textures of the current game scene, etc. Furthermore, the data rendering method provided in this manual can be applied to both the client and the server.
[0042] See Figure 2 , Figure 2 A flowchart of a data rendering method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0043] Step 202: Determine the initial rendering data corresponding to the current position of the target object, and determine the light source display ratio corresponding to the current position.
[0044] The light source display ratio can be understood as the sky visibility data in the game scene displayed on the game display page. This sky visibility data is also called sky visibility value, skybox visibility, or sky occlusion information, and is used to describe the proportion of the skybox in the entire game display page. The game display page can be a display page on the user's terminal monitor that can display the game scene; the user terminal can be a terminal device held by the user, such as a computer or mobile phone. It should be noted that sky visibility is an important parameter for calculating indirect lighting in the game scene and enhancing the sense of space in the scene.
[0045] The initial rendering data can be understood as scene model data corresponding to the game scene within the camera view, including but not limited to terrain, stone, building, vegetation and other models. For example, the initial rendering data can be a map of the game scene model that needs to be rendered into the game display page, including but not limited to vegetation map, terrain map, etc.
[0046] The target object can be understood as a camera controlled by a player during the game process, or a game character operated by a player during the game process. The current position can be understood as the coordinate position of the target object in the game scene.
[0047] Specifically, the data rendering method provided by the present specification first determines the initial rendering data corresponding to the current position of the target object during the rendering process, and determines the light source display ratio corresponding to the current position of the target object. Wherein, the determination of the light source display ratio corresponding to the current position comprises:
[0048] determining the light source display data corresponding to the current position, and rendering the light source display data to the object display interface of the user terminal;
[0049] from the object display page of the user terminal, the light source display ratio corresponding to the current position is obtained.
[0050] The light source display data can be understood as a three-dimensional light source display ratio corresponding to a plurality of specific positions in the entire game scene. The three-dimensional light source display ratio can be understood as a ratio representing the sky that can be observed at a specific position in the game scene; that is, the sky box visibility of the specific position. The three-dimensional light source display ratio can be stored in the form of a scene map. That is, the light source display data is a light source display map, which can be a 3D map containing the sky visibility of the plurality of positions in the current game scene. The user terminal can be understood as a client device running the data rendering method.
[0051] For example, the data rendering method provided by the present specification obtains the light source display ratio, which includes determining the 3D map corresponding to the current position of the camera in the G buffer stage of the game running process. The 3D map contains the sky box visibility of the game scene within the camera view. Then the GPU renders the 3D map corresponding to the current position of the camera into the display page of the client; then the client can calculate the sky visibility value on the game screen space, which is used to represent the ratio of the sky box in the screen space.
[0052] It should be noted that after determining the sky visibility value on the screen space, the sky visibility value is packed into the G Buffer, and subsequent deferred rendering is based on the sky visibility.
[0053] In the embodiments provided in the specification, the light source display data is rendered to the object display interface of the user terminal, and the light source display ratio corresponding to the current position is obtained from the object display page, so as to facilitate subsequent calculation of target rendering data with higher definition and better light and shadow effect based on the light source display ratio, thereby improving the game experience of the user.
[0054] Further, in the embodiments provided in the specification, in the process of rendering the 3D map to the game screen, in order to ensure the accuracy of rendering, so that each pixel point in the 3D map can be rendered to the corresponding position, and the generation of errors is avoided, therefore, in the process of rendering, the 3D map is rendered based on the map conversion matrix corresponding to the 3D map, so as to ensure the accuracy of map rendering. Specifically, the determination of the light source display data corresponding to the current position and the rendering of the light source display data to the object display interface of the user terminal comprises:
[0055] determining the light source display map corresponding to the current position and the map conversion matrix corresponding to the light source display map;
[0056] rendering the light source display map to the object display interface of the user terminal by using the map conversion matrix.
[0057] The light source display map can be understood as a map containing a three-dimensional light source display ratio, for example, the 3D map corresponding to the game scene described above, which contains the normalized [0.0, 1.0] sky visibility. For details, see Figure 3 , Figure 3 is a schematic diagram of a 3D map in a data rendering method provided by an embodiment of the specification, wherein Figure 3 Part A in the above figure is a game scene, Figure 3 Part B in the above figure is a 3D map corresponding to the game scene, which contains the sky visibility corresponding to a plurality of position points in the game scene. Wherein, the darker pixel point part in the 3D map represents low sky visibility, and the whiter pixel point part represents high sky visibility.
[0058] The map conversion matrix can be understood as a matrix representing the position of the pixel point in the 3D map in the three-dimensional space.
[0059] In the above example, in the G buffer stage during the game running process, the client will transmit the 3D map and its corresponding conversion matrix into the GPU, and the GPU will render the 3D map to the corresponding position in the screen space by using the conversion matrix.
[0060] In an embodiment provided in the specification, in order to improve the efficiency of light rendering of a game scene, the scheme needs to generate a 3D map of the game scene in advance before calculating the ambient light data of the game scene based on the 3D map, so as to improve the efficiency of light rendering. Specifically, before determining the initial rendering data corresponding to the current position and the light source display ratio corresponding to the current position, the method further comprises:
[0061] determining region object information of a target region, wherein the current position is any position in the target region;
[0062] determining data generation information of the target region, and generating light source display data of the target region by using the region object information and the data generation information.
[0063] The target region can be understood as a complete game scene map, for example, a game copy map, or a specific region in the game scene map, for example, a local forest region in the entire forest scene map. The region object can be understood as an object constituting the game scene, that is, a game model contained in the game scene, for example, a tree model, a stone model, a furniture model, etc. The region object information can be understood as model mesh information of the game model.
[0064] The data generation information can be understood as information for generating the light source display data. For example, the data generation information can be resolution accuracy (also known as baking accuracy), and the resolution accuracy can be used to generate a 3D map corresponding to the target region and having a specific resolution.
[0065] The determination of the region object information of the target region can be understood as, after the arrangement of scene objects in the game scene space is completed, the region in the game scene space where the sky occlusion (i.e., sky visibility) needs to be baked is specified in the case of baking the light environment. The generation of the light source display data of the target region by using the region object information and the data generation information can be understood as determining a 3D map corresponding to the scene region based on the model mesh information of the scene model in the scene region and the baking accuracy.
[0066] It should be noted that the above step of generating a 3D map can be implemented by a client or a server. The client or server for generating a 3D map can be the same as or different from the client or server to which the data rendering method is applied.
[0067] Further, in the embodiments provided in the specification, in order to adapt to different application scenarios and ensure that the determined 3D map meets the user's demand, in the process of determining the 3D map, the 3D map is generated based on the data generation information sent by the user, so as to obtain a 3D map meeting the user's demand. Specifically, the data generation information of the target area includes:
[0068] receiving a data generation request sent by the user for the target area, and obtaining data generation information carried in the data generation request.
[0069] The data generation request can be understood as a request sent by the user based on the user terminal for generating light source display data. In actual application, the client or server can receive an environment baking request sent by the user through the user terminal for the target area, wherein the environment baking request carries resolution accuracy.
[0070] In the above example, in the data rendering method provided in the specification, an Occlusion Probe component is provided, which runs in the client or server and provides a corresponding editing panel (which can be understood as a user interaction interface) to the user. The user sends an environment baking request to the client or server through the editing panel, and the request carries the resolution accuracy provided by the user.
[0071] In an embodiment provided in the specification, in order to improve the generation efficiency of the light source display data, the data rendering method provided in the specification quickly generates the light source display data through a module for generating the light source display data, thereby improving the efficiency of the light source display data. Specifically, the light source display data of the target area is generated by using the region object information and the data generation information, including:
[0072] The region object information and the data generation information are processed by using a light source data generation module to obtain the light source display data of the target area.
[0073] The light source data generation module can be understood as a program, hardware device, etc. for generating the light source display data. For example, the light source data generation module can be an offline baking program, which can bake a specific region in a game scene to store the skybox visibility of the specific region in a 3D map.
[0074] With the above example, the data rendering method provided by the present specification provides an offline baking program. When a baking light environment is needed, the object information to be baked is input into the offline baking program. The offline baking program considers the relationship between each object and the object, calculates the skybox visibility of a given point set in the space according to the resolution accuracy given by the user based on the Occlusion Probe component, and fills the skybox visibility into the blank 3D map corresponding to the baking area to obtain a 3D map that saves the normalized sky visibility.
[0075] Further, in the embodiments provided in the present specification, the offline baking program specifically bakes the baking area, and the specific process of obtaining the skybox visibility is as follows. The region object information and the data generation information are input into the light source data generation module, and the light source display data of the target region is obtained by processing the region object information and the data generation information using the light source data generation module, including:
[0076] The region object information and the data generation information are input into the light source data generation module, and the structure region corresponding to the target region is generated based on the region object information using the light source data generation module.
[0077] The first data acquisition unit is generated in the structure region based on the data generation information.
[0078] The environment occlusion parameters in the structure region are acquired through the first data acquisition unit, and the three-dimensional light source display ratio of the target region is calculated and determined based on the environment occlusion parameters.
[0079] The three-dimensional light source display ratio is stored in the region map of the target region to obtain the light source display map of the target region.
[0080] The structure region can be understood as a model structure scene constructed based on model mesh information. The game scene only represents the positional relationship of the game model and the occlusion relationship between the game models. For example, a three-dimensional space containing multiple object mesh information.
[0081] The data generation information can be understood as the resolution accuracy described above. For example, the resolution accuracy can be 200*200*200. In actual application, after determining the model structure scene, the offline baking program generates a corresponding number of occlusion probes in the model structure scene according to 200*200*200. The occlusion probes are evenly distributed in the model structure scene, and each occlusion probe corresponds to a position information.
[0082] The first data acquisition unit can be understood as an occlusion probe generated by an offline baking program. The environment occlusion parameter can be understood as a parameter representing the sky at a specific position, which is not occluded by other models, for example, the number of rays emitted by the occlusion probe that do not hit an object. The three-dimensional light source display ratio can be understood as the sky box visibility corresponding to the position of each occlusion probe.
[0083] In the data rendering method provided by the present specification, the object information to be baked is input into the offline baking program, the offline baking program considers the relationship between each object and the object, constructs a structured scene representing the occlusion relationship between the objects, and generates a corresponding number of occlusion probes in the model structured scene according to the resolution accuracy 200*200*200 given by the Occlusion Probe component, each occlusion probe corresponding to a position information. Referring to Figure 4 , Figure 4 is a schematic diagram of an occlusion probe in a data rendering method provided by an embodiment of the present specification. Wherein, Figure 4 Part A of the above is the state of the Occlusion Probe occlusion probe being turned on; Figure 4 Part B of the above is the state of the Occlusion Probe occlusion probe being turned off.
[0084] Referring to Figure 5 , Figure 5 is an application schematic diagram of an occlusion probe in a data rendering method provided by an embodiment of the present specification. From the position of the occlusion probe, a plurality of rays are emitted in all directions, and whether there is an object above the position to block the sky box and the range of the occlusion are determined by the rays; and the sky box visibility can be calculated according to the plurality of rays (sky box visibility = number of rays not shot to the object / total number of rays), based on which the sky box visibility corresponding to the position of each occlusion probe can be determined. Thus, the sky box visibility of the given point set (which contains the position information of each occlusion probe) in the space (model construction scene) is calculated. Then the sky box visibility is normalized to [0.0, 1.0] to obtain the normalized sky box visibility of the float type (float32), and then the sky box visibility information of the point set in the space is filled into the pre-generated blank 3D map.
[0085] Step 204: determining the ambient light parameter of the current position, processing the initial rendering data based on the ambient light parameter and the light source display ratio to obtain target rendering data, and rendering the target rendering data.
[0086] The ambient light parameter can be understood as global light data of the current position, for example, spherical harmonic parameters of an ambient light probe in the game scene, and there is only one ambient light probe in each scene.
[0087] Specifically, the data rendering method provided in the specification requires determining the ambient light parameter corresponding to the current position during the generation of the target rendering data, and processing the initial rendering data based on the ambient light parameter and the light source display ratio to obtain the target rendering data, and then rendering the target rendering data. In the embodiments provided in the specification, before determining the ambient light parameter of the current position, the method further comprises:
[0088] determining the initial ambient light parameter collected by the second data collection unit in the target area, and determining the adjustment parameter corresponding to the initial ambient light parameter, wherein the adjustment parameter is obtained from the parameter adjustment request sent by the user.
[0089] adjusting the initial ambient light parameter based on the adjustment parameter to obtain the regional ambient light parameter of the target area.
[0090] The second data collection unit can be understood as a module that collects the initial ambient light parameter, for example, an ambient light probe in a game scene, and the initial ambient light parameter can be understood as the spherical harmonic parameters corresponding to the ambient light probe in the game scene. The parameter adjustment request can be understood as a request sent by the user through the user terminal for adjusting the initial ambient light parameter; the adjustment parameter can be understood as a numerical value for adjusting the initial ambient light parameter, which can be set according to the actual application scenario, and the specification does not make specific limitations. The regional ambient light parameter can be understood as the corrected spherical harmonic parameters corresponding to the target area.
[0091] Based on this, after determining the skybox visibility, in order to avoid the problem that the occlusion relationship of the subsequent game scene is not clear enough and lacks stereoscopic effect, the game picture is rendered based on the skybox visibility and the corrected ambient light probe. The correction of the ambient light probe is performed by the value set by the user on the Occlusion Probe component panel, and the user inputs a numerical value for correcting the ambient light probe on the component panel, wherein the numerical value can be set according to the actual application needs, for example, a numerical value within the range of [0, 100]; the Occlusion Probe component corrects the spherical harmonic parameters of the ambient light probe based on the numerical value, for example, multiplies the numerical value input by the user with the spherical harmonic parameters of the ambient light probe to obtain the corrected spherical harmonic parameters. Then, the baked 3D map and the recorded corrected spherical harmonic parameters of the ambient light probe are stored as a baking file of the lighting environment.
[0092] Further, in the embodiments provided in the specification, the determining the ambient light parameter of the current position comprises:
[0093] obtaining the ambient light parameter corresponding to the current position from the region ambient light parameter corresponding to the target region, wherein the current position is any position in the target region.
[0094] In the above example, in the light calculation stage in the running process, the spherical harmonic parameter corresponding to the current position is determined from the corrected spherical harmonic parameter corresponding to the game scene based on the current coordinate position of the camera.
[0095] In the embodiments provided in the specification, the ambient light parameter can be quickly obtained from the region ambient light parameter based on the current position of the target object, thereby improving the efficiency of data rendering.
[0096] In the embodiments provided in the specification, the processing the initial rendering data based on the ambient light parameter and the light source display ratio to obtain target rendering data comprises:
[0097] based on the ambient light parameter and the light source display ratio, calculating the light rendering data of the current position; and adjusting the initial rendering data based on the light rendering data to obtain target rendering data.
[0098] The light rendering data can be understood as ambient light global light data and reflection light intensity data in the current game scene.
[0099] In the above example, in the light calculation stage in the running process, the corrected ambient light probe spherical harmonic coefficient is transmitted to the GPU, and based on the sky visibility unpacked from the G Buffer and the corrected spherical harmonic parameter of the ambient light probe, the ambient light global light data and the reflection light intensity data of the point position are calculated. Then, the ambient light global light data, the reflection light intensity data, and the current game scene map are input into the GPU, and are rendered to the game display interface of the client through the GPU, so that the game scene displayed in the game display interface is more realistic.
[0100] It should be noted that the data rendering method provided in the specification optimizes the sky light leakage problem and beautifies the scene effect by baking the sky visibility on the probe point in space on the 3DTexture (3D texture) through the Occlusion Probe technology to bake the light occlusion information of the scene in the 3D texture. Figure 6 , Figure 6 is a schematic diagram of light rendering in a data rendering method provided in an embodiment of the specification, wherein Figure 6Part A in FIG. 1 is a game scene without using the Occlusion Probe technology, in which there is no correct shading under the tree shade, and the reflected light intensity in the game scene is quite different from the real physics, and there will be light leakage problems.
[0101] The game scene in Part B in FIG. 1 uses the Occlusion Probe technology, in which there is more natural and correct shading under the tree shade, and the reflected light intensity in the game scene is closer to the physical correctness, and there will be no light leakage. Figure 6
[0102] The data rendering method provided in the specification considers the influence of the light source display ratio on the light rendering in the process of rendering the rendering data, so that the initial rendering data is processed by using the light source display ratio and the ambient light parameter and other data, so as to obtain target rendering data closer to the physical light, and the target rendering data is rendered, so as to obtain a better rendering result, increase the reality of the game scene, avoid the problem that the shadow effect in the scene will be unclear due to the inability to simulate the real physical light effect, and the problem that there is a large difference between the real physical light, and improve the game experience.
[0103] The following describes the data rendering method provided in the specification in combination with the accompanying drawings. Figure 7 The data rendering method provided in the specification is further described by taking the application of the data rendering method in a game light rendering scene as an example. Wherein, Figure 7 FIG. 1 shows a processing process flow diagram of a data rendering method provided in an embodiment of the specification, which specifically includes the following steps.
[0104] Step 702: After the arrangement of the scene object is completed, in the case of needing to bake the light environment, the object information needing to be baked is transmitted into the offline baking program.
[0105] Wherein, the object refers to the game model in the game scene, for example, a tree model, a stone model, a furniture model, etc.
[0106] Wherein, the object information refers to the model mesh information of the game model in the scene.
[0107] Step 704: The offline baking program will consider the relationship between each object and the object, and calculate the skybox visibility of the given point set in the space according to the resolution accuracy given by the Occlusion Probe component.
[0108] Wherein, the skybox visibility is a normalized value to [0.0, 1.0], which represents the proportion of the field of view that can be observed by the position of the point.
[0109] Specifically, in the baking process, the information of the objects to be baked is input into the offline baking program, the offline baking program considers the relationship between each object and the object, and constructs a model structure scene representing the occlusion relationship between the objects (which can be understood as a three-dimensional space containing multiple object grid information).
[0110] According to the resolution accuracy given by the Occlusion Probe component, for example, 200*200*200, a corresponding number of occlusion probes are generated in the model structure scene, wherein the occlusion probes are evenly distributed in the model structure scene, and each occlusion probe corresponds to a position information.
[0111] Then, a plurality of rays are emitted from the position of the occlusion probe to the surrounding, and the skybox visibility is calculated according to the plurality of rays (skybox visibility = number of rays not shot to the object / total number of rays).
[0112] Referring to Figure 5 , a plurality of Occlusion Probes (occlusion probes) are placed in the indoor game environment. The occlusion probes emit a plurality of rays to the surrounding, wherein the solid lines represent that the objects are tracked; the dashed lines are not shot to the object and leak out of the skylight, representing that no object is tracked; and the dashed lines will eventually be shot to the skybox and be counted in the sky visibility calculation.
[0113] Step 706: Fill the skybox visibility information of the point set in the space into the 3D map.
[0114] Specifically, the skybox visibility is normalized to the range of [0.0, 1.0] to obtain the normalized skybox visibility of the float type (float32), and then the skybox visibility information of the given point set in the space is filled into the blank 3D map generated in advance.
[0115] Step 708: After waiting for the baking thread to complete, read the 3D map generated by baking and the original environment light probe in the scene.
[0116] The environment light probe stores spherical harmonic values (i.e., spherical harmonic parameters), and there is only one in each scene.
[0117] Specifically, after waiting for the baking thread to complete, the client reads the 3D map generated by baking and the original environment light probe in the game scene, and records the spherical harmonic parameters of the environment light probe.
[0118] Step 710: Correct the recorded parameter value, and store the baked 3D map and the recorded spherical harmonic parameters of the corrected environment light probe as a baking file of the lighting environment.
[0119] Specifically, after determining the visibility of the skybox, in order to avoid problems such as unclear occlusion relationships and lack of three-dimensionality in the subsequent game scene, the game screen will be rendered based on the visibility of the skybox and the corrected ambient light probe.
[0120] The ambient light probe is corrected using the user-defined value on the Occlusion Probe component panel, see [link / reference]. Figure 8 , Figure 8 This is a schematic diagram illustrating the process of correcting spherical harmonic parameters using a data rendering method provided in one embodiment of this specification; Figure 8 Part A of the rendering process utilizes Occlusion Probe technology. The user inputs a value on the component panel to correct the ambient light probe. This value can be set according to the specific application requirements, such as a value within the range [0, 100]. The Occlusion Probe component then corrects the spherical harmonic parameters of the ambient light probe based on this value. For example, it multiplies the user-input value by the spherical harmonic parameters of the ambient light probe to obtain the corrected parameters. Subsequently, in the final rendering process, the corrected ambient light probe is used in conjunction with the occlusion probe at the current position to generate the final game screen. This final game screen can be found in [link to example]. Figure 5 Part B of the video.
[0121] in, Figure 8 The video also demonstrates a game rendering process that does not use Occlusion Probe technology. Specifically, it uses the spherical harmonic parameters of the ambient light probe for rendering to obtain the rendered game footage. This game footage can be found in [link to video]. Figure 6 Part A of the screen.
[0122] Step 712: During the G Buffer phase of the process, the 3D texture and its transformation matrix are passed to the GPU.
[0123] In practical applications, game scenes are displayed on the client's game display interface. However, because the visibility of the sky is not taken into account during the rendering process, the impact on the ambient global illumination data and reflected light intensity data within the current game scene is not considered. As a result, the occlusion relationship of the game scene is not clear enough, lacks a sense of three-dimensionality, and the reflected light intensity within the game scene differs significantly from the reflected light intensity in real physical reality, and there is also a problem of light leakage.
[0124] Based on this, in order to overcome the above problems, after determining the current position of the camera, the game scene map corresponding to the current position needs to be rendered to the game display interface of the client, and the game scene (for example, a game forest scene containing game models such as trees, stones, and sky) within the current camera field of view will be displayed on the game display interface.
[0125] After the game scene map is rendered, the client or the server renders the 3D map corresponding to the current position of the camera obtained in the above step to the game display interface.
[0126] Step 714: Pack the sky visibility value on the screen space into the G Buffer for deferred rendering.
[0127] Specifically, after the 3D map is rendered, the client or the server obtains the sky visibility value on the screen space, packs the sky visibility value into the G Buffer, and performs deferred rendering.
[0128] Step 716: In the light calculation stage of the running process, the modified environmental light probe spherical harmonic coefficient is transmitted to the GPU; and the sky visibility data unpacked from the G Buffer and the modified environmental probe are used to calculate the environmental light global illumination data and the reflection light intensity data of the point position.
[0129] In the light calculation stage, the client or the server determines the modified spherical harmonic parameter corresponding to the current position. Then the modified environmental light probe spherical harmonic coefficient is transmitted to the GPU, and the sky visibility data unpacked from the G Buffer and the modified environmental probe are used to calculate the environmental light global illumination data and the reflection light intensity data of the point position.
[0130] Step 718: Input the current game scene map, the environmental light global illumination data, and the reflection light intensity data into the GPU, and render them to the game display interface of the client through the GPU.
[0131] The Occlusion Probe technology provided by the data rendering method provided in the specification can record the sky visibility of the probe points in space on the 3D Texture (3D texture), and transmit the baked information into the light calculation process by mounting the Occlusion Probe component in the scene; sample the 3D map information in the G Buffer stage in the rendering process, and compress the information into the G Buffer channel; then consider the sky occlusion degree information transmitted from the G Buffer in the light calculation process, so as to optimize the sky light leakage problem and beautify the scene effect.
[0132] Corresponding to the method embodiments described above, the specification also provides data rendering device embodiments,Figure 9 A structural diagram of a data rendering device is shown. As shown in the figure, the device comprises: Figure 9
[0133] A determining module 902 is configured to determine a current position of a target object, and determine initial rendering data corresponding to the current position, and a light source display ratio corresponding to the current position.
[0134] A rendering module 904 is configured to obtain an ambient light parameter of the current position, process the initial rendering data based on the ambient light parameter and the sky display ratio, obtain target rendering data, and render the target rendering data.
[0135] Optionally, the determining module 902 is further configured to:
[0136] determine light source display data corresponding to the current position, and render the light source display data to an object display interface of a user terminal;
[0137] obtain the light source display ratio corresponding to the current position from an object display page of the user terminal.
[0138] Optionally, the determining module 902 is further configured to:
[0139] determine a light source display map corresponding to the current position, and a map conversion matrix corresponding to the light source display map;
[0140] render the light source display map to an object display interface of a user terminal by using the map conversion matrix.
[0141] Optionally, the data rendering device further comprises a data determining module configured to:
[0142] determine region object information of a target region, wherein the current position is any position in the target region;
[0143] determine data generation information of the target region, and generate light source display data of the target region by using the region object information and the data generation information.
[0144] Optionally, the data determining module is configured to:
[0145] receive a data generation request sent by a user for the target region, and obtain data generation information carried in the data generation request.
[0146] Optionally, the data determining module is configured to:
[0147] The light source data generation module is used to process the region object information and the data generation information, and obtain light source display data of the target region.
[0148] Optionally, the data determination module is configured to:
[0149] The region object information and the data generation information are input into a light source data generation module, and the light source data generation module is used to generate a structure region corresponding to the target region based on the region object information.
[0150] A first data acquisition unit is generated in the structure region based on the data generation information.
[0151] An environment shading parameter in the structure region is acquired through the first data acquisition unit, and a three-dimensional light source display ratio of the target region is calculated and determined based on the environment shading parameter.
[0152] The three-dimensional light source display ratio is stored in a region map of the target region, and a light source display map of the target region is obtained.
[0153] Optionally, the rendering module 904 is further configured to:
[0154] The current position corresponding environment illumination parameter is obtained from the target region corresponding region environment illumination parameter, wherein the current position is any position in the target region.
[0155] Optionally, the data rendering device further comprises a parameter determination module configured to:
[0156] An initial environment illumination parameter acquired by a second data acquisition unit in the target region is determined, and an adjustment parameter corresponding to the initial environment illumination parameter is determined, wherein the adjustment parameter is obtained from a parameter adjustment request sent by the user.
[0157] The initial environment illumination parameter is adjusted based on the adjustment parameter, and a region environment illumination parameter of the target region is obtained.
[0158] Optionally, the rendering module 904 is further configured to:
[0159] Based on the environment illumination parameter and the light source display ratio, illumination rendering data of the current position is calculated and obtained; and based on the illumination rendering data, the initial rendering data is adjusted to obtain target rendering data.
[0160] The data rendering device provided in the specification considers the influence of the light source display ratio on the light rendering in the process of rendering the rendering data, and therefore processes the initial rendering data by using the light source display ratio and the ambient light parameter and other data, so as to obtain target rendering data closer to the physical light, and renders the target rendering data, so as to obtain a rendering result with better effect, increase the reality of the game scene, avoid the problem that the shadow effect in the scene is not clear due to the inability to simulate the real physical light effect, and the problem that there is a large difference between the real physical light, and improve the game experience.
[0161] The above is a schematic scheme of the data rendering device of the embodiment. It should be noted that the technical scheme of the data rendering device belongs to the same concept as the technical scheme of the data rendering method described above, and the details of the technical scheme of the data rendering device that are not described in detail can be referred to the description of the technical scheme of the data rendering method.
[0162] Figure 10 The structure block diagram of a computing device 1000 according to an embodiment of the specification is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected with the memory 1010 through a bus 1030, and a database 1050 is used to save data.
[0163] The computing device 1000 also includes an access device 1040, which enables the computing device 1000 to communicate via one or more networks 1060. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1040 can include one or more of any type of network interface (for example, a network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0164] In an embodiment of the specification, the above-mentioned components of the computing device 1000 and other components not shown in the Figure 10 should be understood that the components shown in the computing device structure block diagram are only for the purpose of example, and are not a limitation on the scope of the specification. Other components can be added or replaced as needed by those skilled in the art. Figure 10 should be understood that the components shown in the computing device structure block diagram are only for the purpose of example, and are not a limitation on the scope of the specification. Other components can be added or replaced as needed by those skilled in the art.
[0165] The computing device 1000 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. The computing device 1000 can also be a mobile or stationary server.
[0166] The processor 1020 is configured to execute the following computer-executable instructions, which implement the steps of the data rendering method described above.
[0167] The above is a schematic solution of the computing device of the embodiment. It should be noted that the technical solution of the computing device and the technical solution of the data rendering method described above belong to the same concept, and the details of the technical solution of the computing device that are not described in detail can be referred to the description of the technical solution of the data rendering method.
[0168] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the data rendering method described above when executed by a processor.
[0169] The above is a schematic solution of the computer-readable storage medium of the embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the data rendering method described above belong to the same concept, and the details of the technical solution of the storage medium that are not described in detail can be referred to the description of the technical solution of the data rendering method.
[0170] An embodiment of the present specification also provides a computer program, which causes a computer to perform the steps of the data rendering method described above when the computer program is executed in the computer.
[0171] The above is a schematic solution of the computer program of the embodiment. It should be noted that the technical solution of the computer program and the technical solution of the data rendering method described above belong to the same concept, and the details of the technical solution of the computer program that are not described in detail can be referred to the description of the technical solution of the data rendering method.
[0172] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0173] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0174] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0175] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0176] The preferred embodiments disclosed above are merely illustrative of this specification. Optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data rendering method, comprising: determining initial rendering data corresponding to a current position of a target object, and determining a light source display ratio corresponding to the current position, wherein the light source display ratio is sky visibility data in a game scene, and the light source display ratio is determined based on model mesh information and baking precision of the game scene; determining ambient light parameters of the current position, processing the initial rendering data based on the ambient light parameters and the light source display ratio to obtain target rendering data, and rendering the target rendering data.
2. The data rendering method of claim 1, wherein the determining the light source display ratio corresponding to the current position comprises: determining light source display data corresponding to the current position, and rendering the light source display data to an object display interface of a user terminal; obtaining the light source display ratio corresponding to the current position from an object display page of the user terminal.
3. The data rendering method of claim 2, wherein the determining the light source display data corresponding to the current position, and rendering the light source display data to the object display interface of the user terminal comprises: determining a light source display map corresponding to the current position, and a map conversion matrix corresponding to the light source display map; rendering the light source display map to the object display interface of the user terminal by using the map conversion matrix.
4. The data rendering method of claim 2, further comprising, before the determining the initial rendering data corresponding to the current position, and the light source display ratio corresponding to the current position: determining region object information of a target region, wherein the current position is any position in the target region; determining data generation information of the target region, and generating light source display data of the target region by using the region object information and the data generation information.
5. The data rendering method of claim 4, wherein the determining the data generation information of the target region comprises: receiving a data generation request sent by a user for the target region, and obtaining data generation information carried in the data generation request.
6. The data rendering method of claim 4, wherein the generating the light source display data of the target region by using the region object information and the data generation information comprises: processing the region object information and the data generation information by using a light source data generation module to obtain the light source display data of the target region.
7. The data rendering method of claim 6, wherein the processing the region object information and the data generation information by using the light source data generation module to obtain the light source display data of the target region comprises: inputting the region object information and the data generation information into the light source data generation module, and generating a structure region corresponding to the target region based on the region object information by using the light source data generation module; generating a first data acquisition unit in the structure region based on the data generation information. The first data acquisition unit collects an environment shading parameter in the structure region, and a three-dimensional light source display ratio of the target region is calculated based on the environment shading parameter; The three-dimensional light source display ratio is stored in a region map of the target region, and a light source display map of the target region is obtained.
8. The data rendering method of claim 1, wherein the environment lighting parameter of the current position is determined by: obtaining the environment lighting parameter corresponding to the current position from the region environment lighting parameter corresponding to the target region, wherein the current position is any position in the target region.
9. The data rendering method of claim 8, wherein before the environment lighting parameter of the current position is determined, the method further comprises: determining an initial environment lighting parameter collected by a second data acquisition unit in the target region, and determining an adjustment parameter corresponding to the initial environment lighting parameter, wherein the adjustment parameter is obtained from a parameter adjustment request sent by a user; and adjusting the initial environment lighting parameter based on the adjustment parameter to obtain the region environment lighting parameter of the target region.
10. The data rendering method of claim 1, wherein the initial rendering data is processed based on the environment lighting parameter and the light source display ratio to obtain target rendering data, comprising: obtaining lighting rendering data of the current position based on the environment lighting parameter and the light source display ratio; and adjusting the initial rendering data based on the lighting rendering data to obtain target rendering data.
11. A data rendering device, comprising: a determination module configured to determine a current position of a target object, and determine initial rendering data corresponding to the current position and a light source display ratio corresponding to the current position, wherein the light source display ratio is sky visibility data in a game scene, and the light source display ratio is determined based on model mesh information and baking precision of the game scene; a rendering module configured to obtain an environment lighting parameter of the current position, process the initial rendering data based on the environment lighting parameter and the light source display ratio to obtain target rendering data, and render the target rendering data.
12. A computing device, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, the computer executable instructions, when executed by the processor, implement the steps of the data rendering method of any one of claims 1 to 10.
13. A computer readable storage medium storing computer executable instructions, the computer executable instructions, when executed by a processor, implement the steps of the data rendering method of any one of claims 1 to 10.
Citation Information
Patent Citations
Game picture rendering method and device, storage medium and electronic equipment
CN111068312A
Illumination rendering method and device
CN111760277A
Dynamic global illumination method, electronic equipment and computer readable storage medium
CN112712582A
Global illumination method supporting day and night alternation and computer readable storage medium
CN112884876A
Scene rendering method and device, computer storage medium and electronic equipment
CN113144611A