Method, device and equipment for rendering lighting information in game scenes

By arranging probe grids and updating lighting probes in the game scene, the probe data texture is generated and transmitted to the graphics processor, and the lighting information is rendered using resource textures and indirect texture sampling lighting information, the lighting information sampling and transmission in the game scene is solved. and the problem of high storage costs improve rendering efficiency.

CN114549723BActive Publication Date: 2025-02-18BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210188716.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-30
Publication Date
2025-02-18
Estimated Expiration
2041-03-30

AI Technical Summary

Technical Problem

The sampling, transmission and storage costs of lighting information in game scenes are high, which affects the rendering efficiency of lighting information.

Method used

By arranging a probe grid in a game scene, updating the lighting probes according to the viewpoint position, and capturing lighting information, generating multiple probe data textures with the same data size, transmitting them to the graphics processor, utilizing resource textures and indirect texture sampling Lighting information is rendered.

Benefits of technology

It saves the cost of updating, transmission and storage of lighting information, improves the rendering efficiency of lighting information, and avoids the waste of lighting probes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549723B_ABST
    Figure CN114549723B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and equipment for rendering illumination information in a game scene, which relates to the field of 3D rendering technology and can reduce the update, transmission and storage costs of illumination information sampling in the game scene, and improve the rendering efficiency of illumination information. The method includes: arranging a probe grid for spatial voxels in the game scene, wherein the probe grid includes illumination probes for capturing illumination information in the game scene, updating illumination probes at corresponding viewpoint positions in the probe grid according to viewpoint positions in the game scene, and capturing illumination information at viewpoint positions; transmitting illumination information at viewpoint positions to a graphics processor after generating multiple probe data textures with the same data size through a central processing unit; in response to a rendering instruction called by the central processing unit, the graphics processor samples illumination information of objects in the game scene using resource textures and indirect textures according to the position information of sampling points on the surface of objects in the game scene, and renders the illumination information of the objects.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application filed with the China Patent Office on March 30, 2021, with application number 202110342315.4 and entitled “Method, device and apparatus for rendering lighting information in game scenes”. Technical Field

[0002] The present application relates to the field of 3D rendering technology, and in particular to a method, device, and equipment for rendering lighting information in a game scene. Background Art

[0003] In order to make the objects in the game scene more realistic, it is usually necessary to project light into the scene. The lighting in nature is very complex, with various reflections, refractions, etc. The lighting in games is to simulate the real world as much as possible to achieve a realistic effect.

[0004] Currently, global illumination is commonly used in game scenes to simulate complex behaviors such as light interactions and bounces. Global illumination uses a series of complex algorithms to calculate how light bounces between surfaces after being emitted from a light source. This simulation is typically accurate at runtime, effectively enhancing the realism of the scene. Limited by hardware technology, the performance of real-time global illumination is limited to small-scale rendering and is suitable for rendering static objects. For dynamic object lighting calculations, light probes are typically used to store reflected light from nearby objects, which are then fed to the dynamic object in conjunction with the light source as it passes by.

[0005] As a way to collect lighting information, light probes can be sampled pixel by pixel in the game scene. Since screen pixels are fixed, collecting lighting information in pixels instead of objects can provide more accurate light probes. When linear interpolation is performed between multiple light probes in pixels or compute shaders, GPU hardware can be used to quickly sample the lighting information captured by millions of light probes per frame. However, the large number of pixel textures in game scenes requires high speed and convenience in reading and sampling textures in shaders or GPU compute units, which increases the update, transmission, and storage costs of lighting information sampling in game scenes to a certain extent, affecting the rendering efficiency of lighting information. Summary of the Invention

[0006] In view of this, the present application provides a method, device and equipment for rendering lighting information in a game scene. The main purpose is to solve the problem that the updating, transmission and storage costs of lighting information sampling in the existing game scene are high, which affects the rendering efficiency of the lighting information.

[0007] According to a first aspect of the present application, a method for rendering lighting information in a game scene is provided, comprising:

[0008] Arranging a probe grid for spatial voxels in the game scene, wherein the probe grid includes lighting probes for capturing lighting information in the game scene;

[0009] Update the lighting probe of the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture the lighting information of the viewpoint position;

[0010] The illumination information of the viewpoint position is generated by a central processing unit into a plurality of probe data textures having the same data size and then transmitted to a graphics processor, wherein the probe data textures include resource textures and indirect textures;

[0011] In response to the rendering instruction called by the central processing unit, the graphics processor uses the resource texture and indirect texture to sample the lighting information of the object in the game scene according to the position information of the surface sampling point of the object in the game scene, and renders the lighting information of the object.

[0012] Furthermore, the lighting probes in the probe grid have a node hierarchical relationship, and updating the lighting probes at corresponding viewpoint positions in the probe grid according to the viewpoint position in the game scene and capturing the lighting information at the viewpoint position specifically includes:

[0013] According to the viewpoint position in the game scene, query the node hierarchy relationship of the light probe mapped to the viewpoint position;

[0014] According to the viewpoint position mapping, the node hierarchical relationship of the lighting probe is updated, the lighting probe of the corresponding viewpoint position in the probe grid is updated, and the lighting information of the viewpoint position is captured.

[0015] Furthermore, the illumination information of the viewpoint position carries a node hierarchical relationship, and the generating of a plurality of probe data textures having the same data size from the illumination information of the viewpoint position and transmitting the same to the graphics processor specifically includes:

[0016] Extracting resource textures and indirect textures using the node hierarchical relationship carried by the lighting information at the viewpoint position;

[0017] The resource texture and the indirect texture are used to generate a plurality of probe data textures with the same data size and then transmitted to the graphics processor.

[0018] Furthermore, the extracting of resource textures and indirect textures by utilizing the node hierarchical relationship carried by the illumination information of the viewpoint position specifically includes:

[0019] Expanding the illumination information of the viewpoint position information into a resource texture according to a node hierarchical relationship carried by the illumination information of the viewpoint position;

[0020] During the process of expanding into the resource texture, the original hierarchical relationship of the resource texture in the tree structure is stored in the indirect texture.

[0021] Furthermore, the probe grid includes effective lighting probes and virtual lighting probes, and the arrangement of the probe grid for spatial voxels in the game scene specifically includes:

[0022] Obtaining close-range voxels contained in the spatial voxels in the game scene, wherein the close-range voxels are voxels in a preset layer formed by segmenting the spatial voxels in the game scene that meet a distance condition, wherein the voxel's bounding box intersects with the bounding box of the object in the game scene;

[0023] A probe grid is arranged for the close-range voxels included in the spatial voxel.

[0024] Furthermore, the illumination probes in the probe grid include effective illumination probes and virtual illumination probes, and the arranging of the probe grid for the close-range voxels included in the spatial voxels specifically includes:

[0025] Creating valid light probes for the nearby voxels in the hierarchy among the spatial voxels;

[0026] Virtual voxels corresponding to a level are added to the spatial voxels, and virtual lighting probes are created for voxels in the virtual voxels that meet the adding conditions. The virtual lighting probes are used to seamlessly interpolate lighting information sampled by nearby voxels in the level of the spatial voxels.

