Lighting rendering method and system, electronic device and storage medium

CN117710570BActive Publication Date: 2026-10-27SHANGHAI MIHOYO TIANMING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311748165.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2026-10-27
Estimated Expiration
2043-12-18

AI Technical Summary

Technical Problem

但是,由于场景中探针的数量众多,若同时针对所有探针进行更新,势必会导致开销过大,进而影响光照渲染的效果

Benefits of technology

[0190]在本公开的实施例中,能够动态确定与虚拟场景中的目标渲染区域相对应的待更新探针,以便根据待更新探针的探针调用方式,对待更新探针进行更新处理,以根据待更新探针中更新后的光照数据进行光照渲染操作。。由此可见,在该方式中,虚拟场景中的待更新探针是根据当前渲染需求动态确定的,因而能够实现按需更新的效果,避免针对渲染过程中不会用到的探针进行不必要的更新所导致的资源浪费问题。并且,由于待更新探针的更新处理方式是根据探针调用方式确定的,因而便于针对不同的探针调用方式的特点灵活配置不同的更新处理方式,从而兼顾渲染效果以及更新开销。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117710570B_ABST
    Figure CN117710570B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of image display, and specifically discloses a light rendering method and system, an electronic device and a storage medium. The method comprises: dynamically determining a to-be-updated probe corresponding to a target rendering area in a virtual scene; wherein the to-be-updated probe is a probe called in a rendering process of the target rendering area; and performing update processing on the to-be-updated probe according to a probe calling mode of the to-be-updated probe, so as to perform a light rendering operation according to updated light data in the to-be-updated probe. In this way, the update mode of the probe can be determined according to the calling mode of the probe, so that on-demand update of the probe can be realized, different update modes can be configured for different probes, the operation overhead of probe update and the requirements of scene light rendering can be considered, and thus better rendering effects can be realized with lower update overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image display, specifically to a lighting rendering method, system, electronic device, and storage medium. Background Technology

[0002] A light probe is a virtual object placed in a scene (such as a game scene) to collect lighting information received from various directions in the scene. This lighting information is then applied to objects within the rendered scene, thus affecting their lighting effects. Since lighting information in a scene may change dynamically, the probes placed in the scene need to be updated dynamically.

[0003] In related technologies, all probes in the scene are updated using the same method. However, due to the large number of probes in the scene, updating all probes simultaneously would inevitably lead to excessive overhead, thus affecting the lighting rendering effect. Summary of the Invention

[0004] In view of the above problems, this disclosure is made in order to provide a lighting rendering method, system, electronic device and storage medium that overcomes or at least partially solves the above problems.

[0005] According to one aspect of the present disclosure, a lighting rendering method is provided, comprising:

[0006] Dynamically determine the probe to be updated corresponding to the target rendering area in the virtual scene; wherein, the probe to be updated is the probe that is invoked during the rendering process of the target rendering area;

[0007] According to the probe invocation method of the probe to be updated, the probe to be updated is updated so as to perform lighting rendering operation based on the updated lighting data in the probe to be updated.

[0008] In one optional implementation, updating the probe to be updated according to its probe invocation method includes:

[0009] If the probe to be updated is invoked via a direct invocation method, the probe is updated according to the direct probe update strategy; and / or,

[0010] If the probe to be updated is invoked in an indirect manner, the probe to be updated is updated according to the indirect probe update strategy.

[0011] In one optional implementation, upon receiving a direct probe invocation instruction, the probe invocation method of the probe to be updated is determined to be a direct invocation method; upon receiving an indirect probe invocation instruction, the probe invocation method of the probe to be updated is determined to be an indirect invocation method.

[0012] The direct probe invocation instruction includes: a probe invocation instruction associated with the lighting rendering operation of the target rendering area;

[0013] The indirect probe invocation instruction includes: a probe invocation instruction associated with a ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

[0014] In one optional implementation, the update frequency of the direct probe update strategy is greater than the update frequency of the indirect probe update strategy; the update frequency is used to characterize the probe update frequency and / or update number.

[0015] The update budget of the direct probe update strategy is greater than the update budget of the indirect probe update strategy, and the update budget is used to characterize the performance budget required during the probe update process;

[0016] The probe lifetime of the direct probe update strategy is less than that of the indirect probe update strategy. The probe lifetime is used to characterize the duration for which the probe to be updated is in an active state.

[0017] In one alternative implementation, the update budget is determined based on the number of rays to be solved required during the probe update process, and / or the intersection tracking distance of the rays to be solved;

[0018] Furthermore, the number of light rays to be solved under the direct probe update strategy is greater than the number of light rays to be solved under the indirect probe update strategy, and / or the intersection tracking distance of the light rays to be solved under the direct probe update strategy is less than the intersection tracking distance of the light rays to be solved under the indirect probe update strategy.

[0019] In one optional implementation, the number of probes to be updated is multiple, and before updating the probes according to their probe invocation methods, the method further includes:

[0020] If the sum of the update budgets of multiple probes to be updated exceeds a preset budget upper limit threshold, the update budgets of the multiple probes to be updated are adjusted so that the sum of the adjusted update budgets of the multiple probes to be updated does not exceed the budget upper limit threshold.

[0021] The preset budget upper limit threshold is determined based on computing performance parameters; and the computing performance parameters include at least one of the following: device-type computing performance parameters determined based on device parameters, network-type computing performance parameters determined based on network parameters, and resource-type computing performance parameters determined based on system resource occupancy.

[0022] In one optional implementation, the step of updating the probe to be updated according to the direct probe update strategy includes:

[0023] For the ray to be solved during the probe update process, if it is determined, based on the ray tracing algorithm and the symbolic distance field, that there is no ray intersection point corresponding to the ray to be solved within the preset tracing distance, the ray calculation result of the ray to be solved is calculated based on the illumination information of the position point on the ray to be solved corresponding to the preset tracing distance.

[0024] In one optional implementation, if there is a ray intersection point corresponding to the ray to be solved within a preset tracking distance, the probe adjacent to the ray intersection point is determined as the probe to be updated corresponding to the first type of indirect probe update strategy.

[0025] If there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the position point corresponding to the preset tracking distance is determined as the probe to be updated corresponding to the second type of indirect probe update strategy;

[0026] The update budget for the second type of indirect probe update strategy is greater than the update budget for the first type of indirect probe update strategy.

[0027] In one optional implementation, the method is applied to a virtual game scene, and the update process for the probe to be updated includes:

[0028] The probe to be updated is updated based on the direct lighting information in the virtual game scene;

[0029] The direct lighting information in the virtual game scene is determined based on the main light source information corresponding to the clock data in the virtual game scene; wherein the main light source information changes dynamically with the day-night changes of the clock data.

[0030] In one optional implementation, the number of probes to be updated corresponding to the target rendering area in the virtual scene is multiple, and the updated lighting data in the multiple probes to be updated is obtained in the following way:

[0031] Identify the multiple elements contained in the target rendering area;

[0032] The probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table.

[0033] Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier in the second-level hash table; wherein, the probe grid identifier is used to characterize the probe grid where the probe is located, and the probe grid identifier is used to characterize the grid position of the probe in the probe grid, and a probe grid includes multiple grid positions.

[0034] Based on the secondary hash identifiers of the multiple probe grid identifiers after deduplication stored in the secondary hash table, the updated illumination data in the probe to be updated corresponding to the multiple probe grid identifiers is obtained.

[0035] In one optional implementation, before updating the probe to be updated, the method further includes:

[0036] Obtain the initial grid point position of the probe to be updated in the probe grid;

[0037] If the symbol distance field value at the initial grid point position does not meet the preset condition, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset condition.

[0038] The preset conditions include: the symbol distance field value of the initial grid point position is a positive number that is greater than a preset threshold.

[0039] According to one aspect of the present disclosure, a lighting rendering system is provided, comprising:

[0040] The dynamic determination module is adapted to dynamically determine the probe to be updated corresponding to the target rendering area in the virtual scene; wherein the probe to be updated is a probe that is invoked during the rendering process of the target rendering area;

[0041] The update rendering module is adapted to update the probe to be updated according to the probe calling method of the probe to be updated, so as to perform lighting rendering operation based on the updated lighting data in the probe to be updated.

[0042] According to another aspect of the present disclosure, a probe update method is provided, comprising:

[0043] The probes invoked in the virtual scene are identified as probes to be updated, and the update type of the probes to be updated is determined according to the probe invocation method.

[0044] Obtain the update strategy corresponding to the update type of the probe to be updated, and perform the probe update operation according to the update strategy.

[0045] In one optional implementation, determining the probes invoked in the virtual scene as probes to be updated, and determining the update type of the probes to be updated based on the probe invocation method, includes:

[0046] In response to a probe invocation command in the virtual scene, the probe corresponding to the probe invocation command is identified as the probe to be updated;

[0047] Determine the probe invocation method corresponding to the instruction type of the probe invocation instruction, and determine the update type of the probe to be updated based on the probe invocation method;

[0048] Wherein, when the instruction type of the probe call instruction is the direct call type, the probe call method corresponding to the instruction type of the probe call instruction is the direct call method, and the update type of the probe to be updated is the direct probe update type;

[0049] When the instruction type of the probe call instruction is an indirect call type, the probe call method corresponding to the instruction type of the probe call instruction is an indirect call method, and the update type of the probe to be updated is an indirect probe update type.

[0050] In one alternative implementation, the probe invocation instruction of the direct invocation type includes: a first probe invocation instruction associated with a lighting rendering operation; wherein the lighting rendering operation is used to perform lighting rendering on a region to be rendered in a virtual scene during the lighting rendering process;

[0051] The indirect call type probe call instruction includes: a second probe call instruction associated with a ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

[0052] In one optional implementation, the update strategy corresponding to the update type of the probe to be updated includes: a frequency-based update strategy and / or a budget-based update strategy.

[0053] The frequency-based update strategy is used to set the update frequency and / or probe lifetime of the probe to be updated.

[0054] The budget-based update strategy is used to set the probe update budget for the probe to be updated; wherein the probe update budget is determined based on the number of rays to be solved and / or the intersection tracking distance of the rays to be solved during the probe update process.

[0055] In one optional implementation, the update frequency of the direct probe update type is greater than the update frequency of the indirect probe update type, and / or the probe lifetime of the direct probe update type is less than the probe lifetime of the indirect probe update type.

[0056] Furthermore, the number of rays to be solved for the direct probe update type is greater than the number of rays to be solved for the indirect probe update type, and / or, the intersection tracking distance of the rays to be solved for the direct probe update type is less than the intersection tracking distance of the rays to be solved for the indirect probe update type.

[0057] In one optional implementation, after identifying the probes invoked in the virtual scene as probes to be updated, and determining the update type of the probes to be updated based on the probe invocation method, the method further includes:

[0058] Query the handle of the probe to be updated. If the status identifier stored in the handle is an inactive identifier, update the status identifier of the probe to be updated to an active identifier.

[0059] The probes whose status identifier is updated to the activation identifier are added to the probe initialization queue, so that the initialization operation is performed on the probes to be updated in the probe initialization queue.

[0060] In one optional implementation, performing initialization operations on the probes to be updated in the probe initialization queue includes:

[0061] For any probe to be updated in the probe initialization queue, obtain the initial grid position of the probe to be updated in the probe grid.

[0062] If the symbol distance field value at the initial grid point position does not meet the preset condition, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset condition.

[0063] The preset conditions include: the symbol distance field value of the initial grid point position is a positive number that is greater than a preset threshold.

[0064] In one optional implementation, after updating the status identifier of the probe to be updated to an activation identifier, the method further includes:

[0065] Set the probe lifetime value of the probe to be updated according to the update type of the probe to be updated;

[0066] The probe lifetime is stored in the handle of the probe to be updated; wherein the probe lifetime is used to characterize the duration during which the probe to be updated is in an active state.

[0067] In an optional implementation, the method further includes: adding the probe to a deletion queue when the probe lifetime value of any probe is detected to be a preset termination value;

[0068] Furthermore, after performing the probe update operation according to the update strategy, the method further includes: updating the status identifier stored in the handle of the probe in the deletion queue from an active identifier to an inactive identifier, and releasing the resources occupied by the probe.

[0069] In one optional implementation, before obtaining the update strategy corresponding to the update type of the probe to be updated, and before performing the probe update operation according to the update strategy, the method further includes:

[0070] Determine the probe update budget for the probe to be updated based on the update type of the probe to be updated;

[0071] Store the probe to be updated and its probe update budget in the probe update queue;

[0072] The step of obtaining the update strategy corresponding to the update type of the probe to be updated, and performing the probe update operation according to the update strategy, includes:

[0073] Based on the probe update budget of the probe to be updated stored in the probe update queue, the update strategy of the probe to be updated is determined, and the probe update operation is performed according to the update strategy.

[0074] In one optional implementation, determining the probe invoked in the virtual scene as the probe to be updated includes:

[0075] Probes invoked in the current frame and / or the previous frame are identified as probes to be updated, and an update flag is set for the probes to be updated; wherein, the update flag is deleted after the current frame is rendered, and the probe initialization queue and the probe update queue are cleared after the current frame is rendered.

[0076] Furthermore, before obtaining the update strategy corresponding to the update type of the probe to be updated, and before performing the probe update operation according to the update strategy, the method further includes:

[0077] According to the preset probe selection strategy, a preset number of probes are selected from multiple probes that have an activation flag but no update flag, and the preset number of probes are added to the probe update queue for dynamic updates.

[0078] In an optional implementation, after determining the probes invoked in the current frame and / or the previous frame as probes to be updated and setting an update flag for the probes to be updated, the method further includes:

[0079] For probes that have an activation flag set but no update flag set, update the probe's health value to reduce it.

[0080] In one optional implementation, after storing the probe to be updated and its probe update budget to the probe update queue, the method further includes:

[0081] Determine the sum of the probe update budgets for multiple probes to be updated in the probe update queue;

[0082] If the sum of the probe update budgets of the plurality of probes to be updated exceeds a preset budget upper limit threshold, the probe update budgets of the plurality of probes to be updated are adjusted so that the sum of the adjusted probe update budgets of the plurality of probes to be updated does not exceed the budget upper limit threshold.

[0083] In one optional implementation, the preset budget upper limit threshold is determined based on computational performance parameters; wherein the computational performance parameters include at least one of the following:

[0084] Device-related computing performance parameters determined based on device parameters, network-related computing performance parameters determined based on network parameters, and resource-related computing performance parameters determined based on system resource usage.

[0085] In one optional implementation, performing the probe update operation according to the update strategy includes:

[0086] The ray to be solved needs to be calculated during the probe update process is determined according to the update strategy described above;

[0087] When the update type of the probe to be updated is the direct probe update type, the existence of a ray intersection point corresponding to the ray to be solved within the preset tracking distance is determined according to the ray tracing algorithm and the symbolic distance field.

[0088] If so, the intersection point of the light rays corresponding to the light ray to be solved within the preset tracking distance is determined as the target intersection point;

[0089] If not, the position point on the ray to be solved that corresponds to the preset tracking distance is determined as the target intersection point;

[0090] Based on the illumination information of the target intersection point, the ray calculation result of the ray to be solved is calculated, and the illumination data of the probe to be updated is updated according to the ray calculation result of the ray to be solved.

[0091] In one optional implementation, the step of calculating the ray calculation result of the ray to be solved based on the illumination information of the target intersection point includes:

[0092] Identify the probe adjacent to the target intersection point, and send a second probe call command associated with the ray solving operation to the probe adjacent to the target intersection point to obtain the illumination data of the probe adjacent to the target intersection point;

[0093] Based on the illumination data of the probes adjacent to the intersection point with the target, the ray calculation result of the ray to be solved is calculated.

[0094] In one optional implementation, the indirect probe update type further includes: a first type of indirect probe update type and a second type of indirect probe update type;

[0095] After determining the probe adjacent to the target intersection point and sending a second probe invocation command associated with the ray solving operation to the probe adjacent to the target intersection point, the method further includes:

[0096] If there is a ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the target intersection point is determined as the probe to be updated of the first type of indirect probe update;

[0097] If there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the target intersection point is determined as the probe to be updated of the second type of indirect probe update.

[0098] The update budget for the second type of indirect probe update is greater than the update budget for the first type of indirect probe update.

[0099] In one optional implementation, the method is applied to a virtual game scene, and the step of calculating the ray calculation result of the ray to be solved based on the lighting information of the target intersection point includes:

[0100] Obtain the direct illumination information corresponding to the target intersection point, and calculate the ray calculation result of the ray to be solved based on the direct illumination information;

[0101] The direct illumination information corresponding to the target intersection point is determined based on the main light source information corresponding to the clock data in the virtual game scene; wherein, the main light source information changes dynamically with the day and night changes of the clock data.

[0102] According to another aspect of this disclosure, a lighting rendering method is provided, comprising:

[0103] Determine the area to be rendered in the virtual scene, and obtain the lighting data of the probe corresponding to the area to be rendered; wherein, the lighting data of the probe is updated according to the probe update method described above;

[0104] Based on the acquired illumination data from the probe, the area to be rendered is then illuminated.

[0105] In one optional implementation, obtaining the illumination data of the probe corresponding to the region to be rendered includes:

[0106] The process involves identifying multiple elements within the region to be rendered, obtaining the probe grid identifier corresponding to each element, performing deduplication on the multiple probe grid identifiers corresponding to multiple elements, and obtaining the illumination data of the corresponding probe based on the deduplicated probe grid identifiers.

[0107] In one optional implementation, obtaining the probe grid identifier corresponding to each element and performing deduplication processing on multiple probe grid identifiers corresponding to multiple elements includes:

[0108] The probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table.

[0109] Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier in the second-level hash table; wherein, the second-level hash table is used to store the second-level hash identifiers of multiple probe grid identifiers after deduplication.

[0110] The probe grid identifier is used to characterize the probe grid in which the probe is located, and the probe grid point identifier is used to characterize the grid point position of the probe in the probe grid. A probe grid includes multiple grid point positions.

[0111] In one optional implementation, determining the multiple elements contained in the region to be rendered and obtaining the probe grid identifier corresponding to each element includes:

[0112] A preset number of elements from the multiple elements contained in the area to be rendered are grouped into an element group, and a preset number of threads contained in the thread group are used to obtain the probe grid identifier corresponding to each element in parallel.

[0113] In one optional implementation, obtaining the illumination data of the probe corresponding to the region to be rendered includes:

[0114] Send a first probe invocation command associated with the lighting rendering operation to the probe corresponding to the region to be rendered, so as to obtain the lighting data of the probe corresponding to the region to be rendered;

[0115] Among them, the probe corresponding to the first probe call instruction is used as the probe to be updated, so as to be updated by the probe update method described above.

[0116] According to another aspect of this disclosure, a probe updating apparatus is provided, comprising:

[0117] The determination module is adapted to identify probes invoked in the virtual scene as probes to be updated, and to determine the update type of the probes to be updated based on the probe invocation method.

[0118] The update module is adapted to obtain an update strategy corresponding to the update type of the probe to be updated, and to perform a probe update operation according to the update strategy.

[0119] In one alternative implementation, the determining module is specifically adapted to:

[0120] In response to a probe invocation command in the virtual scene, the probe corresponding to the probe invocation command is identified as the probe to be updated;

[0121] Determine the probe invocation method corresponding to the instruction type of the probe invocation instruction, and determine the update type of the probe to be updated based on the probe invocation method;

[0122] Wherein, when the instruction type of the probe call instruction is the direct call type, the probe call method corresponding to the instruction type of the probe call instruction is the direct call method, and the update type of the probe to be updated is the direct probe update type;

[0123] When the instruction type of the probe call instruction is an indirect call type, the probe call method corresponding to the instruction type of the probe call instruction is an indirect call method, and the update type of the probe to be updated is an indirect probe update type.

[0124] In one alternative implementation, the probe invocation instruction of the direct invocation type includes: a first probe invocation instruction associated with a lighting rendering operation; wherein the lighting rendering operation is used to perform lighting rendering on a region to be rendered in a virtual scene during the lighting rendering process;

[0125] The indirect call type probe call instruction includes: a second probe call instruction associated with a ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

[0126] In one optional implementation, the update strategy corresponding to the update type of the probe to be updated includes: a frequency-based update strategy and / or a budget-based update strategy.

[0127] The frequency-based update strategy is used to set the update frequency and / or probe lifetime of the probe to be updated.

[0128] The budget-based update strategy is used to set the probe update budget for the probe to be updated; wherein the probe update budget is determined based on the number of rays to be solved and / or the intersection tracking distance of the rays to be solved during the probe update process.

[0129] In one optional implementation, the update frequency of the direct probe update type is greater than the update frequency of the indirect probe update type, and / or the probe lifetime of the direct probe update type is less than the probe lifetime of the indirect probe update type.

[0130] Furthermore, the number of rays to be solved for the direct probe update type is greater than the number of rays to be solved for the indirect probe update type, and / or, the intersection tracking distance of the rays to be solved for the direct probe update type is less than the intersection tracking distance of the rays to be solved for the indirect probe update type.

[0131] In one alternative implementation, the apparatus further includes:

[0132] An initialization module is used to query the handle of the probe to be updated, and if the status identifier stored in the handle is an inactive identifier, update the status identifier of the probe to be updated to an active identifier; add the probe to be updated with the status identifier updated to an active identifier to the probe initialization queue, so as to perform an initialization operation on the probe to be updated in the probe initialization queue.

[0133] In one alternative implementation, the initialization module is specifically used for:

[0134] For any probe to be updated in the probe initialization queue, obtain the initial grid position of the probe to be updated in the probe grid.

[0135] If the symbol distance field value at the initial grid point position does not meet the preset condition, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset condition.

[0136] The preset conditions include: the symbol distance field value of the initial grid point position is a positive number that is greater than a preset threshold.

[0137] In one alternative implementation, the initialization module is further configured to:

[0138] Set the probe lifetime value of the probe to be updated according to the update type of the probe to be updated;

[0139] The probe lifetime is stored in the handle of the probe to be updated; wherein the probe lifetime is used to characterize the duration during which the probe to be updated is in an active state.

[0140] In an optional implementation, the initialization module is further configured to: add the probe to the deletion queue when the probe lifetime value of any probe is detected to be a preset termination value;

[0141] Furthermore, the update module is also used to: update the status identifier stored in the handle of the probe in the deletion queue from an active identifier to an inactive identifier, and release the resources occupied by the probe.

[0142] In one alternative implementation, the update module is specifically used for:

[0143] Based on the update type of the probe to be updated, determine the probe update budget of the probe to be updated; store the probe to be updated and its probe update budget in the probe update queue.

[0144] Based on the probe update budget of the probe to be updated stored in the probe update queue, the update strategy of the probe to be updated is determined, and the probe update operation is performed according to the update strategy.

[0145] In one alternative implementation, the determining module is specifically used for:

[0146] Probes invoked in the current frame and / or the previous frame are identified as probes to be updated, and an update flag is set for the probes to be updated; wherein, the update flag is deleted after the current frame is rendered, and the probe initialization queue and the probe update queue are cleared after the current frame is rendered.

[0147] Furthermore, the update module is also used for:

[0148] According to the preset probe selection strategy, a preset number of probes are selected from multiple probes that have an activation flag but no update flag, and the preset number of probes are added to the probe update queue for dynamic updates.

[0149] In one alternative implementation, the determining module is further configured to:

[0150] For probes that have an activation flag set but no update flag set, update the probe's health value to reduce it.

[0151] In one alternative implementation, the update module is further configured to:

[0152] Determine the sum of the probe update budgets for multiple probes to be updated in the probe update queue;

[0153] If the sum of the probe update budgets of the plurality of probes to be updated exceeds a preset budget upper limit threshold, the probe update budgets of the plurality of probes to be updated are adjusted so that the sum of the adjusted probe update budgets of the plurality of probes to be updated does not exceed the budget upper limit threshold.

[0154] In one optional implementation, the preset budget upper limit threshold is determined based on computational performance parameters; wherein the computational performance parameters include at least one of the following:

[0155] Device-related computing performance parameters determined based on device parameters, network-related computing performance parameters determined based on network parameters, and resource-related computing performance parameters determined based on system resource usage.

[0156] In one alternative implementation, the update module is specifically used for:

[0157] The ray to be solved needs to be calculated during the probe update process is determined according to the update strategy described above;

[0158] When the update type of the probe to be updated is the direct probe update type, the existence of a ray intersection point corresponding to the ray to be solved within the preset tracking distance is determined according to the ray tracing algorithm and the symbolic distance field.

[0159] If so, the intersection point of the light rays corresponding to the light ray to be solved within the preset tracking distance is determined as the target intersection point;

[0160] If not, the position point on the ray to be solved that corresponds to the preset tracking distance is determined as the target intersection point;

[0161] Based on the illumination information of the target intersection point, the ray calculation result of the ray to be solved is calculated, and the illumination data of the probe to be updated is updated according to the ray calculation result of the ray to be solved.

[0162] In one alternative implementation, the update module is specifically used for:

[0163] Identify the probe adjacent to the target intersection point, and send a second probe call command associated with the ray solving operation to the probe adjacent to the target intersection point to obtain the illumination data of the probe adjacent to the target intersection point;

[0164] Based on the illumination data of the probes adjacent to the intersection point with the target, the ray calculation result of the ray to be solved is calculated.

[0165] In one optional implementation, the indirect probe update type further includes: a first type of indirect probe update type and a second type of indirect probe update type;

[0166] The update module is specifically used for:

[0167] If there is a ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the target intersection point is determined as the probe to be updated of the first type of indirect probe update;

[0168] If there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the target intersection point is determined as the probe to be updated of the second type of indirect probe update.

[0169] The update budget for the second type of indirect probe update is greater than the update budget for the first type of indirect probe update.

[0170] In one alternative implementation, the method is applied to a virtual game scene, and the update module is specifically used for:

[0171] Obtain the direct illumination information corresponding to the target intersection point, and calculate the ray calculation result of the ray to be solved based on the direct illumination information;

[0172] The direct illumination information corresponding to the target intersection point is determined based on the main light source information corresponding to the clock data in the virtual game scene; wherein, the main light source information changes dynamically with the day and night changes of the clock data.

[0173] According to another aspect of this disclosure, a lighting rendering apparatus is provided, comprising:

[0174] The acquisition module is adapted to determine the area to be rendered in the virtual scene and acquire the lighting data of the probe corresponding to the area to be rendered; wherein the lighting data of the probe is updated according to the probe update method described above.

[0175] The rendering module is adapted to perform lighting rendering on the area to be rendered based on the acquired lighting data from the probe.

[0176] In one optional implementation, the acquisition module is specifically used for:

[0177] The process involves identifying multiple elements within the region to be rendered, obtaining the probe grid identifier corresponding to each element, performing deduplication on the multiple probe grid identifiers corresponding to multiple elements, and obtaining the illumination data of the corresponding probe based on the deduplicated probe grid identifiers.

[0178] In one optional implementation, the acquisition module is specifically used for:

[0179] The probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table.

[0180] Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier in the second-level hash table; wherein, the second-level hash table is used to store the second-level hash identifiers of multiple probe grid identifiers after deduplication.

[0181] The probe grid identifier is used to characterize the probe grid in which the probe is located, and the probe grid point identifier is used to characterize the grid point position of the probe in the probe grid. A probe grid includes multiple grid point positions.

[0182] In one optional implementation, the acquisition module is specifically used for:

[0183] A preset number of elements from the multiple elements contained in the area to be rendered are grouped into an element group, and a preset number of threads contained in the thread group are used to obtain the probe grid identifier corresponding to each element in parallel.

[0184] In one optional implementation, the acquisition module is specifically used for:

[0185] Send a first probe invocation command associated with the lighting rendering operation to the probe corresponding to the region to be rendered, so as to obtain the lighting data of the probe corresponding to the region to be rendered;

[0186] Among them, the probe corresponding to the first probe call instruction is used as the probe to be updated, so as to be updated by the probe update method described above.

[0187] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0188] The memory is used to store at least one executable instruction that causes the processor to perform the lighting rendering method described above.

[0189] According to another aspect of this disclosure, a computer storage medium is provided, the storage medium storing at least one executable instruction that causes a processor to perform the lighting rendering method described above.

[0190] In the embodiments of this disclosure, the probes to be updated corresponding to the target rendering area in the virtual scene can be dynamically determined. This allows for updating the probes according to their invocation methods, enabling lighting rendering operations based on the updated lighting data from the probes. Therefore, in this method, the probes to be updated in the virtual scene are dynamically determined based on current rendering needs, achieving on-demand updates and avoiding resource waste caused by unnecessary updates to probes not used during rendering. Furthermore, since the update method for the probes is determined based on their invocation methods, different update methods can be flexibly configured to suit the characteristics of different probe invocation methods, thus balancing rendering quality and update overhead.

[0191] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description

