Method and apparatus for volume component light rendering

By acquiring multiple volume components within the field of view of a virtual camera, determining the target voxel, and calculating the blending weight value, the problem of poor rendering effect of multiple light sources is solved, and a more efficient and realistic lighting rendering effect is achieved.

CN116115997BActive Publication Date: 2026-07-03NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-01-30
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, when using multiple light sources to render the lighting of a single volume component, the rendering effect is poor. In particular, when the positions of the virtual camera and the game character change, the occlusion relationship cannot be accurately determined, resulting in incorrect rendering parameters and affecting the realism of the rendering effect.

Method used

By acquiring multiple volumetric components within the virtual camera's field of view in the game scene, the target voxels that meet the rendering conditions are determined. Based on the priority and attribute parameters of the volumetric components, the blending weight value of the target voxels is calculated, and the game scene is then lit and rendered using the blending weight.

Benefits of technology

It improves the efficiency and effect of lighting rendering, ensures that the rendering results are more consistent with the real scene, and reduces the problem of incorrect rendering parameter acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116115997B_ABST
    Figure CN116115997B_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of image processing, and more specifically, to a method and apparatus for lighting rendering of volumetric components. The method includes: acquiring multiple volumetric components located within the field of view of a virtual camera in a game scene; determining a target voxel from multiple voxels in the game scene that satisfies the rendering conditions corresponding to the volumetric component; determining a blending weight value of the target voxel based on the priority and attribute parameters of the volumetric component; and performing lighting rendering on scene objects in the game scene based on the blending weight values ​​of the multiple voxels. This application solves the technical problem of poor rendering effect when using multiple light sources to light-render a single volumetric component in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing, and more specifically, to a method and apparatus for rendering lighting on volumetric components. Background Technology

[0002] Currently, many game developers, in order to depict the effects of virtual objects emitting light and indirect illumination in game scenes, typically place multiple reflective sphere components within the scene to provide reflection information, such as light reflection and indirect illumination. When the user captures light information from the game scene through a virtual camera, the game rendering system can perform a simple weighted mixing calculation on the reflection information provided by each reflective sphere component to achieve lighting rendering for a specific game scene. However, this method is usually limited to the area where the reflective sphere components are located. When the virtual camera is outside the reflective sphere component area—for example, when the reflective sphere component is indoors and the user-controlled game character is outdoors—the lack of occlusion determination can lead to the game rendering system using indoor reflective sphere components to reflect virtual objects outdoors. This results in incorrect rendering parameters, causing the final rendered game scene to differ from the real scene, resulting in poor rendering quality.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This disclosure provides at least some embodiments of a lighting rendering method and apparatus for a volumetric component, in order to at least solve the technical problem in the related art that the rendering effect is poor when using multiple light sources to perform lighting rendering on a single volumetric component.

[0005] According to one embodiment of this disclosure, a lighting rendering method for volumetric components is provided, comprising: acquiring multiple volumetric components located within the field of view of a virtual camera in a game scene; determining a target voxel from multiple voxels in the game scene that satisfies the rendering conditions corresponding to the volumetric component; determining a blending weight value of the target voxel based on the priority and attribute parameters of the volumetric components, wherein the blending weight values ​​of the other voxels besides the target voxel among the multiple voxels are first preset values; and performing lighting rendering on scene objects in the game scene based on the blending weight values ​​of the multiple voxels.

[0006] According to one embodiment of this disclosure, a lighting rendering apparatus for volumetric components is also provided, comprising: a component acquisition module for acquiring multiple volumetric components located within the field of view of a virtual camera in a game scene; a voxel determination module for determining a target voxel from the multiple voxels in the game scene that satisfies the rendering conditions corresponding to the volumetric component; a weight value determination module for determining a mixed weight value of the target voxel based on the priority and attribute parameters of the volumetric components, wherein the mixed weight value of the other voxels besides the target voxel among the multiple voxels is a first preset value; and a rendering module for performing lighting rendering on scene objects in the game scene based on the mixed weight values ​​of the multiple voxels.

[0007] According to one embodiment of the present disclosure, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program is configured to execute the lighting rendering method of the volumetric component in any of the preceding claims when running.

[0008] According to one embodiment of this disclosure, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the lighting rendering method for volumetric components as described above.

[0009] In at least some embodiments of this disclosure, a method is employed to acquire multiple volumetric components located within the field of view of a virtual camera in a game scene; determine a target voxel from multiple voxels in the game scene that satisfies the rendering conditions corresponding to the volumetric components; determine the blending weight value of the target voxel based on the priority and attribute parameters of the volumetric components; and perform lighting rendering on scene objects in the game scene based on the blending weight values ​​of multiple voxels. This method utilizes volumetric components that can be acquired within the field of view of the virtual camera and are located in the same space as the volumetric components to be rendered to render the target voxel, thereby greatly improving the efficiency of lighting rendering. Furthermore, the method determines the blending weight of each volumetric component to the target voxel based on the priority and attribute parameters of the volumetric components, and then uses the blending weight to perform lighting rendering on scene objects, making the final rendered lighting effect more consistent with the real scene. This solves the technical problem in related technologies where the rendering effect is poor when using multiple light sources to light-render a single volumetric component. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this application, illustrate exemplary embodiments of this disclosure and are used to explain this disclosure, but do not constitute an undue limitation of this disclosure. In the drawings:

[0011] Figure 1 This is a hardware structure block diagram of a mobile terminal for a volumetric component lighting rendering method according to an embodiment of the present disclosure.

[0012] Figure 2 This is a flowchart of a lighting rendering method for a volumetric component according to one embodiment of the present disclosure;

[0013] Figure 3 This is a schematic diagram of a scene where the virtual camera is located outside the study according to one embodiment of the present disclosure;

[0014] Figure 4 This is a structural block diagram of an apparatus according to one embodiment of the present disclosure;

