A picture rendering method and device, computer equipment and storage medium

By acquiring the ambient occlusion parameters of the virtual 3D scene, the impact of global illumination on subspace lighting within the virtual camera's field of view is determined, unnecessary lighting and shadow rendering is disabled, solving the problem of excessive computational resources and memory bandwidth consumption when rendering shadows in the shadow map, and improving the rendering efficiency of the virtual 3D scene.

CN116485988BActive Publication Date: 2026-11-20BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310410164.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2026-11-20
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

When using shadow maps to render shadows in a virtual 3D scene, the virtual 3D scene needs to be rendered multiple times, resulting in excessive consumption of computing resources and memory bandwidth.

Method used

By acquiring the ambient occlusion parameters of the virtual 3D scene, it is determined whether global illumination has a lighting effect on the subspace within the virtual camera's field of view. When global illumination does not have a lighting effect, the lighting and shadow rendering effects are turned off to reduce unnecessary computation and memory consumption.

Benefits of technology

It significantly reduces the overhead of shadow calculation during game runtime, reduces the pressure on memory bandwidth, and improves the lighting and shadow rendering efficiency of virtual 3D scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116485988B_ABST
    Figure CN116485988B_ABST
Patent Text Reader

Abstract

The present disclosure provides a picture rendering method and device, computer equipment and a storage medium, wherein the method comprises: obtaining an ambient light occlusion parameter of a virtual three-dimensional scene; wherein the ambient light occlusion parameter is used to describe the lighting condition of a subspace in the virtual three-dimensional scene under global lighting; a plurality of subspaces are formed by the virtual three-dimensional scene according to a preset size; based on the ambient light occlusion parameter, it is determined whether the global lighting has an illumination effect on a first target subspace within the field of view of a virtual camera; in response to the global lighting not having an illumination effect on the first target subspace, the light and shadow rendering effect of the global lighting is turned off.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer graphics processing technology, and more specifically, to a screen rendering method, apparatus, computer device, and storage medium. Background Technology

[0002] Shadow mapping is a commonly used method for generating real-time shadows, typically used to generate shadows cast by lighting in a virtual 3D scene during rendering. Rendering shadows using shadow mapping requires multiple renderings of the virtual 3D scene, each consuming significant computational resources and memory bandwidth. Summary of the Invention

[0003] This disclosure provides at least one screen rendering method, apparatus, computer device, and storage medium.

[0004] In a first aspect, embodiments of this disclosure provide a screen rendering method, including:

[0005] Obtain ambient occlusion parameters of a virtual 3D scene; wherein, the ambient occlusion parameters are used to describe the lighting conditions of subspaces in the virtual 3D scene under global illumination; multiple subspaces are formed by dividing the virtual 3D scene according to a preset size;

[0006] Based on the ambient light occlusion parameters, determine whether the global illumination has a lighting effect on the first target subspace within the virtual camera's field of view;

[0007] In response to the fact that the global illumination does not have a lighting effect on the first target subspace, the lighting and shadow rendering effects of the global illumination are turned off.

[0008] In this way, by using the ambient occlusion parameters of the virtual 3D scene, it is determined whether global illumination has a lighting effect on the first target subspace within the field of view of the virtual camera; if global illumination does not have a lighting effect on the first target subspace, the lighting and shadow rendering effect of global illumination is turned off, thereby turning off the shadows caused by global illumination in a timely manner, so as to significantly reduce the overhead of shadow calculation and sampling during game runtime and reduce the pressure on memory bandwidth.

[0009] In one possible implementation, the ambient occlusion parameters include: ambient occlusion values ​​corresponding to each of the multiple subspaces; determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient occlusion parameters includes:

[0010] From the ambient light occlusion parameters, determine the target ambient occlusion value corresponding to the first target subspace located within the field of view of the virtual camera;

[0011] Based on the value of the target environment occlusion, it is determined whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0012] In one possible implementation, determining the target ambient occlusion value corresponding to the first target subspace located within the virtual camera's field of view from the ambient occlusion parameters includes:

[0013] Based on the pose of the virtual camera in the virtual 3D scene and the camera parameters, candidate subspaces within the camera's field of view are determined from multiple subspaces.

[0014] The candidate subspaces are subjected to line-of-sight occlusion removal processing to obtain the first target subspace;

[0015] The target ambient occlusion value corresponding to the first target subspace is selected from the ambient light occlusion parameters.

[0016] In one possible implementation, determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view, based on the value of the target environment occlusion value, includes:

[0017] Traverse the target environment occlusion values ​​corresponding to each of the first target subspaces, and determine whether the traversed target environment occlusion values ​​meet a first preset condition; wherein, when the target environment occlusion value meets the first preset condition, it indicates that the corresponding first target subspace is not affected by the global illumination;

[0018] If the target environment occlusion value corresponding to all first target subspaces meets the first preset condition, then it is determined that the global illumination does not have an illumination effect on the first target subspace within the field of view of the virtual camera.

[0019] If the target environment occlusion value corresponding to any first target subspace does not meet the first preset condition, then it is determined that the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0020] In one possible implementation, before obtaining the ambient occlusion parameters of the virtual 3D scene, the method further includes:

[0021] Determine whether the movement information of the virtual camera in the virtual 3D scene meets the target movement conditions; the target movement conditions include at least one of the following: the movement distance of the virtual camera in the virtual 3D scene is greater than or equal to a preset distance; the rotation angle of the virtual camera in the virtual 3D scene is greater than or equal to a preset angle;