[0192] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this disclosure. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0193] Figure 1 A flowchart of a lighting rendering method provided in one embodiment of this disclosure is shown;

[0194] Figure 2 A flowchart of a probe update method provided in one embodiment of this disclosure is shown;

[0195] Figure 3 A flowchart of a lighting rendering method provided in one embodiment of this disclosure is shown;

[0196] Figure 4 A schematic diagram of the probe update process in this example is shown;

[0197] Figure 5 A flowchart illustrating the process of determining the probe's illumination data based on the ray calculation results of the ray to be solved is shown.

[0198] Figure 6 A schematic diagram of the process of performing probe initialization according to the probe initialization queue is shown;

[0199] Figure 7 A schematic diagram of a lighting rendering process is shown in one example;

[0200] Figure 8 A schematic diagram of a probe updating device according to another embodiment of this disclosure is shown;

[0201] Figure 9 A schematic diagram of the structure of a lighting rendering apparatus provided in yet another embodiment of this disclosure is shown;

[0202] Figure 10 A schematic diagram of the structure of a lighting rendering system provided in yet another embodiment of this disclosure is shown; Figure 11 A schematic diagram of the structure of an electronic device provided in yet another embodiment of this disclosure is shown. Detailed Implementation

[0203] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0204] Figure 1 A flowchart illustrating a lighting rendering method according to an embodiment of this disclosure is shown. Figure 1 As shown, this lighting rendering method includes the following steps:

[0205] Step S110: Dynamically determine the probe to be updated corresponding to the target rendering area in the virtual scene; wherein, the probe to be updated is the probe that is called during the rendering process of the target rendering area.

[0206] The virtual scene can take various forms, such as game-type virtual scenes and augmented reality virtual scenes; this application does not limit this. The target rendering area refers to the area within the virtual scene that needs to be dynamically rendered. Taking a game-type virtual scene as an example, since the virtual scene may include multiple image frames, the target rendering area contained in each image frame can be different.

[0207] The target rendering region in a virtual scene can be the region to be rendered in the current image frame, or it can be the region to be rendered in at least one image frame preceding the current image frame. For example, the target rendering region could be the region to be rendered in the previous image frame. Alternatively, the target rendering region could include the regions to be rendered in the current image frame and the m image frames preceding it, where m is a natural number. In short, the target rendering region in a virtual scene can dynamically change as the scene content changes. Accordingly, in this step, to ensure the targeted nature of the lighting rendering operation, it is necessary to dynamically determine the probes to be updated corresponding to the target rendering region in the virtual scene. Therefore, the types and number of probes to be updated in the virtual scene are not fixed, but rather change dynamically with the scene content.

[0208] The probes to be updated are those invoked during the rendering process of the target rendering area. Invocation includes both direct and indirect invocation. Specifically, the invoked probes are those used. Directly invoked probes include multiple probes located around the target rendering area that are directly invoked during the rendering process to perform rendering operations based on lighting data from these probes. Indirectly invoked probes include those invoked during the update process of the probe to be updated. In short, directly invoked probes primarily refer to those directly used to implement lighting rendering operations; indirectly invoked probes primarily refer to those used to implement probe update operations.

[0209] Step S120: Update the probe to be updated according to the probe calling method of the probe to be updated, so as to perform lighting rendering operation based on the updated lighting data in the probe to be updated.

[0210] The probe invocation methods for the probes to be updated mainly include the direct invocation method and the indirect invocation method mentioned above. In addition to the methods mentioned above, those skilled in the art can also distinguish between direct and indirect invocation in other ways. For example, the invocation method of the probe called in the current image frame can be determined as the direct invocation method, and the invocation method of the probe called in the m image frames preceding the current image frame can be determined as the indirect invocation method. In short, this application does not limit the specific criteria for distinguishing between direct and indirect invocation methods, as long as it ensures that the probe update strategies corresponding to different invocation methods are different.

[0211] Accordingly, in this step, the probe to be updated is updated according to its probe invocation method. To reduce system computational overhead, different update strategies are configured for different probe invocation methods. Specifically, for any probe to be updated, an update strategy corresponding to its probe invocation method is determined, and the probe is updated according to the corresponding update strategy.

[0212] Since different probe invocation methods correspond to different probe update strategies, it is easy to distinguish the importance and / or priority of the probes to be updated based on the probe invocation method. This allows for the configuration of different probe update strategies based on different importance and / or priority levels, balancing performance budget and update effectiveness. For example, for probe invocation methods with high importance and / or high priority, an update strategy with a larger performance budget but better update effectiveness can be configured; for probe invocation methods with low importance and / or low priority, an update strategy with slightly worse update effectiveness but smaller performance budget can be configured.

[0213] Therefore, in this embodiment, since the target rendering area and the probe to be updated are dynamically determined, and the update method of the probe to be updated varies with the probe calling method, it is convenient to configure different probe update strategies for different probe calling methods, thereby making the update budget allocated to each probe more reasonable.

[0214] In one optional implementation, when updating the probe to be updated based on its invocation method, the following approach can be used: If the probe invocation method is direct, the probe is updated according to a direct probe update strategy. Specifically, if the probe invocation method is direct, the update type can be defined as a direct probe update type, and this type of probe can also be called a direct probe. If the probe invocation method is indirect, the probe is updated according to an indirect probe update strategy. Specifically, if the probe invocation method is indirect, the update type can be defined as an indirect probe update type, and this type of probe can also be called an indirect probe. The update frequency and / or update budget differ between the direct and indirect probe update strategies.

[0215] In one optional implementation, the probe invocation method is determined based on the instruction type of the received probe invocation command. For example, if a direct probe invocation command is received, the probe invocation method for the probe to be updated is determined to be a direct invocation method; if an indirect probe invocation command is received, the probe invocation method for the probe to be updated is determined to be an indirect invocation method. The direct probe invocation command (i.e., the probe invocation command type is direct invocation) includes: a probe invocation command associated with the lighting rendering operation of the target rendering area; the indirect probe invocation command (i.e., the probe invocation command type is indirect invocation) includes: a probe invocation command associated with the ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

[0216] In one optional implementation, the direct probe update strategy updates more frequently than the indirect probe update strategy; the update frequency is used to characterize the probe's update frequency and / or number of updates. Because the direct probe update strategy updates more frequently, the probe data corresponding to the direct probe update strategy has better real-time performance and better rendering results.

[0217] The update budget for a direct probe update strategy is greater than that for an indirect probe update strategy. The update budget characterizes the performance budget required during the probe update process. A larger update budget results in more comprehensive and accurate probe update data. The probe lifetime for a direct probe update strategy is shorter than that for an indirect probe update strategy. The probe lifetime characterizes the duration the probe to be updated remains active. A shorter probe lifetime results in less resource consumption.

[0218] In one optional implementation, the update budget is determined based on the number of rays to be solved during the probe update process and / or the intersection tracking distance of the rays. Furthermore, the number of rays to be solved under the direct probe update strategy is greater than that under the indirect probe update strategy, and / or the intersection tracking distance of the rays under the direct probe update strategy is less than that under the indirect probe update strategy. A smaller intersection tracking distance results in less resource consumption during the probe update process. Setting a smaller intersection tracking distance for the rays under the direct probe update strategy helps reduce the update overhead of the direct probe and improve update efficiency.

[0219] In one optional implementation, there are multiple probes to be updated. Accordingly, to ensure that the resource consumption required during the probe update process does not exceed the system's capacity limit, thus ensuring the smooth progress of the update process, before updating the probes according to their probe invocation methods, the following operations are performed: If the sum of the update budgets of multiple probes to be updated exceeds a preset budget upper limit threshold, the update budgets of the multiple probes to be updated are adjusted so that the sum of the adjusted update budgets of the multiple probes to be updated does not exceed the budget upper limit threshold. The preset budget upper limit threshold can be determined based on computational performance parameters; and the computational performance parameters can include at least one of the following: device-related computational performance parameters determined based on device parameters, network-related computational performance parameters determined based on network parameters, and resource-related computational performance parameters determined based on system resource occupancy.

[0220] In one optional implementation, considering the large number of direct probes and the significant resource consumption during the update process, the intersection tracking distance of the ray to be solved for each direct probe is limited to ensure that this distance does not exceed a preset tracking distance, thereby reducing resource consumption during the solution process. Accordingly, when updating the probe to be updated according to the direct probe update strategy, for the ray to be solved during the probe update process, if it is determined, based on the ray tracing algorithm and the symbolic distance field, that there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the ray calculation result of the ray to be solved is calculated based on the illumination information of the position point on the ray to be solved corresponding to the preset tracking distance. The preset tracking distance can be set comprehensively based on factors such as rendering requirements in the actual scene and device performance.

[0221] In one optional implementation, if a ray intersection point corresponding to the ray to be solved exists within a preset tracking distance, the probe adjacent to the ray intersection point is determined as the probe to be updated corresponding to the first type of indirect probe update strategy; if no ray intersection point corresponding to the ray to be solved exists within the preset tracking distance, the probe adjacent to the position point corresponding to the preset tracking distance is determined as the probe to be updated corresponding to the second type of indirect probe update strategy; wherein, the update budget corresponding to the second type of indirect probe update strategy is greater than the update budget corresponding to the first type of indirect probe update strategy. Therefore, based on the way indirect probes are used in the update process, indirect probe update strategies can be further divided into two types. Correspondingly, different update budgets can be allocated to probes according to their different usage methods in the update process, thereby facilitating precise configuration of the update budget.

[0222] In one alternative implementation, the above method is applied to a virtual game scene. Accordingly, when updating the probe to be updated, it can be done based on the direct lighting information in the virtual game scene. This direct lighting information can be determined based on the main light source information corresponding to the clock data in the virtual game scene; the main light source information can dynamically change with the day-night cycle of the clock data. This method can more realistically simulate ambient light, ensuring that the ambient lighting dynamically changes with day and night, thereby improving the realism of the scene.

[0223] In one optional implementation, there are multiple probes to be updated corresponding to the target rendering area in the virtual scene, and the updated lighting data in the multiple probes to be updated can be obtained in the following way: First, determine the multiple elements contained in the target rendering area; then, convert the probe grid identifier corresponding to each element into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, store the converted first-level hash identifier in the first-level hash table; next, obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and store the converted second-level hash identifier in the second-level hash table if it is not stored in the preset second-level hash table; wherein, the probe grid identifier is used to represent the probe grid in which the probe is located, and the probe grid identifier is used to represent the grid position of the probe in the probe grid. One probe grid includes multiple grid positions. Finally, based on the second-level hash identifiers of the multiple probe grid identifiers after deduplication stored in the second-level hash table, obtain the updated lighting data in the probes to be updated corresponding to the multiple probe grid identifiers. This method uses hash deduplication to avoid unnecessary reading overhead caused by repeatedly reading the same probe data, thus significantly improving data reading efficiency.

[0224] In one optional implementation, before updating the probe to be updated, the following operations can be further performed: The initial grid position of the probe to be updated in the probe grid can be obtained; if the signed distance field value of the initial grid position does not meet a preset condition, the initial grid position can be adjusted so that the signed distance field value of the adjusted initial grid position meets the preset condition; wherein, the preset condition includes: the signed distance field value of the initial grid position is a positive number greater than a preset threshold. If the signed distance field value of the initial grid position is negative, it indicates that the corresponding probe is inside an object in the scene. Since the probe's function is to provide lighting data to the object, placing the probe inside the object obviously cannot achieve the expected effect. Therefore, the signed distance field value of the initial grid position should be positive. However, if the signed distance field value of the initial grid position is a small positive number, it indicates that the probe is placed too close to the object's surface, thus affecting the lighting effect. Therefore, to obtain a better lighting effect, it is preferable to place the probe within a certain distance around the object; it should not be too close to the object, nor should it be embedded inside the object. Accordingly, by setting the symbol distance field value of the initial grid point position to a positive number greater than a preset threshold, it can be ensured that the initial grid point position of the probe meets the above requirements. The probe initialization operation described above can be performed on each probe to be updated, or it can be performed on probes that are currently active and awaiting update; this application does not limit the specific implementation.

[0225] The lighting rendering method in this application can be implemented based on the probe update method. By setting different update strategies for various types of probes to be updated, it is possible to balance the dual requirements of probe update budget and rendering effect.

[0226] Figure 2 A flowchart illustrating a probe update method provided in one embodiment of this disclosure is shown. Figure 2 As shown, the probe update method includes:

[0227] Step S210: Determine the update type of the probe to be updated based on the probe invocation method of the probe to be updated in the virtual scene.

[0228] Specifically, the probes invoked in the virtual scene can be identified as probes to be updated, and the update type of the probes to be updated can be determined based on the probe invocation method. The probes invoked are those mentioned above that correspond to the target rendering area in the virtual scene and are the ones to be updated.

[0229] The virtual scene can be a virtual scene in a game or a virtual scene in augmented reality; this application does not limit this. The invoked probe is the probe used during the rendering process of the virtual scene. This usage includes: probes directly used during lighting rendering (i.e., the direct probes mentioned above), and probes indirectly used during probe updates to achieve lighting rendering (i.e., the indirect probes mentioned above). Accordingly, based on the different probe invocation methods (i.e., usage methods), the probes to be updated can be divided into at least two different update types. Generally, directly used probes are more important than indirectly used probes.

[0230] In this step, by identifying the probes to be invoked as those to be updated, on-demand updates can be achieved when probes are used, thus avoiding unnecessary resource consumption caused by uniformly updating all probes in the virtual scene. Furthermore, the importance of probes can be determined based on the invocation method, and correspondingly, different update types can be set for different invocation methods, helping to balance resource consumption and lighting rendering.

[0231] Step S220: Obtain the update strategy corresponding to the update type of the probe to be updated, and perform the probe update operation according to the update strategy.

[0232] Different update types correspond to different update strategies. The update strategy determines how the probe is updated. For example, an update strategy may include: probe update frequency, update budget, etc. Update frequency characterizes how often the probe is updated: probes with higher importance are updated more frequently than probes with lower importance. Update budget characterizes the performance budget required during the probe update process. Typically, the performance budget required during probe update can be determined based on the number of rays to be calculated during the probe update; for example, the number of rays to be calculated during the update of a higher importance probe is greater than the number of rays to be calculated during the update of a lower importance probe.

[0233] In summary, those skilled in the art can flexibly set the specific types and contents of update strategies, as long as they can achieve the effect of on-demand updating according to the importance of the probe. This application does not limit the specific update strategies.