[0015] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0016] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.

[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0018] In one possible implementation, the method of directly utilizing the reflection parameters of each reflective sphere component for lighting rendering in the field of image processing still suffers from poor rendering effects after practical experience and careful research. Therefore, the game scene applied in this disclosure embodiment can be any 3D game scene with lighting effects, and the target game type is generally a 3D role-playing game. A method for lighting rendering of volumetric components is proposed, which involves: acquiring multiple volumetric components within the field of view of a virtual camera in the game scene; determining target voxels that meet the rendering conditions corresponding to the volumetric components from multiple voxels in the game scene; and rendering based on the priority and attributes of the volumetric components. The method determines the blending weights of the target voxels based on the blending weights of multiple voxels. It renders the target voxels using volume components that can be captured within the virtual camera's field of view and are in the same space as the volume component to be rendered, which greatly improves rendering efficiency. Furthermore, it determines the blending weights of each volume component to the target voxel based on the priority and attribute parameters of the volume components, and then uses the blending weights to render the scene objects, making the final rendered lighting effect more consistent with the real scene. This solves the technical problem of poor rendering effect when using multiple light sources to render a single volume component in related technologies.

[0019] The methods and embodiments described above in this disclosure can be executed on mobile terminals, computer terminals, or similar computing devices. Taking a mobile terminal as an example, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other terminal device. Figure 1 This is a hardware structure block diagram of a mobile terminal using a volumetric component-based lighting rendering method according to an embodiment of this disclosure. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. Processor 102 (processor 102 may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and memory 104 for storing data. In one embodiment of this disclosure, it may also include: input / output device 108 and display device 110.

[0020] In some optional embodiments primarily focused on gaming scenarios, the aforementioned device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0021] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0022] According to one embodiment of this disclosure, an embodiment of a lighting rendering method based on volume components is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0023] In one possible implementation, this disclosure provides a volumetric component-based lighting rendering method that provides a graphical user interface through a terminal device, wherein the terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system. Figure 2 This is a flowchart of a volumetric component-based lighting rendering method according to one embodiment of the present disclosure. A graphical user interface is provided through a terminal device, and the content displayed by the graphical user interface includes a touch area, such as... Figure 2 As shown, the method includes the following steps:

[0024] Step S202: Obtain multiple volumetric components within the field of view of the virtual camera in the game scene.

[0025] The aforementioned virtual camera is generally used to simulate the user's field of view. Users can use the virtual camera to capture virtual scenes within the game, such as a study scene with tables, chairs, books, and bookshelves, or a city scene with lawns, buildings, and vehicles. Each volumetric component typically corresponds to a rendering influence space, which can be used to provide reflection information for the game scene, such as light reflection and indirect lighting. Therefore, multiple volumetric components can generally be set in the virtual scene to simulate the indirect light reflection effects between different game objects. Since there may be indirect reflected light illumination between different game objects, the voxels on those objects will be affected by other game objects. Setting a corresponding reflection component for each game object to render the game scene's lighting may result in low rendering efficiency and high rendering pressure. Therefore, to improve the overall lighting rendering efficiency of the game scene, the lighting rendering influence between different game objects can be replaced by the rendering effects of multiple volumetric components. In other words, multiple volumetric components can be set in the game scene to achieve simplified lighting rendering between different game objects.

[0026] In one alternative embodiment, the shape of the volume component can generally be spherical or square. The specific component shape can be set according to actual needs and is not limited here.

[0027] In one optional embodiment, since multiple volume components may overlap, taking the study scene mentioned above as an example, if the study is large, multiple volume components can be set in the study to ensure that the coverage of the volume components can encompass the entire study. This ensures that multiple game objects in the study can be rendered with indirect light reflection effects. For light source areas, such as near a candle, in order to show the difference in brightness between the area around the candle and other areas, as well as the effect of the candle on the lighting of other areas, multiple symmetrical volume components can be set around the candle to simulate the lighting effect. In this case, the area where the candle is located can be the overlapping area of ​​multiple volume components. Generally, since the scene outside the study may also require lighting rendering, a larger volumetric component can be set up to simulate the indirect light reflection effect outside the study. However, this volumetric component outside the study may overlap with multiple volumetric components inside the study. If the volumetric component is directly used to render the voxels in the overlapping area, such as when lighting the table in the study, the volumetric component outside the study might also affect the table's rendering. This differs from the lighting effects in a real-world scene, leading to errors in lighting rendering parameters and resulting in a less realistic rendering. Therefore, to address this issue, before lighting the game objects, multiple volumetric components within the virtual camera's field of view can be acquired. Then, volumetric components with the same spatial information as the game objects can be used for lighting rendering. This ensures that the lighting rendering effect of each game object more closely matches the visual effect that users would experience in a real-world scene.

[0028] Taking the study room scenario above as an example, if the virtual camera is currently inside the study room, the volume components that can be obtained first can include indoor volume components; if the virtual camera is outside the study room, the volume components that can be obtained through the door can include both indoor and outdoor volume components.

[0029] In one optional embodiment, the volume component can also be set as a movable component according to actual needs. For example, when there is a moving light source, the intensity and brightness of the light reflected from the surface of the object will change at different times. Therefore, in order to make the rendered effect more realistic, the volume component can be set as a movable component, and the position parameters or attribute parameters of the volume component can be changed according to the preset lighting rules, thereby improving the realism of the final lighting rendering effect.

[0030] In one optional embodiment, a frustum elimination method or a rasterization elimination method can also be used to determine multiple volume components within the field of view of the virtual camera, so as to ensure the accuracy of the obtained volume components.

[0031] Step S204: Determine the target voxel that meets the rendering conditions corresponding to the volume component from multiple voxels in the game scene.