[0022] The acquisition of ambient occlusion parameters of the virtual 3D scene includes:

[0023] In response to the virtual camera's movement information in the virtual 3D scene satisfying the target movement condition, the ambient light occlusion parameters of the virtual 3D scene are obtained.

[0024] It is not necessary to perform the detection process described in the first aspect for every frame of the image, which saves the overhead of initiating the detection process for each frame of the image, and further reduces the computational overhead required in the rendering of the virtual 3D scene.

[0025] In one possible implementation, before determining whether the global illumination has a lighting effect on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters, the method further includes:

[0026] Based on the ambient light occlusion parameters, determine whether multiple second target subspaces adjacent to the location of the virtual camera are all affected by the global illumination;

[0027] The step of determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters includes:

[0028] If a preset number of second target subspaces are not affected by the global illumination, then based on the ambient light occlusion parameters, it is determined whether the global illumination has an illumination effect on the first target subspace within the virtual camera's field of view.

[0029] This further reduces the time required for the detection process, allowing for faster activation or deactivation of global illumination rendering and improving the rendering effect of virtual 3D scenes.

[0030] In one possible implementation, the method further includes:

[0031] In response to the fact that the second target subspace is affected by the global illumination, the lighting and shadow rendering effect of the global illumination is enabled.

[0032] In one possible implementation, determining whether each second target subspace corresponding to the location of the virtual camera is affected by the global illumination based on the ambient light occlusion parameters includes:

[0033] Based on the position of the virtual camera in the virtual 3D scene, the second target subspace is determined from the multiple subspaces;

[0034] For each second target subspace, determine whether the environmental occlusion value corresponding to each second target subspace meets the second preset condition;

[0035] If the second preset condition is not met, then it is determined that the second target subspace is affected by the global illumination.

[0036] Secondly, embodiments of this disclosure also provide a screen rendering apparatus, comprising:

[0037] An acquisition module is used to acquire ambient light occlusion parameters of a virtual 3D scene; wherein, the ambient light occlusion parameters are used to describe the lighting conditions of subspaces in the virtual 3D scene under global illumination; and multiple subspaces are formed by dividing the virtual 3D scene according to a preset size;

[0038] The determination module is used to determine, based on the ambient light occlusion parameters, whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera;

[0039] The control module is used to disable the lighting and shadow rendering effects of the global illumination in response to the fact that the global illumination does not have a lighting effect on the first target subspace.

[0040] In one possible implementation, the ambient occlusion parameters include: ambient occlusion values ​​corresponding to each of the multiple subspaces; the determining module, when determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient occlusion parameters, is used to:

[0041] From the ambient light occlusion parameters, determine the target ambient occlusion value corresponding to the first target subspace located within the field of view of the virtual camera;

[0042] Based on the value of the target environment occlusion, it is determined whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0043] In one possible implementation, the determining module, when determining the target ambient occlusion value corresponding to the first target subspace located within the virtual camera's field of view from the ambient light occlusion parameters, is configured to:

[0044] Based on the pose of the virtual camera in the virtual 3D scene and the camera parameters, candidate subspaces within the camera's field of view are determined from multiple subspaces.

[0045] The candidate subspaces are subjected to line-of-sight occlusion removal processing to obtain the first target subspace;

[0046] The target ambient occlusion value corresponding to the first target subspace is selected from the ambient light occlusion parameters.

[0047] In one possible implementation, the determining module, when determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the value of the target environment occlusion value, is configured to:

[0048] Traverse the target environment occlusion values ​​corresponding to each of the first target subspaces, and determine whether the traversed target environment occlusion values ​​meet a first preset condition; wherein, when the target environment occlusion value meets the first preset condition, it indicates that the corresponding first target subspace is not affected by the global illumination;

[0049] If the target environment occlusion value corresponding to all first target subspaces meets the first preset condition, then it is determined that the global illumination does not have an illumination effect on the first target subspace within the field of view of the virtual camera.

[0050] If the target environment occlusion value corresponding to any first target subspace does not meet the first preset condition, then it is determined that the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0051] In one possible implementation, it further includes: a first detection module, configured to determine whether the movement information of the virtual camera in the virtual 3D scene satisfies target movement conditions; the target movement conditions include at least one of the following: the movement distance of the virtual camera in the virtual 3D scene is greater than or equal to a preset distance; the rotation angle of the virtual camera in the virtual 3D scene is greater than or equal to a preset angle;

[0052] The acquisition module, when acquiring the ambient light occlusion parameters of the virtual 3D scene, is used for:

[0053] In response to the virtual camera's movement information in the virtual 3D scene satisfying the target movement condition, the ambient light occlusion parameters of the virtual 3D scene are obtained.

[0054] In one possible implementation, it further includes: a second detection module, which determines, based on the ambient light occlusion parameters, whether multiple second target subspaces adjacent to the location of the virtual camera are all affected by the global illumination;

[0055] The determining module, when determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters, is used to:

[0056] If a preset number of second target subspaces are not affected by the global illumination, then based on the ambient light occlusion parameters, it is determined whether the global illumination has an illumination effect on the first target subspace within the virtual camera's field of view.

[0057] In one possible implementation, the control module is further configured to:

[0058] In response to the fact that the second target subspace is affected by the global illumination, the lighting and shadow rendering effect of the global illumination is enabled.

[0059] In one possible implementation, the second detection module, when determining whether each second target subspace corresponding to the location of the virtual camera is affected by the global illumination based on the ambient light occlusion parameters, is used to:

[0060] Based on the position of the virtual camera in the virtual 3D scene, the second target subspace is determined from the multiple subspaces;

[0061] For each second target subspace, determine whether the environmental occlusion value corresponding to each second target subspace meets the second preset condition;

[0062] If the second preset condition is not met, then it is determined that the second target subspace is affected by the global illumination.

[0063] Thirdly, an optional implementation of this disclosure also provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible implementation of the first aspect, are performed.

[0064] Fourthly, an optional implementation of this disclosure also provides a computer-readable storage medium storing a computer program that, when run, performs the steps of the first aspect or any possible implementation of the first aspect.

[0065] For a description of the effects of the aforementioned rendering device, computer equipment, and computer-readable storage medium, please refer to the description of the rendering method above; it will not be repeated here.

[0066] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0067] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0068] Figure 1 A flowchart illustrating a screen rendering method provided in some embodiments of this disclosure is shown;

[0069] Figure 2 The illustration shows a top view of some embodiments of the present disclosure, illustrating the division of a virtual three-dimensional scene into multiple subspaces.

[0070] Figure 3 A top view schematic diagram illustrating the determination of a first target subspace among multiple subspaces provided in some embodiments of this disclosure is shown;

[0071] Figure 4 A top view schematic diagram illustrating the determination of a second target subspace among multiple subspaces provided by some embodiments of the present disclosure is shown;

[0072] Figure 5 The present disclosure illustrates specific examples of how the CPU and GPU work together to achieve image rendering, as provided in some embodiments of the present disclosure.

[0073] Figure 6 A schematic diagram of a screen rendering apparatus provided in some embodiments of the present disclosure is shown;

[0074] Figure 7 A schematic diagram of a computer device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0075] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown herein can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0076] When rendering shadows using a shadow map, a virtual camera needs to be set up at the location of the light source. From the perspective of this virtual camera, the virtual 3D scene is rendered to obtain a depth map. The pixel value of each pixel in this depth map represents the depth value of the projection point corresponding to that pixel relative to the virtual camera. When rendering the virtual 3D scene from the perspective of the main camera (user's viewing perspective), this depth map is used to determine the shadow intensity corresponding to each projection point in the virtual 3D scene observed through the main camera, thus achieving the rendering of light and shadow in the virtual 3D scene from the main camera's perspective. This rendering process requires rendering the virtual 3D scene multiple times; that is, rendering the virtual 3D scene both at the light source location and from the main camera's perspective. If there are multiple light sources in the virtual 3D scene, the virtual 3D scene needs to be rendered for each light source. Each rendering of the virtual 3D scene consumes a significant amount of computing resources and memory bandwidth. Furthermore, the generated depth map also requires additional storage space, which further increases memory usage.

[0077] Specifically, virtual 3D scenes typically include global illumination (GA), which provides overall lighting for the entire scene. Therefore, regardless of the virtual camera's pose, lighting and shadow rendering of the virtual 3D scene is required based on GA. Furthermore, virtual 3D scenes may also include point light sources that only illuminate local areas. Therefore, when the virtual camera is in an area where point light sources do not provide illumination, lighting and shadow rendering for those point light sources is unnecessary. It is evident that lighting and shadow rendering based on GA is a significant factor consuming the computational resources and memory bandwidth required in the lighting and shadow rendering process.

[0078] Based on the above research, this disclosure provides a method for rendering virtual 3D scenes. By utilizing the AO information of global illumination in the virtual 3D scene, the shadows caused by global illumination are turned off in some scenes where global illumination does not produce an effect, such as indoor game scenes, thereby significantly reducing the shadow calculation overhead during game runtime and reducing the pressure on memory bandwidth.

[0079] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.

[0080] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0081] To facilitate understanding of this embodiment, a detailed description of the screen rendering method disclosed in this disclosure is provided first. The execution subject of the screen rendering method provided in this disclosure is generally a computer device with a certain computing capability. This computer device may include, for example, a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, etc. In some possible implementations, the screen rendering method can be implemented by a processor calling computer-readable instructions stored in memory.

[0082] It should be noted that the image rendering method provided in this disclosure can be applied to any process of rendering a virtual 3D scene, such as rendering 3D game scenes, virtual 3D communities, virtual reality (VR) scenes, etc. Taking a 3D game scene as an example, the 3D game scene may include, for example, third-person shooter games, first-person shooter games, role-playing games, action games, strategy games, fighting games, sports games, adventure games, etc., without specific limitations.

[0083] The following uses the rendering of a 3D game scene (hereinafter referred to as the game scene) as an example to illustrate the image rendering method provided in this disclosure. To facilitate understanding of the technical solution of this disclosure, the technical terms used in the embodiments of this disclosure are first explained:

[0084] The main light in a game, also known as the scene main light, is the primary light source responsible for illumination in a game scene. It's typically a light source that simulates the sun or another major light source, responsible for illuminating and casting shadows on most objects in the scene. The lighting it produces is often referred to as global illumination.

[0085] Global illumination is a technique used to calculate how light travels through a scene to simulate real-world lighting effects. It is commonly used to create more realistic and lifelike lighting effects in game scenes.

[0086] Ambient occlusion (AO) parameters are used to simulate the occlusion and scattering effects of light in a scene. In computer graphics, AO parameters control the shadow density and color variations of object surfaces in a scene, making the shadow effects on object surfaces more realistic.

[0087] See Figure 1 The diagram shows a flowchart of a screen rendering method provided in an embodiment of this disclosure. The method includes steps S101 to S103, wherein:

[0088] S101: Obtain ambient occlusion parameters of the virtual 3D scene; wherein, the ambient occlusion parameters are used to describe the lighting conditions of subspaces in the virtual 3D scene under global illumination; the multiple subspaces are formed by the virtual 3D scene according to a preset size.

[0089] In practice, the process of rendering virtual scene images is a collaborative effort between the Central Processing Unit (CPU) and the Graphics Processing Unit (GPU). Taking game scene rendering as an example, the CPU runs the game engine, passing various data needed to render the game scene images to the GPU. After acquiring the relevant data, the GPU renders the game scene images based on that data. Among the various data required for rendering game scene images are the lighting information of various light sources in the virtual scene, such as the number of light sources, their positions, and the direction of global illumination. After acquiring the lighting information, the GPU uses it to render the virtual 3D scene with light and shadow.

[0090] When a GPU uses lighting information to render shadows in a virtual 3D scene, if it uses a shadow map, it renders a depth map for each light source in the virtual 3D scene. Then, using Screen Space Ambient Occlusion (SSAO) or an AO algorithm, it calculates the AO parameters of the virtual 3D space under lighting based on the depth information contained in the depth map. Finally, it uses these AO parameters to render the shadows in the virtual 3D scene.

[0091] Furthermore, when obtaining the ambient occlusion parameters of a virtual 3D scene, for example, the AO parameters corresponding to the current image frame to be rendered can be obtained on the GPU. These AO parameters are generated by the GPU and stored in the target memory space during the rendering of the current image frame. The GPU can directly obtain the ambient occlusion parameters by reading the target memory space.

[0092] The virtual 3D scene is divided into multiple subspaces according to a certain size. The size of each subspace is, for example, 2 meters * 2 meters * 2 meters. Alternatively, the subspaces can be determined to have other sizes according to the application needs of the virtual 3D scene. This embodiment does not limit the size. The AO parameter includes the ambient occlusion value corresponding to each subspace, i.e., the AO value. The ambient occlusion value corresponding to each subspace is, for example, a floating-point value, and its value range is, for example, from 0 to 1. When the AO value is 0, it means that the subspace corresponding to the AO value is not affected by the light. The larger the AO value, the higher the degree of light influence the subspace corresponding to the AO value receives.

[0093] Following the above S101, the image rendering method provided in this embodiment further includes:

[0094] S102: Based on the ambient light occlusion parameters, determine whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0095] In practical implementation, virtual 3D scenes may include buildings or terrain features (such as caves) that are enclosed or semi-enclosed. When the virtual camera is located in these enclosed or semi-enclosed scenes, global illumination may not produce any lighting effects. In such cases, the lighting and shadow rendering effects of global illumination can be turned off.

[0096] Therefore, when determining whether the global illumination has a lighting effect on the first target subspace within the virtual camera's field of view based on ambient light occlusion parameters, the following method can be used, for example:

[0097] From the ambient light occlusion parameters, determine the target ambient occlusion value corresponding to the first target subspace located within the field of view of the virtual camera;

[0098] Based on the value of the target environment occlusion, it is determined whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0099] In practice, the field of view of a virtual camera is, for example, the area within a virtual scene that can be seen through the virtual camera. This area is affected by the virtual camera's view frustum and the degree of occlusion.

[0100] Specifically, the ambient occlusion parameters include: ambient occlusion values ​​corresponding to the multiple subspaces included in the virtual 3D scene; and the ambient occlusion value corresponding to each subspace, which is used to describe the lighting conditions of each subspace under global illumination.

[0101] The target ambient occlusion value corresponding to the first target subspace within the virtual camera's field of view can be determined from the ambient occlusion parameters using the following method:

[0102] Based on the pose of the virtual camera in the virtual 3D scene and the camera parameters, candidate subspaces within the camera's field of view are determined from multiple subspaces.

[0103] The candidate subspaces are subjected to line-of-sight occlusion removal processing to obtain the first target subspace;

[0104] The target ambient occlusion value corresponding to the first target subspace is selected from the ambient light occlusion parameters.

[0105] The view frustum of a virtual camera, for example, is a cone-shaped space with the optical center of the camera as its axis. It is the shape of the area that the virtual camera can see when rendering. The position of the view frustum in the virtual 3D scene is related to the pose of the virtual camera and the parameters of the virtual camera. The position of the view frustum of the virtual camera in the virtual 3D scene can be determined by the pose of the virtual camera and the camera parameters of the virtual camera.

[0106] Then, based on the position of the view frustum in the virtual 3D scene, and the positions of the multiple subspaces into which the virtual scene is divided, candidate subspaces within the camera's view frustum are determined from among the multiple subspaces. Here, if only a portion of a subspace is within the camera's view frustum, it is also considered a candidate subspace within the camera's view frustum.

[0107] like Figure 2 The example shown illustrates a top-down view of a virtual 3D scene divided into multiple subspaces; a virtual camera, such as... Figure 2 As shown in s1, the determined range of the view frustum is shown in s2. The determined candidate subspaces within the camera's view frustum range are as follows: Figure 2 As shown in s3.

[0108] After identifying the candidate subspaces within the camera's view frustum, occlusion culling is performed on these candidate subspaces; that is, candidate subspaces obscured by other objects in the virtual 3D scene are removed. For example... Figure 3 The example shown illustrates the first target subspace within the virtual camera's field of view after line-of-sight occlusion culling of the candidate subspaces. Figure 3 As shown in s4, at this time, the comparison Figure 2 and Figure 3 It can be seen that some of the candidate subspaces within the camera's field of view are blocked by the wall. After these blocked candidate subspaces are eliminated, the remaining unblocked candidate subspaces are the first target subspace.