[0234] Therefore, in this method, the update frequency and update method of the probe can be determined according to the call frequency and call method of the probe. Thus, it is possible to update the probe on demand, which makes it easy to configure different update methods for different probes, so as to take into account the computational overhead of probe updates and the needs of scene lighting rendering, thereby achieving better rendering results with lower update overhead.

[0235] Those skilled in the art can also make various modifications and variations to the above embodiments:

[0236] In one optional implementation, the update type of the probe to be updated can be determined based on the invocation instruction received by the probe. Accordingly, when identifying the probe invoked in the virtual scene as the probe to be updated, and determining the update type of the probe to be updated based on the probe invocation method, this is specifically achieved as follows: In response to the probe invocation instruction in the virtual scene, the probe corresponding to the probe invocation instruction is identified as the probe to be updated; the probe invocation method corresponding to the instruction type of the probe invocation instruction is determined, and the update type of the probe to be updated is determined based on the probe invocation method. For example, if the instruction type of the probe invocation instruction is a direct invocation type (i.e., the probe invocation instruction is a direct probe invocation instruction), the probe invocation method corresponding to the instruction type of the probe invocation instruction is a direct invocation method, and the update type of the probe to be updated is a direct probe update type. As another example, if the instruction type of the probe invocation instruction is an indirect invocation type (i.e., the probe invocation instruction is an indirect probe invocation instruction), the probe invocation method corresponding to the instruction type of the probe invocation instruction is an indirect invocation method, and the update type of the probe to be updated is an indirect probe update type. Since the instruction type of the invocation command can characterize how the probe is invoked, the update type of the probe to be updated can be quickly and accurately determined based on the instruction type. Specifically, the instruction type of the probe invocation command can be determined based on the instruction parameters contained in the probe invocation command, or based on the timing of the instruction sending.

[0237] In one optional implementation, the direct-invocation type probe invocation instruction includes: a first probe invocation instruction associated with the lighting rendering operation (i.e., the direct probe invocation instruction mentioned above); wherein, the lighting rendering operation is used to perform lighting rendering on the area to be rendered in the virtual scene during the lighting rendering process. Therefore, the direct-invocation type probe invocation instruction is used to directly use probes for lighting rendering. For example, during the rendering of an object to be rendered on the screen, it is necessary to calculate the lighting conditions of the object to be rendered based on the lighting data of probes around the object. The probe used in this case is a direct probe update type probe (also called a direct probe). In other words, the probe directly used during screen rendering is a direct probe update type.

[0238] Indirect probe invocation instructions include a second probe invocation instruction associated with a ray solving operation (i.e., the indirect probe invocation instruction mentioned above); the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process. Typically, during probe updates, the lighting conditions after the probe update are determined by calculating multiple rays to be solved. Accordingly, indirect probe invocation instructions do not directly use the probe for lighting rendering, but rather use the probe to calculate the rays to be solved. Therefore, probes of the indirect probe update type do not directly participate in the rendering process of the objects to be rendered on the screen, but indirectly affect the rendering process on the screen by being used in the process of updating other probes. In other words, probes not directly used in the screen rendering process (also called indirect probes) are of the indirect probe update type. The probe update process described above can include both the update process of probes of the direct probe update type and the update process of probes of the indirect probe update type.

[0239] In practice, probe invocation instructions of the direct invocation type and probe invocation instructions of the indirect invocation type can also include other types of invocation instructions, which are not limited in this application.

[0240] In one optional implementation, the update strategy corresponding to the update type of the probe to be updated may include: a frequency-based update strategy and / or a budget-based update strategy. The frequency-based update strategy is used to set the update frequency and / or probe lifetime of the probe to be updated. The budget-based update strategy is used to set the probe update budget for the probe to be updated; wherein the probe update budget is determined based on the number of rays to be solved and / or the intersection tracking distance of the rays to be solved during the probe update process.

[0241] For example, in one alternative implementation, considering that direct probes need to directly act on the lighting rendering process, the accuracy requirements for direct probes are higher. Accordingly, the update frequency corresponding to the direct probe update type (i.e., the update frequency of the direct probe update strategy) can be greater than the update frequency corresponding to the indirect probe update type (i.e., the update frequency of the indirect probe update strategy). A higher update frequency ensures more accurate lighting data from the direct probes. Furthermore, since the update frequency of direct probes is higher and the update overhead is greater, the probe lifetime corresponding to the direct probe update type can be set slightly smaller to avoid excessive update overhead. Correspondingly, the probe lifetime corresponding to the direct probe update type (i.e., the probe lifetime of the direct probe update strategy) can be less than the probe lifetime corresponding to the indirect probe update type (i.e., the probe lifetime of the indirect probe update strategy).

[0242] For example, the number of rays to be solved for the direct probe update type (i.e., the number of rays to be solved for the direct probe update strategy) can be greater than the number of rays to be solved for the indirect probe update type (i.e., the number of rays to be solved for the indirect probe update strategy). By setting a larger number of rays to be solved for the probes of the direct probe update type, the accuracy of the probes of the direct probe update type can be further improved. In addition, the intersection tracking distance of the rays to be solved for the direct probe update type can be less than the intersection tracking distance of the rays to be solved for the indirect probe update type. For example, when calculating the rays to be solved for the direct probe update type, the tracking intersection can be limited to a small distance range, so that the ray intersection is only found within this small distance range. If the ray intersection cannot be found within this small distance range, the intersection illumination can be estimated using other methods. That is, the intersection tracking distance of the rays to be solved for the direct probe update strategy is less than the intersection tracking distance of the rays to be solved for the indirect probe update strategy. Since there are more direct probes and the update overhead is greater, setting the intersection tracking distance of the ray to be solved corresponding to the direct probe to a smaller distance helps to reduce the overhead in the update process and improve the update efficiency.

[0243] In one optional implementation, to facilitate probe management, probe status information can be stored through the probe handle, allowing for flexible probe management based on this status information. After identifying probes invoked in the virtual scene as those to be updated and determining the update type based on the probe invocation method, the following probe initialization operation can be further performed: First, query the handle of the probe to be updated. If the status identifier stored in the handle is an inactive identifier, update the status identifier of the probe to be updated to an active identifier. The probe handle represents the current state of the probe. If the status identifier stored in the handle is an active identifier, it indicates that the corresponding probe has been invoked before the current frame and is currently still active. Conversely, if the status identifier stored in the handle is an inactive identifier, the corresponding probe may not have been invoked before the current frame and is therefore in an inactive state; or, the corresponding probe may have been invoked and activated before the current frame, but has become inactive again due to probe lifetime exhaustion. In short, regardless of the situation, if the status identifier stored in the handle is an inactive identifier, the status identifier of the corresponding probe to be updated needs to be updated from inactive to active to implement the probe initialization process. Then, the probes whose status identifiers have been updated to active are added to the probe initialization queue for initialization operations. The probe initialization queue can store multiple probes to be updated, and these multiple probes can be initialized in parallel using a multi-threaded approach.

[0244] In one alternative implementation, initialization operations can be performed on probes to be updated in the probe initialization queue in the following way:

[0245] First, for any probe to be updated in the probe initialization queue, the initial grid point position of the probe in the probe grid is obtained. The virtual scene contains multiple probe grids, each of which can include multiple grid points. For example, in a hexagonal probe grid, one probe grid can include eight grid points. Correspondingly, multiple probes can be arranged in various ways within these multiple probe grids. The initial grid point position of the probe in the probe grid represents the probe's initial position within the probe grid. This initial grid point position can be calculated using a probe arrangement algorithm.

[0246] Then, if the symbol distance field value at the initial grid point position does not meet the preset conditions, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset conditions. The preset conditions include: the symbol distance field value at the initial grid point position is a positive number greater than a preset threshold.

[0247] Specifically, if the signed distance field value of the initial grid point position is negative, it indicates that the corresponding probe is inside an object in the scene. Since the probe's function is to provide lighting data to the object, placing it inside the object obviously cannot achieve the desired effect. Therefore, the signed distance field value of the initial grid point position should be positive. However, if the signed distance field value of the initial grid point position is a small positive number, it means that the probe is placed too close to the object's surface, thus affecting the lighting effect. Therefore, to obtain better lighting effects, it is preferable to place the probe within a certain distance around the object; it should not be too close to the object, nor should it be embedded inside the object. Accordingly, by setting the signed distance field value of the initial grid point position to a positive number greater than a preset threshold, it can be ensured that the initial grid point position of the probe meets the above requirements. When the signed distance field value of the initial grid point position does not meet the preset conditions, the initial grid point position can be adjusted by calculating the distance field gradient and shifting the initial grid point position along the gradient direction.

[0248] In one optional implementation, to achieve dynamic and on-demand updates of probes, probes that have not been used for a long time need to be deleted. Accordingly, after updating the status flag of the probe to be updated to an active flag, the probe lifetime is further set according to the update type of the probe to be updated; and the probe lifetime is stored in the handle of the probe to be updated. The probe lifetime represents the duration the probe to be updated is active. Thus, the probe lifetime indicates the duration the probe to be updated is active, which can be the duration it has been active (i.e., how long it has been active) or the remaining duration it is active (i.e., how much time is left before it becomes inactive). In short, the probe lifetime limits the activation duration of the probe to be updated, thereby releasing probe resources in a timely manner when the probe lifetime is exhausted, avoiding resource waste caused by continuously updating probes that have not been used recently. In addition, the type flag corresponding to the update type can also be stored in the handle of the probe to be updated to facilitate the subsequent determination of the probe update budget.

[0249] In one optional implementation, when the probe lifetime of any probe is detected to be a preset termination value, the probe is added to the deletion queue. Furthermore, after performing a probe update operation according to the update strategy, the status flag stored in the handle of the probe in the deletion queue is updated from an active flag to an inactive flag, and the resources occupied by that probe are released. This method allows for the timely release of resources from temporarily unused probes, thereby improving system efficiency. Additionally, the deletion queue allows probes whose lifetimes have been exhausted to be cached after the probe update operation of the current frame, ensuring that more probes are available during the probe update operation of the current frame.

[0250] In one optional implementation, before obtaining the update strategy corresponding to the update type of the probe to be updated and executing the probe update operation according to the update strategy, the probe update budget (i.e., update budget) of the probe to be updated is further determined based on the update type of the probe to be updated; and the probe to be updated and its probe update budget are stored in the probe update queue. Correspondingly, when obtaining the update strategy corresponding to the update type of the probe to be updated and executing the probe update operation according to the update strategy, the update strategy of the probe to be updated can be determined based on the probe update budget of the probe to be updated stored in the probe update queue, and then the probe update operation can be executed according to the update strategy. The probe update budgets corresponding to different update types are usually different. For example, the probe update budget corresponding to the direct probe update type is usually greater than the probe update budget corresponding to the indirect probe update type. In addition, the update budget of probes in the initialization probe queue is usually also greater than that of other probes, specifically because newly initialized probes have insufficient existing illumination data and therefore require more update budget. The probe update queue facilitates the pre-determination of the total budget of probes that need to be updated in the current frame.

[0251] In one optional implementation, when identifying probes invoked in the virtual scene as probes to be updated, probes invoked in the current frame and / or the previous frame can be identified as probes to be updated, and an update flag can be set for these probes. The update flag can be deleted after the current frame is rendered, and correspondingly, the probe initialization queue and the probe update queue can be cleared after the current frame is rendered. Thus, the update flag can identify recently invoked probes. Furthermore, before obtaining the update strategy corresponding to the update type of the probe to be updated and performing the probe update operation according to the update strategy, a preset number of probes can be selected from multiple probes with activation flags but no update flags according to a preset probe selection strategy. This preset number of probes is then added to the aforementioned probe update queue for dynamic updates. Therefore, the probe update queue contains not only currently invoked probes but also probes that are not currently invoked but are still active. This ensures the timeliness and comprehensiveness of probe updates in the virtual scene. The preset number of probes can be determined through various methods such as random selection or round-robin selection. In addition, the preset number of probes can also be determined based on the update budget of the currently invoked probes stored in the probe update queue of the current frame. If the update budget of the currently invoked probe is small, the preset number can be set to a larger number; if the update budget of the currently invoked probe is large, the preset number can be set to a smaller number.

[0252] In summary, the probe update queue can include two parts of probes to be updated: one part consists of first-type probes that were invoked in the current frame and / or the previous frame, and the other part consists of second-type probes that were not invoked in the current frame and / or the previous frame but are still active. The update priority of the first-type probes is higher than that of the second-type probes. In practice, if the budget is insufficient, more update budget can be allocated to the first-type probes, and less update budget can be allocated to the second-type probes.

[0253] In one optional implementation, probes invoked in the current frame and / or the previous frame are identified as probes to be updated. After setting an update flag for these probes, the probe lifetimes of probes with activation flags but no update flags are further updated to reduce their lifetimes. Probes with activation flags but no update flags are those not invoked in the current frame and / or the previous frame, meaning they are temporarily unused. Although these probes are still active, their temporary unuse indicates lower importance, and their lifetimes are reduced accordingly. Since the lifetimes of probes not invoked in the current and / or previous frames need to be updated during each frame processing, activated probes that remain unused for multiple consecutive frames will be deleted due to depleted lifetimes, thus releasing occupied resources.

[0254] In one optional implementation, adjusting the update budgets of multiple probes to be updated can be achieved using a probe update queue. Accordingly, after storing the probes to be updated and their update budgets in the probe update queue, the sum of the update budgets for multiple probes in the queue is further determined. If the sum of the update budgets for multiple probes exceeds a preset budget upper limit threshold, the update budgets for multiple probes are adjusted so that the adjusted sum of the update budgets for multiple probes does not exceed the budget upper limit threshold. The budget upper limit threshold can be determined based on the device's performance. By setting the budget upper limit threshold, it can be ensured that the resource consumption required during the update process does not exceed the system's capacity limit, thus ensuring the smooth progress of the update process. When adjusting the update budgets for multiple probes to be updated, the update budgets of each probe can be adjusted proportionally. For example, if the budget upper limit threshold is 70% of the sum of the update budgets, then the update budget for each probe is adjusted to 70% of its original budget. This proportional adjustment ensures that the budgets of probes with higher importance remain greater than the budgets of probes with lower importance after adjustment.

[0255] In one optional implementation, the preset budget upper limit threshold is determined based on computational performance parameters. These computational performance parameters include at least one of the following: device-related computational performance parameters determined based on device parameters, network-related computational performance parameters determined based on network parameters, and resource-related computational performance parameters determined based on system resource usage. Specifically, the device-related computational performance parameters can be determined based on the performance parameters of the client device running the game, the network-related computational performance parameters can be determined based on the current network status, and the resource-related computational performance parameters can be determined based on the current system resource usage. In summary, this application does not limit the specific method for determining the budget upper limit threshold; it can dynamically adjust the budget upper limit threshold based on the current system resource situation to ensure that the updated budget does not exceed the current system resource capacity.