[0027] Furthermore, the method of sampling the lighting information of the object in the game scene using the resource texture and the indirect texture according to the position information of the sampling point on the surface of the object in the game scene, and rendering the lighting information of the object specifically includes:

[0028] According to the position information of the sampling points on the surface of the object in the game scene, the original hierarchical relationship of the resource texture in the tree structure is obtained from the indirect texture;

[0029] The original hierarchical relationship of the resource texture in the tree structure is utilized to sample the lighting information of the object in the game scene from the resource texture, and the lighting information of the object is rendered.

[0030] Furthermore, the method of sampling lighting information of objects in the game scene from the resource texture using the original hierarchical relationship of the resource texture in the tree structure and rendering the lighting information of the objects specifically includes:

[0031] Using the original hierarchical relationship of the resource texture in the tree structure, obtaining the level and offset of the resource texture in the tree structure;

[0032] Calculating a cached lighting sampling position in the resource texture according to the level and offset of the resource texture in the tree structure;

[0033] The lighting information of objects in the game scene is sampled according to the lighting sampling positions cached in the resource texture, and the lighting information of the objects is rendered.

[0034] According to a second aspect of the present application, a device for rendering lighting information in a game scene is provided, comprising:

[0035] an arrangement unit, configured to arrange a probe grid for spatial voxels in a game scene, wherein the probe grid includes lighting probes for capturing lighting information in the game scene;

[0036] An updating unit, configured to update the lighting probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture lighting information at the viewpoint position;

[0037] A generating unit, configured to generate a plurality of probe data textures having the same data size from the illumination information of the viewpoint position via a central processing unit and transmit the generated plurality of probe data textures to a graphics processing unit, wherein the probe data textures include resource textures and indirect textures;

[0038] A rendering unit is used to respond to the rendering instruction called by the central processing unit, and the graphics processor uses the resource texture and indirect texture to sample the lighting information of the objects in the game scene according to the position information of the surface sampling points of the objects in the game scene, and renders the lighting information of the objects.

[0039] Furthermore, the illumination probes in the probe grid have a node hierarchical relationship, and the updating unit includes:

[0040] A query module, configured to query the node hierarchical relationship of the light probes mapped to the viewpoint position in the game scene;

[0041] An updating module is configured to map the node hierarchical relationship of the lighting probe according to the viewpoint position, update the lighting probe at the corresponding viewpoint position in the probe grid, and capture lighting information at the viewpoint position.

[0042] Furthermore, the illumination information of the viewpoint position carries a node hierarchical relationship, and the generating unit includes:

[0043] An extraction module, configured to extract resource textures and indirect textures by utilizing the node hierarchical relationship carried by the illumination information of the viewpoint position;

[0044] The generating module is used for generating a plurality of probe data textures with the same data size from the resource texture and the indirect texture and then transmitting the generated probe data textures to the graphics processor.

[0045] Furthermore, the extraction module includes:

[0046] an expansion submodule, configured to expand the illumination information of the viewpoint position information into a resource texture according to a node hierarchy relationship carried by the illumination information of the viewpoint position;

[0047] The storage submodule is used to store the original hierarchical relationship of the resource texture in the tree structure into the indirect texture during the process of expanding into the resource texture.

[0048] Furthermore, the probe grid includes valid lighting probes and virtual lighting probes, and the arrangement unit includes:

[0049] A first acquisition module is configured to acquire close-range voxels contained in the spatial voxels in the game scene, wherein the close-range voxels are voxels in a preset layer formed by segmenting the spatial voxels in the game scene that meet a distance condition, wherein the voxel's bounding box intersects with the bounding box of the object in the game scene;

[0050] An arrangement module is used to arrange a probe grid for the close-range voxels included in the spatial voxels.

[0051] Furthermore, the arrangement module is specifically configured to create valid lighting probes for close-range voxels in the hierarchy among the spatial voxels;

[0052] The arrangement module is further specifically used to add virtual voxels corresponding to the level for the spatial voxels, and create virtual lighting probes for the voxels in the virtual voxels that meet the addition conditions. The virtual lighting probes are used to seamlessly interpolate the lighting information sampled by the nearby voxels in the level of the spatial voxels.

[0053] Furthermore, the rendering unit includes:

[0054] A second acquisition module is used to obtain the original hierarchical relationship of the resource texture in the tree structure from the indirect texture according to the position information of the sampling points on the surface of the object in the game scene;

[0055] A rendering module is used to sample lighting information of objects in a game scene from the resource texture by utilizing the original hierarchical relationship of the resource texture in the tree structure, and to render the lighting information of the objects.

[0056] Furthermore, the rendering module includes:

[0057] An acquisition submodule, configured to acquire the level and offset of the resource texture in the tree structure by utilizing the original hierarchical relationship of the resource texture in the tree structure;

[0058] A calculation submodule, configured to calculate a cached illumination sampling position in a resource texture according to a level and an offset of the resource texture in the tree structure;

[0059] The rendering submodule is used to sample the lighting information of objects in the game scene according to the lighting sampling positions cached in the resource texture, and render the lighting information of the objects.

[0060] According to a third aspect of the present application, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.

[0061] According to a fourth aspect of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0062] By means of the above technical solution, the present application provides a method, device and equipment for rendering lighting information in a game scene. Compared with the current method of using GPU hardware to quickly sample the lighting information captured by millions of lighting probes per frame, the present application arranges the probe grid for spatial voxels in the game scene, can reasonably place the lighting probes, effectively avoid the waste of lighting probes, further update the lighting probes of the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture the lighting information of the viewpoint position, generate multiple probe data textures with the same data size from the lighting information of the viewpoint position, and transmit them to the graphics processor, without pixel by pixel lighting information. Sampling saves storage space for the rendering buffer. The probe data texture includes resource texture and indirect texture. The graphics processor responds to the rendering instruction called by the central processing unit, and uses the resource texture and indirect texture to sample the lighting information of the object in the game scene according to the position information of the sampling point on the surface of the object in the game scene, and renders the lighting information of the object. Since the indirect texture stores the sampling position information of the lighting information in the game scene, the resource texture is combined with the indirect texture to sample different densities of lighting information for the same screen pixels according to the viewpoint position in the game scene, which can save the updating, transmission and storage costs of the lighting information sampling in the game scene and improve the rendering efficiency of the lighting information.

[0063] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0065] Figure 1 A schematic diagram illustrating a flow chart of a method for rendering lighting information in a game scene provided by an embodiment of the present application is shown;

[0066] Figure 2 A schematic diagram showing a flow chart of another method for rendering lighting information in a game scene provided by an embodiment of the present application is shown;

[0067] Figure 3a-3b A schematic diagram illustrating the creation and rendering process of light probes in a game scene provided by an embodiment of the present application is shown;

[0068] Figure 4 A schematic diagram showing a flow chart of another method for rendering lighting information in a game scene provided by an embodiment of the present application is shown;

[0069] Figure 5 A schematic diagram of a framework for rendering lighting information in a game scene provided by an embodiment of the present application is shown;

[0070] Figure 6 A schematic diagram showing the structure of a device for rendering lighting information in a game scene provided by an embodiment of the present application is shown;