[0032] The aforementioned target voxel can refer to the volume element on the game object to be rendered in the game scene, obtained through a virtual camera, such as the voxel on the aforementioned table and chair model. Since multiple volume components may overlap and superimpose, the same voxel may be affected by different volume components. Therefore, to improve the rendering accuracy of the game scene, the target voxel can first be determined from multiple voxels in the game scene based on a series of rendering conditions. Then, using the influence weights of multiple volume components on the target voxel, lighting rendering is performed on the game object to be rendered voxel by voxel, thereby improving the overall lighting rendering effect of the game object and ultimately making the rendered game scene more realistic.

[0033] Optionally, determining the target voxel that satisfies the rendering conditions corresponding to the volume component from multiple voxels in the game scene includes: determining a first voxel that is not occluded by scene objects in the game scene from multiple voxels; determining a second voxel located in the volume space of the volume component from the first voxel; and obtaining the target voxel located in the same space as the volume component from the second voxel.

[0034] The first voxel mentioned above can refer to all voxels corresponding to the scene area that can be obtained through the virtual camera; the second voxel mentioned above can refer to the voxel in the space area affected by the volume component in the scene area; the scene object mentioned above can refer to the game object to be rendered, such as the table, chairs, walls, potted plants and other game objects in the aforementioned study scene.

[0035] To improve rendering efficiency, the above rendering conditions may refer to considering only the lighting rendering effect on unoccluded volumetric components within the virtual camera's field of view and in the same space on the game objects to be rendered.

[0036] Figure 3 This is a schematic diagram of a scene where the virtual camera is positioned outside the study according to one embodiment of this disclosure, as shown below. Figure 3As shown, the two rectangles represent wall images, the shape in the larger wall represents the potted plant image, and the shape between the two walls represents a portion of the table and chair images. Taking this virtual scene as an example, if the game objects that can be captured from the current position of the virtual camera include the walls of the study, the table and chair inside the study, and the potted plant outside the study, then for rendering inside the study, we only need to consider the influence of the indoor volume components on the lighting rendering of the table and chair; for rendering outside the study, we only need to consider the influence of the outdoor volume components on the lighting rendering of the walls and potted plant.

[0037] Specifically, the game scene can first be rendered from the front, and based on the scene images captured by the virtual camera, multiple scene areas that are not obscured by scene objects can be identified from the game scene. All voxels corresponding to these scene areas are taken as the first voxel. Continuing with the example of the virtual camera being located outside the study, since the images that can be obtained through the virtual camera include the walls, potted plants, some tables and chairs, as well as other spaces besides these game objects, the first voxel mentioned above can refer to the voxels corresponding to the walls, potted plants, some tables and chairs, and other spaces.

[0038] After determining the first voxel, the spatial information to be rendered can be further determined. For example, if the scene is to be rendered in a study, the volume component can be determined to be an indoor volume component, and the volume space is indoor. After determining the volume space, the game objects in the first voxel scene can be rendered from the back. Based on the volume space of the target volume component, for example, if the volume component is an indoor volume component, the corresponding volume space is indoor, then a second voxel can be determined from the first voxel using a stencil test method, such as the indoor voxel in the first voxel. Continuing with the above... Figure 3 Taking a scene where the virtual camera is located outside the study as an example, if the game object to be rendered is a table, then the second voxel that can be obtained above refers to the voxel on the table and chair models.

[0039] Finally, based on the spatial information of the game object to be rendered and the target volume component mentioned above, the target voxel is determined from the second voxel. For example, if the game object to be rendered is a chair in the aforementioned study scene, and part of the chair is in the indoor space and part is in the outdoor space, then the voxel on the chair model that is indoors can be used as the target voxel. If the game object to be rendered is a table in the aforementioned study scene, and the table model is entirely in the indoor space, then all the voxels on the table model can be used as the target voxel.

[0040] Step S206: Determine the blending weight value of the target voxel based on the priority and attribute parameters of the volume component.

[0041] Among them, the mixed weight value of the voxels other than the target voxel is the first preset value.

[0042] The aforementioned priority can refer to the priority of the influence of multiple volume components on the lighting rendering of the target voxel. In one optional solution of this embodiment, the priority of each volume component can be set according to the center distance between the volume component and the target voxel, or the priority of each volume component can be determined according to the attribute information of the volume component, such as the light intensity. The aforementioned attribute parameters can refer to the blending transition parameters of the volume components to be indoors and outdoors, such as the size of the edge transition area of ​​the volume component and the coefficient of the weight attenuation curve. The aforementioned blending weight value can refer to the influence weight value of other volume components on the lighting rendering of the target voxel after integration. Generally, the blending weight value can be taken as a preset threshold, such as 0.2.

[0043] In one optional embodiment, if a target voxel is affected by multiple volume components, it is necessary to determine the influence weight of each volume component on the target voxel based on the influence priority of the multiple volume components and the mixing transition parameter, thereby determining the aforementioned mixing weight value.

[0044] Optionally, the blending weight values ​​are stored in a preset channel of the target voxel, and the preset channel is stored in an on-chip cache.

[0045] In one alternative embodiment, after determining the blend weight value, the blend weight value can be stored in an on-chip channel of the MRT (Multiple Render Targets). Compared with traditional memory, this channel can be directly read and written, which can greatly improve the efficiency of storing and retrieving the blend weight value.

[0046] Optionally, determining the blending weight value of the target voxel based on the priority and attribute parameters of the volume components includes: determining the target attribute parameters corresponding to the current cycle in multiple iterations from the attribute parameters of the volume components according to the priority of the volume components, wherein multiple iterations correspond one-to-one with multiple volume components; obtaining the first weight value of the target voxel, wherein the first weight value is used to characterize the blending weight value or the first preset value corresponding to the previous cycle; determining the second weight value of the target voxel based on the target attribute parameters; and determining the blending weight value corresponding to the current cycle based on the first weight value and the second weight value.