[0109] The ambient occlusion value corresponding to the first target subspace is the target ambient occlusion value.

[0110] It is important to note here that... Figure 2 and Figure 3 In the context of virtual 3D scenes, the gaps between adjacent subspaces are merely for distinguishing them; in reality, there are no gaps between adjacent subspaces in the multiple subspaces into which the virtual 3D scene is divided.

[0111] After obtaining the target environment occlusion value, the target environment occlusion value corresponding to each of the first target subspaces can be traversed to determine whether the traversed target environment occlusion value meets the first preset condition; wherein, when the target environment occlusion value meets the first preset condition, it indicates that the corresponding first target subspace is not affected by the global illumination.

[0112] If the target environment occlusion value corresponding to all first target subspaces meets the first preset condition, then it is determined that the global illumination does not have an illumination effect on the first target subspace within the field of view of the virtual camera.

[0113] If the target environment occlusion value corresponding to any first target subspace does not meet the first preset condition, then it is determined that the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0114] The first preset condition includes, for example, the target environment occlusion value being equal to a preset value.

[0115] Here, the default value is, for example, 0. Furthermore, depending on the range of ambient occlusion values, other values ​​may be used for the default value.

[0116] For example, the range of the ambient occlusion value is [a, b]. When the ambient occlusion value is 'a', it indicates that the subspace corresponding to that occlusion value is not affected by illumination. A larger AO value indicates a higher degree of illumination influence on the subspace corresponding to that AO value. In this case, the preset value can be set to 'a'.

[0117] Furthermore, if the target environment occlusion value corresponding to any target subspace is not equal to the preset value, the result of the global illumination affecting the first target subspace within the field of view of the virtual camera can be directly obtained, and the remaining untraced target environment occlusion values ​​will no longer be traversed.

[0118] S103: In response to the fact that the global illumination does not have a lighting effect on the first target subspace, the lighting and shadow rendering effect of the global illumination is turned off.

[0119] In a specific implementation, the result of whether global illumination affects the first target subspace can be written into a 1*1 pixel texture map; this texture map includes only one pixel; for example, if the pixel value of this pixel is 0, it indicates that global illumination has not affected the first target subspace; if the pixel value of this pixel is 1, it indicates that global illumination has affected the first target subspace. Then, the texture map is read back on the CPU; if the pixel value of the pixel in the texture map read by the CPU is 0, the lighting and shadow rendering effect of global illumination is turned off on the CPU side. At this time, when the CPU passes the relevant parameters of the image to be rendered to the GPU, it will no longer pass the lighting parameters of global illumination to the GPU; at this time, when the GPU renders the image to be rendered in this frame, it will no longer perform lighting and shadow rendering based on global illumination, thereby reducing the computing resources and memory bandwidth required in the lighting and shadow rendering process. If the CPU reads a pixel value of 1 from the texture, it controls the global illumination lighting and shadow rendering effect to be enabled. At this time, when the CPU passes the relevant parameters of the image to be rendered to the GPU, it will pass the global illumination lighting parameters to the GPU. When the GPU renders the image to be rendered, it will perform lighting and shadow rendering based on global illumination, thereby ensuring that the lighting and shadow effects of global illumination can be rendered in the image to be rendered in that frame.

[0120] It's important to note that when global illumination's lighting and shadow rendering effects are turned off or on, the CPU doesn't necessarily actually execute the off or on logic. After receiving the texture map from the GPU, the CPU matches the on or off signal represented by the pixel value of the pixel in the texture map with the on / off state of the global illumination's lighting and shadow rendering effects at the current moment. If the two don't match, the CPU will execute the off or on logic; if they match, the CPU will not execute the off or on logic.

[0121] In another embodiment of this disclosure, before obtaining the ambient occlusion parameters of the virtual 3D scene, the method further includes:

[0122] Determine whether the movement information of the virtual camera in the virtual 3D scene meets the target movement conditions; the target movement conditions include at least one of the following: the movement distance of the virtual camera in the virtual 3D scene is greater than or equal to a preset distance; the rotation angle of the virtual camera in the virtual 3D scene is greater than or equal to a preset angle;

[0123] At this time, S101 may include, for example, obtaining the ambient light occlusion parameters of the virtual three-dimensional scene in response to the virtual camera's movement information in the virtual three-dimensional scene satisfying the target movement condition.

[0124] In practical implementation, when the movement information of the virtual camera in the virtual 3D scene meets the target movement condition, the first target subspace within the field of view of the virtual camera is likely to change from a state unaffected by global illumination to a state affected by global illumination, or from a state affected by global illumination to a state unaffected by global illumination. Therefore, the detection process as described in S101 to S103 can only be executed when the movement information of the virtual 3D scene meets the target movement condition. This allows the GPU to avoid performing the detection process as described in S101 to S103 for each frame of image, saving the overhead of initiating the detection process as described in S101 to S103 for each frame of image, and further reducing the computational overhead required in the rendering process of the virtual 3D scene.

[0125] Here, with the subspace dimensions of 2 meters * 2 meters * 2 meters, the aforementioned preset distance can be set to, for example, 2 meters. The aforementioned preset angle can be set to, for example, 5° to 10°, and can be set according to actual needs; this embodiment does not limit the specific setting.