[0071] Figure 7 A schematic structural diagram of another device for rendering lighting information in a game scene provided by an embodiment of the present application is shown;

[0072] Figure 8 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0073] The present invention will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the present invention, rather than to imply any limitation on the scope of the present invention.

[0074] As used herein, the term "including" and variations thereof are to be interpreted as open-ended terms meaning "including, but not limited to." The term "based on" is to be interpreted as "based, at least in part, on." The terms "one embodiment" and "an embodiment" are to be interpreted as meaning "at least one embodiment." The term "another embodiment" is to be interpreted as meaning "at least one other embodiment."

[0075] In game scenes, lighting is a factor with a great influence and an indispensable part of the visual style. Usually, static and dynamic objects in game scenes may have different sizes or complex model structures. These art assets are difficult to bake into effective light maps. The pixel-by-pixel sampling of light probes can avoid the lighting effects of moving objects and the feeling of incoordination with the entire scene using static light maps. It can bring unified indirect lighting to the scene, while simplifying the complexity of the rendering pipeline and improving rendering efficiency. During the operation of the light probe, the lighting information can be sampled at the position of a certain light probe, and then the lighting information can be sampled from the positions of other light probes adjacent to the light probe, and then the lighting information obtained by these samples can be interpolated to calculate the lighting information of a certain position between these light probes.

[0076] As a sampling method of light probes, it can sample each object in the game scene, including object-by-object parameter sampling and object-by-object 3D texture sampling. In the process of object-by-object parameter sampling, the lighting change depends on the surface normal of the object rather than the position on the surface. It is sufficient for small objects, but may cause lighting mismatch and discontinuity with adjacent larger models. Therefore, one-to-one collection, update, and sampling are performed on the CPU side. Each related object has its corresponding interpolated SH coefficient. Although it is relatively easy to maintain and low-cost, it cannot provide indirect lighting for a large number of complex objects and has a single applicable scenario. In the process of object-by-object 3D texture sampling, the hardware acceleration function is used to perform sampling interpolation calculations on the GPU side. Compared with the above-mentioned object-by-object parameter sampling method, the sampling effect of lighting information is improved to a certain extent. However, the update cost and transmission bandwidth of 3D textures from the CPU side to the CPU side limit the total number of objects sampled object-by-object. It is difficult to use multi-object sampling for a large number of large instantiated models.

[0077] Typically, both static and dynamic objects in game scenes vary in size or have complex model structures, making it difficult to bake art assets into valid lightmaps. Pixel-by-pixel sampling in game scenes offers the advantage of indirect processing, unifying the processing of indirect lighting while simplifying the complexity of the rendering pipeline and improving rendering efficiency. However, dynamic objects require more accurate light probes, and the location and number of light probes deployed impact the efficiency of later sampling of lighting information. The large number of texture resources required in game scenes forces GPU hardware to accelerate the sampling rate of light probes, increasing the cost of updating, transmitting, and storing lighting information samples in game scenes, impacting the rendering efficiency of lighting information.

[0078] In order to solve this problem, this embodiment provides a method for rendering lighting information in a game scene, such as Figure 1 As shown, the method is applied to a scene rendering tool, involving the interaction between the central processing unit and the image processing unit of the scene rendering tool, that is, the interaction between the CPU and the GPU, and includes the following steps:

[0079] 101. Arrange a probe grid for the spatial voxels in the game scene.

[0080] Games are real-time, dynamic, and interactive computer simulations. Many three-dimensional games use three-dimensional triangular meshes to represent the surface of objects. The detailed layer of this representation of the object's surface is stored in the texture. When shading, it is necessary to first consider the object with which the light intersects, and then select the multi-level texture of the detailed layer corresponding to the surface of the object for shading calculation. Spatial voxels are the volume units of texture rendering in the game space. Objects containing voxels can be expressed through stereo rendering or extracting polygonal isosurfaces with a given threshold contour.

[0081] For lighting effects in game scenes, global illumination is typically used. Global illumination takes into account direct light and maximizes diffuse reflections, resulting in lighting effects that are closer to real-world effects. Specifically, global illumination refers to the calculation of light reflections around the game scene, responsible for creating many subtle shading effects, atmosphere, and glossy metallic reflections within the environment. In existing global illumination methods, all indirect lighting is pre-calculated and stored in texture information with light maps. Light maps enable game scenes to achieve effects similar to global illumination, but because they are pre-calculated, they only work on static objects. For global illumination of non-static objects, light probes can simulate the effects of light maps. Light probes sample the lighting information illuminating a specific point in 3D space during a pre-calculation phase before runtime. The collected information is then compiled and packaged using spherical harmonics. During game runtime, this lighting information is encoded in shader programs to quickly reconstruct the lighting effects. Similar to light maps, light probes can capture and store lighting information in the game scene. The difference is that light maps store lighting information when light shines on the surface of an object, while light probes store lighting information when light passes through a vacuum area.

[0082] Normally, the arrangement of light probes is done by manual placement and position adjustment, and the position and number of light probes directly affect the sampling results of the lighting information. In order to avoid unnecessary waste of light probe resources, in the embodiment of the present invention, when arranging a probe grid for light probes in a game scene, light probes can be arranged for spatial voxels close to the surface of an object, and for spatial voxels in an open area. Here, the determination process for spatial voxels close to the surface of an object can be specifically performed by multiple-level voxels formed by dividing the spatial voxels in the game scene multiple times. If it is determined that the voxel intersects with an object in the game scene, the voxel is determined to be a spatial voxel close to the surface of the object, and then light probes are arranged for the spatial voxels close to the surface of the object to form a probe grid.

[0083] It can be understood that since light probes usually process the lighting of characters or dynamic objects in the game scene to provide high-quality lighting for moving objects in the game scene, the probe grid arranged in this application sets light probes for spatial voxels close to the surface of objects in the game scene, and does not set light probes for other spatial voxels, so that the subsequently sampled lighting information is effective lighting information around the object, avoiding waste of light probe resources while improving the lighting effect of moving objects in the game scene.

[0084] 102. Update the lighting probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture lighting information at the viewpoint position.

[0085] It is understandable that since the lighting information collection process is affected by the position of the lighting probe in the probe grid, the lighting information at different spatial positions will be affected by each other, and the viewpoint position in the game scene is the spatial position corresponding to the viewing angle of the video device. This position is used as the sampling position of the lighting information, and the lighting probe at the corresponding viewpoint position in the probe grid is updated. Subsequently, the lighting information captured by the lighting probe at the viewpoint position is rendered, without consuming a lot of resources to store and transmit probe data, saving storage and transmission overhead while ensuring rendering accuracy.

[0086] Among them, the viewpoint position in the game scene is any sampling position for setting lighting information in the game scene. For the viewpoint position, the effective lighting probe will continuously collect the changing lighting data in the game scene, and then use the probe grid to provide sampling interpolation results of different densities in the process of interpolating the lighting information to form a probe grid to capture the lighting information of the viewpoint position.

