CN-121982189-A - Virtual scene illumination layout method and device, electronic equipment and storage medium
Abstract
The application discloses a virtual scene illumination layout method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of extracting scene characteristics of a target virtual scene according to scene data of the target virtual scene; the method comprises the steps of obtaining illumination constraint conditions input under at least one illumination constraint type aiming at a target virtual scene, constructing illumination constraint functions under the target virtual scene based on the illumination constraint conditions, predicting noise of a noisy illumination layout scheme by taking scene characteristics as conditions of a diffusion model to obtain predicted noise quantity, correcting the predicted noise quantity based on each illumination constraint function and weight parameters aiming at each illumination constraint function to obtain corrected noise quantity, and carrying out iterative denoising on the noisy illumination layout scheme based on the corrected noise quantity until denoising end conditions are met to obtain a first illumination layout scheme. Therefore, the illumination layout scheme which is consistent with the scene structure and has high availability can be obtained, and the illumination layout efficiency of the virtual scene is improved.
Inventors
- WEI WEILIANG
Assignees
- 广州博冠信息科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260107
Claims (13)
- 1. A method for virtual scene lighting layout, the method comprising: Extracting scene characteristics of a target virtual scene according to scene data of the target virtual scene; acquiring an illumination constraint condition input under at least one illumination constraint type aiming at a target virtual scene; Constructing an illumination constraint function under the target virtual scene based on the illumination constraint condition, wherein the illumination constraint function is used for determining the satisfaction degree of an illumination layout scheme on the illumination constraint condition; Taking the scene characteristics as the conditions of the diffusion model, carrying out noise prediction on the noisy illumination layout scheme to obtain the predicted noise quantity; correcting the predicted noise amount based on each illumination constraint function and weight parameters of each illumination constraint function to obtain corrected noise amount; and carrying out iterative denoising on the noisy illumination layout scheme based on the corrected noise amount until a denoising ending condition is met, so as to obtain a first illumination layout scheme.
- 2. The method of claim 1, wherein iteratively denoising the noisy illumination layout scheme based on the corrected noise amount until a denoising end condition is satisfied, obtaining a first illumination layout scheme, comprises: denoising the noisy illumination layout scheme based on the corrected noise amount to obtain a new noisy illumination layout scheme; and continuously executing the condition taking the scene characteristic as a diffusion model based on the new noisy illumination layout scheme, and carrying out noise prediction on the noisy illumination layout scheme to obtain a predicted noise amount until a denoising ending condition is met, so as to obtain the first illumination layout scheme.
- 3. The method of claim 2, wherein correcting the predicted noise amount based on the illumination constraint functions and the weight parameters of the illumination constraint functions to obtain corrected noise amounts comprises: determining a first loss of the illumination layout scheme corresponding to the predicted noise amount based on each illumination constraint function and the weight parameter of each illumination constraint function; and determining a gradient corresponding to the first loss to obtain a corrected noise amount based on the gradient.
- 4. A method according to claim 3, wherein said determining a gradient corresponding to said first loss to obtain a corrected noise amount based on said gradient comprises: Determining a gradient of the first loss relative to a lighting layout scheme corresponding to the predicted noise amount; Weighting the gradient sum based on a preset guiding intensity parameter to obtain a correction quantity of the predicted noise quantity; and correcting the predicted noise amount based on the correction amount to obtain the corrected noise amount.
- 5. A method according to claim 3, wherein said determining a first loss of the lighting layout scheme corresponding to the predicted noise amount based on the lighting constraint functions and the weight parameters of the lighting constraint functions comprises: Determining a second loss corresponding to each illumination constraint function according to each illumination constraint function and an illumination layout scheme corresponding to the predicted noise amount; and determining the first loss according to the second loss corresponding to each illumination constraint function and the weight parameter of each illumination constraint function.
- 6. The method of claim 5, wherein the method further comprises: determining an evaluation index value of the target virtual scene under at least one evaluation dimension based on the first illumination layout scheme; Determining the comprehensive evaluation score of the first illumination layout scheme according to the evaluation index value corresponding to each evaluation dimension and the preset weight corresponding to each evaluation dimension; updating the weight parameters of each illumination constraint function according to the comprehensive evaluation score to obtain updated weight parameters of each illumination constraint function; Re-executing the weight parameters based on the illumination constraint functions and the illumination constraint functions based on the updated weight parameters of the illumination constraint functions, and correcting the predicted noise amount to obtain corrected noise amount so as to obtain a second illumination layout scheme; wherein the evaluation dimension includes at least one of an interaction dimension, a visual dimension, and a resource consumption dimension.
- 7. The method of claim 6, wherein updating the weight parameters of each of the illumination constraint functions according to the comprehensive evaluation score to obtain updated weight parameters of each of the illumination constraint functions comprises: calculating the gradient of the comprehensive evaluation score relative to the weight parameter of each illumination constraint function based on the comprehensive evaluation score; and updating the weight parameters of each illumination constraint function according to the gradient and the preset learning rate parameter to obtain updated weight parameters of each illumination constraint function.
- 8. The method according to any one of claims 1-7, wherein extracting at least one scene feature of the target virtual scene according to the scene data of the target virtual scene comprises: acquiring object information of a virtual object in the target virtual scene based on the scene data of the target virtual scene; extracting object features of the virtual object based on the object information of the virtual object, wherein the object features comprise at least one of geometric feature vectors, material feature vectors and semantic feature vectors; And combining object features of the virtual objects to obtain at least one scene feature of the target virtual scene.
- 9. The method of any one of claims 1-7, wherein the illumination constraint type includes at least one of a constraint on global illumination of the target virtual scene, a constraint on partial area illumination in the target virtual scene, a constraint on illumination of a specified virtual object in the target virtual scene, a constraint on illumination of a path in the target virtual scene, a constraint on illumination of a specified viewing angle, and a constraint related to light source rendering resources.
- 10. The method according to any one of claims 1-7, further comprising: And rendering the target virtual scene by using a target illumination layout scheme, wherein the target illumination layout scheme is determined based on the first illumination layout scheme and/or the second illumination layout scheme.
- 11. A virtual scene lighting layout apparatus, the apparatus comprising: The extraction module is used for extracting scene characteristics of the target virtual scene according to the scene data of the target virtual scene; The acquisition module is used for acquiring the illumination constraint conditions input under at least one illumination constraint type aiming at the target virtual scene; The construction module is used for constructing an illumination constraint function under the target virtual scene based on the illumination constraint condition, and the illumination constraint function is used for determining the satisfaction degree of an illumination layout scheme on the illumination constraint condition; the obtaining module is used for carrying out noise prediction on the noisy illumination layout scheme by taking the scene characteristics as the conditions of the diffusion model to obtain the predicted noise quantity; correcting the predicted noise amount based on each illumination constraint function and weight parameters of each illumination constraint function to obtain corrected noise amount; and carrying out iterative denoising on the noisy illumination layout scheme based on the corrected noise amount until a denoising ending condition is met, so as to obtain a first illumination layout scheme.
- 12. An electronic device, comprising a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads instructions from the memory to perform the steps of the virtual scene lighting layout method of any one of claims 1-10.
- 13. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the virtual scene illumination layout method according to any of claims 1-10.
Description
Virtual scene illumination layout method and device, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of games, and in particular relates to a virtual scene illumination layout method, a device, electronic equipment and a storage medium. Background Nowadays, artificial intelligence technology is widely applied to the fields of game development, virtual reality, film and television production and the like gradually, and corresponding scene images or illumination effects can be generated through text input. In the related technology, the artificial intelligence technology is used for generating a basic illumination map according to text description or performing simple style migration, but the generation scheme of the illumination layout of the method often does not accord with the expectation of a user, the problems of unreasonable shadow, high-light misplacement or light source omission and the like easily occur, the generation effect is poor, and the user (such as a designer) still needs to input a great amount of time to manually adjust and correct. Disclosure of Invention The embodiment of the application provides a virtual scene illumination layout method, a device, electronic equipment and a storage medium, which can obtain an illumination layout scheme with higher satisfaction and availability and improve the illumination layout efficiency of a virtual scene. In a first aspect, an embodiment of the present application provides a virtual scene illumination layout method, where the method includes: Extracting scene characteristics of a target virtual scene according to scene data of the target virtual scene; acquiring an illumination constraint condition input under at least one illumination constraint type aiming at a target virtual scene; Constructing an illumination constraint function under the target virtual scene based on the illumination constraint condition, wherein the illumination constraint function is used for determining the satisfaction degree of an illumination layout scheme on the illumination constraint condition; Taking the scene characteristics as the conditions of the diffusion model, carrying out noise prediction on the noisy illumination layout scheme to obtain the predicted noise quantity; correcting the predicted noise amount based on each illumination constraint function and weight parameters of each illumination constraint function to obtain corrected noise amount; and carrying out iterative denoising on the noisy illumination layout scheme based on the corrected noise amount until a denoising ending condition is met, so as to obtain a first illumination layout scheme. In a second aspect, an embodiment of the present application provides a virtual scene illumination layout apparatus, including: The extraction module is used for extracting scene characteristics of the target virtual scene according to the scene data of the target virtual scene; The acquisition module is used for acquiring the illumination constraint conditions input under at least one illumination constraint type aiming at the target virtual scene; The construction module is used for constructing an illumination constraint function under the target virtual scene based on the illumination constraint condition, and the illumination constraint function is used for determining the satisfaction degree of an illumination layout scheme on the illumination constraint condition; the obtaining module is used for carrying out noise prediction on the noisy illumination layout scheme by taking the scene characteristics as the conditions of the diffusion model to obtain the predicted noise quantity; correcting the predicted noise amount based on each illumination constraint function and weight parameters of each illumination constraint function to obtain corrected noise amount; and carrying out iterative denoising on the noisy illumination layout scheme based on the corrected noise amount until a denoising ending condition is met, so as to obtain a first illumination layout scheme. In a third aspect, an embodiment of the present application further provides an electronic device, including a memory storing a plurality of instructions, and a processor loading the instructions from the memory to execute any one of the steps of the virtual scene illumination layout method provided by the embodiment of the present application. In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, where a plurality of instructions are stored, where the instructions are adapted to be loaded by a processor to perform any of the steps of the virtual scene lighting layout method provided by the embodiment of the present application. By adopting the scheme of the embodiment of the application, in the generation process, the scene characteristics are extracted from the scene data and are input as the conditions of the diffusion model, so that