Illumination baking method, device, equipment, medium and program product
By voxelizing Unity game scene data and uploading it to the cloud for baking, it solves the problem of excessive consumption of lighting baking computing resources when the game is running, achieving a more realistic game scene experience and improved performance.
Patent Information
- Application Number
- CN202410634448.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-08-27
AI Technical Summary
In Unity game development, existing technology cannot perform scene dynamic lighting baking while the game is running, resulting in excessive consumption of computing resources, especially on mobile devices where performance requirements are too high.
By voxelizing the data of the scene to be processed, the voxelized scene data is generated and sent to the cloud server. The cloud server reconstructs and generates baked textures, and then applies them to the game scene after returning, reducing the local computing burden.
It effectively reduces the demand for device performance, improves the visual effects and fidelity of game scenes, and reduces the occupation of network resources.
Smart Images

Figure CN118552679A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of cloud computing technology, and in particular to a light baking method, device, equipment, medium and program product. Background Art
[0002] In traditional Unity game development, the local baking solution provided by Unity is to convert the dynamic lighting in the scene into static textures when the game is not running. When entering the scene during game running, it reads the pre-calculated textures or data files and renders the entire scene. It can be seen that the local baking solution provided by Unity only supports the baking of dynamic lighting in the scene when the game is not running, and cannot support the baking of dynamic lighting in the scene when the game is running.
[0003] However, in order to provide realistic game scenes, it is usually necessary to calculate lighting and shadow effects in real time while the game is running. This consumes a lot of computing resources and leads to excessive demands on device performance, which is particularly evident on mobile devices. Summary of the invention
[0004] The embodiments of the present application provide a lighting baking method, apparatus, device, medium and program product to solve the technical problem in the related art that real-time calculation of lighting and shadow effects for lighting baking during game running consumes a large amount of computing resources, resulting in excessive demand on device performance.
[0005] To solve the above technical problems, the embodiments of the present application provide the following aspects:
[0006] In a first aspect, an embodiment of the present application provides a light baking method, the method comprising:
[0007] voxelize the relevant data of the scene to be processed to generate voxelized scene data;
[0008] Sending the voxelized scene data to a cloud server;
[0009] The reconstructed scene and the baked map returned by the cloud server are received, wherein the reconstructed scene is generated based on the voxelized scene data, and the baked map is generated based on the reconstructed scene.
[0010] Optionally, after receiving the reconstructed scene and baked texture returned by the cloud server, the method further includes:
[0011] Determining a correspondence between the baked map and the reconstructed scene;
[0012] According to the corresponding relationship, the baked map is applied to the scene to be processed to obtain a target scene.
[0013] Optionally, before performing voxel processing on the relevant data of the scene to be processed to generate voxelized scene data, the method further includes:
[0014] Receive scene editing operations;
[0015] Generate the scene to be processed according to the scene editing operation;
[0016] Based on the scene to be processed, relevant data of the scene to be processed is obtained, wherein the relevant data includes at least one of the following: scene model data, scene illumination data, and scene color data of the scene to be processed.
[0017] Optionally, after sending the voxelized scene data to the cloud server, the method further includes:
[0018] Determine whether the voxelized scene data has been sent, and if so, send a first notification message to the cloud server, wherein the first notification message is used to request the baked map and the reconstructed scene.
[0019] In a second aspect, an embodiment of the present application provides a light baking method, the method comprising:
[0020] receiving voxelized scene data;
[0021] Reconstructing a scene based on the voxelized scene data;
[0022] Generate baked maps based on the reconstructed scene;
[0023] The baked textures and the reconstructed scene are sent.
[0024] Optionally, after generating a baked map based on the reconstructed scene, the method further includes:
[0025] After the baked map and the reconstructed scene are stored in the cloud storage, a second notification message is sent, wherein the second notification message is used to obtain the baked map and the reconstructed scene from the cloud storage.
[0026] In a third aspect, an embodiment of the present application provides a light baking system, the system comprising a client and a cloud server, wherein:
[0027] The client is used to perform voxel processing on the relevant data of the scene to be processed, generate voxelized scene data, and send the voxelized scene data to the cloud server;
[0028] The cloud server is used to reconstruct the scene based on the received voxelized scene data; and generate a baked map based on the reconstructed scene;
[0029] The cloud server is also used to send the baked map and the reconstructed scene to the client.
[0030] The client is also used to receive the baked map and the reconstructed scene returned by the cloud server.
[0031] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of a light baking method as described in the first aspect or the second aspect are implemented.
[0032] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a light baking method as described in the first aspect or the second aspect are implemented.
[0033] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of a light baking method as described in the first aspect or the second aspect.
[0034] Therefore, uploading voxelized scene data can reduce the occupation of network resources. Generating baked textures on the cloud server can reduce the computing burden of local devices and improve device performance. Baking textures can also improve visual effects and provide a more realistic game scene experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0036] Figure 1 A flowchart of a light baking method provided in one of the embodiments of the present application;
[0037] Figure 2 A schematic diagram of vertices and triangular faces of a mesh obtained during voxelization of scene data provided in an embodiment of the present application;
[0038] Figure 3 A flowchart of a light baking method provided for another embodiment of the present application;
[0039] Figure 4 A system architecture diagram of light baking provided in an embodiment of the present application;
[0040] Figure 5 A structural block diagram of a light baking device provided in one of the embodiments of the present application;
[0041] Figure 6 A structural block diagram of a light baking device provided in another embodiment of the present application;
[0042] Figure 7 A structural block diagram of a light baking system provided in an embodiment of the present application;
[0043] Figure 8 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] Figure 1 A light baking method provided by an embodiment of the present application is shown. Figure 1 As shown, the method includes:
[0046] Step S101, voxelizing the relevant data of the scene to be processed to generate voxelized scene data;
[0047] Step S102: sending voxelized scene data to a cloud server;
[0048] Step S103, receiving the reconstructed scene and baked texture returned by the cloud server;
[0049] Figure 1 The method shown can be performed based on Unity, which is a widely used game engine and real-time 3D content creation platform that provides a powerful and flexible development environment for game developers and other content creators.
[0050] Before step S101, relevant data of the scene to be processed can be obtained, including: receiving a scene editing operation of a user; generating a scene to be processed according to the scene editing operation; based on the scene to be processed, obtaining relevant data of the scene to be processed, wherein the relevant data includes at least one of the following: scene model data, scene lighting data, and scene color data of the scene to be processed.
[0051] It should be noted that a user interface (such as the user interface on Unity) or other interactive methods can be used to receive user editing operations on the scene, such as adding, deleting, moving or modifying objects in the scene. Generating a scene to be processed based on the scene editing operation can be creating, adjusting or combining different scene elements (such as objects, textures, light sources, etc.). The scene model data includes: information such as objects, geometric shapes, positions, rotations and scales in the scene. These data can be saved as a 3D model file (such as OBJ, FBX, etc.) for subsequent processing; the scene lighting data includes information such as the position, type, intensity and color of the light source in the scene; the scene color data includes the color information of the objects in the scene, which can be the color of the object material, texture map or other shading information.
[0052] Voxelization is a method of converting scene data to be processed into voxel representation. Voxels are discrete points in three-dimensional space, similar to pixels being discrete points in two-dimensional space. Voxelization converts information such as objects, geometry, and attributes in a scene into a voxel grid for more advanced analysis, processing, and rendering.
[0053] It should be noted that after editing the scene in the application client, the voxel storage method of Dense Array (a data structure used to realize scene voxelization) can be used to store two-dimensional planes with grids, and the three-dimensional space objects can be divided into a large number of small squares of the same size to realize the voxelization of the scene. Specifically, dividing the three-dimensional space object into a large number of small squares of the same size means using the component MeshFilter in the client logic to obtain the mesh (Mesh) used by the three-dimensional space object, thereby obtaining the vertices (vertices) of the mesh and the triangles (triangles) composed of these vertices, such as Figure 2 As shown. Among them, the coordinates of the vertices in the triangle are local coordinates (local Position), which need to be converted to world coordinates (world Position) before voxelization is calculated. Bounds (that is, the AABB box corresponding to the mesh, which can also be understood as a bounding box) is obtained through mesh.bounds, and the bounding box is used to simplify collision judgment. When the bounding box of a mesh intersects with the bounding box of an object that pre-limits the voxelization range, it is necessary to voxelize it. When voxelizing a triangle, the bounding box can be used to obtain the value range of the mesh where the triangle is located on the x, y, and z axes, and obtain the voxel array occupied by the object, and then split the triangle to finally obtain the voxel state array of the marked voxels that are occupied.
[0054] It should be noted that the voxelization process can be summarized into the following steps: Determine the resolution of the voxel grid: First, it is necessary to determine the resolution of the voxel grid, that is, how many voxels the scene space is divided into. The choice of resolution depends on the complexity of the scene and the required accuracy; Create an empty voxel grid: According to the determined resolution, create an empty voxel grid, which is composed of discrete voxels to form a three-dimensional grid structure; Map scene data to the voxel grid: Map information such as objects, geometric shapes, and attributes in the scene data to be processed to the voxel grid. This can be achieved by intersecting the volume of the object with the voxel and storing the corresponding attribute information in the intersecting voxels; Attribute storage: Various attributes can be stored in each voxel as needed, such as the material, color, density, etc. of the object. These attributes can be used in subsequent processing, such as lighting calculation, collision detection or volume rendering.
[0055] In step S102 and step S103, voxelized scene data needs to be sent to the cloud server, and the reconstructed scene and baked texture returned by the cloud server are received.
[0056] Among them, the reconstructed scene is generated based on the voxelized scene data, and the baked map is generated based on the reconstructed scene. Baking in the baked map is an optimization technique that precalculates and stores the effects of lighting, shadows, and reflections in the scene. The baked map is the product of this process and contains this pre-calculated lighting information. When the client downloads and applies these baked maps, they are used to improve the visual quality of the original voxelized scene (for example: game scene). This means that the basic structure and layout of the scene remain unchanged, but its visual performance (such as lighting and shadow effects) will be significantly improved.
[0057] It should be noted that step S102 and step S103 specifically involve the following components:
[0058] Cloud Function: Cloud Function is a serverless computing service that allows users to write and deploy code without having to worry about the underlying infrastructure. Cloud functions are executed when triggered, such as through http requests, scheduled tasks, or other cloud service events. In the method shown in the embodiment of the present application, the cloud function is used to receive voxel scene information uploaded by the client, and trigger subsequent processing based on this information. In addition, a Docker container can be started in the cloud function to execute the logic in the Docker container. And the method shown in the embodiment of the present application can support the opening of multiple cloud functions to execute baking synchronously, and support multiple clients to request the cloud server to execute cloud baking tasks at the same time.
[0059] Docker container: A Docker container is a lightweight, executable software package that contains everything needed for the software to run, such as code, runtime environment, libraries, and system tools. Docker containers can be isolated from the rest of the system but share the same operating system kernel. In the method shown in the embodiment of the present application, Docker containers can be used to encapsulate the Unity editor and related extensions to ensure that the Unity environment can run in the same way anywhere.
[0060] In an embodiment of the present application, a Docker container can be used to carry out baking and resource packaging operations. Specifically, a customized Unity editor is started to reconstruct the corresponding scene according to the voxel scene information received by the cloud function baking scheduler from the scene resource bucket. That is, the voxel data of the corresponding client stored in the scene resource bucket is used to extend the Unity editor in the Docker container, and each grid is restored according to the incoming voxel scene information, and the game scene is automatically generated. The light source, material, object and other information in the scene are calculated and stored as a baked map. It should be noted that in the Unity editor, Unity's AssetBundle function can be used to package the reconstructed scene and the generated map resources into a resource package, and after configuring the automated script to upload the resource package to the lighting resource bucket, the client is notified to update the resource package.
[0061] Cloud Function Baking Scheduler: The Cloud Function Baking Scheduler is responsible for scheduling and managing the baking process (for example, lighting and shadow processing for game scenes), including starting cloud functions and Docker containers that can perform baking work.
[0062] The cloud function baking scheduler is mainly responsible for receiving voxel scene information transmitted by the client and dynamically allocating computing and storage resources according to demand. Specifically, the cloud function baking scheduler monitors the voxel scene information events transmitted by the client in real time, receives and stores the voxel scene information, and creates a thread to execute the cloud function when it monitors the event of the client transmitting voxel scene information to the scene resource storage bucket.
[0063] Optionally, the Cloud Function Baking Scheduler can not only continuously monitor changes in the scene resource bucket and automatically respond when new data is detected, but also receive requests sent by the client. Requests usually contain the necessary data or instructions to tell the Cloud Function Baking Scheduler what specific operations need to be performed, such as starting the scene reconstruction and baking process.
[0064] Unity Editor: Unity Editor is a widely used game development platform that provides a series of tools for creating, testing and deploying games and interactive content. In the method shown in the embodiment of the present application, the Unity Editor is used to automatically generate game scenes based on the uploaded voxel scene information, including scene layout, lighting processing, etc.
[0065] In a possible implementation, after step S102, sending the voxelized scene data to the cloud server, the method further includes: determining whether the voxelized scene data has been sent, and if so, sending a first notification message to the cloud server, wherein the first notification message is used for a request.
[0066] That is to say, after determining that the voxelized scene data has been completely sent, a first notification message is sent to the cloud server to obtain the reconstructed scene and baked map. Among them, determining whether the voxelized scene data has been completely sent can be achieved by checking whether the amount of data sent is equal to the expected amount of data. In addition, the reconstructed scene and baked map can be obtained in another way, that is, the client uploads the voxelized scene data (such as: voxelized scene data stored as VoxelState[]Voxels) to the scene resource storage bucket, and marks the corresponding client's unique identifier to store the corresponding voxel data; the scene resource storage bucket can notify the cloud function baking scheduler to start cloud baking; when the client detects a new available resource package, it can download the resource package. The application client can apply the new baked map in the resource package to the game scene to improve the visual effect of the scene.
[0067] In summary, the client first uploads the voxel scene information (a data structure used to describe objects in 3D space) to the cloud function, where the voxel scene information is transmitted as basic data. After uploading, the cloud function triggers and executes tasks. The main task of the cloud function is to schedule a Docker container. Docker is an open source application container engine that can be used to package, transport and run applications. Inside the Docker container, the Unity editor is started. In the Unity editor, a special extension is integrated, which can automatically generate game scenes based on the received voxel scene information. This process includes scene reconstruction and baking (baking usually refers to pre-calculating and storing the lighting and shadow effects of the game environment to improve the performance of the game when it is running). In the Unity editor, Unity's AssetBundle function (a function for packaging and loading scenes and their resources) can be used to package the reconstructed scene and the generated texture resources into resource packages, and then these resource packages are uploaded to the cloud storage bucket through automated scripts, which not only ensures the availability of resources, but also improves the security of resources. Finally, after the application client detects the availability of new baked texture resource packages, it downloads these resource packages. After downloading, the client applies these baked maps to the scene (such as the game scene), thereby improving the visual effect of the scene. And through the above solution, efficient and flexible scene generation and management are achieved.
[0068] In a possible implementation, after receiving the reconstructed scene and the baked map returned by the cloud server in step S103, the method further includes: determining a correspondence between the baked map and the reconstructed scene; and applying the baked map to the scene to be processed according to the correspondence to obtain a target scene.
[0069] It should be noted that the correspondence between the reconstructed scene and the baked map can be determined by matching the geometric information of the reconstructed scene and the texture information of the baked map. For example, the correspondence can be performed using texture coordinates or pixel coordinates. After the correspondence between the baked map and the reconstructed scene is determined, the baked map can be applied to the scene to be processed to obtain the target scene according to the correspondence. In this way, the lighting effect can be simulated more accurately during the rendering process of the scene, making the final rendering result more realistic and lifelike.
[0070] Figure 3 A light baking method according to an embodiment of the present application is shown. Figure 3 As shown, the method includes:
[0071] Step S301, receiving voxelized scene data;
[0072] Step S302: reconstructing the scene based on the voxelized scene data;
[0073] Step S303, generating a baked map based on the reconstructed scene;
[0074] Step S304: Send the baked texture and the reconstructed scene.
[0075] Among them, generating a baked map based on the reconstructed scene includes: generating a baked map based on the reconstructed scene and pre-stored baking parameters, wherein the baking parameters include at least one of the following: baking resolution, light source settings, and shadow quality. Specifically, the baking parameters include: light map resolution, which is used to control the detail level of the light map. The higher the resolution, the more details on the map; lighting model, which is used to determine how to calculate the interaction between lighting and materials. Different lighting models can simulate different physical properties, such as diffuse reflection, specular reflection, etc.; light source settings, which can determine the impact of each light source on the baking result, including the type, intensity, color, shadow, etc. of the light source; shadow quality, which is used to affect the clarity and realism of the shadow. High-quality shadows can enhance the depth and three-dimensional sense of the scene; reflection probes, which are used to capture and simulate reflection effects in the environment to improve the realism of the scene; ambient lighting, which is used to simulate the light of indirect light sources. Lighting effects, such as scattered light; indirect lighting intensity, which determines the degree of influence of indirect light (such as reflected light) on the scene. Increasing or decreasing the indirect lighting intensity can balance the overall lighting effect of the scene; the compression and format of the lightmap, which can affect the size and quality of the lightmap. Users can choose the appropriate compression level and format according to actual needs; post-processing of light baking, which is used to optimize the lightmap after baking, such as eliminating baking artifacts, smooth transitions, etc.; light probes, which are used to provide indirect lighting effects for dynamic objects; baking time and performance, which are used to affect the time and resource consumption required for baking; lightmap size optimization, to ensure efficient use of lightmaps and avoid unnecessary waste of resources. In summary, it is necessary to adjust the baking parameters according to the specific needs of the scene, the expected visual effects, and the performance limitations of the device. Reasonable baking parameter settings can significantly improve the visual quality of the scene while ensuring the performance and efficiency of the device during operation.
[0076] It should be noted that Figure 3 The execution subject of the method shown is the cloud server, and the specific steps can be referred to Figure 1 The introduction in the method shown will not be repeated here.
[0077] In another possible implementation, after step S303, generating a baked map based on the reconstructed scene, the method further includes: after storing the baked map and the reconstructed scene in the cloud storage, sending a second notification message, wherein the second notification message is used to obtain the baked map and the reconstructed scene from the cloud storage.
[0078] It should be noted that the cloud server can send the baked maps and reconstructed scenes to the cloud storage, and after sending, send a second notification message to the client to notify the client that it can obtain the required baked maps and reconstructed scenes from the cloud storage.
[0079] It should be noted that by using cloud storage as a distribution point, the direct burden on the server can be significantly reduced, and a more flexible, reliable and efficient resource management and distribution mechanism can be provided, which is suitable for handling large-scale and complex application scenarios. If there are high requirements for real-time updates, the resource package can also be sent directly to the corresponding client to reduce time consumption and improve efficiency.
[0080] In summary, the lighting baking method provided in the embodiment of the present application can realize the baking requirements after scene editing of the dynamic processing application client; it can improve the visual effect and provide a more realistic game scene experience; it can reduce the computing burden of the local device and improve the game performance; and it has a scalable architecture and can adapt to cloud baking of application clients of different sizes.
[0081] Figure 4 A system architecture diagram of light baking provided according to an embodiment of the present application is shown. Figure 4 The system architecture diagram shown summarizes the method shown in the embodiment of the present application from the perspective of business process:
[0082] 1. After the application client edits the scene, it voxelizes the scene, uploads the voxel data to the scene resource bucket, and notifies the baking scheduler;
[0083] It should be noted that due to the huge amount of information in the complete scene, voxelizing the scene and then uploading it to the cloud server can reduce the consumption of network resources.
[0084] 2. The baking scheduler creates and starts cloud function tasks, and supports creating and starting multiple cloud function tasks based on baking notifications from different clients at the same time.
[0085] 3. The cloud function first executes the scene reconstruction task. Obtain the scene voxel data of the corresponding application client from the scene resource bucket, start the cloud unity editor to rebuild the scene and execute the baking task according to the information of the current version of the server, package the light map resources, upload them to the light resource bucket, and notify the client that the baking is completed.
[0086] 4. The application client obtains the corresponding light map resource from the light resource bucket and applies it to the current scene, completing the cloud baking process of the current scene.
[0087] In summary, the application client transmits the voxel scene information to the cloud function, and then the cloud function baking scheduler starts a Docker container, in which the Unity editor is started. The Unity editor contains a Unity editor extension that can automatically generate the game scene based on the incoming voxel scene information. Further, this process includes scene reconstruction and baking. In the Unity editor, use Unity's AssetBundle function to package the reconstructed scene and the generated texture resources into a resource package. The resource package is then uploaded to the cloud storage bucket through the configured automation script to ensure the availability and security of the resources. The application client detects the availability of the new baked texture resource package and downloads the resource package. The application client applies the baked texture to the game scene to improve the visual effect of the scene.
[0088] Figure 5 A light baking device according to an embodiment of the present application is shown. Figure 5 As shown, the device 50 includes:
[0089] A generating module 501 is used to perform voxel processing on the relevant data of the scene to be processed to generate voxelized scene data;
[0090] A first execution module 502, configured to send voxelized scene data to a cloud server;
[0091] The reconstructed scene and the baked map returned by the cloud server are received, wherein the reconstructed scene is generated based on the voxelized scene data, and the baked map is generated based on the reconstructed scene.
[0092] In a possible implementation, the first execution module 502 is further configured to determine a correspondence between the baked texture and the reconstructed scene after receiving the reconstructed scene and the baked texture returned by the cloud server;
[0093] According to the corresponding relationship, the baked map is applied to the scene to be processed to obtain the target scene.
[0094] In a possible implementation, the first execution module 502 is further configured to receive a scene editing operation from a user before voxelizing the relevant data of the scene to be processed to generate voxelized scene data;
[0095] Generate a scene to be processed according to the scene editing operation;
[0096] Based on the scene to be processed, relevant data of the scene to be processed is obtained, wherein the relevant data includes at least one of the following: scene model data, scene lighting data, and scene color data of the scene to be processed.
[0097] In one possible implementation, the first execution module 502 is further used to determine whether the voxelized scene data has been sent to the cloud server after sending the voxelized scene data to the cloud server. If so, a first notification message is sent to the cloud server, wherein the first notification message is used to request baking of the map and the reconstructed scene.
[0098] In summary, the lighting baking device provided in the embodiment of the present application can realize the baking requirements after scene editing of the dynamic processing application client; it can improve the visual effect and provide a more realistic game scene experience; it can reduce the computing burden of the local device and improve the game performance; and it has a scalable architecture and can adapt to cloud baking of application clients of different sizes.
[0099] Figure 6 A light baking device according to an embodiment of the present application is shown. Figure 6 As shown, the device 60 includes:
[0100] A receiving module 601 is used to receive voxelized scene data;
[0101] A second execution module 602, configured to perform scene reconstruction based on voxelized scene data;
[0102] Generate baked maps based on the reconstructed scene;
[0103] Send the baked maps and the rebuilt scene.
[0104] In one possible implementation, the second execution module 602 is further used to send a second notification message after generating a baked map based on the reconstructed scene and storing the baked map and the reconstructed scene in the cloud storage, wherein the second notification message is used to obtain the baked map and the reconstructed scene from the cloud storage.
[0105] In summary, the lighting baking device provided in the embodiment of the present application can realize the baking requirements after scene editing of the dynamic processing application client; it can improve the visual effect and provide a more realistic game scene experience; it can reduce the computing burden of the local device and improve the game performance; and it has a scalable architecture and can adapt to cloud baking of application clients of different sizes.
[0106] The present application also provides a light baking system. Figure 7 As shown, the system 70 includes a client 701 and a cloud server 702, wherein:
[0107] The client 701 is used to voxelize the relevant data of the scene to be processed, generate voxelized scene data, and send the voxelized scene data to the cloud server;
[0108] The cloud server 702 is used to reconstruct the scene based on the received voxelized scene data; and generate a baked map based on the reconstructed scene;
[0109] The cloud server 702 is also used to send the baked texture and the reconstructed scene to the client;
[0110] The client 701 is also used to receive the baked texture and reconstructed scene returned by the cloud server.
[0111] In summary, the lighting baking system provided in the embodiment of the present application can dynamically process the baking requirements of the application client after scene editing; can improve the visual effects and provide a more realistic game scene experience; and reduce the computing burden of the local device and improve the game performance; and has a scalable architecture that can adapt to cloud baking of application clients of different sizes.
[0112] The present application embodiment also provides an electronic device 80, such as Figure 7 As shown, it includes: a processor 801, a memory 802, and a program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor, the steps of a light baking method shown in the above embodiment are implemented.
[0113] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a light baking method shown in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0114] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of a light baking method shown in the above method embodiment and can achieve the same technical effect. To avoid repetition, they are not described here.
[0115] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0117] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A light baking method, characterized in that: The method comprises: voxelize the relevant data of the scene to be processed to generate voxelized scene data; Sending the voxelized scene data to a cloud server; The reconstructed scene and the baked map returned by the cloud server are received, wherein the reconstructed scene is generated based on the voxelized scene data, and the baked map is generated based on the reconstructed scene.
2. The method according to claim 1, characterized in that: After receiving the reconstructed scene and baked texture returned by the cloud server, the method further includes: Determining a correspondence between the baked map and the reconstructed scene; According to the corresponding relationship, the baked map is applied to the scene to be processed to obtain a target scene.
3. The method according to claim 1, characterized in that Before performing voxel processing on the relevant data of the scene to be processed to generate voxelized scene data, the method further includes: Receive scene editing operations; Generate the scene to be processed according to the scene editing operation; Based on the scene to be processed, relevant data of the scene to be processed is obtained, wherein the relevant data includes at least one of the following: scene model data, scene illumination data, and scene color data of the scene to be processed.
4. The method according to claim 1, characterized in that After sending the voxelized scene data to the cloud server, the method further includes: Determine whether the voxelized scene data has been sent, and if so, send a first notification message to the cloud server, wherein the first notification message is used to request the baked map and the reconstructed scene.
5. A light baking method, characterized in that: The method comprises: receiving voxelized scene data; Reconstructing a scene based on the voxelized scene data; Generate baked maps based on the reconstructed scene; The baked textures and the reconstructed scene are sent.
6. The method according to claim 5, characterized in that After generating a baked map based on the reconstructed scene, the method further includes: After the baked map and the reconstructed scene are stored in the cloud storage, a second notification message is sent, wherein the second notification message is used to obtain the baked map and the reconstructed scene from the cloud storage.
7. A light baking system, characterized in that: The system includes a client and a cloud server, wherein: The client is used to perform voxel processing on the relevant data of the scene to be processed, generate voxelized scene data, and send the voxelized scene data to the cloud server; The cloud server is used to reconstruct the scene based on the received voxelized scene data; and generate a baked map based on the reconstructed scene; The cloud server is also used to send the baked map and the reconstructed scene to the client. The client is also used to receive the baked map and the reconstructed scene returned by the cloud server.
8. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the light baking method according to any one of claims 1 to 4 are implemented, or when the program is executed by the processor, the steps of the light baking method according to any one of claims 5 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the program is executed by the processor, the steps of the light baking method according to any one of claims 1 to 4 are implemented. When the program is executed by the processor, the steps of the light baking method according to any one of claims 5 to 6 are implemented.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the light baking method according to any one of claims 1 to 4, or the program, when executed by the processor, implements the steps of the light baking method according to any one of claims 5 to 6.