[0087] Specifically, in the process of updating the lighting probes of the corresponding viewpoint positions in the probe grid according to the viewpoint positions in the game scene, the positions of the lighting probes corresponding to the corresponding viewpoint positions in the probe grid can be obtained for the viewpoint positions in the game scene. According to the positions of the lighting probes in the spatial voxels, it is judged whether the spatial voxels contain objects. Lighting probes will be arranged in the spatial voxels containing objects, while light probes will not be arranged in the spatial voxels that do not contain objects. The lighting probes arranged in the spatial voxels containing objects in the probe grid are further updated according to the viewpoint positions, so that in the subsequent process of collecting lighting information, the lighting information corresponding to the lighting probes arranged in the spatial voxels containing objects can be directly collected.

[0088] 103. The lighting information of the viewpoint position is generated into a plurality of probe data textures with the same data size by a central processing unit and then transmitted to a graphics processing unit.

[0089] It is understandable that the lighting information at the viewpoint position includes pre-calculated lighting data. Many budget overheads are only generated during editing and will not appear at runtime. The light probe stores the lighting data that passes through the scene space and integrates it into multiple probe data textures with the same data size. The probe data texture is equivalent to the light map of the dynamic object, which also includes the direct light source projected onto the surface of the object in the scene, and the indirect light source reflected between different objects. The surface information and bump information of the object can be described through the shader on the object material.

[0090] Specifically, in the process of generating multiple probe data textures with the same data size from the lighting information of the viewpoint position, since the lighting information of the viewpoint position is captured by the lighting probe in the probe grid, and the position of the lighting probe in the probe grid can affect the sampling of the lighting information, an octree is used here to represent a game scene. The size of the scene space and the distribution and complexity of the objects in the space cannot be unified. The viewpoint position in the current game scene is in a child node at a certain level in the octree, and the child node is also in the probe grid and has corresponding probe data. On the one hand, the hierarchical relationship of the probe data corresponding to the viewpoint position can be recorded in the indirect texture, and on the other hand, the probe data corresponding to the viewpoint position can be recorded in the resource texture. The indirect texture and the resource texture form the probe data texture, and the probe data texture is further transmitted to the graphics processor.

[0091] Among them, the central processing unit is equivalent to, and the graphics processing unit is equivalent to a microprocessor that performs drawing operations on personal computers, workstations, game consoles and some mobile devices (such as tablets, smart phones, etc.). It is mainly used here to render probe data textures. Since the probe data texture includes resource textures and indirect textures, the subsequent graphics processor can use the indirect texture to obtain the hierarchical relationship of the viewpoint position mapping probe data, and use the hierarchical relationship to sample the probe data from the resource texture for lighting rendering.

[0092] 104. In response to the rendering instruction called by the central processing unit, the graphics processor uses the resource texture and indirect texture to sample the lighting information of the object in the game scene according to the position information of the sampling point on the surface of the object in the game scene, and renders the lighting information of the object.

[0093] When the CPU gives a rendering instruction, the GPU calculates the pixel output based on the rendering state (e.g., material, texture, shader, etc.) and the input sampling point data. Specifically, the GPU can obtain the original hierarchical relationship of the resource texture in the tree structure from the indirect texture based on the position information of the sampling points on the surface of the game object. The position information of the sampling points on the surface of the object in the game scene is equivalent to the position of the sampling points output by the game scene to the screen. The original hierarchical relationship of the resource texture in the tree structure is used to sample the lighting information of the objects in the game scene from the resource texture and render the lighting information of the objects.

[0094] The execution subject of this embodiment can be a rendering device or equipment for lighting information in the game scene, which mainly involves the CPU and GPU ends of the scene rendering tool. Steps 101 to 103 are mainly applied to the CPU end. Specifically, after the game scene is arranged, it is necessary to arrange the position information of the lighting probe in the game scene. Since the lighting probe cannot be directly hung on the game object, it usually needs to rely on the specified spatial area in the game scene. When adding a lighting probe to the game scene, the spatial voxel closer to the object in the specified spatial area can be used as the preferred position for placing the lighting probe, which can collect lighting information that better meets the needs of the game scene, and then according to the game scene, the lighting probe is placed. The light probe is updated at the viewpoint position and the light information is captured. The arrangement process of the light probe and the capture process of the light information are mainly executed by the client of the rendering tool, that is, it can be executed by the CPU side, and the light information is uploaded to the CPU side. The light information is generated by the CPU side and then transmitted to the GPU side. The CPU side calculates the display content and submits it to the GPU side. The GPU side responds to the rendering instructions called by the central processing unit, and according to the position information of the surface sampling points of the objects in the game scene, uses the resource texture and indirect texture to sample the light information of the objects in the game scene, and renders the light information of the objects, and then outputs it to the screen.

[0095] The rendering method of lighting information in the game scene provided by the embodiment of the present application is compared with the current method of using GPU hardware to quickly sample the lighting information captured by millions of lighting probes per frame. The present application arranges the probe grid for the spatial voxels in the game scene, which can reasonably place the lighting probes and effectively avoid the waste of lighting probes. It further updates the lighting probes of the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and captures the lighting information of the viewpoint position. The lighting information of the viewpoint position is generated into multiple probe data textures with the same data size and then transmitted to the graphics processor, without sampling the lighting information pixel by pixel, saving rendering time. The buffered storage space, the probe data texture includes resource texture and indirect texture, and the graphics processor responds to the rendering instruction called by the central processing unit, and uses the resource texture and indirect texture to sample the lighting information of the object in the game scene according to the position information of the sampling point on the surface of the object in the game scene, and renders the lighting information of the object. Since the indirect texture stores the sampling position information of the lighting information in the game scene, the resource texture is combined with the indirect texture to sample different densities of lighting information for the same screen pixels according to the viewpoint position in the game scene, which can save the updating, transmission and storage costs of the lighting information sampling in the game scene and improve the rendering efficiency of the lighting information.

[0096] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, this embodiment provides another method for rendering lighting information in a game scene, which is applied to the CPU side of the scene rendering tool, such as Figure 2 As shown,

[0097] 201. Obtain the close-range voxels contained in the spatial voxels in the game scene.

[0098] Among them, the spatial voxels in the game scene are equivalent to the three-dimensional spatial units in the game world. The close-range voxels are the voxels in the preset layer of voxels formed by the segmentation of the spatial voxels in the game scene that meet the distance conditions, which are equivalent to the voxels close to the surface of the object. The distance condition is used as the basis for determining the voxels close to the surface of the object. It can be the intersection of the bounding box of the voxel and the bounding box of the object in the game scene. The spatial voxels will be formed during the segmentation process, and the pixels to be segmented and the segmented pixels will be judged according to the distance condition. If the bounding box of the voxel intersects with the bounding box of the object in the game scene, it means that the voxel is close to the surface of the object, that is, the close-range voxel.

[0099] It can be understood that the above-mentioned judgment process can be performed before and after the segmentation of the spatial voxels, and the voxels that meet the judgment conditions are repeatedly segmented. If the voxels do not meet the judgment conditions, they will not be segmented. First, start with a large voxel as the original spatial voxel to be segmented, and then segment it evenly. The segmentation principle is that if it is close to the surface of the object, it will be subdivided, and each sub-voxel will be repeatedly segmented until the specified minimum voxel size is reached, that is, the preset level. This process will generate a tree structure of the preset level.

