Image rendering method and apparatus

CN117218273BActive Publication Date: 2026-10-27ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311255120.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2026-10-27
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

[0004]然而,在场景数据的数据量较大的情况下,例如,大世界游戏场景的场景数据包括上万个对象模型,直接对场景数据进行渲染,需要将场景数据先映射到生成二维纹理空间(UV空间)中,接着依次完成光照信息的采样、光照参数的计算、光照贴图的分配、光照贴图的打包和压缩等步骤,所需要处理的数据量是巨大的,场景中的每个对象模型都要对应生成一一对应的光照贴图,再基于光照贴图,对各对象模型进行渲染,对软硬件资源的性能要求过高,导致图像渲染的成本高,且图像渲染的效率不足

Benefits of technology

[0011]本说明书一个实施例中,获取目标场景的场景数据;基于空间维度,对场景数据进行划分,获得多个场景子数据;利用预设体素单元,分别对多个场景子数据进行拟合,获得各场景子数据对应的体素数据;将各体素数据分发至分布式计算节点上进行光照烘焙,获得各体素数据的光照参数;基于各体素数据的光照参数,对目标场景的场景图像进行渲染。在空间维度上将场景数据划分成多个场景子数据,利用预设体素单元,分别对多个场景子数据进行拟合,获得空间维度下各场景子数据对应的体素数据,将各体素数据分发至分布式节点,多线程并行地实现了光照烘焙,避免了生成与对象模型一一对应的光照贴图,提升了光照烘焙的效率,基于高效获得的光照参数,对场景图像进行渲染,相应提升了图像渲染的效率,降低了对软硬件资源的性能要求,降低了图像渲染的成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117218273B_ABST
    Figure CN117218273B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide an image rendering method and device, wherein the image rendering method comprises: obtaining scene data of a target scene; dividing the scene data based on a spatial dimension to obtain a plurality of scene sub-data; fitting the plurality of scene sub-data respectively using a preset voxel unit to obtain voxel data corresponding to each scene sub-data; distributing each voxel data to a distributed computing node for light baking to obtain a light parameter of each voxel data; and rendering a scene image of the target scene based on the light parameter of each voxel data. Through the distributed computing node, light baking of the voxel data under the spatial dimension is completed, the efficiency of light baking is improved, the efficiency of image rendering is correspondingly improved, the performance requirement for software and hardware resources is reduced, and the cost of image rendering is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of image processing technology, and in particular to an image rendering method. Background Technology

[0002] With the development of image processing technology, large-scale scene production and scene image rendering have been widely used in many fields such as animation, games, architecture, design, and film and television.

[0003] Currently, in the process of image rendering, in order to achieve realistic lighting effects and thus improve the image quality of the rendered scene image, it is necessary to perform lighting baking on the scene data to simulate the lighting effects in the real scene.

[0004] However, when dealing with large amounts of scene data—for example, large-scale game scenes containing tens of thousands of object models—direct rendering requires mapping the scene data into a generated 2D texture space (UV space), followed by sequential steps such as sampling lighting information, calculating lighting parameters, allocating lightmaps, and packaging and compressing them. The amount of data processed is enormous; each object model in the scene needs a corresponding lightmap generated, and then rendering is performed based on these lightmaps. This places excessive demands on hardware and software resources, resulting in high rendering costs and insufficient efficiency. Therefore, a low-cost, high-efficiency image rendering method is urgently needed. Summary of the Invention

[0005] In view of this, embodiments of this specification provide an image rendering method. One or more embodiments of this specification also relate to an image rendering apparatus, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0006] According to a first aspect of the embodiments of this specification, an image rendering method is provided, comprising: Obtain scene data for the target scene; Based on the spatial dimension, the scene data is divided to obtain multiple scene sub-data; Using preset voxel units, multiple scene sub-data are fitted to obtain voxel data corresponding to each scene sub-data. The voxel data is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data. The scene image of the target scene is rendered based on the lighting parameters of each voxel data.

[0007] According to a second aspect of the embodiments of this specification, an image rendering apparatus is provided, comprising: The acquisition module is configured to acquire scene data of the target scene; The partitioning module is configured to divide the scene data based on spatial dimensions to obtain multiple scene sub-data. The fitting module is configured to use preset voxel units to fit multiple scene sub-data to obtain voxel data corresponding to each scene sub-data. The baking module is configured to distribute the voxel data to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data. The rendering module is configured to render the scene image of the target scene based on the lighting parameters of each voxel data.

[0008] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described image rendering method.

[0009] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the above-described image rendering method.

[0010] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described image rendering method.

[0011] In one embodiment of this specification, scene data of a target scene is acquired; the scene data is divided into multiple scene sub-data based on the spatial dimension; using preset voxel units, the multiple scene sub-data are fitted to obtain voxel data corresponding to each scene sub-data; the voxel data is distributed to distributed computing nodes for lighting baking to obtain lighting parameters for each voxel data; and the scene image of the target scene is rendered based on the lighting parameters of each voxel data. Dividing the scene data into multiple scene sub-data in the spatial dimension, fitting the multiple scene sub-data with preset voxel units to obtain voxel data corresponding to each scene sub-data in the spatial dimension, and distributing the voxel data to distributed nodes, lighting baking is implemented in a multi-threaded parallel manner. This avoids generating lightmaps that correspond one-to-one with the object model, improving the efficiency of lighting baking. Based on the efficiently obtained lighting parameters, the scene image is rendered, thereby improving the efficiency of image rendering, reducing the performance requirements of hardware and software resources, and lowering the cost of image rendering. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating an image rendering method provided in one embodiment of this specification; Figure 2 This is a schematic diagram of the spatial envelope in an image rendering method provided in one embodiment of this specification; Figure 3 This is a schematic diagram of scene data partitioning in an image rendering method provided in one embodiment of this specification; Figure 4 This is a schematic diagram of a virtual camera in an image rendering method provided in one embodiment of this specification; Figure 5 This is a schematic diagram illustrating the dynamic loading of the renderer in an image rendering method provided in one embodiment of this specification; Figure 6 This is a schematic diagram of the detail levels in an image rendering method provided in one embodiment of this specification; Figure 7 This is a schematic diagram of an overlapping region in an image rendering method provided in one embodiment of this specification; Figure 8 This is a front-end schematic diagram of adjusting baking parameters in an image rendering method provided in one embodiment of this specification; Figure 9 This is a front-end schematic diagram of voxel unit settings in an image rendering method provided in one embodiment of this specification; Figure 10 This is a schematic flowchart of an image rendering method provided in one embodiment of this specification; Figure 11 This is a flowchart illustrating the processing procedure of an image rendering method applied to a game scene, as provided in one embodiment of this specification. Figure 12 This is a schematic diagram of the structure of an image rendering apparatus provided in one embodiment of this specification; Figure 13 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0013] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0014] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0015] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0016] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0017] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0018] Global Illumination (GI) is a technique in computer graphics used to simulate the reflection, refraction, and diffraction of light in real-world scenarios. It simulates the surface lighting effects of objects in a scene by calculating the propagation paths and reflection coefficients of light rays. In practical applications, light baking is often used to reduce computational load.

[0019] Voxel (volume element): The basic building block of a 3D scene. It is used to represent the shape and structure of object models in a 3D scene, and is commonly used in 3D graphics and computer graphics.

[0020] Pixel (image element): The basic building block of a two-dimensional scene. It can be used to represent the color and texture of a two-dimensional image and is commonly used in computer graphics and digital image processing.

[0021] Reflection probe: A technique used in computer graphics to simulate the reflection, refraction, and diffraction of light in real life. It can be used to simulate the reflective effects of object surfaces, such as specular reflection and diffuse reflection. Reflection probes typically use a physics engine to simulate reflection behavior and a lighting model to simulate reflection effects.