[0126] In another embodiment of this disclosure, before determining whether the global illumination has a lighting effect on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters, the method further includes:

[0127] Based on the ambient light occlusion parameters, determine whether multiple second target subspaces adjacent to the location of the virtual camera are all affected by the global illumination;

[0128] The step of determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters includes:

[0129] If a preset number of second target subspaces are not affected by the global illumination, then based on the ambient light occlusion parameters, it is determined whether the global illumination has an illumination effect on the first target subspace within the virtual camera's field of view.

[0130] In specific implementation, the second target subspace adjacent to the location of the virtual camera may include, for example, eight subspaces centered on the location of the virtual camera that are closest to the center and can form a cube. Specifically, the target subspace where the virtual camera is located can be determined based on the location of the virtual camera. Then, from the other adjacent subspaces of the target subspace, the other seven subspaces that are closest to the virtual camera and can form a cube with the target subspace can be determined. The determined target subspace and the seven other subspaces are used as the second target subspace.

[0131] like Figure 4The example shown illustrates a top-view schematic diagram of determining a second target subspace among multiple subspaces, wherein the second target subspace includes, for example, […]. Figure 4 Multiple subspaces within the region defined by s5. Here, due to this Figure 4 This is a top view, therefore Figure 4 Only a portion of the second target subspace is shown in the diagram.

[0132] Then, the ambient occlusion values ​​corresponding to the second target subspaces are determined from the ambient light occlusion parameters. For each second target subspace, it is determined whether the ambient occlusion value corresponding to each second target subspace meets a second preset condition; if it does not meet the second preset condition, it is determined that the second target subspace is affected by the global illumination. Here, the second preset condition includes, for example, that the ambient occlusion value corresponding to the second target subspace is greater than a preset value; the meaning of the preset value here is similar to the meaning of the preset value corresponding to the first preset condition mentioned above, and will not be repeated here.

[0133] If at least one second target subspace is not affected by global illumination, it means that the first target subspace within the virtual camera's field of view may also not be affected by global illumination. Therefore, in this case, based on the ambient light occlusion parameter, it will be determined whether the global illumination has an illumination effect on the first target subspace within the virtual camera's field of view.

[0134] If all second target subspaces are affected by the global illumination, then due to the propagation characteristics of light, the first target subspace within the virtual camera's field of view is also very likely affected by the global illumination. Therefore, in this case, the lighting and shadow rendering effect of the global illumination will be enabled.

[0135] This further reduces the time required for S102, allowing the CPU to receive the relevant signals for enabling or disabling global illumination rendering from the GPU more quickly, thus improving the rendering effect of virtual 3D scenes.

[0136] This embodiment of the disclosure uses the ambient occlusion parameters of the virtual 3D scene to determine whether global illumination has a lighting effect on the first target subspace within the field of view of the virtual camera; if global illumination does not have a lighting effect on the first target subspace, the lighting and shadow rendering effect of global illumination is turned off, thereby turning off the shadows caused by global illumination in a timely manner, so as to significantly reduce the shadow calculation overhead during game runtime and reduce the pressure on memory bandwidth.

[0137] like Figure 5 As shown, this disclosure also provides a specific example of CPU and GPU working together to implement the screen rendering method of this disclosure, including:

[0138] S501: The GPU obtains the ambient occlusion parameters of the t-th frame.

[0139] S502: The GPU determines the target environment occlusion value corresponding to the first target subspace located within the virtual camera's field of view from the ambient occlusion parameters. That is, occlusion culling is performed, and the target environment occlusion values ​​of each first target subspace located within the camera's field of view are retained from the AO data.

[0140] S503: The GPU iterates through the target environment occlusion value to determine whether global illumination can be blocked. If yes, it jumps to S501; otherwise, it jumps to S504. In other words, it determines whether global illumination affects the lighting of the first target subspace within the virtual camera's field of view. If it does, global illumination cannot be blocked, and the process jumps to S501 to continue the judgment process for frame t+1. If it does not, global illumination can be blocked, and the process jumps to S504.

[0141] S504: The GPU transmits the detection result of frame t to the CPU. Before the CPU generates frame t+n, it reads back the result of frame t sent by the GPU. Here, the detection result indicates that global illumination needs to be disabled. Since it takes a certain amount of time for the GPU and CPU to transmit the detection result of frame t, and the CPU has already sent the rendering parameters of frames t+1 to t+n-1 to the GPU during this period, the CPU cannot disable global illumination for frames t+1 to t+n-1. Instead, it can only disable global illumination in S505 below, before determining the rendering parameters for frame t+n.

[0142] S505: At frame t+n, the CPU disables global illumination. That is, when determining the rendering parameters for frame t+n, the CPU no longer considers the impact of global illumination on the rendering of the frame t+n, and the lighting parameters corresponding to global illumination are no longer part of the rendering parameters.

[0143] Here, if the CPU reads back the detection result indicating that global illumination needs to be enabled before determining the rendering parameters for frame t+n+m, then global illumination is enabled before determining the rendering parameters for frame t+n+m.

[0144] Based on the above process, the lighting and shadow rendering effects of global illumination can be turned off when global illumination does not have a lighting effect, and then turned on when global illumination has a lighting effect again, thereby significantly reducing the shadow calculation overhead during game runtime and reducing the pressure on memory bandwidth.