[0047] When determining the blending weight value corresponding to the target voxel, we can first determine the influence of each volume component on the lighting rendering of the game object to be rendered in an orderly manner according to the preset priority of each volume component, that is, the influence weight of each volume component on the game object to be rendered.

[0048] For example, if the target voxel A to be rendered is simultaneously affected by volume components B, C, and D—that is, if target voxel A is a voxel within the overlapping portion of volume components B, C, and D—then the weight of each volume component's influence on the target voxel can be determined individually based on its priority. If volume component B has the highest attribute parameter, such as maximum light intensity, its priority can be set to a relatively large value of 5. If volume component C has medium light intensity, its priority can be set to a middle value of 3. If volume component D has the lowest light intensity, its priority can be set to a relatively small value of 1. When determining the lighting rendering influence of volume components B, C, and D on target voxel A, the influence weight of each component can be determined repeatedly in the order of B, C, and D, following the aforementioned priority ranking.

[0049] The aforementioned first weight can refer to the mixed weight value that the target voxel has been occupied after each loop, or it can refer to the first preset value corresponding to each volume component during the first loop.

[0050] The aforementioned target attribute parameter can refer to the attribute mixing range corresponding to each volume component in each loop. Continuing with the target voxel A and volume components B, C, and D as examples, the mixing range of volume component B on target voxel A can be determined in the first loop, the mixing range of volume component C on target voxel A can be determined in the second loop, and so on. The mixing range of each volume component is determined in each loop. Using this mixing range, the influence weight of each volume component on target voxel A can be calculated, which is the second weight value mentioned above.

[0051] Optionally, determining the second weight value of the target voxel based on the target attribute parameters includes: determining the second weight value of the target voxel based on the target attribute parameters when the first weight value is less than the second preset value; and stopping the determination of the second weight value of the target voxel based on the target attribute parameters when the second weight value is greater than or equal to the first preset value.

[0052] To ensure that each volume component has an impact on the target voxel as much as possible, thereby improving the final rendering effect of the game scene, and to ensure that the sum of the weights of multiple volume components on the target voxel is no greater than 1, when determining the influence weight of different volume components on the target voxel in each loop, the calculated influence weight can be compared with a second preset value. Only if the first weight is less than the second preset value, the second weight value of the target voxel is determined according to the aforementioned target attribute parameters; if the first weight is greater than or equal to the first preset value, the determination of the second weight value is stopped.

[0053] In one optional embodiment, in order to ensure that the influence of multiple volume components on the target voxel is not unbalanced, the second weight value can be set to 0.5.

[0054] Optionally, determining the mixed weight value corresponding to the current cycle based on the first weight value and the second weight value includes: obtaining the third weight value of the target voxel, wherein the third weight value is used to characterize the remaining weight value or the second preset value corresponding to the previous cycle; obtaining the difference between the third weight value and the first weight value to obtain the weight difference value, wherein the weight difference value is used to characterize the remaining weight value corresponding to the current cycle; determining the weight difference value as the mixed weight value when the weight difference value is less than or equal to the second weight value; and determining the second weight value as the mixed weight value when the weight difference value is greater than the second weight value.

[0055] In one optional scheme of this embodiment, since the maximum weight value that each target voxel can contain is 1, if the sum of the influence weights of multiple volume components on the target voxel is equal to 1, it is no longer necessary to consider the influence of the remaining volume components on the lighting rendering of the target voxel. Therefore, when determining whether the target voxel will be affected by other volume components, the remaining weight value of the target voxel in this loop can be obtained.

[0056] Specifically, we can first obtain the remaining voxel values ​​of the target voxel at the end of the previous loop, and then combine them with the influence weight values ​​already determined during the current loop, i.e., the aforementioned first weight value, to obtain the remaining weight values ​​in the current loop, i.e., the aforementioned weight difference. After determining the weight difference, we can compare this weight difference with the second weight value. If the weight difference is less than or equal to the second weight value, the weight difference can be determined as a mixed weight value; if the weight difference is greater than the second weight value, the second weight value is determined as a mixed weight value.

[0057] After determining the first and second weights mentioned above, the hybrid weights corresponding to the target voxels can be further determined.

[0058] Step S208: Based on the mixed weight values ​​of multiple voxels, perform lighting rendering on scene objects in the game scene.

[0059] The aforementioned scene objects can refer to the game objects to be rendered, such as the table, chairs, walls, and potted plants in the aforementioned study scene. In an optional embodiment, after determining the blending weight value corresponding to the target voxel, the influence it has on the game object to be rendered during lighting rendering can be further determined based on the blending weight value. Through the above process, after determining the blending weight values ​​of each voxel on the corresponding indoor and outdoor scene objects based on different volume components, the scene objects can be rendered with lighting using these blending weights and the attribute parameters corresponding to each voxel.

[0060] In one optional embodiment, after determining the mixing weight values ​​corresponding to the multiple voxels, the direct and indirect light diffusion calculations for the game object to be rendered can be performed according to normal image-based lighting techniques. The calculation results are then optimized and superimposed based on the mixing weight values ​​and rendered onto the game object to be rendered, i.e., the scene object, thereby completing the lighting rendering of the game object to be rendered.

[0061] In one optional embodiment, after calculating the total weight value corresponding to the target voxel, the total weight value can be updated to the corresponding mixed weight value, which facilitates the calculation of mixed weights when rendering other game objects under lighting in the future.