[0022] Distributed computing nodes: In a distributed computing system, multiple computer nodes are responsible for executing computing tasks. Each distributed computing node can independently process computing tasks and transmit the computing results to other nodes through the network. Finally, the computing results of all nodes are integrated to obtain the final computing result.

[0023] Virtual camera: A technique in computer graphics used to simulate the behavior of a real-life camera. It can be used to control the rendering of objects in a scene, such as the camera's position, viewpoint, focal length, and exposure time. Virtual cameras typically use a physics engine to simulate camera movement and a lighting model to simulate lighting effects.

[0024] Level of Detail (LOD) is a polygon level of detail technique used to optimize model and scene objects in animation, improving performance without sacrificing quality. LOD is typically used for distant objects in animation, such as mountains, buildings, and trees. Animation generation applications automatically reduce the polygon level of detail for distant objects to improve performance. This process of reducing the polygon level of detail is called LOD toggling, and it can be done automatically by using predefined polygon templates in the animation generation application or through a custom algorithm. Furthermore, LOD can be used to optimize textures and materials to reduce memory usage without sacrificing quality. In short, LOD is a technique for optimizing animation performance, helping developers increase frame rates without compromising quality.

[0025] Weighted interpolation: A method for estimating unknown data points using a linear combination of a set of known data points. It assumes that points with unknown values ​​are more influenced by closer control points than by more distant control points, with the degree of influence (or weight) expressed as the inverse of the power of the distance between points; the weight value is inversely proportional to the distance. It can be used for inverse distance weighted interpolation (IDW interpolation), a geometrically local interpolation method that can be used for exact or smooth interpolation.

[0026] Currently, lighting baking for target scenes is achieved through Lightmap technology. Lightmap technology primarily involves pre-calculating the lighting effects produced by light sources and storing them in a lightmap. During image rendering, the lightmap is rendered onto the object models to obtain the scene image, improving the realism and visual effects of the scene. Lightmaps typically use a Central Processing Unit (CPU) for calculation. This requires loading the model meshes of all object models in the scene into the CPU, mapping the mesh faces onto a generated 2D texture space (UV space), and then sequentially performing steps such as sampling lighting information, calculating lighting parameters for each mesh face, allocating lightmaps for each mesh face, and packaging and compressing the lightmaps for each mesh face. The amount of data that needs to be processed is enormous. Each mesh face of each object model in the scene must generate a corresponding lightmap, and then each object model is rendered based on the lightmap. This places excessive demands on hardware and software resources, resulting in high image rendering costs and insufficient rendering efficiency.

[0027] To address the aforementioned problems, this specification provides an image rendering method. This specification also relates to an image rendering apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0028] See Figure 1 , Figure 1 A flowchart of an image rendering method according to an embodiment of this specification is shown, including the following specific steps: Step 102: Obtain scene data for the target scene.

[0029] The embodiments in this specification apply to applications, websites, or mini-programs that perform image rendering functions, including but not limited to: Unity development engine, 3DS Max development engine, Unreal Engine development engine, Maya development engine, Blender development engine, Three.js library, Babylon.js development engine, and A-Frame framework.

[0030] The target scene is a multi-dimensional virtual space to be rendered, including scene objects, scene lighting, and scene backgrounds. Scene data consists of the element parameters of each scene element in the target scene, including but not limited to: the size, position, texture, and material of scene objects; the light source type, position, and intensity of scene lighting; the position, texture, and size of the scene background. For example, in game development, the target scene might be a game map scene, including scene objects such as mountains, forests, water, buildings, and characters; scene lighting such as sunlight; and a scene background such as the sky. The scene objects such as mountains, forests, water, buildings, and characters have corresponding element parameters such as size, position, texture, and material. The scene light source for sunlight has element parameters such as light source type (sunlight), position, and intensity. The scene background for the sky has element parameters such as position, texture, and size.

[0031] For example, on the Unity development engine, the development team of game A developed the game's... Figure 1 The map scene is 1536m 1536m A 100m three-dimensional virtual space, including 10,000 pre-designed game object models (including mountains, forests, water, buildings, and characters, etc.), scene lighting with sunlight as the scene light source, and a sky background as the scene background. The 10,000 game object models, the sunlight scene light source, and the sky background have corresponding element parameters (game object size, game object position, game object texture, game object material, scene lighting light source type, scene lighting light source position, scene lighting light source intensity, scene background position, scene background texture, and scene background size).

[0032] Acquire scene data for the target scenario. This provides a data foundation for subsequent spatial dimension division.

[0033] Step 104: Divide the scene data based on the spatial dimension to obtain multiple scene sub-data.

[0034] Spatial dimension refers to the corresponding dimension of the space in which the scene data is located, including two-dimensional spatial dimension and three-dimensional spatial dimension.

[0035] Scene sub-data consists of information parameters of each scene element in the target sub-scene. The target sub-scene is a multi-dimensional virtual subspace obtained by spatially dividing the multi-dimensional virtual space of the target scene. Correspondingly, scene sub-data consists of information parameters of scene elements such as scene objects, scene lighting, and scene background in the multi-dimensional virtual subspace. The scene sub-data needs to be adapted to the distributed computing nodes in step 108 and cannot far exceed the lighting baking performance of the distributed computing nodes.

[0036] Scene data can be divided in several ways. First, it can be divided along a coordinate axis, such as the X and Y axes of a 3D scene viewed from above. Second, it can be divided based on the characteristics of the scene data, such as a space containing a large number of scene objects while other spaces have scattered scene objects, which can be divided according to their distribution density.

[0037] Based on the spatial dimension, the scene data is divided to obtain multiple scene sub-data. Specifically, the scene data is divided based on distributed computing nodes and the spatial dimension to obtain multiple scene sub-data.

[0038] For example, based on 9 distributed computing nodes and spatial dimensions, a top-down view of 1536m 1536m The scene data of a 100m 3D virtual space map scene was divided into 9 scene sub-data, each of which is 512m in size. 512m Scene data for a map sub-scene within a 100m 3D virtual subspace.

[0039] Based on the spatial dimension, the scene data is divided into multiple scene sub-data. This provides a spatial data foundation for subsequent fitting of multiple scene sub-data using pre-defined voxel units.

[0040] Step 106: Using preset voxel units, fit multiple scene sub-data to obtain voxel data corresponding to each scene sub-data.

[0041] A preset voxel unit is a virtual space unit composed of multiple predefined voxels. Each preset voxel unit includes multiple voxel points and has a corresponding voxel size. A preset voxel unit can be understood as a container of a defined shape in a multi-dimensional virtual space. For example, in a three-dimensional virtual space, a preset voxel unit is a cube with an edge length of 64. Individual voxel units. In addition to size, preset voxel units also include parameters such as inverse blending, whether to enable compatibility mode, and color model depth stencil mode.

[0042] The voxel data corresponding to each scene sub-data is the scene sub-data within a preset voxel unit. This voxel unit is used to fit information parameters of scene elements such as scene objects, scene lighting, and scene background in a multi-dimensional virtual subspace. If we understand the preset voxel unit as a container of a defined shape in a multi-dimensional virtual space, the voxel data corresponding to each scene sub-data is the information parameters loaded into that container. The voxel data can be stored as small files for subsequent baking and rendering.

[0043] By fitting pre-defined voxel units, the scene sub-data is decoupled from scene elements such as scene objects, scene lighting, and scene background, and then refitted with each voxel point. In subsequent lighting baking, it is not necessary to bind it to the object model, generating a lightmap that corresponds one-to-one with the object model. Simultaneously, in step 108, the voxel data is distributed to distributed computing nodes for lighting baking. This can be understood as step 106 generating multiple lighting baking tasks corresponding to scene sub-data, with each voxel data serving as the input data for the lighting baking task.