[0100] Specifically, in the process of obtaining the close-range voxels contained in the spatial voxels in the game scene, since the close-range voxels are voxels close to the surface of the object in the game scene, we can first divide each spatial voxel in the spatial area covered by the object to be mounted in the game scene into voxels of a preset level. The preset level is the limited depth of the tree structure, which can be set according to the actual application scenario. The higher the number of levels, the more voxels the spatial voxels contain after segmentation. Then, each voxel in the preset level is traversed to determine whether the bounding box of the voxel after segmentation intersects with the bounding box of the object in the game scene. If so, it is determined that the voxel after segmentation is a close-range voxel on the surface of the object in the game scene.

[0101] 202. Arrange a probe grid for the close-range voxels included in the spatial voxels.

[0102] Light in the game scene can control the activities of characters, affect the player's mood, and also affect the way various events are perceived. As a tool for game development, the game engine can observe various effects in real time during the game production, including intensity, color, shadows, etc., which can be flexibly adjusted during production. Usually, for dynamic objects in the game scene, sampling points of light probes can be set in designated areas to collect light and dark information of the designated area. The designated area can be the spatial area covered by the object to be mounted in the game scene. Since the lighting information generated in places with small lighting changes in the game scene is relatively small, arranging too many light probes will be wasteful. The preferred location is to set dense light probes in the lighting changes, shadows, and lighting transition areas.

[0103] Specifically, in the process of arranging probe grids for the close voxels contained in the spatial voxels, on the one hand, effective lighting probes are created for the close voxels in the hierarchy in the spatial voxels. The effective lighting probes can capture the lighting information in the game scene to form spherical harmonic function coefficients defined in the spherical coordinate system. On the other hand, virtual voxels corresponding to the hierarchy are added to the spatial voxels, and virtual lighting probes are created for the voxels in the virtual voxels that meet the adding conditions. The virtual lighting probes are used to seamlessly interpolate the lighting information sampled by the close voxels in the hierarchy in the spatial voxels.

[0104] Since the position of the effective light probe in the probe grid is fixed, there is no need to set up virtual light probes for the positions of the probe grid where effective light probes have been set. Specifically, in the process of adding virtual light probes, first for the levels greater than the first order in the spatial voxels, add virtual voxels corresponding to the level. The virtual voxels are mapped to the voxels of the corresponding level in the spatial voxels. Further traverse the virtual voxels corresponding to the level to determine whether there are effective light probes for the mapped voxels in the spatial voxels. If not, create virtual light probes for the virtual voxels. Here, voxels of different levels can be displayed in different colors, and virtual voxels and virtual light probes can be added for different levels. For places where there are no effective light probes around the close voxels where effective light probes are created, virtual light probes are added.

[0105] 203. According to the viewpoint position in the game scene, query the node hierarchy relationship of the light probe mapped to the viewpoint position.

[0106] It is understandable that the lighting information captured by the probe grid of spatial voxels includes pre-calculated lighting data. Many budget overheads are only generated during editing and will not appear at runtime. The light probe stores the lighting information that passes through the scene space and integrates it into the data probe texture. The data probe texture is equivalent to the light map of the dynamic object. It also contains the direct light source projected onto the surface of the object in the scene, and the indirect light source reflected between different objects. The surface information and bump information of the object can be described through the shader on the object material.

[0107] Here, the viewpoint position in the game scene is the sampling position of the current shooting device. By querying the node hierarchy relationship of the light probe based on the sampling position of the current shooting device, the node hierarchy relationship of the corresponding light probe is used to capture the lighting information. There is no need for GPU hardware to sample millions of light probes, but more efficient lighting information sampling is achieved, thereby improving the rendering efficiency of lighting information.

[0108] 204. Update the lighting probe of the corresponding viewpoint position in the probe grid according to the node hierarchy relationship of the lighting probe mapped to the viewpoint position, and capture lighting information of the viewpoint position.

[0109] In an embodiment of the present application, since each probe node in the tree structure of the probe grid has spatial range information, the node hierarchy relationship of the viewpoint position mapping illumination probe is relatively easy to determine, and then according to the node hierarchy relationship of the viewpoint position illumination probe, the illumination probe of the corresponding viewpoint position in the probe grid is updated to capture the illumination information of the viewpoint position.

[0110] 205. Extract resource textures and indirect textures using the node hierarchical relationship carried by the illumination information of the viewpoint position.

[0111] In an embodiment of the present application, effective lighting probes in the probe grid can be used to sample lighting data in the game scene, and interpolation operations can be performed on the lighting data to obtain first lighting information of the viewpoint position in the game scene. The virtual lighting probes in the probe grid can be used to seamlessly interpolate the lighting data sampled by close-range voxels in the spatial voxels within the hierarchy to obtain second lighting information of the viewpoint position in the game scene. The first lighting information and the second lighting information of the viewpoint position in the game scene can be further expanded to extract resource textures and indirect textures.

[0112] It can be understood that the lighting data is attached to the lighting probe, and the lighting probe belongs to the node at a certain level in the probe grid. Therefore, in the process of expanding the first lighting information and the second lighting information, the node's hierarchical information and lighting information are also expanded. Here, the lighting information is expanded step by step according to the hierarchical information of the node in the attribute structure. Resource textures can be formed for the lighting information, and indirect textures can be formed for the node's hierarchical information.

[0113] 206 . Generate multiple probe data textures with the same data size from the resource texture and the indirect texture, and transmit the resulting textures to a graphics processor.

[0114] It should be noted that the tree-structured data probe texture combines lighting information captured by effective and virtual lighting probes and can transmit this lighting information to the GPU to form texture resource information. Specifically, the lighting information from the viewpoint position can be expanded into a resource texture according to the node hierarchy carried by the lighting information at the viewpoint position. During this expansion process, the original hierarchical relationship of the resource texture in the tree structure is stored in the indirect texture.

[0115] The following takes 2D quadtree as an example of a specific application scenario. First, effective lighting probes are adaptively created within the spatial voxels in the game scene, and then an effective lighting probe is placed in each voxel corner. Specifically, each spatial voxel can be divided into 4 voxels, and the division is repeated for each voxel to form an octree structure of the spatial voxels, forming a 2*2*2 probe grid, recording the voxels close to the surface of the object, and placing effective lighting probes on these voxel nodes. Then, virtual voxels and virtual lighting probes are added to the level corresponding to the spatial voxels in the game scene. The virtual voxels and virtual lighting probes can achieve seamless interpolation of lighting information when sampling between larger and smaller levels of voxels, and further form multiple probe data textures with the same data size as the lighting information captured by the effective lighting probes and the virtual lighting probes, combined with Figure 3a and Figure 3bAs shown, the probe data texture includes resource textures and indirect textures, and can be expanded layer by layer during the rendering process. The resource textures at each level have separate numbers. Usually, the resource textures at each level merge the lighting information captured by the effective lighting probes and the virtual lighting probes. For the resource textures that are not merged and stored, the merging process can continue. Since the expanded resource texture consists of a storage structure composed of multiple textures with the same block size layout, the storage structure can implement indirect addressing during the rendering process, so that after completing the caching of the probe data texture, the hierarchical relationship of the indirect texture records in the cache can be used to obtain the sampling position of the resource texture in the game scene, and the rendering process of the objects in the game scene can be implemented according to the sampling position.