[0062] This application employs a method that acquires multiple volumetric components within the virtual camera's field of view in a game scene; identifies target voxels from multiple voxels in the game scene that meet the rendering conditions corresponding to the volumetric components; determines the blending weight value of the target voxel based on the priority and attribute parameters of the volumetric components; and performs lighting rendering on scene objects in the game scene based on the blending weight values ​​of multiple voxels. This method utilizes volumetric components that can be acquired within the virtual camera's field of view and are in the same space as the volumetric components to be rendered to render the target voxel, greatly improving rendering efficiency. Furthermore, it determines the blending weight of each volumetric component to the target voxel based on the priority and attribute parameters of the volumetric components, and then uses the blending weights to perform lighting rendering on scene objects, making the final rendered lighting effect more consistent with the real scene. This solves the technical problem of poor rendering effect when using multiple light sources to light-render a single volumetric component in related technologies.

[0063] Optionally, determining a first voxel from multiple voxels that is not occluded by scene objects in the game scene includes: performing a depth test on multiple voxels through a first rendering process to obtain a first test result for multiple voxels, wherein the first test result is used to characterize whether the voxel is occluded by scene objects; and determining the first voxel from multiple voxels based on the first test result.

[0064] In one optional embodiment, a first rendering process, such as frontal rendering, can be used to perform preliminary rendering of the game scene. Then, depth testing methods can be used to determine the scene areas that are not occluded by scene objects, such as those described above. Figure 3 The virtual camera is positioned in the scene outside the study. The scene area not obscured by scene objects refers to the area including walls, potted plants, tables, chairs, and other corresponding spaces. After determining the scene area, the voxels within that scene area can be used as the first voxels.

[0065] Optionally, determining the second voxel located in the volume space of the volume component from the first voxel includes: determining the component space corresponding to the volume component; testing the first voxel based on the component space through a second rendering process to obtain a second test result of the first voxel; and determining the second voxel in the first voxel based on the second test result.

[0066] After determining the first voxel, the component space affected by each of the aforementioned volumetric components can be further determined. For example, if there is an indoor volumetric component, then the component space mentioned above refers to the indoor space. After determining the component space, a second rendering process, such as backface rendering, can be used to perform a second rendering of the component space. Finally, using a stencil test method, the second voxel within the virtual camera's field of view can be determined from the first voxel. Since there are spatial regions in the game scene that are not affected by the aforementioned volumetric components, and these spatial regions do not need to consider the influence of lighting rendering, the second voxel mentioned above can refer to the first voxel within the space affected by the corresponding volumetric component obtained after the second rendering process.

[0067] Optionally, obtaining the target voxel located in the same space as the volume component from the second voxel includes: obtaining voxel marking information of the second voxel and component marking information of the volume component, wherein the voxel marking information is used to characterize whether the second voxel is located in a preset space in the game scene, and the component marking information is used to characterize whether the volume component is located in a preset space in the game scene; if the voxel marking information and the component marking information are the same, the second voxel is determined to be the target voxel.

[0068] The aforementioned marking information can generally be used to represent the spatial location of voxels or volume components, such as indoors or outdoors. In an optional embodiment, since only game objects in the same space will have indirect light reflection, for example, only when game objects are all indoors can they influence each other's lighting, and game objects outdoors cannot influence game objects indoors, when determining the target voxel that will affect the lighting rendering of the game object to be rendered, the spatial information of each voxel in the second voxel, i.e., the aforementioned voxel marking information, and the spatial information of each volume component, i.e., the aforementioned component marking information, can be obtained first. Since indoor volume components can only affect indoor second voxels, and outdoor volume components can only affect outdoor second voxels, only when the voxel marking information and component marking information are the same can the voxel be determined to be a voxel that can affect the lighting rendering effect of the game object to be rendered, and the voxel is determined as the target voxel.

[0069] Continuing with the example of the virtual camera being located outside the study, if we want to perform lighting rendering on the indoor scene, we can first obtain the component marker information of the indoor volume component, which is marked as "indoor." Then, we obtain the voxel marker information of the second voxel. If the second voxel is on the potted plant, its marker information is "outdoor"; if the second voxel is on the table, its marker information is "indoor." Since only voxels whose voxel marker information matches the component marker information are affected by the corresponding volume component, only the second voxel on the table can be used as the target voxel in this scene, while the second voxel on the potted plant cannot be used as the target voxel at this time.

[0070] In one optional embodiment, the method for spatially marking the second voxel can be either actively set during the construction of the volume component, or it can be automatically marked by using ray-detection physical collision. It should be noted that, to avoid light leakage issues in the constructed game scene, ray-detection physical collision can be used to automatically mark the voxels while simultaneously checking for the aforementioned light leakage problem in the game scene.

[0071] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solutions of this disclosure, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this disclosure.

[0072] This embodiment also provides an apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0073] Figure 4 This is a structural block diagram of an apparatus according to one embodiment of the present disclosure, which provides a graphical user interface through a terminal device. The content displayed by the graphical user interface includes a touch area, such as... Figure 4As shown, the device includes: a component acquisition module 402, used to acquire multiple volume components located within the field of view of a virtual camera in a game scene; a voxel determination module 404, used to determine a target voxel that meets the rendering conditions corresponding to the volume component from multiple voxels in the game scene; a weight value determination module 406, used to determine the blending weight value of the target voxel based on the priority and attribute parameters of the volume components, wherein the blending weight value of other voxels besides the target voxel among the multiple voxels is a first preset value; and a rendering module 408, used to perform lighting rendering on scene objects in the game scene based on the blending weight values ​​of multiple voxels.

[0074] Optionally, the component acquisition module 302 includes: a first determining unit, configured to determine a first voxel from a plurality of voxels that is not occluded by scene objects in the game scene; a second determining unit, configured to determine a second voxel from the first voxel that is located in the volume space of the volume component; and a first acquisition unit, configured to acquire a target voxel from the second voxel that is located in the same space as the volume component.

[0075] Optionally, the first determining unit is further configured to: perform depth testing on multiple voxels through a first rendering process to obtain a first test result for the multiple voxels, wherein the first test result is used to characterize whether the voxel is occluded by a scene object; and determine a first voxel from the multiple voxels based on the first test result.