[0044] Using preset voxel units, multiple scene sub-data are fitted to obtain voxel data corresponding to each scene sub-data. Specifically, the voxel units are used to fit multiple scene sub-data to obtain voxel data corresponding to each scene sub-data. Based on each voxel data, a lighting baking task is generated.

[0045] For example, using a preset size of 64 64 64 voxel units were used to fit the data to 9 scene sub-data sets, resulting in 36 voxel data sets GI0, GI1...GI35 (each scene sub-data set corresponds to 4 voxel data sets). Based on the 36 voxel data sets, 36 lighting baking tasks were generated: S0 (task 0.0, task 0.1, task 0.2, task 0.3), S1 (task 1.0, task 1.1, task 1.2, task 1.3)...S8 (task 8.0, task 8.1, task 8.2, task 8.3). The 36 lighting baking tasks were recorded in the task list.

[0046] By using pre-defined voxel units, multiple scene sub-data sets are fitted to obtain the voxel data corresponding to each scene sub-data set. Fitting the scene sub-data sets and voxels decouples them from the object models in the scene, providing a data foundation for multi-threaded parallel implementation of lighting baking.

[0047] Step 108: Distribute the voxel data to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data.

[0048] The illumination parameters of voxel data are a set of illumination parameters for each voxel point, including but not limited to: illumination intensity parameters, illumination angle parameters, illumination color parameters, transmittance parameters, reflection parameters, diffraction parameters, and refraction parameters. Among these, indirect optical information parameters such as reflection, diffraction, and refraction parameters can be calculated by setting reflection probes. For example, voxel data includes... The illumination parameters for individual voxels are as follows: voxel (0,0,0) - (illuminance parameter XX; illumination angle parameter XX; illumination color parameter XX; transmittance parameter XX; reflection parameter XX; diffraction parameter XX; refraction parameter XX); voxel (0,0,1) - (illuminance parameter YY; illumination angle parameter YY; illumination color parameter YY; transmittance parameter YY; reflection parameter YY; diffraction parameter YY; refraction parameter YY) ... voxel (64,64,64) - (illuminance parameter ZZ; illumination angle parameter ZZ; illumination color parameter ZZ; transmittance parameter ZZ; reflection parameter ZZ; diffraction parameter ZZ; refraction parameter ZZ).

[0049] It's important to note that lighting baking is achieved using pre-defined baking parameters, including: baking mode, number of X-axis detection points, number of Y-axis detection points, target cumulative frames, whether to place reflection probes, reflection probe resolution, reflection probe coverage offset, reflection probe shape, blending influence distance, and blending normal influence distance. Lighting baking includes global lighting baking and local lighting baking; the former bakes the lighting of all objects in the scene, while the latter bakes the lighting of a subset of objects in the scene.

[0050] The voxel data is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters for each voxel. Specifically, each illumination baking task and its corresponding voxel data are distributed to distributed computing nodes for illumination baking to obtain the illumination parameters for each voxel. Distribution can be done through a task list, based on the positional relationship between voxel data, or based on the performance or status of the distributed computing nodes; no specific limitation is made here.

[0051] For example, 36 light baking tasks (task 0.0, task 0.1...task 8.3) and corresponding voxel data (GI0, GI1...GI35) are distributed to distributed computing nodes (S0, S1...S8) through a task list. Light baking is performed based on pre-set baking parameters to obtain the light parameters Baked GI0, Baked GI1...Baked GI35 for the 36 voxel data.

[0052] The voxel data is distributed to distributed computing nodes for lighting baking to obtain the lighting parameters for each voxel. Lighting baking is implemented in parallel using multi-threading, avoiding the generation of lightmaps that correspond one-to-one with the object model and improving the efficiency of lighting baking.

[0053] Step 110: Render the scene image of the target scene based on the lighting parameters of each voxel data.

[0054] The scene image of the target scene is a rendered visual image of a multi-dimensional virtual space, which can be in various modes such as photos, images, and videos. The scene image can be displayed on the front end, for example, on a mobile terminal display screen, on a computer screen, or on a wearable display device.

[0055] The scene image of the target scene is rendered based on the lighting parameters of each voxel data. Specifically, the renderer is invoked to render the scene image of the target scene based on the lighting parameters of each voxel data. Rendering can be dynamic rendering, that is, rendering the voxel data to be displayed in real time, or static rendering, that is, rendering all voxel data in real time.

[0056] Optionally, after step 110, the following specific steps are also included: Adjust the baking parameters and return to step 108.

[0057] Re-render by adjusting the baking parameters.

[0058] For example, the Unity rendering engine is invoked, and the lighting parameters Baked GI0, Baked GI1...Baked GI35 based on 36 voxel data are used to render the background in game A. Figure 1 The data is then rendered and displayed on the development team's computer screens.

[0059] In this embodiment, scene data of the target scene is acquired; the scene data is divided into multiple scene sub-data based on the spatial dimension; using preset voxel units, the multiple scene sub-data are fitted to obtain voxel data corresponding to each scene sub-data; the voxel data is distributed to distributed computing nodes for lighting baking to obtain lighting parameters for each voxel data; and the scene image of the target scene is rendered based on the lighting parameters of each voxel data. Dividing the scene data into multiple scene sub-data in the spatial dimension, fitting the multiple scene sub-data with preset voxel units to obtain voxel data corresponding to each scene sub-data in the spatial dimension, and distributing the voxel data to distributed nodes, lighting baking is implemented in parallel through multi-threading. This avoids generating lightmaps that correspond one-to-one with the object model, improving the efficiency of lighting baking. Based on the efficiently obtained lighting parameters, the scene image is rendered, thereby improving the efficiency of image rendering, reducing the performance requirements of hardware and software resources, and lowering the cost of image rendering.

[0060] In one optional embodiment of this specification, the scene sub-data includes an object model of at least one object; Correspondingly, before step 106, the following specific steps are also included: For any given scene sub-data, based on the object model of each object in the given scene sub-data, the given scene sub-data is compressed to obtain compressed scene sub-data.

[0061] In step 106 of this embodiment, the fitting of preset voxel units decouples scene sub-data from scene elements and refits them with each voxel point, i.e., only binding them to voxel points, while voxel points cannot distinguish whether they correspond to valid scene objects. In practical applications, only a small number of voxel points in the multidimensional virtual space of the target scene correspond to valid scene objects. For example, in game scenes, valid scene objects such as characters, buildings, and terrain occupy only a very small number of voxel points, while most are invalid voxel points such as "air" and "underground space," which do not require lighting baking, thus avoiding waste of hardware and software resources, improving the efficiency of lighting baking, and consequently improving image rendering efficiency.

[0062] An object is a scene object within the target sub-scene, a multi-dimensional virtual item object in a multi-dimensional virtual space, and a scene element within the target scene. Objects possess specific characteristics such as size, texture, position, and material. For example, if the target scene is a game scene, then virtual item objects such as characters, terrain, buildings, and objects within the game scene are objects within that game scene.

[0063] An object model is a multidimensional virtual model of an object in a multidimensional virtual space. An object model has specific size parameters, texture parameters, position parameters, and material parameters. For example, a character model in a game scene has specific size parameters, texture parameters, position parameters, and material parameters.

[0064] For any scene sub-data, based on the object model of each object in the scene sub-data, the scene sub-data is compressed to obtain compressed scene sub-data. Specifically, for any scene sub-data, based on the size parameters and position parameters of the object model of each object in the scene sub-data, the scene sub-data is spatially compressed to obtain spatially compressed scene sub-data.

[0065] For example, for the nine scene sub-data, based on the size and position parameters of the character model, terrain model, building model and item model of each object in each scene sub-data, spatial compression is performed on each scene sub-data to obtain the nine spatially compressed scene sub-data.