[0116] The example of this application expands the spatial voxels with hierarchical relationships in the tree structure into a set of lighting probes to form a data probe texture, and stores the hierarchical relationship of each resource texture in the tree structure in an indirect mapping texture. Then, during the rendering process of the game scene, each frame of scene data updates the lighting information captured by the lighting probes in the tree structure according to the viewpoint position, and expands it to the data probe texture. During the expansion process, the hierarchical relationship is recorded to the indirect texture and then transmitted to the GPU. During sampling, according to the world position of the sampling point on the surface of the object, a hierarchical relationship in the corresponding tree structure is first obtained from the indirect texture, and finally the hierarchical relationship is used to sample the lighting information formed by the final lighting probe in the resource texture for rendering.

[0117] Furthermore, this embodiment provides another method for rendering lighting information in a game scene, such as Figure 4 As shown, the method is applied to the GPU side of the scene rendering tool and includes the following steps:

[0118] 301. In response to a rendering instruction called by the central processing unit, receive a plurality of probe data textures.

[0119] Among them, the probe data texture includes resource texture and indirect texture. The probe data texture has a storage structure with the same data size, which can meet the texture cache of the GPU side and show the uniform layout of the resource texture.

[0120] Since each level of space in the storage structure is flattened and has the lighting information collected by the lighting probes in the game scene, the GPU is further required to sample the lighting information in the game scene. The sampling process of lighting information on the GPU is a relatively simple and fixed operation. Here, the indirect texture in the probe data texture is used to address the resource texture. There is no need to transmit and sample the lighting information of a large number of lighting probes at one time, so as to achieve limited probe data textures and fixed overhead to efficiently meet the data transmission and sampling of the entire game scene.

[0121] 302. According to the position information of the sampling points on the surface of the object in the game scene, obtain the original hierarchical relationship of the resource texture in the tree structure from the indirect texture.

[0122] Taking into account the distribution of valid lighting probes and virtual lighting probes in the probe grid, in the process of obtaining the original hierarchical relationship of the resource texture in the tree structure from the indirect texture, first, according to the position information of the sampling points on the surface of the object in the game scene, the position distribution of the valid lighting probes and virtual lighting probes in the probe grid is extracted, and then according to the position distribution of the valid lighting probes and virtual lighting probes in the probe grid, since the indirect texture is not direct texture information, the original hierarchical relationship of the resource texture in the tree structure is obtained from the indirect texture. In the process of transmitting texture resource information, there is no need to transmit a large amount of texture information, so as to improve the transmission efficiency and sampling efficiency of the lighting information in the subsequent rendering process.

[0123] 303 : Sample lighting information of objects in the game scene from the resource texture using the original hierarchical relationship of the resource texture in the tree structure, and render the lighting information of the objects.

[0124] Here, the node information of the resource texture in the tree structure, that is, the offset value, can be sampled from the indirect texture through the position of the current pixel in the game scene. Then, the probe spherical harmonic function on the pixel can be obtained through the offset value, and the projection and reconstruction of the spherical harmonic function can be realized to render the lighting information.

[0125] In an embodiment of the present invention, the original hierarchical relationship of the resource texture in the tree structure can be used to obtain the level and offset of the resource texture in the tree structure, and then according to the level and offset of the resource texture in the tree structure, since each hierarchical node in the tree structure is expanded in a set order, it is usually expanded from the first hierarchical node, and the offset is 0 at this time, and so on, the cached lighting sampling position in the resource texture is calculated, and then the lighting information of the objects in the game scene is sampled according to the cached lighting sampling position in the resource texture, and the lighting information of the objects is rendered.

[0126] In specific application scenarios, the lighting information rendering process in the game scene can be as follows Figure 5As shown, the process mainly involves data transmission between the CPU and GPU. First, the CPU arranges a probe grid for the spatial voxels in the game scene, and can adaptively generate uniform and irregular grid probes. The grid probe contains valid lighting probes and virtual lighting probes. Here, the position marked at the midpoint of the grid probe is the valid lighting probe, and the position marked at the cross in the grid probe is the virtual lighting probe. Then, the lighting pre-calculation data, material and lighting execution data are combined to generate a probe data texture, that is, an indirect texture containing a node hierarchy relationship and a resource texture containing lighting information. The probe texture data and the cube map are combined with the viewpoint position of the game scene to the renderer in the GPU, and the renderer in the GPU converts the probe data texture Store in the cache to perform deferred rendering, execute drawing instructions for the GPU side to rasterize the geometry stage of scene objects. Deferred rendering will use MRT multiple rendering buffers to save geometric information at this extreme, without additional operations to sample and buffer costs to save lighting information, saving cache resources while reducing GPU bandwidth, and then sample probe data textures pixel by pixel, sample the scene at a specific location, and arrange reflection probes. When an object with a reflective effect is near the probe, the probe result will be given to the object, and further use screen space reflection to obtain the collection information of the game scene from the cache, and sample and calculate the resource texture corresponding to the object at the viewpoint position, so that the lighting information of the objects in the game scene can be rendered when using direct lighting.

[0127] Further, as Figure 1 and Figure 2 The specific implementation of the method, the embodiment of the present application provides a rendering device for lighting information in a game scene, such as Figure 6 As shown, the apparatus includes: a layout unit 41 , an updating unit 42 , a generating unit 43 , and a rendering unit 44 .

[0128] An arrangement unit 41 may be configured to arrange a probe grid for spatial voxels in a game scene, wherein the probe grid includes lighting probes for capturing lighting information in the game scene;

[0129] An updating unit 42 may be configured to update the lighting probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture lighting information at the viewpoint position;

[0130] The generating unit 43 may be configured to generate a plurality of probe data textures having the same data size from the illumination information of the viewpoint position via the central processing unit and transmit the plurality of probe data textures to the graphics processing unit, wherein the probe data textures include resource textures and indirect textures;

[0131] The rendering unit 44 is used to respond to the rendering instruction called by the central processing unit. The graphics processor uses the resource texture and indirect texture to sample the lighting information of the objects in the game scene according to the position information of the surface sampling points of the objects in the game scene, and renders the lighting information of the objects.

[0132] In specific application scenarios, such as Figure 7 As shown, the illumination probes in the probe grid have a node hierarchical relationship, and the updating unit 42 includes:

[0133] The query module 421 can be used to query the node hierarchy relationship of the light probe mapped to the viewpoint position according to the viewpoint position in the game scene;

[0134] The updating module 422 may be configured to map the node hierarchical relationship of the lighting probe according to the viewpoint position, update the lighting probe at the corresponding viewpoint position in the probe grid, and capture the lighting information at the viewpoint position.

[0135] In specific application scenarios, such as Figure 7 As shown, the illumination information of the viewpoint position carries a node hierarchical relationship, and the generating unit 43 includes:

[0136] The extraction module 431 may be configured to extract resource textures and indirect textures by utilizing the node hierarchical relationship carried by the illumination information at the viewpoint position;

[0137] The generating module 432 may be configured to generate a plurality of probe data textures having the same data size from the resource texture and the indirect texture and transmit the resulting plurality of probe data textures to the graphics processor.

[0138] In specific application scenarios, such as Figure 7 As shown, the extraction module 431 includes:

[0139] The expansion submodule 4311 may be configured to expand the illumination information of the viewpoint position information into a resource texture according to the node hierarchy relationship carried by the illumination information of the viewpoint position;

[0140] The storage submodule 4312 may be configured to store the original hierarchical relationship of the resource texture in the tree structure into an indirect texture during the process of expanding the resource texture into the resource texture.

[0141] In specific application scenarios, such as Figure 7 As shown, the probe grid includes valid lighting probes and virtual lighting probes, and the arrangement sheet 41 includes:

[0142] A first acquisition module 411 may be configured to acquire close-range voxels contained in the spatial voxels in the game scene, wherein the close-range voxels are voxels in a preset layer formed by segmenting the spatial voxels in the game scene that meet a distance condition, wherein the voxel's bounding box intersects with the bounding box of an object in the game scene;

[0143] The arrangement module 412 may be configured to arrange a probe grid for the close-range voxels included in the spatial voxels.

[0144] In a specific application scenario, the arrangement module 412 may be used to create effective lighting probes for close voxels in the hierarchy among the spatial voxels.

[0145] The arrangement module 412 can also be specifically used to add virtual voxels corresponding to the level for the spatial voxels, and create virtual lighting probes for the voxels in the virtual voxels that meet the addition conditions. The virtual lighting probes are used to seamlessly interpolate the lighting information sampled by the nearby voxels in the level of the spatial voxels.

[0146] In specific application scenarios, such as Figure 7 As shown, the rendering unit 44 includes:

[0147] The second acquisition module 441 may be configured to acquire the original hierarchical relationship of the resource texture in the tree structure from the indirect texture according to the position information of the sampling points on the surface of the object in the game scene;

[0148] The rendering module 442 may be configured to sample lighting information of objects in the game scene from the resource textures using the original hierarchical relationship of the resource textures in the tree structure, and render the lighting information of the objects.

[0149] In specific application scenarios, such as Figure 7 As shown, the rendering module 442 includes:

[0150] The acquisition submodule 4421 may be used to acquire the level and offset of the resource texture in the tree structure by using the original hierarchical relationship of the resource texture in the tree structure;

[0151] The calculation submodule 4422 may be configured to calculate a cached illumination sampling position in the resource texture according to the level and offset of the resource texture in the tree structure;

[0152] The rendering submodule 4423 may be configured to sample lighting information of objects in the game scene according to the lighting sampling positions cached in the resource texture, and render the lighting information of the objects.

[0153] The rendering device for lighting information in the game scene provided by the embodiment of the present invention, compared with the current method of using GPU hardware to quickly sample the lighting information captured by millions of lighting probes per frame, the present application arranges the probe grid for spatial voxels in the game scene, can reasonably place the lighting probes, effectively avoid the waste of lighting probes, further updates the lighting probes at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and captures the lighting information of the viewpoint position, generates multiple probe data textures with the same data size from the lighting information of the viewpoint position, and transmits them to the graphics processor, without sampling the lighting information pixel by pixel, saving rendering The buffered storage space, the probe data texture includes resource texture and indirect texture, and the graphics processor responds to the rendering instruction called by the central processing unit, and uses the resource texture and indirect texture to sample the lighting information of the object in the game scene according to the position information of the sampling point on the surface of the object in the game scene, and renders the lighting information of the object. Since the indirect texture stores the sampling position information of the lighting information in the game scene, the resource texture is combined with the indirect texture to sample different densities of lighting information for the same screen pixels according to the viewpoint position in the game scene, which can save the updating, transmission and storage costs of the lighting information sampling in the game scene and improve the rendering efficiency of the lighting information.

[0154] It should be noted that for other corresponding descriptions of the functional units involved in the rendering device for illumination information in a game scene provided in this embodiment, please refer to Figure 1-Figure 2 The corresponding description in will not be repeated here.

[0155] Based on the above Figure 1 、 Figure 2 、 Figure 4 The method shown in FIG. 1 is a method for performing the above-mentioned operation. Accordingly, the embodiment of the present application further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned operation is performed. Figure 1 、 Figure 2 、 Figure 4 The rendering method of lighting information in the game scene shown.

[0156] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0157] Based on the above Figure 1 、 Figure 2 、 Figure 4 The method shown, and Figure 6-Figure 7In order to achieve the above-mentioned purpose, the embodiment of the virtual device shown in the embodiment of the present application also provides a physical device for rendering lighting information in a game scene, which can be a computer, a smart phone, a tablet computer, a smart watch, a server, or a network device, etc. The physical device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 、 Figure 2 、 Figure 4 The rendering method of lighting information in the game scene shown.

[0158] Optionally, the physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Wi-Fi interface), etc.

[0159] In an exemplary embodiment, see Figure 8 The physical device includes a communication bus, a processor, a memory, and a communication interface. It may also include an input / output interface and a display device. The various functional units can communicate with each other via the bus. The memory stores a computer program, and the processor is configured to execute the program stored in the memory and perform the method for rendering lighting information in the game scene in the above embodiment.

[0160] Those skilled in the art will understand that the physical device structure for rendering lighting information in a game scene provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0161] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device used to process store search information, supporting the execution of the information processing program and other software and / or programs. The network communication module is used to enable communication between components within the storage medium and with other hardware and software within the physical device used to process the information.

[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of the present application, compared with the current existing methods, the present application is a graphics processor that responds to the rendering instruction called by the central processing unit, and uses resource textures and indirect textures to sample the lighting information of objects in the game scene according to the position information of the sampling points on the surface of the object in the game scene, and renders the lighting information of the object. Since the indirect texture stores the sampling position information of the lighting information in the game scene, the resource texture is combined with the indirect texture to sample different densities of lighting information for the same screen pixels according to the viewpoint position in the game scene, which can save the update, transmission and storage costs of the lighting information sampling in the game scene and improve the rendering efficiency of the lighting information.

[0163] Those skilled in the art will understand that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required to implement the present application. Those skilled in the art will understand that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0164] The serial numbers of the above application are for descriptive purposes only and do not represent the advantages or disadvantages of the implementation scenarios. The above disclosure only discloses several specific implementation scenarios of the present application, but the present application is not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the scope of protection of the present application.

Claims

1. A method for rendering lighting information in a game scene, applied to the CPU side of a scene rendering tool, characterized in that: include: Arranging a probe grid for spatial voxels in a game scene, wherein the probe grid includes a lighting probe for capturing lighting information in the game scene; Update the lighting probe of the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture the lighting information of the viewpoint position; The illumination information of the viewpoint position is generated by a central processing unit into a plurality of probe data textures having the same data size and then transmitted to a graphics processor, wherein the probe data texture includes a resource texture and an indirect texture, wherein the resource texture has a storage structure composed of a plurality of textures having the same block size layout, and the storage structure is used to implement indirect addressing during the rendering process, and the hierarchical relationship of the probe data corresponding to the viewpoint position is recorded in the indirect texture, and the probe data corresponding to the viewpoint position is recorded in the resource texture; In response to the rendering instruction called by the central processing unit, the graphics processor samples the lighting information of the objects in the game scene using the resource texture and indirect texture according to the position information of the surface sampling points of the objects in the game scene, and renders the lighting information of the objects.