[0145] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0146] Based on the same inventive concept, this disclosure also provides a screen rendering device corresponding to the screen rendering method. Since the principle of the device in this disclosure for solving the problem is similar to the screen rendering method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0147] Reference Figure 6 The diagram shown is a schematic representation of a screen rendering apparatus provided in an embodiment of this disclosure. The apparatus includes:

[0148] The acquisition module 61 is used to acquire ambient light occlusion parameters of a virtual 3D scene; wherein, the ambient light occlusion parameters are used to describe the lighting conditions of subspaces in the virtual 3D scene under global illumination; and the multiple subspaces are formed by dividing the virtual 3D scene according to a preset size.

[0149] The determination module 62 is used to determine, based on the ambient light occlusion parameters, whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera;

[0150] Control module 63 is used to disable the lighting and shadow rendering effects of global illumination in response to the fact that global illumination does not have a lighting effect on the first target subspace.

[0151] In one possible implementation, the ambient occlusion parameters include: ambient occlusion values ​​corresponding to the plurality of subspaces respectively; the determining module 62, when determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient occlusion parameters, is used to:

[0152] From the ambient light occlusion parameters, determine the target ambient occlusion value corresponding to the first target subspace located within the field of view of the virtual camera;

[0153] Based on the value of the target environment occlusion, it is determined whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0154] In one possible implementation, the ambient light occlusion parameter includes: ambient occlusion values ​​corresponding to the multiple subspaces included in the virtual 3D scene;

[0155] The determining module 62, when determining the target environment occlusion value corresponding to the first target subspace located within the virtual camera's field of view from the ambient light occlusion parameters, is used to:

[0156] Based on the pose of the virtual camera in the virtual 3D scene and the camera parameters, candidate subspaces within the camera's field of view are determined from multiple subspaces.

[0157] The candidate subspaces are subjected to line-of-sight occlusion removal processing to obtain the first target subspace;

[0158] The target ambient occlusion value corresponding to the first target subspace is selected from the ambient light occlusion parameters.

[0159] In one possible implementation, the determining module 62, when determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the value of the target environment occlusion value, is used to:

[0160] Traverse the target environment occlusion values ​​corresponding to each of the first target subspaces, and determine whether the traversed target environment occlusion values ​​meet a first preset condition; wherein, when the target environment occlusion value meets the first preset condition, it indicates that the corresponding first target subspace is not affected by the global illumination;

[0161] If the target environment occlusion value corresponding to all first target subspaces meets the first preset condition, then it is determined that the global illumination does not have an illumination effect on the first target subspace within the field of view of the virtual camera.

[0162] If the target environment occlusion value corresponding to any first target subspace does not meet the first preset condition, then it is determined that the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

[0163] In one possible implementation, it further includes: a first detection module 64, configured to determine whether the movement information of the virtual camera in the virtual 3D scene satisfies the target movement condition; the target movement condition includes at least one of the following: the movement distance of the virtual camera in the virtual 3D scene is greater than or equal to a preset distance; the rotation angle of the virtual camera in the virtual 3D scene is greater than or equal to a preset angle;

[0164] The acquisition module 61, when acquiring the ambient light occlusion parameters of the virtual 3D scene, is used for:

[0165] In response to the virtual camera's movement information in the virtual 3D scene satisfying the target movement condition, the ambient light occlusion parameters of the virtual 3D scene are obtained.

[0166] In one possible implementation, it further includes: a second detection module 65, which determines, based on ambient light occlusion parameters, whether multiple second target subspaces adjacent to the location of the virtual camera are all affected by the global illumination;

[0167] The determining module 62, when determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters, is used to:

[0168] If a preset number of second target subspaces are not affected by the global illumination, then based on the ambient light occlusion parameters, it is determined whether the global illumination has an illumination effect on the first target subspace within the virtual camera's field of view.

[0169] In one possible implementation, the control module 63 is further configured to:

[0170] In response to the fact that the second target subspace is affected by the global illumination, the lighting and shadow rendering effect of the global illumination is enabled.

[0171] In one possible implementation, the second detection module 65, when determining whether each second target subspace corresponding to the location of the virtual camera is affected by the global illumination based on the ambient light occlusion parameters, is used to:

[0172] Based on the position of the virtual camera in the virtual 3D scene, the second target subspace is determined from the multiple subspaces;

[0173] For each second target subspace, determine whether the environmental occlusion value corresponding to each second target subspace meets the second preset condition;

[0174] If the second preset condition is not met, then it is determined that the second target subspace is affected by the global illumination.

[0175] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0176] This disclosure also provides a computer device, such as... Figure 7 The diagram shown is a schematic representation of a computer device structure provided in an embodiment of this disclosure, including:

[0177] A processor 71 and a memory 72; the memory 72 stores machine-readable instructions executable by the processor 71, and the processor 71 executes the machine-readable instructions stored in the memory 72. When the machine-readable instructions are executed by the processor 71, the processor 71 performs the following steps:

[0178] Obtain ambient occlusion parameters of a virtual 3D scene; wherein, the ambient occlusion parameters are used to describe the lighting conditions of multiple subspaces under global illumination; the multiple subspaces are formed by dividing the virtual 3D scene according to a preset size;

[0179] Based on the ambient light occlusion parameters, determine whether the global illumination has a lighting effect on the first target subspace within the virtual camera's field of view;

[0180] In response to the fact that the global illumination does not have a lighting effect on the first target subspace, the lighting and shadow rendering effects of the global illumination are turned off.

[0181] The aforementioned memory 72 includes a main memory 721 and an external memory 722; the main memory 721, also known as internal memory, is used to temporarily store the computational data in the processor 71, as well as the data exchanged with external memory 722 such as a hard disk. The processor 71 exchanges data with the external memory 722 through the main memory 721.