[0256] In one alternative implementation, when performing a probe update operation according to the update strategy, it can be achieved in the following way:

[0257] First, the ray rays to be calculated during the probe update process are determined according to the update strategy. The probe (also called a light probe or illumination probe) stores information about the light rays passing through specific areas (such as blank areas) in the scene. Accordingly, when updating the probe data, the location of the probe to be updated can be used as the ray emission point, emitting multiple rays to be calculated. The probe data is updated by solving for the illumination information corresponding to these rays. The number of rays to be calculated varies depending on the type of probe to be updated. For example, the number of rays to be calculated is greater for direct probe updates than for indirect probe updates.

[0258] Then, based on the ray tracing algorithm and the symbolic distance field, the ray intersection points corresponding to the ray to be solved are determined. The ray tracing algorithm can be a spherical tracing algorithm. The intersection point between the ray and the symbolic distance field is solved using the spherical tracing algorithm, and this intersection point is used as the ray intersection point of the ray to be solved. The ray intersection point of the ray to be solved is used to characterize the intersection point between the ray and objects in the virtual scene. Finally, the lighting information of this ray intersection point is obtained, and the ray calculation result of the ray to be solved is calculated based on the lighting information of the ray intersection point. The lighting data of the probe to be updated is then updated based on the ray calculation result of the ray to be solved.

[0259] In the case of a direct probe update, to reduce resource consumption, when determining the ray intersection point corresponding to the ray to be solved, the existence of a ray intersection point within a preset tracking distance can be determined based on the ray tracing algorithm and the symbolic distance field. If yes, the ray intersection point within the preset tracking distance is designated as the target intersection point; otherwise, the position point on the ray to be solved corresponding to the preset tracking distance is designated as the target intersection point. Accordingly, the ray calculation result of the ray to be solved is calculated based on the illumination information of the target intersection point, and the illumination data of the probe to be updated is updated based on the ray calculation result of the ray to be solved. Therefore, considering that the probe update budget for the direct probe update type is large and the number of probes is greater, a preset tracking distance is set for the direct probe update type to reduce computational consumption during the update process. This preset tracking distance can be a relatively small distance, so that the ray intersection point of the ray to be solved is calculated only within this relatively small distance, thereby saving computational overhead and improving computational speed. If no ray intersection point exists within this relatively small distance, the target intersection point is directly determined as the position on the ray corresponding to the preset tracking distance. For example, if the preset tracking distance is 50 meters, the target intersection point is the point on the ray 50 meters away from the starting point of the ray. Accordingly, based on the illumination conditions at the position point corresponding to the preset tracking distance, the ray calculation result of the ray to be solved can be roughly obtained.

[0260] In one optional implementation, when calculating the ray calculation result of the ray to be solved based on the illumination information of the target intersection point, it can be achieved as follows: First, identify the probes adjacent to the target intersection point, and send a second probe call command associated with the ray solving operation to the probes adjacent to the target intersection point to obtain the illumination data of the probes adjacent to the target intersection point. The probes adjacent to the target intersection point can be probes whose distance from the target intersection point is less than a preset calculation distance. These probes are used to calculate the ray conditions to update other probes; therefore, they can be called indirect probes. Then, based on the illumination data of the probes adjacent to the target intersection point (i.e., the indirect probes), the ray calculation result of the ray to be solved is calculated.

[0261] In one optional implementation, the indirect probe update type further includes: a first type of indirect probe update (corresponding to a first type of indirect probe update strategy) and a second type of indirect probe update (corresponding to a second type of indirect probe update strategy). Accordingly, indirect probes can be further divided into: a first type of indirect probe corresponding to the first type of indirect probe update type, and a second type of indirect probe corresponding to the second type of indirect probe update type. The two different types of indirect probes are primarily determined based on the ray tracing results. After determining the probe adjacent to the target intersection point and sending a second probe call instruction associated with the ray solving operation to the probe adjacent to the target intersection point, if a ray intersection point corresponding to the ray to be solved exists within a preset tracing distance, the probe adjacent to the target intersection point is determined as a probe to be updated of the first type of indirect probe update type (i.e., a first type of indirect probe); if no ray intersection point corresponding to the ray to be solved exists within the preset tracing distance, the probe adjacent to the target intersection point is determined as a probe to be updated of the second type of indirect probe update type (i.e., a second type of indirect probe). The second type of indirect probe is the probe closest to the target intersection point (i.e., the position point on the ray to be solved corresponding to the preset tracking distance) when there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance. Since this type of probe is usually farther from the corresponding probe to be updated for the ray to be solved, it can also be called a long-range indirect probe. Correspondingly, the first type of indirect probe is called a non-long-range indirect probe. The number of long-range indirect probes is usually small, and in cases where the actual intersection point between the ray and the actual object is not found, the data in the long-range indirect probes needs to be more accurate to ensure the accuracy of the ray calculation results. For these reasons, the update budget corresponding to the second type of indirect probe update type (i.e., the update budget of the long-range indirect probe) is greater than the update budget corresponding to the first type of indirect probe update type (i.e., the update budget of the non-long-range indirect probe).

[0262] In one alternative implementation, the above method can be applied to a virtual game scene. When calculating the ray calculation result of the ray to be solved based on the lighting information of the target intersection point, the direct lighting information corresponding to the target intersection point can also be obtained, and the ray calculation result of the ray to be solved can be calculated based on the direct lighting information. Therefore, calculating the ray calculation result of the ray to be solved requires two parts of lighting information: one part is the indirect lighting information determined based on the lighting data of the indirect probe, and the other part is the direct lighting information determined based on the main light source information. Superimposing the two parts of the light yields the final ray calculation result. The direct lighting information corresponding to the target intersection point can be determined based on the main light source information corresponding to the clock data in the virtual game scene; the main light source information can dynamically change with the day / night cycle of the clock data. For example, normally the main light source is sunlight, but in reality, sunlight changes dynamically with time. Therefore, the main light source can be configured as a light source associated with the clock system of the game scene; that is, the lighting data of the main light source is determined based on the current time recorded by the clock system. This method can more realistically simulate ambient light and improve the realism of the scene.

[0263] Figure 3 A flowchart illustrating a lighting rendering method according to yet another embodiment of this disclosure is shown. Figure 3 As shown, the lighting rendering method includes:

[0264] Step S310: Determine the area to be rendered in the virtual scene and obtain the lighting data of the probe corresponding to the area to be rendered.

[0265] The area to be rendered is the target rendering area mentioned above, which can be implemented using pixels or voxels. Alternatively, the area to be rendered can be a virtual object in a virtual scene. In short, this application does not limit the specific range or determination method of the area to be rendered. Furthermore, the probe's lighting data can be updated according to the update method described in the above embodiments.

[0266] The lighting data of the probe corresponding to the area to be rendered corresponds to the updated lighting data in the probe to be updated mentioned above.

[0267] Step S320: Perform lighting rendering on the area to be rendered based on the obtained probe lighting data.

[0268] Specifically, preset calculations can be performed on the lighting data of multiple probes around the area to be rendered to obtain the lighting information of the area to be rendered, and then the area to be rendered can be lit and rendered according to the lighting information. The preset calculations can include various operations such as averaging.

[0269] In one optional implementation, when acquiring the lighting data of the probe corresponding to the region to be rendered, it can be achieved as follows: Determine multiple elements contained in the region to be rendered, obtain the probe grid identifier corresponding to each element, perform deduplication processing on the multiple probe grid identifiers corresponding to multiple elements, and obtain the lighting data of the corresponding probe based on the deduplicated probe grid identifier. Specifically, the elements contained in the region to be rendered can be pixels or voxels, and each element corresponds to a probe grid identifier. This probe grid identifier is used to characterize the probe grid where the nearest probe to the element is located and the grid points within that probe grid. Considering that the probe grids corresponding to adjacent elements may be the same, and that two adjacent probe grids may also contain several identical grid points, in order to avoid problems such as excessive cache pressure and slow reading speed caused by repeatedly reading probe data of the same grid points, in this embodiment, deduplication processing is first performed on the multiple probe grid identifiers corresponding to multiple elements, so that the lighting data of the corresponding probe is obtained only based on the deduplicated probe grid identifier, avoiding the problem of repeated data reading and improving lighting rendering efficiency.

[0270] In one alternative implementation, when obtaining the probe grid identifier corresponding to each element and performing deduplication on multiple probe grid identifiers corresponding to multiple elements, a hash table can be used:

[0271] First, the probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table. The probe grid identifier is used to uniquely identify a probe grid. Specifically, each probe grid identifier is converted into a first-level hash identifier using a hash algorithm. It is then checked whether the first-level hash identifier is already stored in the preset first-level hash table. If it is, it is not stored again; otherwise, the first-level hash identifier is stored in the first-level hash table.

[0272] Then, the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table is obtained, and each probe grid identifier is converted into a second-level hash identifier. If the second-level hash identifier is not stored in the preset second-level hash table, the converted second-level hash identifier is stored in the second-level hash table. The probe grid identifier is used to uniquely identify a grid point in the probe grid. Since the first-level hash identifiers in the first-level hash table have been deduplicated, multiple first-level hash identifiers in the first-level hash table are unique. Accordingly, after obtaining the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table and converting each probe grid identifier into a second-level hash identifier, it is determined whether the preset second-level hash identifier is already stored. If so, it is not stored again; otherwise, the second-level hash identifier is stored in the second-level hash table. Therefore, the second-level hash table is used to store the second-level hash identifiers of multiple probe grid identifiers after deduplication. The probe grid identifier is used to represent the probe grid in which the probe is located, and the probe grid identifier is used to represent the grid point position of the probe in the probe grid. A probe grid includes multiple grid point positions. For example, a probe grid typically includes eight grid point positions. By using a two-level hash table for storage, deduplication can be efficiently achieved, improving both efficiency and accuracy.

[0273] In one alternative implementation, to improve reading efficiency, the probe grid markers corresponding to each element in the region to be rendered can be obtained through parallel processing: a preset number of elements in the region to be rendered are grouped into an element group, and a preset number of threads in the thread group retrieve the probe grid markers corresponding to each element in parallel. The preset number can be, for example, 8*8, etc. This application does not limit the specific value of the preset number, as long as it can improve efficiency through multi-threaded parallel processing.

[0274] In one optional implementation, when obtaining the lighting data of the probe corresponding to the region to be rendered, a first probe invocation command associated with the lighting rendering operation is sent to the probe corresponding to the region to be rendered to obtain the lighting data of the probe corresponding to the region to be rendered; wherein, the probe corresponding to the first probe invocation command is a probe to be updated, so as to be updated by the update method in the above embodiment.

[0275] To facilitate understanding, the following specific example will be used to illustrate the detailed implementation of the above embodiments:

[0276] This example is primarily used in game business scenarios to dynamically update various probes in the game's virtual scene, so as to realize the lighting rendering of the virtual scene based on the updated probes.

[0277] The following explanation addresses some of the concepts involved in the examples below:

[0278] Direct lighting: The illumination result where the light source directly illuminates the surface of an object;

[0279] Global illumination: The lighting result of light rays bouncing multiple times on the surface of an object;

[0280] Path tracing: Calculates lighting entirely by tracing the path of light rays as they bounce off the surface of an object;

[0281] Light probe: Used to capture global lighting information in all directions at a point in space (the probe location);

[0282] Symbolic distance field: Stores the distance value at any given location in space. This value is the distance from that point in space to the surface of the nearest object in the scene. It is positive on the outside and negative on the inside.

[0283] Sphere tracing: An algorithm for finding the intersection of a ray with a distance field (the intersection with a surface in the distance field where the distance field is 0).

[0284] Lighting cache: caches low-precision lighting information of object surfaces in the scene.

[0285] Global illumination (GIA) is a technique used to simulate real-world lighting effects in rendering. Traditional real-time rendering techniques typically use local lighting models, such as directional lights, point lights, or spotlights, to evaluate the single-bounce illumination caused directly by these light sources on an object's surface. However, these models cannot accurately simulate the propagation of light and multiple reflections on the object's surface, resulting in unrealistic lighting effects in the scene. To address these issues, global illumination techniques have emerged. These techniques simulate real-world lighting effects by considering multiple reflections of light.

[0286] One common technique is path-tracing-based global illumination. Path tracing calculates the color of each pixel by tracking light rays emitted from the camera and observing their reflection, refraction, and scattering within the scene. This method can produce very realistic global illumination effects. However, path tracing is computationally complex, requiring significant computing resources and time, and therefore is typically limited to offline rendering scenarios such as those in the film industry where real-time interaction is not required. Of course, thanks to the continuous development of hardware computing power in recent years, real-time global illumination systems based on path tracing technology are gradually beginning to be used to a limited extent on the most advanced and expensive computing platforms.

[0287] However, in the field of real-time rendering for interactive applications such as games, some coarser approximation algorithms have been proposed to quickly simulate global illumination effects within a limited frame time. Some of these methods restrict static scenes and static lighting conditions, achieving global illumination effects through complete pre-computation; the most common examples are pre-baked lightmaps and light probe techniques. Another type of method can handle dynamic lighting environments, such as virtual point lights, radiation shadow maps, and ray propagation volumes. However, these algorithms generally suffer from a series of problems, including poor performance, low accuracy, poor scalability for large scenes, and high memory overhead.

[0288] This example provides a global illumination system that enables real-time dynamic global illumination on low-end platforms, achieving both satisfactory effects and performance, thus providing users with a better interactive experience. This example primarily aims to address the shortcomings of existing technologies, such as poor effects, high computational demands, and inability to handle dynamic lighting. It seeks to improve the performance and quality of global illumination systems, providing game products with higher-quality and more affordable global illumination rendering results, and presenting players with a more realistic and vibrant virtual world.

[0289] This example mainly includes two parts: probe updates and lighting rendering. Figure 4 A schematic diagram of the probe update process in this example is shown, as follows: Figure 4 As shown, the probe update process mainly includes the following steps:

[0290] Step S401: Traverse the handles of multiple probes in the virtual scene in parallel.

[0291] The virtual scene contains multiple probe grids, each containing a unique handle used to store probe status information. Specifically, the handles of multiple probes in the virtual scene can be traversed every other frame to promptly identify probes whose handles have changed in the current frame.

[0292] Step S402: Determine whether the probe is an activated probe based on the handle.