[0066] For any given scene sub-data, based on the object model of each object within that sub-data, the scene sub-data is compressed to obtain compressed scene sub-data. This reduces the amount of data required for subsequent lighting baking, avoids wasting hardware and software resources, further improves the efficiency of lighting baking, and consequently improves image rendering efficiency.

[0067] In one optional embodiment of this specification, based on the object models of each object in any scene sub-data, the scene sub-data is compressed to obtain compressed scene sub-data, including the following specific steps: Using spatial rays, determine the spatial envelope of the object model of each object in any scene sub-data; Based on the spatial envelope, any scene sub-data is compressed to obtain compressed scene sub-data.

[0068] A spatial ray is a series of rays traversing a specific direction in a multidimensional virtual space. Ray detection is achieved by projecting spatial rays onto at least one object model in the multidimensional virtual space, thereby determining the size and position distribution of the object model within the scene sub-data. For example, a Raycast is a series of parallel rays emitted downwards from a top-down direction in the target scene.

[0069] The spatial envelope is the fully curved, enclosed space occupied by an object model in a multidimensional virtual space. For example, in a game scene, the player character can only move within a space with a maximum height of 3 meters. Therefore, by using spatial ray projection, the size and position distribution of the terrain model and building model are determined, and the 3-meter range above and below this is defined as the spatial envelope of the game scene.

[0070] Using spatial rays, the spatial envelope of the object model of each object in any scene sub-data is determined. Specifically, spatial rays are used to perform ray detection on the scene sub-data to determine the size distribution and position distribution of the object model of each object in the scene sub-data. Based on the size distribution and position distribution, the spatial envelope of the object model of each object in any scene sub-data is determined.

[0071] Based on the spatial envelope, any scene sub-data is compressed to obtain compressed scene sub-data. Specifically, the data outside the spatial envelope of any scene sub-data is removed to obtain compressed scene sub-data.

[0072] Figure 2 A schematic diagram of the spatial envelope in an image rendering method provided in one embodiment of this specification is shown.

[0073] The scene data includes object models of various objects such as trees, hillsides, and buildings. First, based on spatial dimensions, the scene data is divided into multiple scene sub-databases, each a 512m multi-dimensional virtual subspace. Then, spatial rays are projected onto the object models of each object within any scene sub-database. Finally, the spatial envelope of each object's object model within any scene sub-database is determined.

[0074] For example, using spatial rays, ray detection is performed on 9 scene sub-data to determine the highest and lowest points of object models such as mountains, forests, water bodies, buildings, and people in the scene sub-data, as well as the positions of the highest and lowest points. Based on the positions of the highest and lowest points, the spatial envelope of each object model in the 9 scene sub-data is determined. Data outside the spatial envelope of the 9 scene sub-data is removed to obtain compressed scene sub-data.

[0075] By using spatial rays, the spatial envelope of each object's model within any scene sub-data is determined. Based on this spatial envelope, the scene sub-data is compressed to obtain compressed scene sub-data. This achieves more accurate spatial compression of the scene sub-data, reducing the amount of data required for subsequent lighting baking, avoiding waste of hardware and software resources, further improving the efficiency of lighting baking, and consequently enhancing image rendering efficiency.

[0076] In one optional embodiment of this specification, step 104 includes the following specific steps: Based on the number of distributed computing nodes and spatial dimensions, the scene data is divided to obtain multiple scene sub-data.

[0077] Distributed computing nodes are computer nodes used for light baking. Multiple distributed nodes can be distributed across different physical locations (data centers), integrating different hardware devices (CPU (Central Processing Unit), GPU (Graphics Processing Unit), storage media (cache, memory, and hard drives, etc.)) and software resources to achieve distributed execution of baking tasks. For example, a distributed cluster may deploy 9 distributed computing nodes, each with a corresponding virtual machine, CPU, 8GB of memory, and 1TB of hard drive. Each computer node is located in a corresponding data center.

[0078] Based on the number of distributed computing nodes and spatial dimensions, the scene data is divided to obtain multiple scene sub-data. Specifically, the scene data is divided based on the number of distributed computing nodes and spatial dimensions to obtain a corresponding number of scene sub-data.

[0079] It should be noted that by using the number of distributed computing nodes, scene sub-data in multiple virtual subspaces are pre-divided in the spatial dimension, laying the foundation for subsequent fitting using preset voxel units.

[0080] For example, the distributed system includes 9 distributed computing nodes. Based on the number of 9 distributed computing nodes and the spatial dimension, the 1536m area is viewed from a top-down perspective. 1536m The scene data of the 100m three-dimensional virtual space map scene is divided into 9 scene sub-data.

[0081] Based on the number and spatial dimensions of distributed computing nodes, the scene data is divided into multiple scene sub-data. This reasonable division of scene data, based on the number of distributed computing nodes, lays the foundation for subsequent multi-threaded parallel lighting baking.

[0082] In one optional embodiment of this specification, after step 106, the following specific steps are further included: Determine the node identifier of the corresponding distributed computing node for each voxel data; Correspondingly, step 108 includes the following specific steps: Based on node identifiers, the data of each voxel is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data.

[0083] By using the node identifiers of the distributed computing nodes, the fitted voxel data is labeled accordingly, providing a basis for accurately distributing it to the corresponding distributed computing nodes.

[0084] The node identifier of a distributed computing node serves as a unique identifier for each node within the distributed system, enabling accurate differentiation between nodes. Examples include generic identifiers and user-defined identifiers for distributed computing nodes.

[0085] Based on node identifiers, each voxel data is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data. Specifically, each illumination baking task and its corresponding voxel data are labeled based on node identifiers, and then distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data.

[0086] Figure 3 This specification illustrates a schematic diagram of scene data partitioning in an image rendering method according to an embodiment of the present specification, as shown below. Figure 3 As shown: The scene data was divided into 9 scene sub-data, each corresponding to a specific distributed computing node (S0-S8). Using pre-defined voxel units, each of the 9 scene sub-data was fitted to obtain 4 voxel data corresponding to each scene sub-data. Based on each voxel data, a lighting baking task was generated. Each lighting baking task and its corresponding voxel data were labeled based on node identifiers: S0 (task 0.0, task 0.1, task 0.2, task 0.3), S1 (task 1.0, task 1.1, task 1.2, task 1.3)...S8 (task 8.0, task 8.1, task 8.2, task 8.3).

[0087] For example, node identifiers (S0-S8) of the corresponding distributed computing nodes are determined for each voxel data. Based on the node identifiers, each light baking task and the corresponding voxel data are labeled: S0 (task 0.0, task 0.1, task 0.2, task 0.3), S1 (task 1.0, task 1.1, task 1.2, task 1.3) ... S8 (task 8.0, task 8.1, task 8.2, task 8.3). The 36 light baking tasks and the corresponding voxel data are distributed to 9 distributed computing nodes. Light baking is performed based on the pre-set baking parameters to obtain the lighting parameters Baked GI0, Baked GI1 ... Baked GI35 of the 36 voxel data.

[0088] A node identifier is assigned to each voxel data point in the distributed computing node. Based on the node identifier, the voxel data is distributed to the distributed computing nodes for illumination baking to obtain the illumination parameters for each voxel data point. This method accurately maps voxel data to distributed computing nodes for illumination baking, improving the rationality of illumination baking.

[0089] In one optional embodiment of this specification, step 110 includes the following specific steps: Based on the current viewpoint information of the virtual camera, the target voxel data is determined from each voxel data; The scene image of the target scene is rendered based on the lighting parameters of the target voxel data.

[0090] A virtual camera is a mathematical model that simulates the behavior of a real camera in a multidimensional virtual space. Virtual cameras are used to detect and identify scene elements in a multidimensional virtual space, which are then rendered accordingly, allowing users to observe the multidimensional virtual space from the perspective of the virtual camera. Virtual cameras typically include attributes such as position, orientation, and focal length.