[0076] Optionally, the second determining unit is further configured to: determine the component space corresponding to the volume component; test the first voxel based on the component space through the second rendering process to obtain a second test result of the first voxel; and determine the second voxel in the first voxel based on the second test result.

[0077] Optionally, the first acquisition unit is further configured to: acquire voxel marking information of the second voxel and component marking information of the volume component, wherein the voxel marking information is used to characterize whether the second voxel is located in a preset space in the game scene, and the component marking information is used to characterize whether the volume component is located in a preset space in the game scene; if the voxel marking information and the component marking information are the same, the second voxel is determined to be the target voxel.

[0078] Optionally, the weight determination module includes: a third determination unit, used to determine the target attribute parameters corresponding to the current cycle in multiple iterations from the attribute parameters of the volume components according to the priority of the volume components, wherein the multiple iterations correspond one-to-one with multiple volume components; a second acquisition unit, used to acquire the first weight value of the target voxel, wherein the first weight value is used to characterize the mixed weight value or the first preset value corresponding to the previous cycle; a fourth determination unit, used to determine the second weight value of the target voxel based on the target attribute parameters; and a fifth determination unit, used to determine the mixed weight value corresponding to the current cycle based on the first weight value and the second weight value.

[0079] Optionally, the blending weight values ​​are stored in a preset channel of the target voxel, and the preset channel is stored in an on-chip cache.

[0080] Optionally, the fifth determining unit is further configured to: obtain a third weight value of the target voxel, wherein the third weight value is used to characterize the remaining weight value or the second preset value corresponding to the previous cycle; obtain the difference between the third weight value and the first weight value to obtain a weight difference value, wherein the weight difference value is used to characterize the remaining weight value corresponding to the current cycle; if the weight difference value is less than or equal to the second weight value, determine the weight difference value as a mixed weight value; if the weight difference value is greater than the second weight value, determine the second weight value as a mixed weight value.

[0081] Optionally, the fourth determining unit is further configured to: determine a second weight value of the target voxel based on the target attribute parameters when the first weight value is less than the second preset value; and stop determining the second weight value of the target voxel based on the target attribute parameters when the second weight value is greater than or equal to the first preset value.

[0082] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to these: all the above-mentioned units and modules are located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.

[0083] Embodiments of this disclosure also provide a computer-readable storage medium storing a computer program configured to perform the steps in any of the above method embodiments when executed.

[0084] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0085] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0086] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0087] S1: Obtain multiple volumetric components within the virtual camera's field of view in the game scene;

[0088] S2: Determine the target voxel that meets the rendering conditions corresponding to the volume component from multiple voxels in the game scene;

[0089] S3: Based on the priority and attribute parameters of the volume components, determine the mixing weight value of the target voxel, wherein the mixing weight value of the other voxels besides the target voxel among the multiple voxels is a first preset value;

[0090] S4: Based on the mixed weight values ​​of multiple voxels, perform lighting rendering on scene objects in the game scene.

[0091] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining a first voxel from a plurality of voxels that is not occluded by scene objects in the game scene; determining a second voxel from the first voxel that is located in the volume space of the volume component; and obtaining a target voxel from the second voxel that is located in the same space as the volume component.

[0092] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: performing a depth test on multiple voxels through a first rendering process to obtain a first test result for the multiple voxels, wherein the first test result is used to characterize whether the voxels are occluded by scene objects; and determining a first voxel from the multiple voxels based on the first test result.

[0093] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the component space corresponding to the volume component; testing the first voxel based on the component space through a second rendering process to obtain a second test result of the first voxel; and determining a second voxel in the first voxel based on the second test result.

[0094] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining voxel marking information of a second voxel and component marking information of a volume component, wherein the voxel marking information is used to characterize whether the second voxel is located within a preset space in the game scene, and the component marking information is used to characterize whether the volume component is located within a preset space in the game scene; and if the voxel marking information and the component marking information are the same, determining the second voxel as the target voxel.

[0095] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the target attribute parameter corresponding to the current loop in a multi-loop process from the attribute parameters of the volume components according to the priority of the volume components, wherein the multi-loop process corresponds one-to-one with multiple volume components; obtaining a first weight value of the target voxel, wherein the first weight value is used to characterize the mixed weight value or a first preset value corresponding to the previous loop; determining a second weight value of the target voxel based on the target attribute parameter; and determining the mixed weight value corresponding to the current loop based on the first weight value and the second weight value.

[0096] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: the mixed weight value is stored in a preset channel of the target voxel, and the preset channel is stored in an on-chip cache.

[0097] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining a third weight value of the target voxel, wherein the third weight value is used to characterize the remaining weight value or a second preset value corresponding to the previous loop; obtaining the difference between the third weight value and the first weight value to obtain a weight difference value, wherein the weight difference value is used to characterize the remaining weight value corresponding to the current loop; determining the weight difference value as a mixed weight value when the weight difference value is less than or equal to the second weight value; and determining the second weight value as a mixed weight value when the weight difference value is greater than the second weight value.

[0098] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: if the first weight value is less than the second preset value, determining a second weight value of the target voxel based on the target attribute parameters; if the second weight value is greater than or equal to the first preset value, stopping the determination of the second weight value of the target voxel based on the target attribute parameters.

[0099] In at least some embodiments of this disclosure, a method is employed to acquire multiple volumetric components located within the field of view of a virtual camera in a game scene; determine a target voxel from multiple voxels in the game scene that satisfies the rendering conditions corresponding to the volumetric components; determine the blending weight value of the target voxel based on the priority and attribute parameters of the volumetric components; and perform lighting rendering on scene objects in the game scene based on the blending weight values ​​of multiple voxels. This method utilizes volumetric components that can be acquired within the field of view of the virtual camera and are located in the same space as the volumetric components to be rendered to render the target voxel, which greatly improves rendering efficiency. Furthermore, the method determines the blending weight of each volumetric component to the target voxel based on the priority and attribute parameters of the volumetric components, and then uses the blending weight to perform lighting rendering on scene objects, making the final rendered lighting effect more consistent with the real scene. This solves the technical problem in related technologies where the rendering effect is poor when using multiple light sources to perform lighting rendering on a single volumetric component.