[0293] An activated probe is also called an active probe. When a probe is invoked (i.e., a probe invoke command is received), it is activated, and the status flag stored in the probe handle changes from an inactive flag to an active flag.

[0294] Step S403: For inactive probes, further determine whether they have an update flag.

[0295] Specifically, an update flag is pre-set for probes invoked in the current or previous frame, so that recently invoked probes can be updated based on the update flag. The update flag can be deleted after the current frame has been rendered. Therefore, if a probe has an update flag set, it means that the probe was invoked in the current or previous frame.

[0296] Step S404: For inactive probes with an update flag, update the status flag stored in their handle to an activation flag, add the probe to the probe initialization queue, and add the initialized probe to the probe update queue to achieve update processing.

[0297] Among them, probes with update flags are those invoked in the current frame or the previous frame. Based on the invocation method of the probe in the current or previous frame, update flags can be further divided into direct update flags corresponding to direct probe update types and indirect update flags corresponding to indirect probe update types. Accordingly, when adding initialized probes to the probe update queue, the update type of the probe can be set according to the type of update flag, and the update budget corresponding to that update type can be determined.

[0298] Step S405: For the activation probe, further determine whether it has an update flag.

[0299] Step S406: For active probes that have an update flag set, add the probe to the probe update queue.

[0300] Furthermore, based on the type of the update flag, the update type and update budget of the corresponding probe to be updated are determined.

[0301] Step S407: For active probes that have not set an update flag, reduce the probe lifetime value of the probe by a preset value; and add probes with a probe lifetime value of a preset termination value to the deletion queue.

[0302] For example, the probe lifetime can be decremented by 1, and the corresponding preset termination value can be 0. It should be noted that during probe initialization, the probe lifetime needs to be further set according to the type of probe update flag. This probe lifetime is used to characterize the activation duration of the probe, and the lifetime of probes with different update types is usually different.

[0303] Step S408: Traverse the probe update queue and calculate the sum of the update budgets of multiple probes in the probe update queue.

[0304] This step aims to collect information on the expected budget updates. In this GPU task allocation, a parallel reduction algorithm is used to count the number of probes at each budget level. Specifically, to improve efficiency, the probe update queue can be traversed in parallel using multithreading, and the number of probes awaiting updates at each budget level can be counted using a parallel reduction algorithm.

[0305] Step S409: If the sum of the update budgets exceeds the preset budget upper limit threshold, adjust the probe update budgets of multiple probes in the probe update queue so that the sum of the adjusted update budgets does not exceed the budget upper limit threshold.

[0306] The adjustment can be made proportionally to ensure that the budgets of probes at different budget levels still have reasonable differences after adjustment.

[0307] Step S410: For any probe in the probe update queue, determine the number of rays to be solved during the probe update process according to the probe update strategy, and write the ray information of the rays to be solved corresponding to each probe into the ray solving queue.

[0308] As mentioned above, different update strategies correspond to different numbers of rays to be solved and different calculation methods. For example, the update strategy for the direct probe update type sets the number of rays to be solved to be greater than the update strategy for the indirect probe update type. The ray solving queue is used to store the rays to be solved for each probe.

[0309] Step S411: Perform calculations for each ray to be solved in the ray solving queue, obtain the ray calculation result for each ray to be solved, and update the illumination data of the corresponding probe based on the ray calculation result of the ray to be solved.

[0310] Step S412: Traverse the probe deletion queue in parallel, release the storage resources corresponding to each probe in the probe deletion queue, and update the status flag of the probe in the probe deletion queue to the inactive flag.

[0311] Specifically, the probe deletion queue is traversed in parallel, probe handles are reset to inactive, and the memory resources held by the probes are released. The reason for delaying the resource release operation until this point is to ensure that as many probes as possible are available during the probe update process, thereby improving the accuracy of the probe update.

[0312] Figure 5 This diagram illustrates the process of determining the probe's illumination data based on the ray calculation results of the ray to be solved. For example... Figure 5 As shown, the process of updating illumination data specifically includes the following steps:

[0313] Step S501: Parallel traverse each ray to be solved in the ray solution queue.

[0314] Specifically, parallel traversal can be achieved through multi-threading to improve processing efficiency.

[0315] Step S502: For any ray to be solved, determine whether the ray to be solved is the ray corresponding to a probe of the direct probe update type.

[0316] Step S503: If the ray corresponding to the probe is of the direct probe update type, determine whether there is a ray intersection point corresponding to the ray to be solved within the preset tracking distance according to the ray tracing algorithm and the symbolic distance field.

[0317] The preset tracking distance is a relatively short distance. For direct probes, in order to reduce computational overhead, the solution range for intersection points is limited to a relatively short distance.

[0318] Step S504: If the ray corresponding to the probe is of the non-direct probe update type, determine the ray intersection point corresponding to the ray to be solved based on the ray tracing algorithm and the symbolic distance field.

[0319] For rays corresponding to probes that are not directly updated (i.e., indirect probes), the distance of the intersection point solution range can be not limited, thus allowing the search for intersection points to be conducted at infinity. For example, for long-range indirect probes, to ensure data accuracy, intersection points need to be searched at infinity. However, for non-long-range indirect probes, to reduce computational load, a preset tracking distance can be defined, and intersection points can be found within that preset tracking distance. This example does not limit the specific implementation details.

[0320] Step S505: If it exists, query the illumination data at the intersection point and calculate the ray calculation result of the ray to be solved based on the query result.

[0321] In order to improve query efficiency, when querying the lighting data at the intersection point, a query caching method can be used. Specifically, a lighting cache query request needs to be sent to the global lighting system (which can also be understood as a second probe call instruction associated with the ray solving operation), and the update flags of the probes around the intersection point are set to indirect update flags (corresponding to non-long-range indirect probes) to update and cache the lighting conditions at the query point.

[0322] Step S506: If it does not exist, determine the position point on the ray to be solved that corresponds to the preset tracking distance as the target intersection point, query the illumination data of the target intersection point, and calculate the ray calculation result of the ray to be solved based on the query result.

[0323] Specifically, the illumination data of the probe near the target intersection point of the ray to be solved is read, and the update flag of the probe near the target intersection point is set as the indirect update flag (corresponding to the long-range indirect probe). The illumination data of the target intersection point is determined based on the illumination data of the given ray direction (i.e., the direction consistent with the ray to be solved) recorded by the long-range indirect probe, in order to calculate the ray calculation result for the ray to be solved. The illumination data of the given ray direction (i.e., the direction consistent with the ray to be solved) recorded by the long-range indirect probe serves as the indirect illumination data of the target intersection point. The direct illumination data of the target intersection point can be obtained from the main light source. Accordingly, the ray calculation result of the ray to be solved can be obtained by combining the indirect and direct illumination data.

[0324] Step S507: Synchronize the ray solving results of multiple rays to be solved corresponding to the same probe, and update the illumination data of the corresponding probe according to the ray solving results of multiple rays to be solved.

[0325] in addition, Figure 6 The diagram illustrates the process of performing probe initialization based on the probe initialization queue in step S404. Figure 6 As shown, the probe initialization process includes the following steps:

[0326] Step S601: Parallel traversal of the probe initialization queue.

[0327] Step S602: For any probe to be initialized, determine the initial grid position of the probe in a uniform and equally spaced manner according to the probe handle.

[0328] Step S603: If the symbol distance field value of the initial grid point position of the probe does not meet the preset conditions, the initial grid point position is adjusted so that the symbol distance field value of the adjusted initial grid point position meets the preset conditions.

[0329] The preset conditions include: the symbolic distance field value of the initial grid point position is a positive number greater than a preset threshold. If the symbolic distance field value of the probe's initial grid point position does not meet the preset conditions, the initial grid point position can be offset using the distance field gradient. For example, the probe's initial grid point position is offset along the gradient direction, and the distance field value at the current position is checked again until it exceeds the preset threshold. If a feasible position is successfully found within a finite number of attempts, probe storage space is actually allocated, and the offset of that position relative to the initial grid point position is recorded.

[0330] Step S604: Allocate storage space for the probe, record the initial grid position of the probe after adjustment, and set the probe lifetime value according to the probe update type.

[0331] Step S605: Calculate the initial illumination result of the probe to be initialized using the illumination data of available probes in the surrounding area.

[0332] If there are available probes around the probe to be initialized, that is, the initial illumination result of the probe is successfully obtained, a lower update budget can be allocated to the probe; conversely, if there are no available probes around the probe to be initialized, that is, the initial illumination result of the probe is not successfully obtained, a higher update budget needs to be allocated to the probe.

[0333] Figure 7 A schematic diagram of the lighting rendering process in this example is shown, such as... Figure 7 As shown, the lighting rendering process mainly includes the following steps:

[0334] Step S701: Determine the area to be rendered in the virtual scene.

[0335] The area to be rendered can be the area where a specific virtual object is located in the virtual scene.

[0336] Step S702: Determine the multiple elements contained in the area to be rendered, convert the probe mesh identifier corresponding to each element into a first-level hash identifier, and if the first-level hash identifier is not stored in the preset first-level hash table, store the converted first-level hash identifier into the first-level hash table.

[0337] The process involves dividing the area to be rendered into multiple 8x8 element groups. A thread group with 64 threads retrieves the probe grid identifier for each element in parallel. Each thread then converts the probe grid identifier for its corresponding element into a first-level hash identifier. Finally, the converted first-level hash identifiers are stored in a first-level hash table. Before storing the converted hash identifier in the first-level hash table, it first checks if the identifier already exists. If it does, it is not stored again; otherwise, it is stored. This check ensures that the first-level hash identifiers stored in the first-level hash table are unique, thus avoiding unnecessary memory overhead caused by repeated reads.

[0338] Step S703: Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier into the second-level hash table.

[0339] The probe grid identifier is used to characterize the probe grid in which the probe is located, and the probe grid point identifier is used to characterize the grid point position of the probe within the probe grid. A probe grid includes multiple grid point positions. Therefore, in step S702, the probe grid identifier corresponding to each element is stored using a first-level hash identifier. However, since a probe grid contains multiple grid point positions, a second-level hash table is needed to further store the probe grid point identifier corresponding to each first-level hash identifier.

[0340] In this context, adjacent probe grids may contain some duplicate probe points. For example, in two vertically adjacent probe grids, the four points corresponding to the bottom surface of the upper probe grid and the four points corresponding to the top surface of the lower probe grid are duplicates. Therefore, deduplication is also required when storing the secondary hash identifier. Specifically, when storing any converted secondary hash identifier into the secondary hash table, it is first checked whether the secondary hash identifier already exists in the secondary hash table. If it does, it is not stored again; otherwise, the converted secondary hash identifier is stored in the secondary hash table. This check ensures that the secondary hash identifiers stored in the secondary hash table are unique, thus avoiding unnecessary memory overhead caused by repeated reads.

[0341] Step S704: Obtain the illumination data of the corresponding probe based on the secondary hash identifier of the multiple probe grid identifiers after deduplication in the secondary hash table.

[0342] In particular, when retrieving the illumination data of the corresponding probe based on the secondary hash identifier of multiple probe grid identifiers after deduplication in the secondary hash table, it can also be achieved through multi-threaded parallel processing. Specifically, each thread reads the illumination data of the corresponding probe from memory and caches the illumination data read from memory in the shared memory of the thread group. Other threads can directly read the data from the shared memory without having to read it from memory again, thus avoiding the memory read bottleneck problem.

[0343] Step S705: Perform lighting rendering on the area to be rendered based on the obtained probe lighting data.

[0344] In summary, the above examples mainly include the following processes:

[0345] Probe management process: The system iterates through all probe handles and checks whether the corresponding probe is active based on the handle's identifier. If it is, it checks whether there is an update flag. If there is no update flag, it means that the probe was not used by the system in any form in the previous frame. The probe's lifetime is decremented by 1. When the lifetime reaches 0, the probe is added to the deletion queue but its storage resources are not released immediately. If there is an update flag, the expected update budget is assigned according to the type of update flag (such as direct probe update type or indirect probe update type), and the probe handle is written to the probe update queue.

[0346] For inactive probes (i.e., non-activated probes), check if they have any update flags. If so, add them to the initialization queue and write them to the update queue with the highest expected update budget. The highest expected update budget is used because newly initialized lighting probes require a large number of light samples to converge to good lighting results. Furthermore, new probes cannot use temporal moving averages to blend old lighting results, thus requiring a higher update budget. After performing the above operations, reset the probe update flags to empty.

[0347] Probe initialization process: In this GPU task assignment, each GPU thread processes one probe in the initialization queue in parallel. First, the probe position is initialized on a uniform grid according to its density level and grid location. Then, the distance field value at the probe position is checked to see if it is greater than a given value. This is to prevent the probe from being too close to the surface or embedded inside the object. If it is less than the given value, the distance field gradient is calculated, and the probe position is offset along the gradient direction. The distance field value at the current position is checked again until it is greater than the given value. If a feasible position is found within a finite number of iterations, the probe storage space is actually allocated, and the offset of that position relative to the starting grid position is recorded. At the same time, the lifetime value is initialized according to the probe type. Otherwise, the probe is recorded as inactive and removed from the update queue. For successfully activated probes, the surrounding available probes are checked, and the probe is initialized using the lighting results of the available probes. If an available probe is found nearby, the probe can have a better initial lighting result, so the expected update budget level of the corresponding probe in the update queue can be reduced.

[0348] Budget Adjustment Process: The expected update budget for each probe in the probe update queue is summed. In this GPU task allocation, a parallel reduction algorithm can be used to count the number of probes at each budget level and allocate update budgets accordingly. Specifically, in this GPU task allocation, the probe update queue is traversed in parallel, and the actual update budget level of each probe is adjusted based on the number of probes at each budget level, ensuring that the final overall budget matches the expected budget level. Then, a corresponding number of ray solving tasks are generated based on the budget level and written to the ray solving queue. In practice, the system allows for performance budget fluctuations of less than 5%.