[0091] The current viewpoint of a virtual camera is the perspective of the multi-dimensional virtual space it is currently detecting and recognizing. It has corresponding position and orientation attributes. The current viewpoint is typically a truncated pyramid shape, which determines the scene elements and their parameters that the virtual camera is currently detecting and recognizing. The current viewpoint changes with the virtual camera's position, orientation, and focal length. For example, if the virtual camera is currently directly below the target scene, and its detection range is a 90-degree truncated pyramid shape, then the multi-dimensional virtual space within that 90-degree range observed from directly below is within the current viewpoint. The current viewpoint information includes its orientation, position, and orientation attributes.

[0092] The target voxel data is the voxel data that needs to be rendered among multiple voxel data. In the embodiments of this specification, the target voxel data is the voxel data within the current view. The target voxel data does not necessarily have to be entirely within the current view. Only a portion of the target voxel data is within the current view.

[0093] Based on the current viewpoint information of the virtual camera, the target voxel data is determined from each voxel data. Specifically, based on the current viewpoint information of the virtual camera, the voxel data located within the current viewpoint is determined as the target voxel data from each voxel data.

[0094] The scene image of the target scene is rendered based on the lighting parameters of the target voxel data. Specifically, the renderer is called to dynamically render the scene image of the target scene based on the lighting parameters of each voxel.

[0095] Figure 4 This specification illustrates a schematic diagram of a virtual camera in an image rendering method according to one embodiment. Figure 4 As shown: The voxel data located at position (3,1) in the target scene for the virtual camera is determined based on the current viewpoint information of the virtual camera: two rays indicate the directional attribute parameters of the virtual camera. The voxel data located in the current viewpoint include the voxel data located at (3,2), (3,3), (3,4), (3,5), (3,6), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6), (5,2), (5,3), (5,4), (5,5), (5,6), (6,2), (6,3), (6,4), (6,5), and (6,6) (marked with "√" in the figure). A total of 21 voxel data are identified as target voxel data. Other voxel data are not located in the current viewpoint (marked with "×" in the figure).

[0096] For example, based on the current viewpoint information of the virtual camera, 21 voxel data located within the current viewpoint are determined from 36 voxel data as target voxel data. Unity's rendering engine is then invoked, and the lighting parameters Baked GI5, Baked GI6...Baked GI34 of the 21 voxel data are used to render the ground in game A. Figure 1 The data is then rendered and displayed on the development team's computer screens.

[0097] Based on the current viewpoint information of the virtual camera, the target voxel data is determined from the voxel data; based on the lighting parameters of the target voxel data, the scene image of the target scene is rendered. This avoids unnecessary rendering of invisible voxel data, which would waste hardware and software resources. By dynamically determining the target voxel data and performing targeted visible rendering, the efficiency of image rendering is improved.

[0098] In one optional embodiment of this specification, after determining the target voxel data from the voxel data based on the current viewpoint information of the virtual camera, the following specific steps are further included: Load the target voxel data into the renderer; The renderer is invoked to render the scene image of the target scene based on the lighting parameters of the target voxel data; Adjust the virtual camera's viewpoint, return to the previous step of determining the target voxel data from the voxel data based on the current viewpoint information of the virtual camera.

[0099] Because the virtual camera's perspective is constantly changing, during the rendering process, it is loaded into the renderer as the scene's sub-data changes dynamically. Therefore, it is necessary to dynamically determine the target voxel data and load it into the renderer for dynamic rendering, thereby ensuring that the renderer can be used reasonably and reducing the performance requirements of hardware and software resources.

[0100] Optionally, before rendering the scene image of the target scene based on the lighting parameters of the target voxel data, the following specific steps are also included: Unload non-target voxel data that has been loaded in the renderer.

[0101] Figure 5 This diagram illustrates the dynamic loading of the renderer in an image rendering method according to an embodiment of this specification, as shown below. Figure 5 As shown: Based on the current viewpoint information of the virtual camera, the target voxel data (solid-line cube) to be rendered is dynamically determined, the target voxel data is loaded into the renderer, the renderer is invoked, and the scene image of the target scene is rendered based on the lighting parameters of the target voxel data. Furthermore, the non-target voxel data (dashed-line cube) already loaded in the renderer is unloaded.

[0102] For example, 21 target voxel data are loaded into Unity's rendering engine, and 4 non-target voxel data already loaded in the rendering engine are unloaded. The rendering engine is then invoked, and the lighting parameters Baked GI5, Baked GI6...Baked GI34 of the 21 target voxel data are used to adjust the lighting of game A. Figure 1 Perform rendering, adjust the virtual camera's viewpoint, and return to execute the steps of determining the target voxel data from 36 voxel data based on the current viewpoint information of the virtual camera.

[0103] The process involves loading the target voxel data into the renderer; invoking the renderer to render the scene image of the target scene based on the lighting parameters of the target voxel data; adjusting the virtual camera's viewpoint; and then returning to execute the steps of determining the target voxel data from the voxel data based on the current viewpoint information of the virtual camera. By dynamically determining the target voxel data and loading it into the renderer for dynamic rendering, the renderer can be used efficiently, reducing instantaneous read / write pressure, lowering the performance requirements for hardware and software resources, and reducing the cost of image rendering.

[0104] In one optional embodiment of this specification, the target voxel data is determined from the voxel data based on the current viewpoint information of the virtual camera, including the following specific steps: Based on the viewpoint information of the virtual camera, the depth information of each voxel data is determined; Based on the depth information of each voxel data, the target voxel data is determined from each voxel data, and the rendering weight of the target voxel data is determined. Correspondingly, step 110 includes the following specific steps: The scene image of the target scene is rendered based on the lighting parameters and rendering weights of the target voxel data.

[0105] The depth information of each voxel data point represents its depth position within the scene sub-data, and is characterized by the distance between the voxel data and the virtual camera in the multidimensional virtual subspace. For example, in the multidimensional virtual subspace, voxel data GI1 is 100m away from the virtual camera, while voxel data GI2 is 500m away. The former has lower depth information than the latter.

[0106] The rendering weight of the target voxel data is the weight of the rendering precision of the voxel data in terms of detail. The higher the rendering weight, the higher the precision of the rendered scene image, the richer the details, and the more realistic the visual experience. The lower the rendering weight, the lower the precision of the rendered scene image, the less detail, and the more distorted the visual experience.

[0107] For voxel data that is too far from the virtual camera, meaning it has extremely high depth information and is beyond the normal observation range of the human eye, no rendering is required. For voxel data that is relatively far from the virtual camera, meaning it has high depth information but is within the normal observation range of the human eye, a coarser rendering is performed. This rendering method simulates the human eye's observation process, improves the realism of image rendering, reduces the performance requirements of hardware and software resources, lowers image rendering costs, and improves image rendering efficiency.

[0108] The scene image of the target scene is rendered based on the lighting parameters and rendering weights of the target voxel data. Specifically, the renderer is invoked to render the scene image of the target scene according to the lighting parameters of the target voxel data and the corresponding rendering weights.

[0109] For example, based on the viewpoint information of the virtual camera, the depth information of 36 voxel data is determined. Based on the depth information of each voxel data: GI0-GI9 have low depth information, GI10-GI20 have high depth information, and GI21-GI35 have high depth information. From the voxel data, 21 target voxel data from GI0 to GI20 are determined, and the rendering weights of the 21 target voxel data are determined: GI0-GI9 have high rendering weights, and GI10-GI20 have low rendering weights. The Unity rendering engine is called, and based on the lighting parameters Baked GI0, Baked GI1...Baked GI20 and the rendering weights of the 21 target voxel data, the rendering weights of game A are used to... Figure 1 Perform rendering.