[0100] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0101] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of this disclosure may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps according to the various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.

[0102] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present disclosure is not limited thereto. In the embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0103] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0104] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0105] Embodiments of this disclosure also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0106] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0107] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0108] S1: Obtain multiple volumetric components within the virtual camera's field of view in the game scene;

[0109] S2: Determine the target voxel that meets the rendering conditions corresponding to the volume component from multiple voxels in the game scene;

[0110] S3: Based on the priority and attribute parameters of the volume components, determine the mixing weight value of the target voxel, wherein the mixing weight value of the other voxels besides the target voxel among the multiple voxels is a first preset value;

[0111] S4: Based on the mixed weight values ​​of multiple voxels, perform lighting rendering on scene objects in the game scene.

[0112] Optionally, the processor may also be configured to perform the following steps via a computer program: determining a first voxel from a plurality of voxels that is not occluded by scene objects in the game scene; determining a second voxel from the first voxel that is located in the volume space of the volume component; and obtaining a target voxel from the second voxel that is located in the same space as the volume component.

[0113] Optionally, the processor may also be configured to perform the following steps via a computer program: perform depth testing on multiple voxels through a first rendering process to obtain a first test result for the multiple voxels, wherein the first test result is used to characterize whether the voxels are occluded by scene objects; and determine a first voxel from the multiple voxels based on the first test result.

[0114] Optionally, the processor may also be configured to perform the following steps via a computer program: determine the component space corresponding to the volume component; test the first voxel based on the component space through a second rendering process to obtain a second test result of the first voxel; and determine the second voxel in the first voxel based on the second test result.

[0115] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining voxel marking information of the second voxel and component marking information of the volume component, wherein the voxel marking information is used to characterize whether the second voxel is located within a preset space in the game scene, and the component marking information is used to characterize whether the volume component is located within a preset space in the game scene; if the voxel marking information and the component marking information are the same, the second voxel is determined to be the target voxel.

[0116] Optionally, the processor may also be configured to perform the following steps via a computer program: determining the target attribute parameters corresponding to the current loop in multiple loops from the attribute parameters of the volume components according to the priority of the volume components, wherein the multiple loops correspond one-to-one with multiple volume components; obtaining the first weight value of the target voxel, wherein the first weight value is used to characterize the mixed weight value or the first preset value corresponding to the previous loop; determining the second weight value of the target voxel based on the target attribute parameters; and determining the mixed weight value corresponding to the current loop based on the first weight value and the second weight value.

[0117] Optionally, the processor described above may also be configured to perform the following steps via a computer program: storing the mixed weight values ​​in a preset channel of the target voxel, the preset channel being stored in an on-chip cache.

[0118] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining a third weight value of the target voxel, wherein the third weight value is used to characterize the remaining weight value or a second preset value corresponding to the previous cycle; obtaining the difference between the third weight value and the first weight value to obtain a weight difference value, wherein the weight difference value is used to characterize the remaining weight value corresponding to the current cycle; determining the weight difference value as a mixed weight value if the weight difference value is less than or equal to the second weight value; and determining the second weight value as a mixed weight value if the weight difference value is greater than the second weight value.

[0119] Optionally, the processor may also be configured to perform the following steps via a computer program: if the first weight value is less than the second preset value, determine the second weight value of the target voxel based on the target attribute parameters; if the second weight value is greater than or equal to the first preset value, stop determining the second weight value of the target voxel based on the target attribute parameters.

[0120] In at least some embodiments of this disclosure, a method is employed to acquire multiple volumetric components located within the field of view of a virtual camera in a game scene; determine a target voxel from multiple voxels in the game scene that satisfies the rendering conditions corresponding to the volumetric components; determine the blending weight value of the target voxel based on the priority and attribute parameters of the volumetric components; and perform lighting rendering on scene objects in the game scene based on the blending weight values ​​of multiple voxels. This method utilizes volumetric components that can be acquired within the field of view of the virtual camera and are located in the same space as the volumetric components to be rendered to render the target voxel, which greatly improves rendering efficiency. Furthermore, the method determines the blending weight of each volumetric component to the target voxel based on the priority and attribute parameters of the volumetric components, and then uses the blending weight to perform lighting rendering on scene objects, making the final rendered lighting effect more consistent with the real scene. This solves the technical problem in related technologies where the rendering effect is poor when using multiple light sources to perform lighting rendering on a single volumetric component.

[0121] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0122] like Figure 5 As shown, the electronic device 500 is presented in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to: at least one processor 510, at least one memory 520, a bus 530 connecting different system components (including memory 520 and processor 510), and a display 550.

[0123] The memory 520 stores program code that can be executed by the processor 510, causing the processor 510 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of this disclosure.

[0124] The memory 520 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 5201 and / or cache memory 5202, and may further include read-only memory (ROM) 5203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0125] In some instances, memory 520 may also include programs / utilities 5205 having a set (at least one) of program modules 5205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 520 may further include memory remotely located relative to processor 510, which can be connected to electronic device 500 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0126] Bus 530 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 510, or a local bus using any of the various bus structures.

[0127] Display 550 may be, for example, a touch screen liquid crystal display (LCD) that allows a user to interact with the user interface of electronic device 500.