[0349] Ray solving process: In this GPU task allocation, each GPU thread processes one ray in the ray solving queue in parallel. First, it checks whether the ray belongs to a direct probe. For direct probes, since this type of probe is the most numerous and has the highest update frequency, in order to reduce the solving overhead of this type of ray, the system restricts the ray solving to a relatively short distance (i.e., a preset tracking distance) to improve intersection performance. The spherical tracking algorithm is used to solve for the intersection point of the ray and the symbolic distance field. If an intersection point is found within this short distance, the illumination cache at that intersection point is queried to obtain the result of the ray. Otherwise, the system searches for long-range probes (i.e., long-range indirect probes) near the point of maximum distance of the ray (i.e., the position point on the ray to be solved corresponding to the preset tracking distance), and uses the illumination result of the long-range probe in the direction of the ray as the result of the ray, while setting the update flag of the long-range probe to the long-range update flag. For other types of probes, due to their lower density and update frequency, intersection calculations with light rays of unlimited length are directly performed to find the intersection points with the scene, and the lighting buffer at that point is read as the lighting result. Long-range probes are no longer used for these probes to reduce the lighting update latency caused by repeatedly retrieving lighting results from the probes. Since there are fewer of these probes to begin with, the performance penalty is acceptable.

[0350] Probe deletion process: Probes are traversed in parallel, probe handles are reset to inactive, and the memory resources held by the probes are released. The release is delayed until this point to ensure that as many probes as possible are available for use during the probe update process.

[0351] Lighting rendering workflow (i.e., probe interpolation workflow): After the above process, dynamically updated probes are obtained. These probes store the dynamic global illumination information of the scene. Therefore, by interpolating these probes according to their spatial position and surface orientation, the global illumination result of the object surface (corresponding to the area to be rendered) can be obtained. However, in order to perform cubic interpolation on the probes, obtaining a global illumination result once requires reading the illumination data of eight probes at the corner of the mesh, and this process needs to be performed on all screen pixels, which can easily lead to a serious memory read bottleneck. In the process of implementing this invention, the inventors found that due to spatial continuity, adjacent pixels are often located in the same or adjacent probe meshes, and therefore often access completely or partially the same probe illumination data. Therefore, in order to alleviate memory pressure, the above example uses a manual memory caching strategy with two-level hash deduplication. For an 8x8 pixel screen space, 64 threads are allocated as a thread group. First, these threads read and calculate the spatial position of the corresponding pixel, and calculate the number of the probe mesh cell (i.e., probe grid identifier) ​​based on the position. Each thread then writes the grid number into the thread group's parallel hash table (i.e., the first-level hash table) and checks if the same grid number already exists in the table. If not, it writes the number into the thread group's grid number queue. Next, the thread group synchronizes again, and each thread writes the probe number corresponding to a grid number into another parallel hash table (i.e., the second-level hash table) of the thread group, while checking if the same probe number already exists in the table. If not, it writes the probe number into the thread group's probe queue. After another thread group synchronization, each thread is responsible for loading the illumination data of one probe into the thread group's shared memory. After deduplication, it is ensured that each required probe is accessed only once from the global main memory, and subsequent accesses to that probe will be completed through the thread group's shared memory. This method greatly reduces the bandwidth pressure on global memory and improves data loading efficiency.

[0352] This example describes a real-time dynamic global illumination system based on light probes, running entirely on a GPU. It uses a distance field as the geometric representation of the scene. To enable the system for ultra-large open worlds, this example includes a technique for automatically placing light probes using screen pixel information and the distance field. Specifically, different types and levels of light probes are adaptively placed around the camera based on pixel-based geometric buffer information, and these probes capture scene lighting to provide global illumination. The system includes various types of light probes, including direct probes, indirect probes, and long-range probes (long-range probes are a special form of indirect probes). Direct probes directly provide global illumination to pixels on the screen, thus having the highest distribution density and update frequency. Indirect probes are mainly used to provide global illumination for multiple bounces (more than two), resulting in a relatively lower density and update frequency. To reduce the computational burden of probe updates, direct probes only perform geometric intersections over short distances when calculating lighting, while results for longer distances are obtained by directly using the results from long-range probes. Therefore, although long-range probes have a lower density, their update frequency is also very high. Furthermore, to rationally allocate available performance resources, this example describes an adaptive computing power allocation strategy. Before each probe update, all update requests are dynamically collected, and statistical information is gathered through efficient parallel reduction operations to determine the performance budget available to each probe. To reduce the performance overhead of interpolation probes, the system also designs a novel memory access merging strategy based on two-level hash deduplication.

[0353] This example has at least the following innovative features:

[0354] (1) Based on the position and orientation of the virtual camera, the illumination probe is automatically managed (created, updated, and destroyed) during runtime in combination with the symbolic distance field, without the need for pre-positioning by humans, thereby increasing the system's availability in open worlds and its scalability in large-scale scenes.

[0355] (2) Automatically allocate the update budget of the illumination probe according to the performance budget of the target platform to adapt to the performance differences of different target platforms.

[0356] (3) Use a variety of different light probes to reduce probe update overhead and improve system efficiency.

[0357] (4) Use a multi-level hash algorithm instead of a hardware cache mechanism to manually manage the data cache of probe interpolation in order to improve the IO performance of probe illumination interpolation.

[0358] This example successfully implements a fully GPU-driven parallel lighting probe management and update system through the aforementioned innovations, and based on this dynamically updated probe system, implements a real-time dynamic global illumination system. Compared to static global illumination techniques such as pre-baked lightmaps or pre-baked lighting probes, this example achieves dynamic global illumination updates, capable of responding to dynamic lighting environment changes such as day and night. Compared to other dynamic global illumination techniques such as virtual point lights, this example significantly improves the quality of global illumination effects while reducing performance requirements, making it possible to implement a high-quality real-time dynamic global illumination system on low-end platforms. This example greatly enhances the realism and expressiveness of virtual environments within game products.

[0359] Figure 8 A schematic diagram of a probe updating device according to another embodiment of this disclosure is shown, as follows: Figure 8 As shown, the probe updating device includes:

[0360] The determination module 81 is adapted to determine the probes invoked in the virtual scene as probes to be updated, and to determine the update type of the probes to be updated according to the probe invocation method;

[0361] The update module 82 is adapted to obtain an update strategy corresponding to the update type of the probe to be updated, and to perform a probe update operation according to the update strategy.

[0362] In one alternative implementation, the determining module 81 is specifically adapted to:

[0363] In response to a probe invocation command in the virtual scene, the probe corresponding to the probe invocation command is identified as the probe to be updated;

[0364] Determine the probe invocation method corresponding to the instruction type of the probe invocation instruction, and determine the update type of the probe to be updated based on the probe invocation method;

[0365] Wherein, when the instruction type of the probe call instruction is the direct call type, the probe call method corresponding to the instruction type of the probe call instruction is the direct call method, and the update type of the probe to be updated is the direct probe update type;

[0366] When the instruction type of the probe call instruction is an indirect call type, the probe call method corresponding to the instruction type of the probe call instruction is an indirect call method, and the update type of the probe to be updated is an indirect probe update type.

[0367] In one alternative implementation, the probe invocation instruction of the direct invocation type includes: a first probe invocation instruction associated with a lighting rendering operation; wherein the lighting rendering operation is used to perform lighting rendering on a region to be rendered in a virtual scene during the lighting rendering process;

[0368] The indirect call type probe call instruction includes: a second probe call instruction associated with a ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

[0369] In one optional implementation, the update strategy corresponding to the update type of the probe to be updated includes: a frequency-based update strategy and / or a budget-based update strategy.

[0370] The frequency-based update strategy is used to set the update frequency and / or probe lifetime of the probe to be updated.

[0371] The budget-based update strategy is used to set the probe update budget for the probe to be updated; wherein the probe update budget is determined based on the number of rays to be solved and / or the intersection tracking distance of the rays to be solved during the probe update process.

[0372] In one optional implementation, the update frequency of the direct probe update type is greater than the update frequency of the indirect probe update type, and / or the probe lifetime of the direct probe update type is less than the probe lifetime of the indirect probe update type.

[0373] Furthermore, the number of rays to be solved for the direct probe update type is greater than the number of rays to be solved for the indirect probe update type, and / or, the intersection tracking distance of the rays to be solved for the direct probe update type is less than the intersection tracking distance of the rays to be solved for the indirect probe update type.

[0374] In one alternative implementation, the apparatus further includes:

[0375] An initialization module is used to query the handle of the probe to be updated, and if the status identifier stored in the handle is an inactive identifier, update the status identifier of the probe to be updated to an active identifier; add the probe to be updated with the status identifier updated to an active identifier to the probe initialization queue, so as to perform an initialization operation on the probe to be updated in the probe initialization queue.

[0376] In one alternative implementation, the initialization module is specifically used for:

[0377] For any probe to be updated in the probe initialization queue, obtain the initial grid position of the probe to be updated in the probe grid.

[0378] If the symbol distance field value at the initial grid point position does not meet the preset condition, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset condition.

[0379] The preset conditions include: the symbol distance field value of the initial grid point position is a positive number that is greater than a preset threshold.

[0380] In one alternative implementation, the initialization module is further configured to:

[0381] Set the probe lifetime value of the probe to be updated according to the update type of the probe to be updated;

[0382] The probe lifetime is stored in the handle of the probe to be updated; wherein the probe lifetime is used to characterize the duration during which the probe to be updated is in an active state.

[0383] In an optional implementation, the initialization module is further configured to: add the probe to the deletion queue when the probe lifetime value of any probe is detected to be a preset termination value;

[0384] Furthermore, the update module is also used to: update the status identifier stored in the handle of the probe in the deletion queue from an active identifier to an inactive identifier, and release the resources occupied by the probe.

[0385] In one alternative implementation, the update module is specifically used for:

[0386] Based on the update type of the probe to be updated, determine the probe update budget of the probe to be updated; store the probe to be updated and its probe update budget in the probe update queue.

[0387] Based on the probe update budget of the probe to be updated stored in the probe update queue, the update strategy of the probe to be updated is determined, and the probe update operation is executed according to the update strategy.

[0388] In one alternative implementation, the determining module is specifically used for:

[0389] Probes invoked in the current frame and / or the previous frame are identified as probes to be updated, and an update flag is set for the probes to be updated; wherein, the update flag is deleted after the current frame is rendered, and the probe initialization queue and the probe update queue are cleared after the current frame is rendered.

[0390] Furthermore, the update module is also used for:

[0391] According to the preset probe selection strategy, a preset number of probes are selected from multiple probes that have an activation flag but no update flag, and the preset number of probes are added to the probe update queue for dynamic updates.

[0392] In one alternative implementation, the determining module is further configured to:

[0393] For probes that have an activation flag set but no update flag set, update the probe's health value to reduce it.

[0394] In one alternative implementation, the update module is further configured to:

[0395] Determine the sum of the probe update budgets for multiple probes to be updated in the probe update queue;

[0396] If the sum of the probe update budgets of the plurality of probes to be updated exceeds a preset budget upper limit threshold, the probe update budgets of the plurality of probes to be updated are adjusted so that the sum of the adjusted probe update budgets of the plurality of probes to be updated does not exceed the budget upper limit threshold.

[0397] In one optional implementation, the preset budget upper limit threshold is determined based on computational performance parameters; wherein the computational performance parameters include at least one of the following:

[0398] Device-related computing performance parameters determined based on device parameters, network-related computing performance parameters determined based on network parameters, and resource-related computing performance parameters determined based on system resource usage.

[0399] In one alternative implementation, the update module is specifically used for:

[0400] The ray to be solved needs to be calculated during the probe update process is determined according to the update strategy described above;

[0401] When the update type of the probe to be updated is the direct probe update type, the existence of a ray intersection point corresponding to the ray to be solved within the preset tracking distance is determined according to the ray tracing algorithm and the symbolic distance field.

[0402] If so, the intersection point of the light rays corresponding to the light ray to be solved within the preset tracking distance is determined as the target intersection point;

[0403] If not, the position point on the ray to be solved that corresponds to the preset tracking distance is determined as the target intersection point;

[0404] Based on the illumination information of the target intersection point, the ray calculation result of the ray to be solved is calculated, and the illumination data of the probe to be updated is updated according to the ray calculation result of the ray to be solved.

[0405] In one alternative implementation, the update module is specifically used for:

[0406] Identify the probe adjacent to the target intersection point, and send a second probe call command associated with the ray solving operation to the probe adjacent to the target intersection point to obtain the illumination data of the probe adjacent to the target intersection point;

[0407] Based on the illumination data of the probes adjacent to the intersection point with the target, the ray calculation result of the ray to be solved is calculated.

[0408] In one optional implementation, the indirect probe update type further includes: a first type of indirect probe update type and a second type of indirect probe update type;

[0409] The update module is specifically used for:

[0410] If there is a ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the target intersection point is determined as the probe to be updated of the first type of indirect probe update;

[0411] If there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the target intersection point is determined as the probe to be updated of the second type of indirect probe update.

[0412] The update budget for the second type of indirect probe update is greater than the update budget for the first type of indirect probe update.

[0413] In one alternative implementation, the method is applied to a virtual game scene, and the update module is specifically used for:

[0414] Obtain the direct illumination information corresponding to the target intersection point, and calculate the ray calculation result of the ray to be solved based on the direct illumination information;

[0415] The direct illumination information corresponding to the target intersection point is determined based on the main light source information corresponding to the clock data in the virtual game scene; wherein, the main light source information changes dynamically with the day and night changes of the clock data.

[0416] Figure 9 A schematic diagram of the structure of a lighting rendering apparatus provided in another embodiment of this disclosure is shown, as follows: Figure 9 As shown, the lighting rendering apparatus includes:

[0417] The acquisition module 91 is adapted to determine the area to be rendered in the virtual scene and acquire the lighting data of the probe corresponding to the area to be rendered; wherein the lighting data of the probe is updated according to the probe update method described above.

[0418] The rendering module 92 is adapted to perform lighting rendering on the area to be rendered based on the acquired lighting data from the probe.

[0419] In one optional implementation, the acquisition module 91 is specifically used for:

[0420] The process involves identifying multiple elements within the region to be rendered, obtaining the probe grid identifier corresponding to each element, performing deduplication on the multiple probe grid identifiers corresponding to multiple elements, and obtaining the illumination data of the corresponding probe based on the deduplicated probe grid identifiers.

[0421] In one optional implementation, the acquisition module is specifically used for:

[0422] The probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table.

[0423] Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier in the second-level hash table; wherein, the second-level hash table is used to store the second-level hash identifiers of multiple probe grid identifiers after deduplication.

[0424] The probe grid identifier is used to characterize the probe grid in which the probe is located, and the probe grid point identifier is used to characterize the grid point position of the probe in the probe grid. A probe grid includes multiple grid point positions.

[0425] In one optional implementation, the acquisition module is specifically used for:

[0426] A preset number of elements from the multiple elements contained in the area to be rendered are grouped into an element group, and a preset number of threads contained in the thread group are used to obtain the probe grid identifier corresponding to each element in parallel.

[0427] In one optional implementation, the acquisition module is specifically used for:

[0428] Send a first probe invocation command associated with the lighting rendering operation to the probe corresponding to the region to be rendered, so as to obtain the lighting data of the probe corresponding to the region to be rendered;

[0429] Among them, the probe corresponding to the first probe call instruction is used as the probe to be updated, so as to be updated by the probe update method described above.

[0430] According to another aspect of this disclosure, this application also provides a lighting rendering system, including: the probe updating device described above and the lighting rendering device described above.

[0431] Figure 10 A schematic diagram of the structure of a lighting rendering system provided in yet another embodiment of this disclosure is shown.

[0432] in, Figure 10 The lighting rendering system shown can be based on Figure 8 The probe update device shown and Figure 9 The lighting rendering device shown is implemented. For example... Figure 10 As shown, the lighting rendering system includes:

[0433] The dynamic determination module 101 is adapted to dynamically determine the probe to be updated corresponding to the target rendering area in the virtual scene; wherein the probe to be updated is a probe that is invoked during the rendering process of the target rendering area;

[0434] The update rendering module 102 is adapted to update the probe to be updated according to the probe calling method of the probe to be updated, so as to perform lighting rendering operation according to the updated lighting data in the probe to be updated.

[0435] In one alternative implementation, the update rendering module 102 is specifically used for:

[0436] If the probe to be updated is invoked via a direct invocation method, the probe is updated according to the direct probe update strategy; and / or,

[0437] If the probe to be updated is invoked in an indirect manner, the probe to be updated is updated according to the indirect probe update strategy.

[0438] In one optional implementation, upon receiving a direct probe invocation instruction, the probe invocation method of the probe to be updated is determined to be a direct invocation method; upon receiving an indirect probe invocation instruction, the probe invocation method of the probe to be updated is determined to be an indirect invocation method.

[0439] The direct probe invocation instruction includes: a probe invocation instruction associated with the lighting rendering operation of the target rendering area;

[0440] The indirect probe invocation instruction includes: a probe invocation instruction associated with a ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

[0441] In one optional implementation, the update frequency of the direct probe update strategy is greater than the update frequency of the indirect probe update strategy; the update frequency is used to characterize the probe update frequency and / or update number.

[0442] The update budget of the direct probe update strategy is greater than the update budget of the indirect probe update strategy, and the update budget is used to characterize the performance budget required during the probe update process;

[0443] The probe lifetime of the direct probe update strategy is less than that of the indirect probe update strategy. The probe lifetime is used to characterize the duration for which the probe to be updated is in an active state.

[0444] In one alternative implementation, the update budget is determined based on the number of rays to be solved required during the probe update process, and / or the intersection tracking distance of the rays to be solved;

[0445] Furthermore, the number of light rays to be solved under the direct probe update strategy is greater than the number of light rays to be solved under the indirect probe update strategy, and / or the intersection tracking distance of the light rays to be solved under the direct probe update strategy is less than the intersection tracking distance of the light rays to be solved under the indirect probe update strategy.

[0446] In one alternative implementation, the update rendering module 102 is further configured to:

[0447] If the sum of the update budgets of multiple probes to be updated exceeds a preset budget upper limit threshold, the update budgets of the multiple probes to be updated are adjusted so that the sum of the adjusted update budgets of the multiple probes to be updated does not exceed the budget upper limit threshold.

[0448] The preset budget upper limit threshold is determined based on computing performance parameters; and the computing performance parameters include at least one of the following: device-type computing performance parameters determined based on device parameters, network-type computing performance parameters determined based on network parameters, and resource-type computing performance parameters determined based on system resource occupancy.

[0449] In one optional implementation, when the update rendering module 102 updates the probe to be updated according to the direct probe update strategy, it is specifically used for:

[0450] For the ray to be solved during the probe update process, if it is determined, based on the ray tracing algorithm and the symbolic distance field, that there is no ray intersection point corresponding to the ray to be solved within the preset tracing distance, the ray calculation result of the ray to be solved is calculated based on the illumination information of the position point on the ray to be solved corresponding to the preset tracing distance.

[0451] In one optional implementation, if there is a ray intersection point corresponding to the ray to be solved within a preset tracking distance, the probe adjacent to the ray intersection point is determined as the probe to be updated corresponding to the first type of indirect probe update strategy.

[0452] If there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the position point corresponding to the preset tracking distance is determined as the probe to be updated corresponding to the second type of indirect probe update strategy;

[0453] The update budget for the second type of indirect probe update strategy is greater than the update budget for the first type of indirect probe update strategy.

[0454] In one alternative implementation, the system is applied to a virtual game scene, and the update rendering module 102 is specifically used for:

[0455] The probe to be updated is updated based on the direct lighting information in the virtual game scene;

[0456] The direct lighting information in the virtual game scene is determined based on the main light source information corresponding to the clock data in the virtual game scene; wherein the main light source information changes dynamically with the day-night changes of the clock data.

[0457] In one optional implementation, the number of probes to be updated corresponding to the target rendering area in the virtual scene is multiple, and the updated lighting data in the multiple probes to be updated is obtained in the following way:

[0458] Identify the multiple elements contained in the target rendering area;

[0459] The probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table.

[0460] Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier in the second-level hash table; wherein, the probe grid identifier is used to characterize the probe grid where the probe is located, and the probe grid identifier is used to characterize the grid position of the probe in the probe grid, and a probe grid includes multiple grid positions.

[0461] Based on the secondary hash identifiers of the multiple probe grid identifiers after deduplication stored in the secondary hash table, the updated illumination data in the probe to be updated corresponding to the multiple probe grid identifiers is obtained.

[0462] In one alternative implementation, the update rendering module 102 is further configured to:

[0463] Obtain the initial grid point position of the probe to be updated in the probe grid;

[0464] If the symbol distance field value at the initial grid point position does not meet the preset condition, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset condition.

[0465] The preset conditions include: the symbol distance field value of the initial grid point position is a positive number that is greater than a preset threshold.

[0466] Figure 11 The diagram shows a structural schematic of an electronic device according to yet another embodiment of the present disclosure. The specific embodiments of the present disclosure do not limit the specific implementation of the electronic device.

[0467] like Figure 11 As shown, the electronic device may include: a processor 502, a communications interface 506, a memory 504, and a communications bus 508.

[0468] in:

[0469] The processor 502, communication interface 506, and memory 504 communicate with each other via communication bus 508.

[0470] Communication interface 506 is used to communicate with other network elements such as clients or other servers.

[0471] The processor 502 is used to execute program 510, specifically to execute the relevant steps in the above-described video image detection method embodiment.

[0472] Specifically, program 510 may include program code that includes computer operation instructions.

[0473] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present disclosure. The electronic device includes one or more processors, which may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0474] Memory 504 is used to store program 510. Memory 504 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0475] Specifically, program 510 can be used to cause processor 502 to perform the corresponding operations in the above-described video image detection method embodiment.

[0476] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used in conjunction with the teachings herein. The required structure for constructing such devices is apparent from the above description. Furthermore, this disclosure is not directed to any particular programming language. It should be understood that the contents of this disclosure described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of this disclosure.

[0477] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this disclosure may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0478] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more of the various aspects of the disclosure, in the above description of exemplary embodiments of the disclosure, various features of the disclosure are sometimes grouped together in a single embodiment, figure, or description thereof. However, this approach to disclosure should not be construed as reflecting an intention that the claimed disclosure requires more features than are expressly recited in each claim.

[0479] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature serving the same, equivalent, or similar purpose.

[0480] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of this disclosure and form different embodiments. For example, any of the claimed embodiments can be used in any combination.

[0481] The various component embodiments of this disclosure can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the apparatus according to embodiments of this disclosure. This disclosure can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing some or all of the methods described herein. Such an implementation of this disclosure can be stored on a computer-readable medium or can take the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0482] It should be noted that the above embodiments are illustrative of this disclosure and not restrictive, and that alternative embodiments can be devised by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This disclosure can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

Claims

1. A lighting rendering method, comprising: Dynamically determine the probe to be updated corresponding to the target rendering area in the virtual scene; wherein, the probe to be updated is the probe that is invoked during the rendering process of the target rendering area; According to the probe invocation method of the probe to be updated, the probe to be updated is updated to perform lighting rendering operations based on the updated lighting data in the probe to be updated; wherein, the update process of the probe to be updated according to the probe invocation method includes: When the probe to be updated is invoked via a direct invocation method, the probe is updated according to a direct probe update strategy. Here, the directly invoked probe is the one directly used to implement lighting rendering operations; and / or, When the probe to be updated is invoked in an indirect manner, the probe to be updated is updated according to the indirect probe update strategy. The probe that is indirectly invoked is the probe used to implement the probe update operation.

2. The method according to claim 1, wherein, Upon receiving a direct probe call instruction, the probe call method of the probe to be updated is determined to be the direct call method; upon receiving an indirect probe call instruction, the probe call method of the probe to be updated is determined to be the indirect call method. The direct probe invocation instruction includes: a probe invocation instruction associated with the lighting rendering operation of the target rendering area; The indirect probe invocation instruction includes: a probe invocation instruction associated with a ray solving operation; wherein the ray solving operation is used to calculate the ray to be solved corresponding to the probe to be updated during the probe update process.

3. The method according to claim 1, wherein, The update frequency of the direct probe update strategy is greater than that of the indirect probe update strategy; the update frequency is used to characterize the probe update frequency and / or the number of updates. The update budget of the direct probe update strategy is greater than the update budget of the indirect probe update strategy, and the update budget is used to characterize the performance budget required during the probe update process; The probe lifetime of the direct probe update strategy is less than that of the indirect probe update strategy. The probe lifetime is used to characterize the duration for which the probe to be updated is in an active state.

4. The method according to claim 3, wherein, The update budget is determined based on the number of rays to be solved and / or the intersection tracking distance of the rays to be solved during the probe update process; Furthermore, the number of light rays to be solved under the direct probe update strategy is greater than the number of light rays to be solved under the indirect probe update strategy, and / or the intersection tracking distance of the light rays to be solved under the direct probe update strategy is less than the intersection tracking distance of the light rays to be solved under the indirect probe update strategy.

5. The method according to any one of claims 1-4, wherein, The number of probes to be updated is multiple. Before updating the probes according to their probe calling methods, the process further includes: If the sum of the update budgets of multiple probes to be updated exceeds a preset budget upper limit threshold, the update budgets of the multiple probes to be updated are adjusted so that the sum of the adjusted update budgets of the multiple probes to be updated does not exceed the budget upper limit threshold. The preset budget upper limit threshold is determined based on computing performance parameters; and the computing performance parameters include at least one of the following: device-type computing performance parameters determined based on device parameters, network-type computing performance parameters determined based on network parameters, and resource-type computing performance parameters determined based on system resource occupancy.

6. The method according to any one of claims 1-4, wherein, The step of updating the probe to be updated according to the direct probe update strategy includes: For the ray to be solved during the probe update process, if it is determined, based on the ray tracing algorithm and the symbolic distance field, that there is no ray intersection point corresponding to the ray to be solved within the preset tracing distance, the ray calculation result of the ray to be solved is calculated based on the illumination information of the position point on the ray to be solved corresponding to the preset tracing distance.

7. The method according to claim 6, wherein, If there is a ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the ray intersection point is determined as the probe to be updated corresponding to the first type of indirect probe update strategy; If there is no ray intersection point corresponding to the ray to be solved within the preset tracking distance, the probe adjacent to the position point corresponding to the preset tracking distance is determined as the probe to be updated corresponding to the second type of indirect probe update strategy; The update budget for the second type of indirect probe update strategy is greater than the update budget for the first type of indirect probe update strategy.

8. The method according to any one of claims 1-4, wherein, The method is applied to a virtual game scene, and the update process for the probe to be updated includes: The probe to be updated is updated based on the direct lighting information in the virtual game scene; The direct lighting information in the virtual game scene is determined based on the main light source information corresponding to the clock data in the virtual game scene; wherein the main light source information changes dynamically with the day-night changes of the clock data.

9. The method according to any one of claims 1-4, wherein, The number of probes to be updated corresponding to the target rendering area in the virtual scene is multiple, and the updated lighting data in the multiple probes to be updated is obtained in the following way: Identify the multiple elements contained in the target rendering area; The probe grid identifier corresponding to each element is converted into a first-level hash identifier. If the first-level hash identifier is not stored in the preset first-level hash table, the converted first-level hash identifier is stored in the first-level hash table. Obtain the probe grid identifier corresponding to each first-level hash identifier in the first-level hash table, convert each probe grid identifier into a second-level hash identifier, and if the second-level hash identifier is not stored in the preset second-level hash table, store the converted second-level hash identifier in the second-level hash table; wherein, the probe grid identifier is used to characterize the probe grid where the probe is located, and the probe grid identifier is used to characterize the grid position of the probe in the probe grid, and a probe grid includes multiple grid positions. Based on the secondary hash identifiers of the multiple probe grid identifiers after deduplication stored in the secondary hash table, the updated illumination data in the probe to be updated corresponding to the multiple probe grid identifiers is obtained.

10. The method according to any one of claims 1-4, wherein, Before updating the probe to be updated, the process further includes: Obtain the initial grid point position of the probe to be updated in the probe grid; If the symbol distance field value at the initial grid point position does not meet the preset condition, the initial grid point position is adjusted so that the symbol distance field value at the adjusted initial grid point position meets the preset condition. The preset conditions include: the symbol distance field value of the initial grid point position is a positive number that is greater than a preset threshold.

11. A lighting rendering system, comprising: The dynamic determination module is adapted to dynamically determine the probe to be updated corresponding to the target rendering area in the virtual scene; wherein the probe to be updated is a probe that is invoked during the rendering process of the target rendering area; The update rendering module is adapted to update the probe to be updated according to the probe calling method of the probe to be updated, so as to perform lighting rendering operation according to the updated lighting data in the probe to be updated. Wherein, if the probe invocation method of the probe to be updated is a direct invocation method, the probe to be updated is updated according to the direct probe update strategy, wherein the probe directly invoked is the probe used to implement the lighting rendering operation; and / or, if the probe invocation method of the probe to be updated is an indirect invocation method, the probe to be updated is updated according to the indirect probe update strategy, wherein the probe indirectly invoked is the probe used to implement the probe update operation.

12. An electronic device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the method as described in any one of claims 1-10.

13. A computer storage medium storing at least one executable instruction that causes a processor to perform the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Illumination rendering method and device, computer equipment and storage medium

    CN114419240A

  • Probe-based dynamic global illumination

    US20210012562A1