[0110] Based on the virtual camera's viewpoint information, the depth information of each voxel data is determined. Based on this depth information, the target voxel data is identified from the voxel data, and its rendering weight is determined. Based on the lighting parameters and rendering weights of the target voxel data, the scene image of the target scene is rendered. This improves the realism of image rendering, reduces the performance requirements of hardware and software resources, lowers image rendering costs, and simultaneously improves image rendering efficiency.

[0111] In one optional embodiment of this specification, the following specific steps are included before step 110: The rendering weight of each voxel data is determined based on the level of detail of each voxel data. Correspondingly, step 110 includes the following specific steps: The scene image of the target scene is rendered based on the lighting parameters and rendering weights of each voxel data.

[0112] In actual image rendering, due to different rendering requirements, such as high requirements for rendering details of buildings and people and low requirements for rendering details of terrain, it is necessary to set different detail levels for each voxel data, and then determine the rendering weight of each voxel data based on the detail level of each voxel data, so as to perform targeted detail rendering.

[0113] The level of detail is the rendering level set for voxel data. The higher the level of detail, the higher the rendering weight, and vice versa. For example, if the voxel data contains character and building models, a high level of detail is set for the voxel data containing them; if the voxel data contains terrain models, a low level of detail is set for the voxel data containing them.

[0114] Fine-grained image rendering is performed on high-detail voxel data, while coarse-grained image rendering is performed on low-detail voxel data. This rendering method simulates the human eye's observation process, improving the realism of image rendering, reducing the performance requirements of hardware and software resources, lowering image rendering costs, and improving image rendering efficiency.

[0115] The rendering weight of each voxel data is determined based on the level of detail of each voxel data. Specifically, the rendering weight of each voxel data is obtained by weight interpolation calculation based on the level of detail of each voxel data.

[0116] Based on the lighting parameters and rendering weights of each voxel data, the scene image of the target scene is rendered. Specifically, the renderer is invoked, and the scene image of the target scene is rendered according to the corresponding rendering weights based on the lighting parameters of the target voxel data.

[0117] Figure 6 This diagram illustrates a detail hierarchy in an image rendering method according to an embodiment of this specification, as shown below. Figure 6 As shown: In a certain landscape scene, a high level of detail is set for the voxel data containing buildings, and a low level of detail is set for the voxel data containing terrain.

[0118] For example, based on the detail levels of 36 voxel data: GI0-GI9 (LOD1), GI10-GI20 (LOD2), GI21-GI35 (LOD3), weight interpolation is performed to calculate the rendering weight of each voxel data: GI0-GI9 have high rendering weight, GI10-GI20 have low rendering weight. Then, Unity's rendering engine is called, and based on the lighting parameters BakedGI0, BakedGI1...BakedGI20 and rendering weights of 21 target voxel data, the rendering weights of game A are calculated. Figure 1 Perform rendering.

[0119] Based on the detail level of each voxel data, the rendering weight of each voxel data is determined; based on the lighting parameters and rendering weights of each voxel data, the scene image of the target scene is rendered. This improves the realism of image rendering, reduces the performance requirements of hardware and software resources, lowers image rendering costs, and improves image rendering efficiency.

[0120] In one optional embodiment of this specification, the following specific steps are included before step 110: In the case where at least two voxel data have overlapping regions, the first rendering weight of the target voxel point is determined based on the distance between the target voxel point in the overlapping region and the reference voxel point in the at least two voxel data, wherein the target voxel point is any voxel point in the overlapping region. Determine the second rendering weight of each voxel point in at least two non-overlapping regions of voxel data; Correspondingly, step 110 includes the following specific steps: The scene image of the target scene is rendered based on the lighting parameters of each voxel data, the first rendering weight of each voxel point in the overlapping region, and the second rendering weight of each voxel point in the non-overlapping region.

[0121] Since step 110 involves distributing voxel data to different distributed computing nodes for illumination baking, edge differences are inevitable. Generally, when fitting using preset voxel units in step 106, overlapping areas are retained at the edges of each voxel data, and then a smooth edge transition is performed subsequently, thereby improving the continuity and realism of image rendering.

[0122] The target voxel is any voxel in the overlapping region whose rendering weight needs to be determined. The spatial distribution of rendering weights in the overlapping region can be obtained by subsequently calculating the rendering weights of each voxel in the overlapping region. The non-target voxel is any voxel in the non-overlapping region whose rendering weight needs to be determined. The spatial distribution of rendering weights in the non-overlapping region can be obtained by subsequently calculating the rendering weights of each voxel in the non-overlapping region. The reference voxel is a voxel within a voxel unit used as a reference for distance calculation. It can be the center voxel of the voxel unit or a specific voxel within the voxel unit; no limitation is made here.

[0123] The first rendering weight of the target voxel is determined based on the distance between the target voxel in the overlapping region and the reference voxel in at least two voxel data. Specifically, the first rendering weight of the target voxel is calculated by weighted averaging the distance between the target voxel in the overlapping region and the reference voxel in at least two voxel data.

[0124] The scene image of the target scene is rendered based on the lighting parameters of each voxel data, the first rendering weight of each voxel point in the overlapping region, and the second rendering weight of each voxel point in the non-overlapping region. Specifically, the renderer is called, and the scene image of the target scene is rendered based on the lighting parameters of the target voxel data, according to the first rendering weight of each voxel point in the overlapping region and the second rendering weight of each voxel point in the non-overlapping region.

[0125] Figure 7This specification illustrates a schematic diagram of an overlapping region in an image rendering method according to an embodiment of this specification, as shown below. Figure 7 As shown: Three voxel datasets, GI1, GI2, and GI3, have an overlapping region. Specific voxel points for each of the three datasets are designated as reference voxel points: the reference voxel point for GI1, the reference voxel point for GI2, and the reference voxel point for GI3. A target voxel point exists within this overlapping region. The distance between the target reference point and the reference voxel point of GI1 is determined as d1, the distance between the target reference point and the reference voxel point of GI2 is determined as d2, and the distance between the target reference point and the reference voxel point of GI3 is determined as d3. The rendering weight of the target voxel point, based on a weighted average, is determined as: (d1 / (d1+d2+d3)*GI1 rendering weight) + (d2 / (d1+d2+d3)*GI2 rendering weight) + (d3 / (d1+d2+d3)*GI3 rendering weight).

[0126] For example, when at least two voxel data have overlapping regions, a weighted average is calculated based on the distance between the target voxel point in the overlapping region and the reference voxel point in the at least two voxel data to obtain the first rendering weight of the target voxel point. A second rendering weight is determined for each voxel point in the non-overlapping region of the at least two voxel data. The renderer is then invoked, and based on the lighting parameters Baked GI0, Baked GI1…Baked GI20 of the 21 target voxel data, the rendering weights for each voxel point in the overlapping region and the second rendering weights for each voxel point in the non-overlapping region are applied to the ground in game A. Figure 1 Perform rendering.

[0127] When at least two voxel data sets have overlapping regions, a first rendering weight for the target voxel point is determined based on the distance between the target voxel point in the overlapping region and a reference voxel point in the at least two voxel data sets. The target voxel point can be any voxel point within the overlapping region. A second rendering weight is then determined for each voxel point in the non-overlapping regions of the at least two voxel data sets. Based on the lighting parameters of each voxel data set, the first rendering weight of each voxel point in the overlapping region, and the second rendering weight of each voxel point in the non-overlapping region, the scene image of the target scene is rendered. This achieves smooth edge transitions, improving the continuity and realism of the image rendering.