[0182] The specific execution process of the above instructions can be referred to the steps of the screen rendering method described in the embodiments of this disclosure, and will not be repeated here.

[0183] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the screen rendering method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0184] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the screen rendering method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0185] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0186] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and computer equipment can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatus, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of apparatus or units may be electrical, mechanical, or other forms.

[0187] 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 network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0188] In addition, 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.

[0189] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, 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 a portion 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 described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0190] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for rendering images, characterized in that, include: Obtain ambient occlusion parameters of a virtual 3D scene; wherein, the ambient occlusion parameters are used to describe the lighting conditions of subspaces in the virtual 3D scene under global illumination; the multiple subspaces are formed by dividing the virtual 3D scene according to a preset size; Based on the ambient light occlusion parameters, determine whether the global illumination has a lighting effect on the first target subspace within the virtual camera's field of view; In response to the fact that the global illumination does not have a lighting effect on the first target subspace, the lighting and shadow rendering effects of the global illumination are turned off.

2. The image rendering method according to claim 1, characterized in that, The ambient occlusion parameters include: ambient occlusion values ​​corresponding to each of the multiple subspaces; determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient occlusion parameters includes: From the ambient light occlusion parameters, determine the target ambient occlusion value corresponding to the first target subspace located within the field of view of the virtual camera; Based on the value of the target environment occlusion, it is determined whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

3. The image rendering method according to claim 2, characterized in that, Determining the target environment occlusion value corresponding to the first target subspace located within the virtual camera's field of view from the ambient light occlusion parameters includes: Based on the pose of the virtual camera in the virtual 3D scene and the camera parameters, candidate subspaces within the camera's field of view are determined from multiple subspaces. The candidate subspaces are subjected to line-of-sight occlusion removal processing to obtain the first target subspace; The target ambient occlusion value corresponding to the first target subspace is selected from the ambient light occlusion parameters.

4. The image rendering method according to claim 2 or 3, characterized in that, The step of determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view, based on the value of the target environment occlusion, includes: Traverse the target environment occlusion values ​​corresponding to each of the first target subspaces, and determine whether the traversed target environment occlusion values ​​meet a first preset condition; wherein, when the target environment occlusion value meets the first preset condition, it indicates that the corresponding first target subspace is not affected by the global illumination; If the target environment occlusion value corresponding to all first target subspaces meets the first preset condition, then it is determined that the global illumination does not have an illumination effect on the first target subspace within the field of view of the virtual camera. If the target environment occlusion value corresponding to any first target subspace does not meet the first preset condition, then it is determined that the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera.

5. The image rendering method according to any one of claims 1-3, characterized in that, Before obtaining the ambient occlusion parameters of the virtual 3D scene, the process also includes: Determine whether the movement information of the virtual camera in the virtual 3D scene meets the target movement conditions; the target movement conditions include at least one of the following: the movement distance of the virtual camera in the virtual 3D scene is greater than or equal to a preset distance; the rotation angle of the virtual camera in the virtual 3D scene is greater than or equal to a preset angle; The acquisition of ambient occlusion parameters of the virtual 3D scene includes: In response to the virtual camera's movement information in the virtual 3D scene satisfying the target movement condition, the ambient light occlusion parameters of the virtual 3D scene are obtained.

6. The image rendering method according to any one of claims 1-3, characterized in that, Before determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters, the method further includes: Based on the ambient light occlusion parameters, determine whether multiple second target subspaces adjacent to the location of the virtual camera are all affected by the global illumination; The step of determining whether the global illumination has an illumination impact on the first target subspace within the virtual camera's field of view based on the ambient light occlusion parameters includes: If a preset number of second target subspaces are not affected by the global illumination, then based on the ambient light occlusion parameters, it is determined whether the global illumination has an illumination effect on the first target subspace within the virtual camera's field of view.

7. The image rendering method according to claim 6, characterized in that, The method further includes: In response to the fact that the second target subspace is affected by the global illumination, the lighting and shadow rendering effect of the global illumination is enabled.

8. The image rendering method according to claim 6, characterized in that, The step of determining whether each second target subspace corresponding to the location of the virtual camera is affected by the global illumination based on the ambient light occlusion parameters includes: Based on the position of the virtual camera in the virtual 3D scene, the second target subspace is determined from the multiple subspaces; For each second target subspace, determine whether the environmental occlusion value corresponding to each second target subspace meets the second preset condition; If the second preset condition is not met, then it is determined that the second target subspace is affected by the global illumination.

9. A screen rendering device, characterized in that, include: An acquisition module is used to acquire ambient light occlusion parameters of a virtual 3D scene; wherein, the ambient light occlusion parameters are used to describe the lighting conditions of subspaces in the virtual 3D scene under global illumination; and multiple subspaces are formed by dividing the virtual 3D scene according to a preset size; The determination module is used to determine, based on the ambient light occlusion parameters, whether the global illumination has an illumination effect on the first target subspace within the field of view of the virtual camera; The control module is used to disable the lighting and shadow rendering effects of the global illumination in response to the fact that the global illumination does not have a lighting effect on the first target subspace.

10. A computer device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, the processor executing the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the processor performing the steps of the screen rendering method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer device, performs the steps of the screen rendering method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Rendering display method and device, computer equipment and storage medium

    CN114385289A

  • Ambient light shielding processing method, device and equipment

    CN114832375A