[0128] Optionally, the electronic device 500 can also communicate with one or more external devices 600 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 550. Furthermore, the electronic device 500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 560. Figure 5 As shown, network adapter 560 communicates with other modules of electronic device 500 via bus 530. It should be understood that, although... Figure 5 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0129] The aforementioned electronic device 500 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0130] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 500 may also include components that are more... Figure 5 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 520 can be used to store computer programs and corresponding data, such as the computer program and corresponding data for the volumetric component-based lighting rendering method in this embodiment. The processor 510 executes various functional applications and data processing by running the computer program stored in the memory 520, thereby implementing the aforementioned volumetric component-based lighting rendering method.

[0131] The sequence numbers of the embodiments disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0132] In the above embodiments of this disclosure, 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.

[0133] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0134] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0135] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0136] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0137] The above are merely preferred embodiments of this disclosure. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this disclosure, and these improvements and modifications should also be considered within the scope of protection of this disclosure.

Claims

1. A lighting rendering method based on volumetric components, characterized in that, include: Acquire multiple volumetric components within the field of view of a virtual camera in a game scene, wherein the multiple volumetric components are used to simulate the indirect light reflection effect between different game objects in the game scene; From multiple voxels in the game scene, a target voxel that satisfies the rendering conditions corresponding to the volume component is determined, wherein the target voxel is used to represent a voxel on the scene object that is not occluded and is within the volume space corresponding to the volume component under the viewpoint corresponding to the virtual camera. Based on the priority and attribute parameters of the volume components, the mixing weight value of the target voxel is determined, wherein the mixing weight value of the other voxels among the plurality of voxels besides the target voxel is a first preset value. Lighting rendering is performed on scene objects in the game scene based on the mixed weight values ​​of multiple voxels.

2. The method according to claim 1, characterized in that, Determining the target voxel that satisfies the rendering conditions corresponding to the volume component from multiple voxels in the game scene includes: From the plurality of voxels, determine the first voxel that is not occluded by scene objects in the game scene; Determine a second voxel located in the volume space of the volume component from the first voxel; Obtain the target voxel located in the same space as the volume component from the second voxel.

3. The method according to claim 2, characterized in that, Determining the first voxel from the plurality of voxels that is not occluded by scene objects in the game scene includes: A depth test is performed on multiple voxels through a first rendering process to obtain a first test result for multiple voxels, wherein the first test result is used to characterize whether the voxel is occluded by the scene object. Based on the first test result, the first voxel is determined from the plurality of voxels.

4. The method according to claim 2, characterized in that, Determining a second voxel located in the volume space of the volume assembly from the first voxel includes: Determine the component space corresponding to the volume component; The first voxel is tested based on the component space through the second rendering process to obtain the second test result of the first voxel; Based on the second test results, the second voxel in the first voxel is determined.

5. The method according to claim 2, characterized in that, Obtaining the target voxel located in the same space as the volume component from the second voxel includes: Obtain the voxel marker information of the second voxel and the component marker information of the volume component, wherein the voxel marker information is used to characterize whether the second voxel is located within a preset space in the game scene, and the component marker information is used to characterize whether the volume component is located within the preset space in the game scene; If the voxel marking information is the same as the component marking information, the second voxel is determined to be the target voxel.

6. The method according to claim 1, characterized in that, Based on the priority and attribute parameters of the volume components, the mixing weight value of the target voxel is determined, including: According to the priority of the volume components, the target attribute parameters corresponding to the current loop in the multiple looping process are determined from the attribute parameters of the volume components. The multiple looping process corresponds one-to-one with multiple volume components. Obtain the first weight value of the target voxel, wherein the first weight value is used to characterize the mixed weight value or the first preset value corresponding to the previous cycle; Determine the second weight value of the target voxel based on the target attribute parameters; Based on the first weight value and the second weight value, the mixed weight value corresponding to this cycle is determined.

7. The method according to claim 6, characterized in that, The hybrid weight value is stored in a preset channel of the target voxel, and the preset channel is stored in an on-chip cache.

8. The method according to claim 6, characterized in that, Based on the first weight value and the second weight value, the mixed weight value corresponding to this cycle is determined, including: Obtain the third weight value of the target voxel, wherein the third weight value is used to characterize the remaining weight value or the second preset value corresponding to the previous cycle; The difference between the third weight value and the first weight value is obtained to obtain the weight difference value, wherein the weight difference value is used to characterize the remaining weight value corresponding to the current cycle; If the weight difference is less than or equal to the second weight value, the weight difference is determined to be the mixed weight value; If the weight difference is greater than the second weight value, the second weight value is determined to be the mixed weight value.

9. The method according to claim 6, characterized in that, Determining the second weight value of the target voxel based on the target attribute parameters includes: If the first weight value is less than the second preset value, the second weight value of the target voxel is determined based on the target attribute parameters; If the second weight value is greater than or equal to the first preset value, stop determining the second weight value of the target voxel based on the target attribute parameter.

10. A lighting rendering apparatus based on volumetric components, characterized in that, include: The component acquisition module is used to acquire multiple volumetric components located within the field of view of the virtual camera in the game scene, wherein the multiple volumetric components are used to simulate the indirect light reflection effect between different game objects in the game scene; A voxel determination module is used to determine a target voxel that satisfies the rendering conditions corresponding to the volume component from multiple voxels in the game scene, wherein the target voxel is used to characterize a voxel that is not occluded on the scene object and is within the volume space corresponding to the volume component under the viewpoint corresponding to the virtual camera. The weight value determination module is used to determine the mixed weight value of the target voxel based on the priority and attribute parameters of the volume component, wherein the mixed weight value of the other voxels among the plurality of voxels besides the target voxel is a first preset value. The rendering module is used to perform lighting rendering on scene objects in the game scene based on the mixed weight values ​​of multiple voxels.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the volumetric component-based lighting rendering method as described in any one of claims 1 to 9 when run by a processor.

12. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the volumetric component-based lighting rendering method as described in any one of claims 1 to 9.