[0128] Figure 8 This specification illustrates a front-end diagram of adjusting baking parameters in an image rendering method according to an embodiment of this specification, as shown below. Figure 8 As shown: On the front-end page for baking parameter settings, configure the following baking parameters: Set the baking mode to "Distributed Scene Baking," the number of X-axis detection points to "1200," the number of Y-axis detection points to "1200" (for detecting the highest and lowest points), the target cumulative frame count to "100," select to place reflection probes incidentally, set the reflection probe resolution to "128," set the reflection probe coverage offset to "2," set the reflection probe shape to "box," set the blending influence distance to "50," and set the blending normal influence distance to "50." After completing the above settings, click the "Preview Baked Scene Image" control to preview and adjust the global baking parameters in real time. In edit mode, preview the baked effect in real time. If the desired effect is not achieved, click the "Stop Baking" control to adjust the global baking parameters as needed to achieve the ideal lighting effect.

[0129] Figure 9 This specification illustrates a front-end schematic diagram of voxel unit settings in an image rendering method according to an embodiment of this specification, as shown below. Figure 9 As shown: On the front-end page for setting preset voxel unit parameters, set the voxel unit parameters: set the dimension to "3D" and the size to "64". 64 Set the inverse blending mode to "None", select "Enable Compatibility Mode", set the color mode to "RGB", and set the depth stencil mode to "None". After completing the above settings, the preset voxel unit, including the indirect light reflection probe, will be displayed in the preview box as a 64-bit unit. 64 64 voxel units in linear RGB mode, with a default data capacity of 2.0MB.

[0130] Figure 10 A schematic flowchart of an image rendering method according to an embodiment of this specification is shown, such as... Figure 10 As shown: During the baking phase: set baking parameters; allocate global illumination baking tasks to distributed computing nodes; receive global illumination baking tasks; read global illumination baking tasks; delete historical baking tasks; divide the scene data based on spatial dimensions to obtain multiple scene sub-data; use spatial rays to determine the highest and lowest points of the object model of each object in any scene sub-data; determine the spatial envelope in each scene sub-data based on the highest and lowest points; distribute the voxel data corresponding to each scene sub-data to distributed computing nodes for illumination baking; obtain the illumination parameters of each voxel data after accumulating the target number of times; determine whether reflection probes need to be placed; if yes, place and bake reflection probes; if no, directly complete illumination baking; then place and bake reflection probes, determine whether the task list is empty; if yes, complete illumination baking; if no, return to read global illumination baking tasks.

[0131] During the rendering phase: Voxel data is loaded on demand in response to rendering engine calls to rendering commands; voxel data is loaded into the rendering engine based on the current viewpoint information of the virtual camera; voxel data is clipped based on the view frustum information of the current viewpoint; voxel data is clipped based on the depth information of the current viewpoint; the voxel data of the current frame is transferred to the graphics processing unit; the voxel data of the previous frame is unloaded; deferred lighting is calculated; the depth map and VP inverse matrix are obtained; the world coordinates of each pixel are calculated; the amount of voxel data needed to cover each pixel is calculated; the fusion between overlapping voxel data is processed; the edge smooth transition between overlapping voxel data is processed; the data is blended with the deferred lighting results; and the pixels are displayed.

[0132] The following is in conjunction with the appendix Figure 11 Taking the application of the image rendering method provided in this specification in a game scene as an example, the image rendering method will be further explained. Figure 11 The present specification illustrates a process flowchart of an image rendering method applied to a game scene according to an embodiment of this specification, including the following specific steps: Step 1102: Set baking parameters and voxel units.

[0133] Step 1104: Obtain scene data for the game scene.

[0134] Step 1106: Based on the number of distributed computing nodes and spatial dimensions, divide the scene data to obtain multiple scene sub-data.

[0135] Step 1108: Using the preset voxel units, fit multiple scene sub-data respectively to obtain the baking task and corresponding voxel data of each scene sub-data, and determine the node identifier of the corresponding distributed computing node for each baking task and corresponding voxel data.

[0136] Step 1110: Record each baking task and its corresponding voxel data into the task list.

[0137] Step 1112: Based on the node identifier, read each baking task and its corresponding voxel data from the task list, and distribute each baking task and its corresponding voxel data to the distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data.

[0138] Step 1114: Based on the current viewpoint information of the virtual camera, determine the depth information, visibility, and level of detail of each voxel data.

[0139] Step 1116: Based on the depth information, visibility, and detail level of each voxel data, determine the target voxel data from each voxel data.

[0140] Step 1118: Based on the distance between the target voxel point in the overlapping region between the target voxel data and the reference voxel point in at least two voxel data, determine the first rendering weight of the target voxel point and determine the second rendering weight of each voxel point in the non-overlapping region of at least two voxel data.

[0141] Step 1120: Determine the rendering weight of each target voxel data based on the first rendering weight of the target voxel points and the second rendering weight of each voxel point in each target voxel data.

[0142] Step 1122: Load the target voxel data into the renderer and delete the non-target voxel data in the renderer.

[0143] Step 1124: Render the scene image of the game scene based on the lighting parameters and rendering weights of each voxel data.

[0144] In the embodiments described in this specification, voxel data is automatically fitted based on the spatial characteristics of each scene sub-data in the game scene data. This voxel data is then distributed to distributed computing nodes, and multi-threaded parallel lighting baking is performed, saving baking time and improving image rendering efficiency. Based on the current viewpoint information, target voxel data is dynamically streamed and loaded into the renderer, reducing instantaneous read / write pressure. According to the depth information, visibility, and detail level of each voxel data, corresponding rendering weights are determined, reducing the performance requirements of the rendering hardware, specifically improving rendering accuracy, and enhancing the realism of image rendering. Edge smoothing further enhances the continuity and realism of image rendering.

[0145] Corresponding to the above method embodiments, this specification also provides embodiments of an image rendering apparatus. Figure 12 A schematic diagram of the structure of an image rendering apparatus according to one embodiment of this specification is shown. Figure 12 As shown, the device includes: The acquisition module 1202 is configured to acquire scene data of the target scene; The partitioning module 1204 is configured to partition the scene data based on the spatial dimension to obtain multiple scene sub-data. The fitting module 1206 is configured to use preset voxel units to fit multiple scene sub-data respectively, and obtain voxel data corresponding to each scene sub-data. Baking module 1208 is configured to distribute each voxel data to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data. The rendering module 1210 is configured to render the scene image of the target scene based on the lighting parameters of each voxel data.

[0146] Optionally, the scene sub-data includes the object model of at least one object; Correspondingly, the device also includes: The compression module is configured to compress any scene sub-data based on the object model of each object in the scene sub-data to obtain compressed scene sub-data.

[0147] Optionally, the compression module is further configured as follows: Using spatial rays, the spatial envelope of the object model of each object in any scene sub-data is determined; based on the spatial envelope, any scene sub-data is compressed to obtain compressed scene sub-data.

[0148] Optionally, the partitioning module 1204 is further configured as follows: Based on the number of distributed computing nodes and spatial dimensions, the scene data is divided to obtain multiple scene sub-data.

[0149] Optionally, the device further includes: The node identifier determination module is configured to determine the node identifier of the corresponding distributed computing node for each voxel data. Correspondingly, the baking module 1208 is further configured as follows: Based on node identifiers, the data of each voxel is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data.

[0150] Optionally, the rendering module 1210 is further configured as follows: Based on the current viewpoint information of the virtual camera, the target voxel data is determined from each voxel data; based on the lighting parameters of the target voxel data, the scene image of the target scene is rendered.

[0151] Optionally, the device further includes: The dynamic rendering module is configured to load target voxel data into the renderer; invoke the renderer to render the scene image of the target scene based on the lighting parameters of the target voxel data; adjust the virtual camera's viewpoint and return to perform the steps of determining the target voxel data from each voxel data based on the current viewpoint information of the virtual camera.

[0152] Optionally, the rendering module 1210 is further configured as follows: Based on the viewpoint information of the virtual camera, the depth information of each voxel data is determined; based on the depth information of each voxel data, the target voxel data is determined from the voxel data, and the rendering weight of the target voxel data is determined; based on the lighting parameters and rendering weight of the target voxel data, the scene image of the target scene is rendered.