2. The method according to claim 1, characterized in that The lighting probes in the probe grid have a node hierarchical relationship, and the updating of the lighting probes at the corresponding viewpoint positions in the probe grid according to the viewpoint positions in the game scene and capturing the lighting information of the viewpoint positions specifically includes: According to the viewpoint position in the game scene, query the node hierarchy relationship of the light probe mapped to the viewpoint position; According to the viewpoint position mapping, the node hierarchy relationship of the illumination probe is updated, the illumination probe of the corresponding viewpoint position in the probe grid is updated, and the illumination information of the viewpoint position is captured.

3. The method according to claim 1, characterized in that The capturing of the illumination information of the viewpoint position specifically includes: Based on the viewpoint position, use light probes to continuously collect changing lighting data in the game scene; In the process of interpolating the illumination data, the probe grid is used to provide sampling interpolation results of different densities to form a probe grid to capture illumination information of a viewpoint position.

4. The method according to claim 1, characterized in that: The illumination information of the viewpoint position carries a node hierarchical relationship, and the generating of a plurality of probe data textures having the same data size from the illumination information of the viewpoint position and transmitting the same to the graphics processor specifically includes: Extracting resource textures and indirect textures by using the node hierarchical relationship carried by the illumination information of the viewpoint position; The resource texture and the indirect texture are used to generate a plurality of probe data textures with the same data size and then transmitted to the graphics processor.

5. The method according to claim 4, characterized in that The step of extracting resource textures and indirect textures by utilizing the node hierarchical relationship carried by the illumination information of the viewpoint position specifically includes: Expanding the illumination information of the viewpoint position information into a resource texture according to the node hierarchy relationship carried by the illumination information of the viewpoint position; During the process of expanding into the resource texture, the original hierarchical relationship of the resource texture in the tree structure is stored in the indirect texture.

6. The method according to any one of claims 1 to 5, characterized in that The probe grid includes effective lighting probes and virtual lighting probes, and the arrangement of the probe grid for spatial voxels in the game scene specifically includes: Acquire close-distance voxels contained in the spatial voxels in the game scene, wherein the close-distance voxels are voxels that meet the distance condition in the voxels of a preset level formed by the segmentation of the spatial voxels in the game scene, and the distance condition is that the bounding box of the voxel intersects with the bounding box of the object in the game scene; A probe grid is arranged for the close-distance voxels included in the spatial voxel.

7. The method according to claim 6, characterized in that The illumination probes in the probe grid include effective illumination probes and virtual illumination probes, and the arrangement of the probe grid for the close-range voxels included in the spatial voxels specifically includes: Creating valid light probes for the near voxels in the hierarchy among the spatial voxels; Virtual voxels corresponding to the level are added to the spatial voxels, and virtual lighting probes are created for the voxels in the virtual voxels that meet the adding conditions. The virtual lighting probes are used to seamlessly interpolate the lighting information sampled by the close-distance voxels in the level of the spatial voxels.

8. The method according to any one of claims 1 to 5, characterized in that The method of sampling the lighting information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the sampling point on the surface of the object in the game scene, and rendering the lighting information of the object specifically includes: According to the position information of the sampling points on the surface of the object in the game scene, the original hierarchical relationship of the resource texture in the tree structure is obtained from the indirect texture; The original hierarchical relationship of the resource texture in the tree structure is utilized to sample the lighting information of the object in the game scene from the resource texture, and the lighting information of the object is rendered.

9. The method according to claim 8, characterized in that The method of sampling the lighting information of an object in a game scene from the resource texture by using the original hierarchical relationship of the resource texture in the tree structure and rendering the lighting information of the object specifically includes: Using the original hierarchical relationship of the resource texture in the tree structure, the level and offset of the resource texture in the tree structure are obtained; Calculate the cached illumination sampling position in the resource texture according to the level and offset of the resource texture in the tree structure; The lighting information of the objects in the game scene is sampled according to the lighting sampling positions cached in the resource texture, and the lighting information of the objects is rendered.

10. A method for rendering lighting information in a game scene, applied to a GPU end of a scene rendering tool, characterized in that: include: In response to a rendering instruction called by a central processing unit, a plurality of probe data textures are received, wherein the probe data textures include a resource texture and an indirect texture, wherein the resource texture has a storage structure composed of a plurality of textures with the same block size layout, wherein the storage structure is used to implement indirect addressing during the rendering process, and the hierarchical relationship of the probe data corresponding to the viewpoint position is recorded in the indirect texture, and the probe data corresponding to the viewpoint position is recorded in the resource texture; According to the position information of the sampling points on the surface of the object in the game scene, the original hierarchical relationship of the resource texture in the tree structure is obtained from the indirect texture; The original hierarchical relationship of the resource texture in the tree structure is utilized to sample the lighting information of the object in the game scene from the resource texture, and the lighting information of the object is rendered.

11. The method according to claim 10, characterized in that The step of obtaining the original hierarchical relationship of the resource texture in the tree structure from the indirect texture according to the position information of the surface sampling points of the object in the game scene specifically includes: According to the position information of the sampling points on the surface of the object in the game scene, the position distribution of the effective light probes and virtual light probes in the probe grid is extracted; According to the position distribution of the effective lighting probes and the virtual lighting probes in the probe grid, the original hierarchical relationship of the resource texture in the tree structure is obtained from the indirect texture.

12. A device for rendering lighting information in a game scene, characterized in that: include: An arrangement unit, configured to arrange a probe grid for spatial voxels in a game scene, wherein the probe grid includes an illumination probe for capturing illumination information in the game scene; An updating unit, configured to update the lighting probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture the lighting information at the viewpoint position; A generating unit, for transmitting the illumination information of the viewpoint position to a plurality of probe data textures having the same data size after being generated by a central processing unit to a graphics processor, wherein the probe data texture comprises a resource texture and an indirect texture, wherein the resource texture has a storage structure composed of a plurality of textures having the same block size layout, wherein the storage structure is used to implement indirect addressing during rendering, wherein the hierarchical relationship of the probe data corresponding to the viewpoint position is recorded in the indirect texture, and the probe data corresponding to the viewpoint position is recorded in the resource texture; A rendering unit is used to respond to the rendering instruction called by the central processing unit. The graphics processor uses the resource texture and indirect texture to sample the lighting information of the object in the game scene according to the position information of the surface sampling point of the object in the game scene, and renders the lighting information of the object.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for rendering lighting information in a game scene described in any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for rendering lighting information in a game scene described in any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Rendering method for dynamically calculating indirectly reflected high light based on optical probe interpolation

    CN106204701A

  • Game scene rendering method and device

    CN110193193A

  • Environment Synthesis for Lighting An Object

    CN110517355A