[0153] Optionally, the device further includes: The detail differentiation module is configured to determine the rendering weight of each voxel data based on the detail level of each voxel data. Correspondingly, the rendering module 1210 is further configured as follows: The scene image of the target scene is rendered based on the lighting parameters and rendering weights of each voxel data.

[0154] Optionally, the device further includes: The edge softening module is configured to, in the case where at least two voxel data have overlapping regions, determine a first rendering weight of a target voxel point based on the distance between the target voxel point in the overlapping region and a reference voxel point in at least two voxel data, wherein the target voxel point is any voxel point in the overlapping region; and determine a second rendering weight of each voxel point in a non-overlapping region of at least two voxel data. Correspondingly, the rendering module 1210 is further configured as follows: The scene image of the target scene is rendered based on the lighting parameters of each voxel data, the first rendering weight of each voxel point in the overlapping region, and the second rendering weight of each voxel point in the non-overlapping region.

[0155] In this embodiment, scene data of the target scene is acquired; the scene data is divided into multiple scene sub-data based on the spatial dimension; using preset voxel units, the multiple scene sub-data are fitted to obtain voxel data corresponding to each scene sub-data; the voxel data is distributed to distributed computing nodes for lighting baking to obtain lighting parameters for each voxel data; and the scene image of the target scene is rendered based on the lighting parameters of each voxel data. Dividing the scene data into multiple scene sub-data in the spatial dimension, fitting the multiple scene sub-data with preset voxel units to obtain voxel data corresponding to each scene sub-data in the spatial dimension, and distributing the voxel data to distributed nodes, lighting baking is implemented in parallel through multi-threading. This avoids generating lightmaps that correspond one-to-one with the object model, improving the efficiency of lighting baking. Based on the efficiently obtained lighting parameters, the scene image is rendered, thereby improving the efficiency of image rendering, reducing the performance requirements of hardware and software resources, and lowering the cost of image rendering.

[0156] The above is a schematic scheme of an image rendering apparatus according to this embodiment. It should be noted that the technical solution of this image rendering apparatus and the technical solution of the image rendering method described above belong to the same concept. For details not described in detail in the technical solution of the image rendering apparatus, please refer to the description of the technical solution of the image rendering method described above.

[0157] Figure 13 A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 1300 include, but are not limited to, a memory 1310 and a processor 1320. The processor 1320 is connected to the memory 1310 via a bus 1330, and a database 1350 is used to store data.

[0158] The computing device 1300 also includes an access device 1340, which enables the computing device 1300 to communicate via one or more networks 1360. Examples of such networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 1340 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0159] In one embodiment of this specification, the above-described components of the computing device 1300 and Figure 13 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 13 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0160] The computing device 1300 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 1300 can also be a mobile or stationary server.

[0161] The processor 1320 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described image rendering method.

[0162] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the image rendering method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the image rendering method described above.

[0163] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described image rendering method.

[0164] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the image rendering method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the image rendering method described above.

[0165] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described image rendering method.

[0166] The above is an illustrative scheme of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the image rendering method described above belong to the same concept. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solution of the image rendering method described above.

[0167] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0168] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0169] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0170] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0171] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. An image rendering method, characterized in that, include: Obtain scene data for the target scene; Based on the spatial dimension, the scene data is divided to obtain multiple scene sub-data, wherein the scene sub-data includes an object model of at least one object; For any given scene sub-data, the scene sub-data is compressed based on the object models of each object in the scene sub-data to obtain compressed scene sub-data. The process of compressing the scene sub-data based on the object models of each object in the scene sub-data to obtain compressed scene sub-data includes: using spatial rays to determine the spatial envelope of the object models of each object in the scene sub-data; and compressing the scene sub-data based on the spatial envelope to obtain compressed scene sub-data. Using preset voxel units, the multiple scene sub-data are fitted to obtain the voxel data corresponding to each scene sub-data; The voxel data is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of each voxel data. The scene image of the target scene is rendered based on the lighting parameters of each voxel data.

2. The method according to claim 1, characterized in that, The scene data is divided based on spatial dimensions to obtain multiple scene sub-data, including: Based on the number of distributed computing nodes and spatial dimensions, the scene data is divided to obtain multiple scene sub-data.

3. The method according to claim 1, characterized in that, After fitting the multiple scene sub-data using preset voxel units to obtain the voxel data corresponding to each scene sub-data, the method further includes: Determine the node identifier of the corresponding distributed computing node for each voxel data; The step of distributing the voxel data to distributed computing nodes for illumination baking to obtain the illumination parameters of the voxel data includes: Based on the node identifier, the voxel data is distributed to distributed computing nodes for illumination baking to obtain the illumination parameters of the voxel data.

4. The method according to claim 1, characterized in that, The rendering of the scene image of the target scene based on the illumination parameters of each voxel data includes: Based on the current viewpoint information of the virtual camera, the target voxel data is determined from the voxel data. The scene image of the target scene is rendered based on the lighting parameters of the target voxel data.

5. The method according to claim 4, characterized in that, After determining the target voxel data from the voxel data based on the current viewpoint information of the virtual camera, the method further includes: Load the target voxel data into the renderer; The renderer is invoked to render the scene image of the target scene based on the lighting parameters of the target voxel data; Adjust the viewpoint of the virtual camera, return to the step of determining the target voxel data from the voxel data based on the current viewpoint information of the virtual camera.

6. The method according to claim 4, characterized in that, The determination of target voxel data from the voxel data based on the current viewpoint information of the virtual camera includes: Based on the viewpoint information of the virtual camera, the depth information of each voxel data is determined; Based on the depth information of each voxel data, the target voxel data is determined from the voxel data, and the rendering weight of the target voxel data is determined. The rendering of the scene image of the target scene based on the lighting parameters of the target voxel data includes: The scene image of the target scene is rendered based on the lighting parameters and rendering weights of the target voxel data.

7. The method according to claim 1, characterized in that, Before rendering the scene image of the target scene based on the lighting parameters of the voxel data, the method further includes: The rendering weight of each voxel data is determined based on the detail level of each voxel data. The rendering of the scene image of the target scene based on the illumination parameters of each voxel data includes: The scene image of the target scene is rendered based on the lighting parameters and rendering weights of each voxel data.

8. The method according to claim 1, characterized in that, Before rendering the scene image of the target scene based on the lighting parameters of the voxel data, the method further includes: In the case where at least two voxel data have overlapping regions, a first rendering weight of the target voxel is determined based on the distance between the target voxel in the overlapping region and the reference voxel in the at least two voxel data, wherein the target voxel is any voxel in the overlapping region. Determine the second rendering weight of each voxel point in the non-overlapping region of the at least two voxel data; The rendering of the scene image of the target scene based on the illumination parameters of each voxel data includes: The scene image of the target scene is rendered based on the lighting parameters of each voxel data, the first rendering weight of each voxel point in the overlapping region, and the second rendering weight of each voxel point in the non-overlapping region.

9. An image rendering apparatus, employing the image rendering method as described in claim 1, characterized in that, include: The acquisition module is configured to acquire scene data of the target scene; The segmentation module is configured to segment the scene data based on spatial dimensions to obtain multiple scene sub-data. The fitting module is configured to use preset voxel units to fit the multiple scene sub-data respectively, and obtain the voxel data corresponding to each scene sub-data. The baking module is configured to distribute each voxel data to distributed computing nodes for illumination baking, thereby obtaining the illumination parameters of each voxel data. The rendering module is configured to render the scene image of the target scene based on the lighting parameters of the voxel data.

10. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the image rendering method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the image rendering method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Scene editor and editing method based on distribution type baking illumination

    CN103456034A

  • A light map bake algorithm based on voxel global illumination algorithm

    CN109448084A