Illumination rendering method and device, computer equipment and storage medium

By using simplex structure partitioning and skew transformation in the virtual scene to determine the position and lighting information of the lighting probe, the problem of low lighting rendering efficiency is solved, and the hardware resource utilization and lighting rendering efficiency are improved.

CN120655808APending Publication Date: 2025-09-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410313048.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the prior art, the efficiency of determining the lighting information of shading points during lighting rendering is low, which occupies a lot of hardware resources and leads to low efficiency.

Method used

The simplex structure is used to divide the virtual scene, and lighting probes are arranged. The vertices of the target simplex mesh to which the shading point belongs are determined through skew transformation, and lighting rendering is performed using the lighting information at the target vertex.

Benefits of technology

The amount of light probe data is reduced, the hardware resource utilization and the efficiency of determining light information are improved, and the efficiency of light rendering is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655808A_ABST
    Figure CN120655808A_ABST
Patent Text Reader

Abstract

The invention relates to an illumination rendering method and device, computer equipment, a storage medium and a computer program product. The method can be applied to the fields of artificial intelligence, image processing, games and the like, and comprises the following steps: performing scene division on a virtual scene according to a simplex structure to obtain simplex grids; illumination probes are arranged at the vertexes of the simplex grid, and illumination information of the illumination probes is determined; performing skew transformation on the coloring points in the virtual scene to obtain matched coloring points corresponding to the coloring points in a skew space; determining a vertex of a reference grid to which the matched coloring point belongs in the deflection space; determining a target vertex of a target simplex grid to which the coloring point belongs according to the vertex of the reference grid; and determining illumination information of the coloring point according to the illumination information of the illumination probe at the target vertex, and performing illumination rendering on the virtual scene based on the illumination information of the coloring point. By adopting the method, the efficiency of determining the illumination information of the coloring points can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a lighting rendering method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] With the development of computer technology, users have higher and higher requirements for the game's visual display effects.

[0003] In related technologies, lighting information in a virtual scene can be collected through lighting probes. When performing lighting rendering, multiple lighting probes are determined around a shading point, and the lighting information of the shading point is obtained by interpolation based on the lighting information of the multiple lighting probes. A large number of lighting probes are involved in determining the lighting information of the shading point, and thus determining the lighting information of the shading point occupies more hardware resources, resulting in lower efficiency in determining the lighting information of the shading point. Summary of the Invention

[0004] Based on this, it is necessary to provide a lighting rendering method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical problems, which can improve the efficiency of determining the lighting information of shading points.

[0005] In a first aspect, the present application provides a lighting rendering method. The method comprises:

[0006] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0007] In a second aspect, the present application further provides a lighting rendering device. The device comprises:

[0008] A scene division module is used to divide the virtual scene according to the simplex structure to obtain a simplex grid after the scene division;

[0009] A lighting information determination module is used to arrange lighting probes at the vertices of the simplex mesh and determine the lighting information of the lighting probes;

[0010] A skew transformation module is used to perform skew transformation on the shading points in the virtual scene to obtain the matching shading points corresponding to the shading points in the skew space;

[0011] A first vertex determination module, configured to determine, in the skew space, a vertex of the reference mesh to which the matching shading point belongs;

[0012] A second vertex determination module is used to determine the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh, to obtain a target vertex; the target simplex mesh is a mesh in the simplex mesh;

[0013] The rendering module is used to determine the lighting information of the shading point according to the lighting information of the lighting probe at the target vertex, and perform lighting rendering on the virtual scene based on the lighting information of the shading point.

[0014] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0015] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0016] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0017] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0018] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0019] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0020] The above-mentioned lighting rendering method, apparatus, computer device, storage medium, and computer program product divide the virtual scene according to the simplex structure, arrange lighting probes at fixed points of the simplex mesh obtained by scene division, and determine the lighting information of the shading point based on the lighting information of the lighting probes at the target vertex of the target simplex mesh to which the shading point belongs. Since the number of vertices of the simplex mesh is four, the number of target vertices of the target simplex mesh to which the shading point belongs is also four. The lighting information of the shading point is determined based on the lighting information of the lighting probes at the four target vertices. Compared with related technologies, the amount of lighting probe data involved in the calculation is reduced, thereby reducing the hardware resources occupied by determining the lighting information of the shading point, and improving the efficiency of determining the lighting information of the shading point. In addition, the shading point in the virtual scene is skewed to obtain a matching shading point in the skew space. In the skew space, the vertex of the reference mesh to which the matching shading point belongs can be quickly determined. Then, based on the vertex of the reference mesh, the target vertex of the target simplex mesh to which the shading point belongs can be quickly determined, thereby improving the efficiency of determining the target vertex of the target simplex mesh to which the shading point belongs and further improving the efficiency of determining the lighting information of the shading point. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A diagram of an application environment of a lighting rendering method in one embodiment;

[0022] Figure 2 1 is a flow chart of a lighting rendering method according to an embodiment;

[0023] Figure 3 is a schematic diagram of a simplex structure in one embodiment;

[0024] Figure 4A schematic diagram of six simplex structures forming a hexahedral structure in one embodiment;

[0025] Figure 5 A schematic diagram of arranging light probes based on a simplex grid in one embodiment;

[0026] Figure 6 A schematic diagram of light probes arranged according to a simplex grid in a virtual scene in one embodiment;

[0027] Figure 7 A schematic diagram of a simplex mesh in a non-regular hexahedron and a corresponding skewed mesh in a cube in one embodiment;

[0028] Figure 8 A schematic diagram of performing a skew transformation on a shading point and an inverse skew transformation on a reference vertex in one embodiment;

[0029] Figure 9 A schematic diagram of arranging light probes in a virtual scene in the related art;

[0030] Figure 10 A reference schematic diagram for determining the magnitude relationship between components of the decimal coordinates of a point in a skewed grid in one embodiment;

[0031] Figure 11 Schematic diagram of an illumination probe inside an object shifted to an illumination collection position according to an embodiment;

[0032] Figure 12 A schematic diagram of a visualization style of a light probe in a virtual scene in one embodiment;

[0033] Figure 13 A schematic diagram of another visualization style of light probes in a virtual scene in one embodiment;

[0034] Figure 14 FIG1 is a schematic diagram of skew transformation and inverse skew transformation in two-dimensional space in one embodiment;

[0035] Figure 15 is a flowchart of a lighting rendering method in another embodiment;

[0036] Figure 16 is a structural block diagram of a lighting rendering device in one embodiment;

[0037] Figure 17 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0039] Computer vision (CV) is the science of enabling machines to "see." Specifically, it refers to the use of cameras and computers to replace the human eye in identifying, tracking, and measuring objects, and further image processing to produce images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, aiming to build artificial intelligence systems that can extract information from images or multidimensional data. Large model technology has brought significant changes to the development of computer vision technology. Pre-trained models in the field of vision, such as the Swin Transformer, ViT, V-MOE, and MAE, can be fine-tuned to quickly and widely apply to specific downstream tasks. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and other technologies. It also includes common biometric recognition technologies such as facial recognition and fingerprint recognition.

[0040] It should be noted that in the following description, the terms "first, second and third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first, second and third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0041] The lighting rendering method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be integrated with server 104, or placed on a cloud or other network server. The lighting rendering method can be executed by terminal 102 or server 104, or by terminal 102 and server 104 working together.

[0042] Taking the execution of the lighting rendering method by terminal 102 as an example, terminal 102 divides the virtual scene according to the simplex structure to obtain the simplex mesh after the scene division; terminal 102 arranges lighting probes at the vertices of the simplex mesh to determine the lighting information of the lighting probes; terminal 102 performs a skew transformation on the shading point in the virtual scene to obtain the matching shading point corresponding to the shading point in the skew space; terminal 102 determines the vertex of the reference mesh to which the matching shading point belongs in the skew space; terminal 102 determines the vertex of the target simplex mesh to which the shading point belongs based on the vertices of the reference mesh to obtain the target vertex; the target simplex mesh is a mesh in the simplex mesh; terminal 102 determines the lighting information of the shading point based on the lighting information of the lighting probe at the target vertex, and performs lighting rendering on the virtual scene based on the lighting information of the shading point.

[0043] The terminal 102 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, IoT device, or portable wearable device. IoT device may be a smart speaker, smart TV, smart air conditioner, or smart car device. Portable wearable device may be a smart watch, smart bracelet, or head-mounted device.

[0044] The server 104 may be an independent physical server or a service node in a blockchain system, where each service node in the blockchain system forms a peer-to-peer network.

[0045] In addition, server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0046] The terminal 102 and the server 104 can be connected via Bluetooth, USB (Universal Serial Bus) or network communication connection methods, and this application does not limit this.

[0047] In some embodiments, as Figure 2 As shown, a lighting rendering method is provided, which is composed of Figure 1 The server or terminal in the Figure 1 The server and terminal in the embodiment cooperate to execute the method, and the method is described as follows: the method is executed by a computer device, and the computer device can be Figure 1 The terminal or server in the embodiment includes the following steps:

[0048] Step 202 : Divide the virtual scene into sections according to the simplex structure to obtain simplex grids after the scene division.

[0049] Among them, the simplex structure refers to a structure formed by K+1 vertices in K-dimensional space, where K is an integer greater than or equal to 1; for example, in one-dimensional space, the simplex structure is a line segment formed by two vertices, in two-dimensional space, the simplex structure is an equilateral triangle formed by three vertices, and in three-dimensional space, the simplex structure is a regular tetrahedron formed by four vertices.

[0050] A virtual scene may be a scene in a game application. When a computer device runs the game application, the virtual scene may be displayed, and virtual characters in the game may move around in the virtual scene. A virtual scene is a scene created by simulating a real environment. For example, a virtual scene may include a virtual sky, rivers, mountains, plants, animals, buildings, etc. A virtual character may be a player character image in a virtual scene that is used to represent a player and is controlled by the player. A virtual character may also be a non-player character image in a virtual scene that represents an interaction with the player.

[0051] It should be noted that the virtual scene is a virtual three-dimensional space, so the simplex structure used to divide the virtual scene is a three-dimensional simplex structure, that is, a regular tetrahedron, such as Figure 3 shown.

[0052] There can be multiple simplex grids, that is, multiple simplex grids can be obtained by dividing the virtual scene; the structures and sizes of the multiple simplex grids are the same.

[0053] Specifically, during the game, the virtual scene can change as the position of the camera model moves. For example, the camera model automatically follows the virtual character controlled by the player. When the player controls the virtual character to move, the position of the camera model follows the movement of the virtual character. For example, when the virtual character moves to the right, the position of the camera model also moves to the right, causing the camera model's field of view to move to the right, thereby causing the virtual scene to change.

[0054] Since the virtual scene can change with the movement of the camera model, the scene division of the virtual scene according to the simplex structure can be carried out in real time during the game; for example, when the computer device obtains the change in the position of the camera model, it determines the virtual scene of the current position of the camera model, divides the current virtual scene according to the simplex structure, and obtains the simplex grid corresponding to the current virtual scene.

[0055] In some embodiments, the virtual scene is divided according to the simplex structure. The position of the camera model in the virtual scene can be used as the origin, and the entire virtual scene can be divided into multiple simplex grids according to the simplex structure. In this way, the lighting probes can be arranged according to the multiple simplex grids that fill the entire virtual scene. By arranging as many lighting probes as possible in the virtual scene, the lighting rendering effect of the virtual scene can be improved.

[0056] It should be noted that the simplex structure is a regular tetrahedron, and the virtual scene can be regarded as a regular hexahedron (rectangle or cube). Multiple regular tetrahedrons cannot just cover the regular hexahedron. Therefore, the virtual scene is divided according to the simplex structure. There may be incomplete simplex grids in the edge area of ​​the virtual scene. The embodiment of the present application can eliminate the incomplete simplex grids.

[0057] In some embodiments, step 202 includes: using the camera model's position in the virtual scene as the origin, determining a scene to be processed in the virtual scene based on the origin and mesh information; and dividing the scene to be processed according to a simplex structure to obtain a simplex mesh after the scene division. Compared to arranging light probes according to multiple simplex meshes of the entire virtual scene, arranging light probes according to multiple simplex meshes of the scene to be processed reduces the number of light probes, reduces the amount of data involved in lighting rendering, and improves lighting rendering efficiency.

[0058] Among them, the grid information includes the preset side length and preset number of the simplex grid; the preset side length and preset number can be set according to actual needs, and the embodiment of the present application does not limit this.

[0059] The scene to be processed is a partial scene in the virtual scene, which can be divided into a preset number of simplex grids with a preset side length, that is, the structure and size of the multiple simplex grids obtained by division are the same, which can be understood as a uniform division of the scene to be processed.

[0060] Specifically, the computer device obtains a preset side length and a preset number of simplex meshes, obtains the position of the camera model in the virtual scene, takes the position as the origin, and determines the scene to be processed around the origin according to the preset side length and the preset number of simplex meshes, provided that the origin and the vertices of some simplex meshes coincide.

[0061] Exemplarily, the preset side length of the simplex grid is a, and the preset number is 6000. Taking the position of the camera model in the virtual scene as the origin, the scene to be processed occupied by 6000 simplex grids with a side length of a is determined. When the origin coincides with the vertices of some simplex grids, the scene to be processed is divided according to the simplex structure to obtain 6000 simplex grids with a side length of a.

[0062] In the above embodiment, the scene to be processed is divided so that lighting probes can be subsequently arranged in the scene to be processed according to multiple simplex grids. The scene to be processed is determined with the position of the camera model as the origin, that is, the scene to be processed includes the surrounding area of ​​the camera model, so that the lighting probes arranged subsequently are around the camera model, and the areas far from the camera model are not arranged with lighting probes. Not arranging lighting probes in areas far from the camera model has less impact on the lighting rendering effect of the virtual scene. Compared with arranging lighting probes according to multiple simplex grids of the entire virtual scene, arranging lighting probes according to multiple simplex grids of the scene to be processed reduces the number of lighting probes, which can reduce the amount of data involved in lighting rendering while ensuring the lighting rendering effect, thereby improving the lighting rendering efficiency.

[0063] In some embodiments, the virtual scene is divided according to a simplex structure to obtain a simplex mesh after the scene division. This can be done by using the location of the camera model in the virtual scene as the origin, and then determining subregions of the simplex structure layer by layer with preset side lengths around the origin until the number of determined subregions reaches a preset number. The scene consisting of the preset number of subregions in the virtual scene is then used as the scene to be processed, and the scene to be processed is divided according to the simplex structure to obtain multiple simplex meshes. In this way, the scene to be processed is centered on the camera model, and the subsequently deployed lighting probes are centered on the camera model, thereby improving the lighting rendering effect of the area around the camera model.

[0064] Among them, determining the sub-regions of the simplex structure layer by layer refers to first determining the sub-regions of the simplex structure of the first layer around the origin. If the number of sub-regions of the first layer does not reach a preset number, determining the sub-regions of the simplex structure of the second layer around the origin outside the sub-regions of the first layer, and repeating this process until the number of determined sub-regions reaches the preset number.

[0065] Taking a cube as an example, the determination of sub-regions layer by layer is explained; the number of sub-regions of the cube structure of the first layer is 8, and the origin is at the center of the 8 sub-regions of the cube structure; the number of sub-regions of the cube structure of the first and second layers is 64, and the origin is at the center of the 64 sub-regions of the cube structure.

[0066] In practical applications, 6 simplex structures can form a hexahedron structure, such as Figure 4As shown, the line segments shown by dotted lines in each hexahedral structure constitute a simplex structure, and the simplex structures in each hexahedral structure constitute a complete hexahedral structure; the hexahedral structure is not a regular hexahedral structure; the number of sub-regions of the simplex structure of the first layer determined around the origin is 48; it should be noted that the preset number of sub-regions does not need to exactly cover each layer, for example, if the preset number is 50, after determining 48 sub-regions of the first layer around the origin, only 2 sub-regions need to be determined in the second layer.

[0067] In the above embodiment, sub-regions of the simplex structure are determined layer by layer around the origin to obtain the scene to be processed, so that the simplex grid obtained by dividing the scene to be processed is centered on the origin, and then the subsequently arranged lighting probes are centered on the camera model, thereby improving the lighting rendering effect of the area around the camera model.

[0068] Step 204: Arrange lighting probes at the vertices of the simplex mesh and determine lighting information of the lighting probes.

[0069] Among them, the light probe is used to record the lighting conditions in the space, that is, the distribution of radiance. Radiance is the radiation flux per unit projected area and unit solid angle, which can measure the energy emitted, reflected, transmitted or received by light from a point in a specific direction; in lighting rendering, radiance affects the lighting brightness, color and overall visual effect of the virtual scene.

[0070] Each simplex mesh includes four vertices, and adjacent simplex meshes share some vertices; the computer device arranges lighting probes at the vertices of the simplex meshes, samples the lighting information of the positions at which the lighting probes are located, and obtains the lighting information of the light probes.

[0071] It should be noted that the simplex mesh is a regular tetrahedral mesh, and the lighting probes are arranged at the vertices of the regular tetrahedral mesh, so that the spacing between each lighting probe is equal. Compared with the situation where the spacing between the lighting probes is unequal, the overlap of the lighting information collected by each lighting probe is reduced, the hardware resource consumption caused by redundant lighting information is avoided, and the hardware resource utilization rate is improved.

[0072] For example, 6 simplex meshes form a hexahedron, and light probes are arranged at the vertices of the 6 simplex meshes as follows: Figure 5 shown.

[0073] It should be noted that the division of the virtual scene according to the simplex structure is performed automatically. After obtaining the simplex mesh, the arrangement of lighting probes at the vertices of the simplex mesh is also performed automatically. Compared with manually arranging lighting probes in the virtual scene, the efficiency of arranging probes is effectively improved.

[0074] A virtual scene may include a variety of objects, such as buildings, plants, etc. Since the virtual scene is divided automatically, there may be vertices of the simplex mesh inside the object, such as the vertices of the simplex mesh inside the wall, or the vertices of the simplex mesh inside the stone; this will cause the light probes to be arranged inside the object. The light probes arranged inside the object may not be able to collect effective lighting information, resulting in the subsequent use of the lighting information of the light probe to determine the lighting information of the shading point, affecting the accuracy of the lighting information of the shading point. In order to improve the quality of the lighting information of the shading point, after the light probes are arranged, the light probes inside the object can be screened out, and the lighting information can be collected outside the object. The lighting information collected outside the object is used as the lighting information of the light probes inside the object.

[0075] Step 206 : Perform skew transformation on the shading point in the virtual scene to obtain a matching shading point corresponding to the shading point in the skew space.

[0076] The shading point can be any point in the virtual scene, and the skew transformation is used to convert the shading point in the world space corresponding to the virtual scene into the skew space; the matching shading point is a point in the skew space that matches the shading point.

[0077] It should be noted that since the hexahedron composed of 6 simplex grids is not a regular hexahedron, the simplex grids are not set in parallel according to the direction of the coordinate system of the world space of the virtual scene, such as Figure 6 As shown, based on the world space coordinate system, it is difficult to determine the vertex of the simplex mesh to which the shading point belongs.

[0078] In order to facilitate the determination of the vertex of the simplex mesh to which the shading point belongs, the skew space after skew transformation is used to assist in determining the vertex of the simplex mesh to which the shading point belongs.

[0079] Specifically, performing a skew transformation on the shading point is essentially performing a skew transformation on the coordinates of the shading point; the computer device obtains the coordinates of the shading point, and performs a skew transformation on the coordinates of the shading point according to the conversion relationship between the coordinate system of the world space and the coordinate system of the skew space, to obtain the skew coordinates in the skew space, and the skew coordinates point to the matching shading point in the skew space.

[0080] The coordinates of the shading point are skewed by transforming them. The skew vector is obtained and used to transform the coordinates of the shading point. The skew vector is determined according to the dimension of the simplex structure. The simplex structure is a three-dimensional simplex structure, so the dimension is 3.

[0081] Exemplarily, the skew vector is determined according to the dimension of the simplex structure, the dot product between the coordinates of the shading point and the skew vector is calculated to obtain a first dot product result, the sum of the first dot product result and the coordinates of the shading point is calculated to obtain the skew coordinate, and the skew coordinate points to the matching shading point in the skew space.

[0082] The skew space can be determined before skew transformation is applied to the shading points in the virtual scene, such as Figure 5 As shown, the coordinate system of the world space can be skewed to obtain the coordinate system of the skew space. The skew space is determined based on the coordinate system of the skew space. It can be understood that the origin of the coordinate system of the skew space is the same as the origin of the coordinate system of the world space, that is, the position of the camera model.

[0083] Step 208 : Determine the vertex of the reference mesh to which the matching shading point belongs in the skew space.

[0084] The reference grid to which the matching colored point belongs is a grid in the skew grid, and the skew grid is a grid that matches the simplex grid in the skew space.

[0085] The structure of the skewed grid is the simplex structure after skew. The simplex structure is a regular tetrahedron. The simplex structure after skew is an irregular tetrahedron. The hexahedron composed of six regular tetrahedrons is not a regular hexahedron. The hexahedron composed of six irregular tetrahedrons is a cube (regular hexahedron). That is, six skewed grids can form a cube grid; the simplex grid in the irregular hexahedron is similar to the skewed grid in the corresponding cube. Figure 7 shown.

[0086] Before executing step 208, a skew grid in the skew space can be determined; after the skew space is determined, the skew grid can be determined in the skew space based on the preset skew side length and the origin; since six skew grids can form a cube grid, and the preset skew side length of the skew grid is the same as the side length of the cube grid, the cube grid can be determined in the skew space based on the preset skew side length and the origin, and then the cube grid can be divided to obtain a skew grid.

[0087] The preset skew side length (side length of the cube mesh) can be the unit length of the skew space. In this way, the cube mesh to which the matching shading point belongs can be determined based on the coordinates of the matching shading point in the skew space. For example, if the coordinates of the matching shading point are (0.2, 1.1, 2.7), it can be determined that the cube mesh to which the matching shading point belongs is the first cube mesh in the x-axis direction, the second cube mesh in the y-axis direction, and the third cube mesh in the z-axis direction in the skew space. After determining the cube mesh to which the matching shading point belongs, the reference mesh to which the matching shading point belongs is determined among the multiple skew meshes that constitute the cube mesh to which the matching shading point belongs, and then the vertices of the reference mesh to which the matching shading point belongs are determined based on the correspondence between the reference mesh and the vertices. The vertices of the reference mesh to which the matching shading point belongs include four vertices.

[0088] It should be noted that the skew space is divided according to the preset skew side length and origin to obtain a skew grid, and there is no need to convert the simplex grid, which reduces the time required to determine the skew grid and improves the efficiency of determining the skew grid.

[0089] Step 210 , determining the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh, and obtaining the target vertex; the target simplex mesh is a mesh in the simplex mesh.

[0090] The target simplex mesh is the simplex mesh to which the shading point belongs; the target vertex is the vertex of the simplex mesh to which the shading point belongs, and the number of target vertices is 4.

[0091] Specifically, the computer device performs an inverse skew transformation on the vertices of the reference mesh to obtain target vertices of the target simplex mesh.

[0092] For example, Figure 8 As shown, for the shading point a, the shading point a is skew transformed to obtain the matching shading point b in the skew space, the reference grid g1 to which the matching shading point b belongs is determined in the skew space, and the four vertices of the reference grid g1 are determined: d1, d2, d3 and d4; the four vertices d1, d2, d3 and d4 of the reference grid g1 are inversely skew transformed to obtain four target vertices: f1, f2, f3 and f4; the four target vertices: f1, f2, f3 and f4 are the vertices of the target simplex grid to which the shading point a belongs.

[0093] Step 212 : determining the lighting information of the shading point according to the lighting information of the lighting probe at the target vertex, and performing lighting rendering on the virtual scene based on the lighting information of the shading point.

[0094] The lighting information of the lighting probe may be indirect lighting information, and thus the lighting information of the shading point is indirect lighting information.

[0095] Specifically, since there can be multiple shading points in the virtual scene, each shading point determines the target vertex of the target simplex mesh to which the shading point belongs according to the process of steps 206 to 210 above, and then in step 212, for each shading point, the indirect lighting information of the shading point is determined based on the lighting information of the lighting probe of the target vertex of the target simplex mesh to which the shading point belongs; the direct lighting information of the shading point is obtained, and the global lighting information of the shading point is determined based on the indirect lighting information and the indirect lighting information of the shading point; and the virtual scene is illuminated and rendered based on the global lighting information of multiple shading points.

[0096] The lighting information of the shading point is determined based on the lighting information of the lighting probe at the target vertex. The weights of the lighting probes at the four target vertices can be determined, and the lighting information of the lighting probes at the four target vertices are fused according to the determined weights to obtain the indirect lighting information of the shading point.

[0097] In related technologies, light probes are evenly arranged in a virtual scene, and the grid to which the shading point belongs has eight vertices, such as Figure 9 As shown, the related technology determines the lighting information of the shading point based on the lighting information corresponding to the eight vertex probes of the mesh vertex to which the shading point belongs. The number of lighting probes involved in determining the lighting information of the shading point is large, and thus determining the lighting information of the shading point occupies more hardware resources, resulting in low efficiency in determining the lighting information of the shading point.

[0098] In the above-mentioned lighting rendering method, a virtual scene is divided according to a simplex structure, and lighting probes are arranged at fixed points of the simplex mesh obtained by the scene division. The lighting information of the shading point is determined based on the lighting information of the light probes at the target vertex of the target simplex mesh to which the shading point belongs. Since the number of vertices of the simplex mesh is four, the number of target vertices of the target simplex mesh to which the shading point belongs is also four. The lighting information of the shading point is determined based on the lighting information of the light probes at the four target vertices. Compared with related technologies, the amount of light probe data involved in the calculation is reduced, thereby reducing the hardware resources occupied by determining the lighting information of the shading point, and improving the efficiency of determining the lighting information of the shading point. In addition, the shading point in the virtual scene is skewed to obtain a matching shading point in the skew space. In the skew space, the vertex of the reference mesh to which the matching shading point belongs can be quickly determined. Then, based on the vertices of the reference mesh, the target vertex of the target simplex mesh to which the shading point belongs can be quickly determined, thereby improving the efficiency of determining the target vertex of the target simplex mesh to which the shading point belongs, and further improving the efficiency of determining the lighting information of the shading point.

[0099] In some embodiments, a skew transformation is performed on a shading point in a virtual scene to obtain a matching shading point corresponding to the shading point in skew space, including: determining a scaling ratio based on the side length of a simplex mesh; scaling the shading point in the virtual scene based on the scaling ratio to obtain a pending shading point; and skew transformation is performed on the pending shading point to obtain a matching shading point corresponding to the shading point in skew space. By establishing a skew transformation relationship between the shading point and the matching shading point through the scaling ratio, the side length of the simplex mesh can be arbitrarily set based on the desired sparsity of light probe placement, thereby increasing the flexibility of light probe placement.

[0100] The shading point is scaled based on the scaling ratio, and the side length of the simplex grid to which the shading point belongs is implicitly scaled to obtain the side length of the grid to which the shading point to be processed belongs.

[0101] For ease of description, the side length of the simplex grid is recorded as the preset side length; the preset side length can be determined based on the basic side length and the scaling ratio, and the basic side length can be understood as the side length of the grid to which the shading point to be processed belongs; the basic side length can be determined based on the preset grid side length of the skewed grid, specifically: preset side length = basic side length * scaling ratio = skew side length * skew factor * scaling ratio.

[0102] The scaling ratio can indicate the degree to which the base side length is magnified or reduced. When the scaling ratio is greater than 1, the larger the scaling ratio, the greater the degree to which the base side length is magnified. When the scaling ratio is less than 1, the smaller the scaling ratio, the greater the degree to which the base side length is reduced. The larger the scaling ratio, the larger the side length of the simplex mesh, and the farther the distance between the arranged lighting probes. The smaller the scaling ratio, the smaller the side length of the simplex mesh, and the closer the distance between the arranged lighting probes.

[0103] Based on the relationship between the preset side length, basic side length and skew side length mentioned above, when the skew side length is fixed, the basic side length is also fixed. The relationship between the preset side length, basic side length and skew side length is established through the scaling ratio. Then, the preset side length can be arbitrarily set according to the requirements of the sparseness of the arrangement of light probes, thereby improving the flexibility of arranging light probes.

[0104] It should be noted that six simplex grids can form a hexahedral grid. Compared with the cube grid, the hexahedral grid can be understood as squeezing the cube grid along the diagonal until the diagonal of the squeezed hexahedral grid is equal to the side length of the cube grid. Therefore, there is a proportional relationship between the basic side length and the preset grid side length of the skewed grid, that is, the ratio between the basic side length and the preset skewed side length is equal to the ratio between the side length of the cube grid and the diagonal. This ratio is the skew factor; the skew factor can be ; In practical applications, the default side length of the simplex grid is: .

[0105] Specifically, for the convenience of calculation, the preset skew side length of the skew grid can be set to 1, and the shading point is scaled according to the scaling ratio. In fact, the coordinates of the shading point are scaled to obtain the scaled coordinates, and the scaled coordinates point to the shading point to be processed.

[0106] The skew transformation is performed on the shading point to be processed. The skew vector can be determined according to the dimension of the simplex structure, the dot product between the coordinates of the shading point to be processed and the skew vector is calculated to obtain a second dot product result, and the sum of the second dot product result and the shading point to be processed is calculated to obtain the skew coordinates, and the skew coordinates point to the matching shading point in the skew space.

[0107] For example, the dimension of the simplex structure is 3, the skew vector is (1 / 3, 1 / 3, 1 / 3), the coordinates of the shading point to be processed are p, and the coordinates of the shading point are matched to p'=p+dot(p,(1 / 3,1 / 3,1 / 3)).

[0108] In the above embodiment, a relationship is assumed between the side length, the base side length and the skew side length, and the skew side length is fixed, so that the vertex of the reference mesh to which the matching shading point belongs can be quickly determined subsequently, thereby improving the efficiency of determining the vertex of the target simplex mesh to which the shading point belongs, and establishing the relationship between the preset side length and the base side length and the skew side length through the scaling ratio, so that the preset side length can be arbitrarily set according to the requirements of the sparsity of arranging the lighting probes, thereby improving the flexibility of arranging the lighting probes.

[0109] In some embodiments, determining the vertex of the reference mesh to which a matching shading point belongs in skew space includes: splitting the coordinates of the matching shading point into integer coordinates and decimal coordinates; finding a partition vector corresponding to the matching shading point based on the magnitude relationship between the components of the decimal coordinates; and determining the vertex of the reference mesh to which the matching shading point belongs based on the partition vector and the integer coordinates. This allows for rapid determination of the vertex of the reference mesh to which the matching coordinate point belongs, improving the efficiency of determining the vertex of the reference mesh to which the matching shading point belongs.

[0110] The coordinates of the matching shading point include an integer part and a decimal part, the integer part corresponds to the integer coordinates, and the decimal part corresponds to the decimal coordinates.

[0111] Since six skew grids form a cube grid, the six skew grids in the cube grid can be understood as six partitions. There is a definite size relationship between the components of the coordinates of the points in each partition. Therefore, based on the size relationship between the components in the decimal coordinates, the partition corresponding to the decimal coordinate can be determined, and then the corresponding partition vector can be found.

[0112] It should be noted that the decimal coordinates include a first component, a second component and a third component. In practical applications, the first component can be the component in the x-axis direction, the second component can be the component in the y-axis direction, and the third component can be the component in the z-axis direction; the size relationship between the components includes the size relationship between the first component and the second component, the size relationship between the second component and the third component, and the size relationship between the third component and the first component.

[0113] Set the first component s(x), the second component s(y) and the third component s(z); determine the partition vector based on the size relationship between the first component s(x) and the second component s(y), the size relationship between the second component s(y) and the third component s(z), and the size relationship between the third component s(z) and the first component s(x); the partition vector is expressed as e=(e(x), e(y), e(z)), where e(x) is the first value, e(y) is the second value, and e(z) is the third value. When the first component s(x) is greater than the second component s(y), the partition vector is expressed as e=(e(x), e(y), e(z)), where e(x) is the first value, e(y) is the second value, and e(z) is the third value. When the first component s(y) is less than the second component s(y), the first value is 1; when the second component s(y) is greater than the third component s(z), the second value is 1; when the second component s(y) is less than the third component s(z), the second value is 0; when the third component s(z) is greater than the first component s(x), the third value is 1; when the third component s(z) is less than the first component s(x), the third value is 0; that is, the components included in the partition vector (e(x), e(y), e(z)) are 0 or 1.

[0114] Specifically, the computer device can round down the coordinates of the matching shading point to obtain integer coordinates, determine the difference between the coordinates of the matching shading point and the integer coordinates to obtain decimal coordinates, and determine the corresponding partition vector based on the size relationship between the first component and the second component, the size relationship between the second component and the third component, and the size relationship between the third component and the first component in the decimal coordinates; obtain four reference coordinates corresponding to the partition vector, and determine the coordinates of the four vertices of the reference grid to which the matching shading point belongs based on the four reference coordinates and the integer coordinates.

[0115] It should be noted that each skew grid in the cube grid has its own corresponding partition vector. After determining the partition vector, the skew grid corresponding to the partition vector can be determined in the six skew grids of the cube grid, and the four reference coordinates of the skew grid can be obtained.

[0116] For example, Figure 10As shown in the figure, for the skew grid k1 in the cube grid, the size relationship between the components of the decimal coordinates of the points belonging to the skew grid k1 is: the first component s(x) is smaller than the second component s(y), the second component s(y) is larger than the third component s(z), and the third component s(z) is smaller than the first component s(x). Therefore, the partition vector corresponding to the decimal coordinates of the points belonging to the skew grid k1 is e=(0,1,0); the four reference coordinates of the skew grid k1 corresponding to the partition vector are: (0,0,0), (0,1,0), (1,1,0) and (1,1,1 ); for the skew grid k2 in the cube grid, the size relationship between the components of the decimal coordinates of the points belonging to the skew grid k2 is: the first component s(x) is smaller than the second component s(y), the second component s(y) is larger than the third component s(z), and the third component s(z) is larger than the first component s(x). Therefore, the partition vector corresponding to the decimal coordinates of the points belonging to the skew grid k2 is e=(0,1,1); the four reference coordinates of the skew grid k2 corresponding to the partition vector are: (0,0,0), (0,1,0), (0,1,1) and (1,1,1).

[0117] In the above embodiment, the corresponding partition vector is searched according to the decimal coordinates corresponding to the matching shading point. According to the partition vector and the integer coordinates corresponding to the matching shading point, the vertex of the reference grid to which the matching coordinate point belongs can be quickly determined, thereby improving the efficiency of determining the vertex of the reference grid to which the matching shading point belongs.

[0118] In some embodiments, the vertices of the reference mesh include a first reference vertex, a second reference vertex, a third reference vertex, and a fourth reference vertex; determining the vertex of the reference mesh to which the matching shading point belongs based on a partition vector and integer coordinates includes: determining a first displacement vector and a second displacement vector based on the partition vector and a preset mesh edge length of the reference mesh; determining the first reference vertex based on the integer coordinates and the first displacement vector; determining the second reference vertex based on the integer coordinates and the second displacement vector; determining the third reference vertex based on the integer coordinates and a displacement threshold vector; and using the point pointed to by the integer coordinates as the fourth reference vertex. Using the partition vector, the preset first displacement vector, the second displacement vector, and the displacement threshold vector, the vertex of the reference mesh to which the matching shading point belongs can be quickly determined, thereby improving the efficiency of determining the vertex of the reference mesh to which the matching shading point belongs.

[0119] In practical applications, the preset grid side length of the reference grid may be a unit length.

[0120] Specifically, the computer device rearranges components of the partition vector to obtain a rearranged vector, acquires a displacement threshold vector, and determines a first displacement vector and a second displacement vector based on the rearranged vector, the displacement threshold vector, and the partition vector.

[0121] The computer device determines a first difference vector between the displacement threshold vector and the rearrangement vector, calculates the product between the partition vector and the first difference vector, and obtains a first displacement vector; calculates a second difference vector between the displacement threshold vector and the partition vector, calculates the product between the rearrangement vector and the second difference vector, and obtains a product vector; calculates the difference between the displacement threshold vector and the product vector, and obtains a second displacement vector.

[0122] The computer device calculates the sum of the integer coordinate and the first displacement vector to obtain a first coordinate, which points to the first reference vertex; calculates the sum of the integer coordinate and the second displacement vector to obtain a second coordinate, which points to the second reference vertex; calculates the sum of the integer coordinate and the displacement threshold vector to obtain a third coordinate, which points to the third reference vertex; and the integer coordinate points to the fourth reference vertex.

[0123] In practical applications, the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space. The corresponding code is shown below.

[0124] float3 p'=p + dot(p, float3(1 / 3, 1 / 3, 1 / 3));

[0125] float3 s=floor(p');

[0126] float3 r=p'-s

[0127] float3 e=step(float3(0,0,0),rr.yzx);

[0128] float3 i1=e*(float3(1,1,1)-e.zxy);

[0129] float3 i2= float3(1,1,1)-e.zxy*(float3(1,1,1)-e);

[0130] r1=s + i1;

[0131] r2 =s + i2;

[0132] r3=s+float3(1,1,1);

[0133] r4=s + float3(0,0,0);

[0134] Where p is the coordinate of the shading point, or the shading point to be processed after scaling the shading point; p' is the coordinate of the matching shading point; s is the integer coordinate, r is the fractional coordinate; e is the partition vector; e.zxy is the rearrangement vector, float3(1,1,1) is the displacement threshold vector, i1 is the first displacement vector, i2 is the second displacement vector, and r1, r2, r3, and r4 are the coordinates of the first, second, third, and fourth reference vertices, respectively.

[0135] In the above embodiment, the partition vector, the preset first displacement vector, the second displacement vector and the displacement threshold vector can be used to quickly determine the vertices of the reference grid to which the matching shading point belongs, thereby improving the efficiency of determining the vertices of the reference grid to which the matching shading point belongs.

[0136] In some embodiments, determining the vertices of the target simplex mesh to which the shading point belongs based on the vertices of the reference mesh to obtain the target vertex includes: performing an inverse skew transformation on the vertices of the reference mesh to obtain candidate points in the virtual scene; determining a scaling factor based on the side length of the simplex mesh; and determining the vertices of the target simplex mesh to which the shading point belongs based on the scaling factor and the candidate points. This allows for rapid determination of the vertices of the target simplex mesh to which the shading point belongs, improving the efficiency of determining the vertices of the target simplex mesh to which the shading point belongs.

[0137] The vertices of the target simplex mesh to which the shading point belongs include a first target vertex, a second target vertex, a third target vertex, and a fourth target vertex.

[0138] Specifically, the computer device obtains an inverse skew factor, which is 1 / 6 in actual applications; calculates the dot product between the coordinates of the first reference vertex and the inverse skew factor to obtain a third dot product result, calculates the difference between the coordinates of the first reference vertex and the third dot product result to obtain the coordinates of the first candidate point, calculates the ratio between the coordinates of the first candidate point and the scaling ratio to obtain the coordinates of the first target vertex; calculates the dot product between the coordinates of the second reference vertex and the inverse skew factor to obtain a fourth dot product result, calculates the difference between the coordinates of the second reference vertex and the fourth dot product result to obtain the coordinates of the second candidate point, calculates the ratio between the coordinates of the second candidate point and the scaling ratio The ratio between them is used to obtain the coordinates of the second target vertex; the dot product between the coordinates of the third reference vertex and the inverse skew factor is calculated to obtain the coordinates of the third candidate point, the ratio between the coordinates of the third candidate point and the scaling ratio is calculated to obtain the fifth dot product result, the difference between the coordinates of the third reference vertex and the fifth dot product result is calculated to obtain the coordinates of the third target vertex; the dot product between the coordinates of the fourth reference vertex and the inverse skew factor is calculated to obtain the coordinates of the fourth candidate point, the ratio between the coordinates of the fourth candidate point and the scaling ratio is calculated to obtain the fourth dot product result, the difference between the coordinates of the fourth reference vertex and the fourth dot product result is calculated to obtain the coordinates of the fourth target vertex.

[0139] In the above embodiment, after determining the vertices of the reference mesh to which the matching shading point belongs, the vertices of the reference mesh are subjected to inverse skew transformation and scaling processing to obtain the vertices of the target simplex mesh to which the shading point belongs. This allows for rapid acquisition of the vertices of the target simplex mesh to which the shading point belongs, thereby improving the efficiency of determining the vertices of the target simplex mesh to which the shading point belongs.

[0140] In some embodiments, after obtaining the simplex mesh after scene division, the method further includes: recording first numbering information of the simplex mesh and second numbering information of the vertices of the simplex mesh; establishing a first association based on the first numbering information and the second numbering information; and determining, based on the vertices of the reference mesh, the vertices of the target simplex mesh to which the shading point belongs to obtain the target vertex, including: determining a reference number of the reference mesh based on the vertices of the reference mesh; and determining, based on the reference number and the first association, the vertices of the target simplex mesh to which the shading point belongs to obtain the target vertex. By finding the target vertex of the target simplex mesh to which the shading point belongs through the association between the first numbering information of the simplex mesh, the second numbering information of the simplex mesh, and the reference number of the reference mesh, the target vertex of the target simplex mesh to which the shading point belongs is not required to calculate the coordinates of the target vertex, thereby improving the efficiency of determining the target vertex.

[0141] The first numbering information is used to indicate the position of the simplex mesh relative to the origin, and may include a first sub-number and a second sub-number. Since six simplex meshes can form a hexahedron, the first sub-number is the number of the hexahedron to which the simplex mesh belongs, and the second sub-number is the number of the simplex mesh in the hexahedron to which it belongs. The second numbering information includes the numbers of the vertices of the simplex mesh.

[0142] Exemplarily, the simplex mesh belongs to the first hexahedral mesh in the positive directions of the x-axis, y-axis and z-axis of the coordinate system of the world space, then the first sub-number of the simplex mesh is (1,1,1); the simplex mesh is the mesh with the preset number 1 in the hexahedral mesh, then the second sub-number of the simplex mesh is 1; the hexahedral mesh also includes simplex meshes with second sub-numbers 2, 3, 4, 5 and 6; the first number information of the simplex mesh is (1,1,1)-1.

[0143] The third and fourth subnumbers of the reference number of the reference grid, the third subnumber is the number of the cube grid to which the reference grid belongs, and the fourth subnumber is the number of the reference grid in the cube to which it belongs; the division method of the six skew grids in the cube grid is the same as the division method of the six simplex grids in the hexahedral grid; the numbering method of the fourth subnumbers of the six skew grids in the cube grid is the same as the numbering method of the second subnumbers of the six simplex grids in the hexahedral grid.

[0144] Specifically, after dividing the scene, the computer device records the first number information of each simplex mesh and the second number information of the vertices of the simplex mesh. After determining the skew space, each cube mesh in the skew space is determined according to unit length. The third sub-number of the cube mesh is determined in the same manner as the first sub-number of the hexahedral mesh. The six skew meshes in the cube mesh are determined in the same manner as the six simplex meshes in the hexahedral mesh. The fourth sub-number of the skew mesh in the cube mesh is determined in the same manner as the second sub-number of the simplex meshes in the hexahedral mesh. The third and fourth sub-numbers form the skew number of the skew mesh, and a correspondence is established between the skew number and the vertices of the skew mesh.

[0145] After obtaining the vertices of the reference mesh, based on the correspondence between the skew numbers and the vertices of the skew mesh, the reference number of the reference mesh is searched in the skew numbers of the skew mesh.

[0146] Exemplarily, the coordinates of the vertices of the reference grid are: (0,1,0), (0,2,0), (0,2,1) and (1,2,1), respectively, indicating that the reference grid belongs to the first cube grid on the x-axis, the second cube grid on the y-axis and the first cube grid on the z-axis of the coordinate system of the skew space, and the reference grid is the skew grid numbered 1 in the cube grid; the reference number of the reference grid is (1,2,1)-1.

[0147] In some embodiments, determining a vertex of a target simplex mesh to which a shading point belongs based on the reference number and the first association relationship to obtain the target vertex includes: selecting the target simplex mesh to which the shading point belongs based on the reference number in the simplex mesh; determining second numbering information associated with the reference number based on the first association relationship; and determining the target vertex of the target simplex mesh based on the second numbering information associated with the reference number. Locating the target vertex through the association between the numbering information eliminates the need to calculate the coordinates of the target vertex, thereby improving the efficiency of determining the target vertex.

[0148] Specifically, the computing device uses the reference number as the target number information, and the simplex mesh whose first number information is consistent with the target number information is the target simplex mesh; in the first association relationship, the second number information associated with the target number information is searched, and the second number information associated with the target number information points to the target vertex of the target simplex mesh.

[0149] It should be noted that this embodiment does not calculate the coordinate value of the target vertex, but locates the target vertex through the second number associated with the target number information. The target vertex is located through the association between the number information, which improves the efficiency of determining the target vertex.

[0150] In one implementation, since six skew grids form a cube grid, the six skew grids in the cube grid can be understood as six partitions, each partition corresponding to a different partition vector. Therefore, the fourth sub-number corresponding to each partition corresponds to a different partition vector, and the correspondence between the partition vector and the fourth sub-number can be pre-stored. After performing a skew transformation on a shading point in a virtual scene to obtain a matching shading point corresponding to the shading point in the skew space, the method further includes: splitting the coordinates of the matching shading point into integer coordinates and decimal coordinates; searching for the partition vector corresponding to the matching shading point based on the magnitude relationship between the components in the decimal coordinates; determining the cube grid to which the matching shading point belongs based on the coordinates of the matching shading point, using the number of the cube grid as the third sub-number, searching for the fourth sub-number corresponding to the partition vector, and determining a reference number of a reference grid based on the third sub-number and the fourth sub-number; selecting a target simplex grid to which the shading point belongs in a simplex grid based on the reference number; determining second number information associated with the reference number based on the first association relationship; and determining a target vertex of the target simplex grid based on the second number information associated with the reference number.

[0151] In this way, there is no need to solve the reference vertex of the reference grid. The reference number of the reference grid can be directly determined according to the partition vector, and then the target vertex is located according to the reference number, which improves the efficiency of determining the target vertex.

[0152] In some embodiments, after determining the lighting information of the Light Probe, the method further includes: establishing a second association based on the second numbering information of the vertex of the simplex mesh and the lighting information of the Light Probe at the vertex; and determining the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh. After obtaining the target vertex, the method further includes: searching for the lighting information of the Light Probe at the target vertex based on the second numbering information of the target vertex and the second association. Based on the second association, the lighting information of the Light Probe at the target vertex can be quickly found, thereby improving the efficiency of determining the lighting information of the Light Probe at the target vertex.

[0153] Specifically, after the computer device determines the lighting information of the lighting probe, it associates the second number information of the vertex where the lighting probe is located with the lighting information of the lighting probe to obtain a second association relationship; the second number information of the target vertex of the target simplex mesh to which the shading point belongs is the second number information associated with the reference number; based on the second number information associated with the reference number, the lighting information of the lighting probe at the target vertex is determined in the second association relationship.

[0154] Exemplarily, the reference number of the reference grid to which the matching shading point belongs is (1,2,1)-1, and the second numbering information of the target vertex of the target simplex grid to which the matching point belongs is determined based on the first association relationship, including: number h1, number h2, number h3 and number h4. Based on the second association relationship, the lighting information of the lighting probe at the target vertex corresponding to number h1 is obtained, the lighting information of the lighting probe at the target vertex corresponding to number h2 is obtained, the lighting information of the lighting probe at the target vertex corresponding to number h3 is obtained, and the lighting information of the lighting probe at the target vertex corresponding to number h4 is obtained.

[0155] In the above embodiment, the second association relationship between the second vertex number information of the simplex mesh and the lighting information of the lighting probe at the vertex can be used to quickly determine the lighting information of the lighting probe at the target vertex, thereby improving the efficiency of determining the lighting information of the lighting probe at the target vertex.

[0156] In some embodiments, the target vertices include a first target vertex, a second target vertex, a third target vertex, and a fourth target vertex; determining the lighting information of the shading point based on the lighting information of the lighting probes at the target vertices includes: obtaining fusion weights of the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex respectively; and fusing the lighting information of the lighting probes corresponding to the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex based on the fusion weights to obtain the lighting information of the shading point. This reduces the amount of data of the lighting probes involved in the calculation, thereby reducing the hardware resources occupied by determining the lighting information of the shading point and improving the efficiency of determining the lighting information of the shading point.

[0157] Specifically, the fusion weight of the first target vertex is also the fusion weight of the lighting probe at the first target vertex; the fusion weight of the second target vertex is also the fusion weight of the lighting probe at the second target vertex; the fusion weight of the third target vertex is also the fusion weight of the lighting probe at the third target vertex; the fusion weight of the fourth target vertex is also the fusion weight of the lighting probe at the fourth target vertex.

[0158] The computer device determines a first product between the first fusion weight and the lighting information of the lighting probe at the first target vertex, determines a second product between the second fusion weight and the lighting information of the lighting probe at the second target vertex, determines a third product between the third fusion weight and the lighting information of the lighting probe at the third target vertex, determines a fourth product between the fourth fusion weight and the lighting information of the lighting probe at the fourth target vertex, calculates the sum of the first product, the second product, the third product and the fourth product, and obtains the lighting information of the shading point.

[0159] In the above embodiment, the lighting information of the shading point is determined based on the lighting information of the lighting probes at the four target vertices; compared with the related technology, the amount of data of the lighting probes involved in the calculation is reduced, thereby reducing the hardware resources occupied by determining the lighting information of the shading point, and improving the efficiency of determining the lighting information of the shading point.

[0160] In some embodiments, determining lighting information from a Light Probe includes: emitting a detection ray from the Light Probe and determining the state of the Light Probe based on the detection ray; when the Light Probe state indicates that the Light Probe is inside an object, determining an offset value required to move the Light Probe to the outside of the object; determining a lighting collection position based on the offset value and the Light Probe's position, and acquiring the Light Probe's lighting information at the light collection position. Moving the light collection position of a Light Probe inside an object to the outside of the object allows the Light Probe inside the object to collect valid lighting information, thereby improving lighting rendering effects.

[0161] The state of the light probe can be a valid state or an invalid state; the valid state indicates that the light probe is outside the object, and the invalid state indicates that the light probe is inside the object.

[0162] Specifically, for each light probe, the computer device emits multiple detection rays through the light probe, and the multiple detection rays correspond to different emission directions, and determines the hitting time when each detection ray intersects with the surface of the object in the virtual scene. When the distance corresponding to the hitting time of the multiple detection rays emitted by the light probe is greater than the interval distance between the light probes, the state of the light probe is determined to be invalid; when a certain proportion of the multiple detection rays emitted by the light probe hits the inner surface of the object, the state of the light probe is determined to be invalid; in addition to the above-mentioned situations where the state of the light probe is determined to be invalid, the state of the light probe can be determined to be valid.

[0163] For the lighting probe in the invalid state, the offset value and offset direction are determined according to the detection ray emitted by the lighting probe and the distance between the lighting probe and the surface of the object. The lighting collection position of the light probe can be determined by the offset value, offset direction and the position of the light probe. Among them, the offset value can be greater than the distance between the light probe and the surface of the object, so that the lighting collection position is outside the object instead of on the surface of the object, avoiding light leakage and improving the lighting rendering effect.

[0164] It should be noted that, in this embodiment, the position of the illumination probe may not be changed, but only the position at which the illumination probe collects illumination may be changed, so that the illumination probe inside the object can collect illumination information outside the object; in this way, the position of the illumination probe remains unchanged and is still at the vertex of the simplex mesh, so that the target vertex of the target simplex mesh to which the shading point belongs can be determined based on the inverse skew transformation, or the target vertex of the target simplex mesh to which the shading point belongs can be determined based on the association between the numbering information, thereby locating the illumination probe at the target vertex.

[0165] In practical applications, an offset texture can be used to record the offset value of each light probe. When collecting lighting information from the light probe, the offset texture can be accessed to obtain the offset value of each light probe, thereby determining the lighting collection position of the light probe.

[0166] For example, Figure 11 As shown, there is an object W in the virtual scene, and the illumination probes are evenly arranged according to the simplex structure. There are illumination probes v1 and v2 inside the object W. For illumination probe v1 and illumination probe v2, according to the offset value of illumination probe v1, illumination probe v1 collects illumination information at the illumination collection position (outside the object W), and according to the offset value of illumination probe v2, illumination probe v2 collects illumination information at the illumination collection position (outside the object W), so that the illumination probes v1 and v2 inside the object W can both collect valid illumination information.

[0167] In this embodiment, the number of target vertices of the target simplex mesh to which the shading point belongs is 4, that is, the number of lighting probes involved in calculating the lighting information of the shading point is relatively small. When part of the lighting probes involved in calculating the lighting information of the shading point is inside the object, it may cause errors in the lighting information of the shading point, thereby affecting the lighting rendering effect; the lighting collection position of the lighting probes inside the object is moved to the outside of the object, so that the lighting probes inside the object can collect valid lighting information, thereby improving the lighting rendering effect.

[0168] In some embodiments, the lighting rendering method can be applied to a scenario of performing lighting rendering on a virtual scene of an open world game on a terminal.

[0169] Specifically, the terminal obtains a virtual scene of an open world game, divides the virtual scene according to the simplex structure, obtains a simplex grid after the scene division, and arranges light probes at the vertices of the simplex grid. In the virtual scene of the open world game, each light probe is located at the vertex of a regular tetrahedron. Figure 12 and Figure 13The visualization styles of lighting probes in different virtual scenes are shown respectively; the terminal determines the lighting information of the lighting probe; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space, the vertices of the reference grid to which the matching shading points belong are determined in the skew space, and the vertices of the reference grid are inversely skewed to obtain the vertices of the target simplex grid to which the shading points belong.

[0170] For example, a two-dimensional space is used for illustration. Figure 14 As shown, in the two-dimensional space, the simplex mesh is an equilateral triangle mesh, and the lighting probes are arranged at the vertices of the equilateral triangle mesh. For the two-dimensional shading point p1 in the two-dimensional space, it is difficult to determine the vertices of the equilateral triangle mesh to which the two-dimensional shading point p1 belongs in the two-dimensional space. The vertices of the equilateral triangle mesh to which the two-dimensional shading point p1 belongs are located through the two-dimensional skew mesh in the two-dimensional skew space; specifically, the two-dimensional shading point p1 is skewed to obtain the two-dimensional matching shading point q1 in the two-dimensional skew space; the two two-dimensional skew meshes in the two-dimensional skew space can form a square, so the two-dimensional reference mesh J1 to which the two-dimensional matching shading point q1 belongs can be quickly determined in the two-dimensional skew space, and the vertices (q2, q3, q4) of the two-dimensional reference mesh J1 are determined. The vertices (q2, q3, q4) of the two-dimensional reference mesh J1 are inversely skewed to obtain the vertices (p2, p3, p4) of the equilateral triangle mesh L1 to which the two-dimensional shading point p1 belongs.

[0171] Applying the above process to three-dimensional space, the reference vertex of the reference grid to which the matching shading point belongs can be determined through the three-dimensional skew space, and then the target vertex of the target simplex grid to which the shading point in the virtual scene belongs can be determined through the inverse skew transformation, thereby improving the efficiency of determining the target vertex of the target simplex grid to which the shading point belongs. Since the target simplex grid is a regular tetrahedral grid, the number of target vertices is small, which reduces the amount of data of the lighting information of the lighting probe involved in the calculation, thereby reducing the hardware resources occupied by determining the lighting information of the shading point, and improving the efficiency of determining the lighting information of the shading point. In addition, the simplex grid is a regular tetrahedral grid, and the lighting probes are arranged at the vertices of the regular tetrahedral grid, so that the spacing between each lighting probe is equal. Compared with the case where the spacing between the lighting probes is unequal, the overlap of the lighting information collected by each lighting probe is reduced, thereby avoiding the consumption of hardware resources caused by redundant lighting information and improving the utilization of hardware resources.

[0172] In some embodiments, as Figure 15 As shown, the lighting rendering methods include:

[0173] Step 1501: Taking the position of the camera model in the virtual scene as the origin, determining a scene to be processed in the virtual scene based on the origin and the grid information; dividing the scene to be processed according to the simplex structure to obtain a simplex grid after the scene division;

[0174] Step 1502: Light probes are placed at vertices of the simplex mesh. Detection rays are emitted by the light probes, and the state of the light probes is determined based on the detection rays. When the state of the light probe indicates that the light probe is inside the object, an offset value required to move the light probe to the outside of the object is determined. A lighting collection position is determined based on the offset value and the position of the light probe, and lighting information of the light probe is obtained at the light collection position.

[0175] Step 1503: Determine a scaling ratio based on the side length of the simplex mesh; scale the shading points in the virtual scene based on the scaling ratio to obtain a to-be-processed shading point; and perform a skew transformation on the to-be-processed shading point to obtain a matching shading point corresponding to the shading point in the skew space.

[0176] Step 1504: Split the coordinates of the matching shading point into integer coordinates and decimal coordinates; search for a partition vector corresponding to the matching shading point based on the magnitude relationship between the components of the decimal coordinates; determine a first displacement vector and a second displacement vector based on the partition vector and a preset grid edge length of the reference grid; determine a first reference vertex based on the integer coordinates and the first displacement vector; determine a second reference vertex based on the integer coordinates and the second displacement vector; determine a third reference vertex based on the integer coordinates and the displacement threshold vector; and use the point pointed to by the integer coordinates as a fourth reference vertex.

[0177] Step 15051: Perform an inverse skew transformation on the vertices of the reference mesh to obtain candidate points in the virtual scene; determine a scaling ratio based on the side length of the simplex mesh; and determine the vertex of the target simplex mesh to which the shading point belongs based on the scaling ratio and the candidate points; the target simplex mesh is a mesh in the simplex mesh.

[0178] Step 15061, obtain lighting information based on the lighting probe at the target vertex;

[0179] Step 15052: Record the first numbering information of the simplex mesh and the second numbering information of the vertices of the simplex mesh; establish a first association based on the first numbering information and the second numbering information; and establish a second association based on the second numbering information of the vertices of the simplex mesh and the illumination information of the illumination probe at the vertex.

[0180] Step 15062: Determine a reference number of the reference mesh based on the vertex of the reference mesh; select a target simplex mesh to which the shading point belongs based on the reference number in the simplex mesh; determine second number information associated with the reference number based on the first association relationship; determine a target vertex of the target simplex mesh based on the second number information associated with the reference number; and search for lighting information of the lighting probe at the target vertex based on the second number information and the second association relationship.

[0181] Step 1507: The target vertices include a first target vertex, a second target vertex, a third target vertex, and a fourth target vertex; fusion weights of the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex are obtained respectively; and based on the fusion weights, the lighting information of the lighting probes corresponding to the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex are fused to obtain the lighting information of the shading point.

[0182] Step 1508 : Determine the lighting information of the shading point according to the lighting information of the lighting probe at the target vertex, and perform lighting rendering on the virtual scene based on the lighting information of the shading point.

[0183] In the above-mentioned lighting rendering method, the virtual scene is divided according to the simplex structure, and lighting probes are arranged at the fixed points of the simplex grid obtained by scene division. The lighting information of the shading point is determined according to the lighting information of the lighting probe at the target vertex of the target simplex grid to which the shading point belongs. Since the number of vertices of the simplex grid is four, the number of target vertices of the target simplex grid to which the shading point belongs is four. The lighting information of the shading point is determined based on the lighting information of the lighting probes at the four target vertices. Compared with the related technology, the amount of data of the lighting probes involved in the calculation is reduced, thereby reducing the hardware resources occupied by determining the lighting information of the shading point, and improving the efficiency of determining the lighting information of the shading point. In addition, the virtual scene is The shading points in the skew space are skewed to obtain matching shading points in the skew space. The vertices of the reference grid to which the matching shading points belong can be quickly determined in the skew space, and then the target vertices of the target simplex grid to which the shading points belong can be quickly determined based on the vertices of the reference grid, thereby improving the efficiency of determining the target vertices of the target simplex grid to which the shading points belong, and further improving the efficiency of determining the lighting information of the shading points. In addition, the lighting probes are arranged at the vertices of the regular tetrahedral grid, so that the spacing between the lighting probes is equal. Compared with the case where the spacing between the lighting probes is unequal, this avoids the overlap of the lighting information collected by the lighting probes, reduces the hardware resources occupied by redundant lighting information, and improves the utilization rate of hardware resources.

[0184] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0185] Based on the same inventive concept, embodiments of the present application also provide a lighting rendering device for implementing the aforementioned lighting rendering method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more lighting rendering device embodiments provided below can be found in the above-mentioned limitations of the lighting rendering method and will not be further elaborated here.

[0186] In some embodiments, as Figure 16 As shown, a lighting rendering device is provided, including: a scene division module 1601, a lighting information determination module 1602, a skew transformation module 1603, a first vertex determination module 1604, a second vertex determination module 1605 and a rendering module 1606, wherein:

[0187] The scene division module 1601 is used to divide the virtual scene according to the simplex structure to obtain a simplex grid after the scene division;

[0188] A lighting information determination module 1602 is configured to place lighting probes at vertices of a simplex mesh and determine lighting information of the lighting probes.

[0189] The skew transformation module 1603 is used to perform skew transformation on the shading point in the virtual scene to obtain the matching shading point corresponding to the shading point in the skew space;

[0190] A first vertex determination module 1604 is configured to determine, in the skew space, a vertex of the reference mesh to which the matching shading point belongs;

[0191] The second vertex determination module 1605 is configured to determine the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh, thereby obtaining a target vertex; the target simplex mesh is a mesh in the simplex mesh;

[0192] The rendering module 1606 is configured to determine the lighting information of the shading point according to the lighting information of the lighting probe at the target vertex, and perform lighting rendering on the virtual scene based on the lighting information of the shading point.

[0193] In the above-mentioned lighting rendering device, a virtual scene is divided according to a simplex structure, and lighting probes are arranged at fixed points of the simplex mesh obtained by the scene division. The lighting information of the shading point is determined based on the lighting information of the lighting probes at the target vertex of the target simplex mesh to which the shading point belongs. Since the number of vertices of the simplex mesh is four, the number of target vertices of the target simplex mesh to which the shading point belongs is also four. The lighting information of the shading point is determined based on the lighting information of the lighting probes at the four target vertices. Compared with related technologies, the amount of data of the lighting probes involved in the calculation is reduced, thereby reducing the hardware resources occupied by determining the lighting information of the shading point, and improving the efficiency of determining the lighting information of the shading point. In addition, the shading point in the virtual scene is skewed to obtain a matching shading point in the skew space. In the skew space, the vertex of the reference mesh to which the matching shading point belongs can be quickly determined. Then, based on the vertices of the reference mesh, the target vertex of the target simplex mesh to which the shading point belongs can be quickly determined, thereby improving the efficiency of determining the target vertex of the target simplex mesh to which the shading point belongs, and further improving the efficiency of determining the lighting information of the shading point.

[0194] In some embodiments, the scene division module 1601 is also used to use the position of the camera model in the virtual scene as the origin, determine the scene to be processed in the virtual scene based on the origin and grid information; divide the scene to be processed according to the simplex structure to obtain the simplex grid after the scene division.

[0195] In some embodiments, the skew transformation module 1603 is also used to determine the scaling ratio based on the side length of the simplex grid; scale the shading points in the virtual scene based on the scaling ratio to obtain the shading points to be processed; and perform skew transformation on the shading points to be processed to obtain the matching shading points corresponding to the shading points in the skew space.

[0196] In some embodiments, the first vertex determination module 1604 is further used to split the coordinates of the matching shading point into integer coordinates and decimal coordinates; based on the size relationship between the components in the decimal coordinates, find the partition vector corresponding to the matching shading point; and determine the vertex of the reference mesh to which the matching shading point belongs based on the partition vector and the integer coordinates.

[0197] In some embodiments, the vertices of the reference grid include a first reference vertex, a second reference vertex, a third reference vertex and a fourth reference vertex; the first vertex determination module 1604 is further used to determine a first displacement vector and a second displacement vector based on the partition vector and a preset grid edge length of the reference grid; determine the first reference vertex based on the integer coordinates and the first displacement vector; determine the second reference vertex based on the integer coordinates and the second displacement vector; determine the third reference vertex based on the integer coordinates and the displacement threshold vector; and use the point pointed to by the integer coordinates as the fourth reference vertex.

[0198] In some embodiments, the second vertex determination module 1605 is used to perform an inverse skew transformation on the vertices of the reference mesh to obtain candidate points in the virtual scene; determine the scaling ratio based on the side length of the simplex mesh; and determine the vertex of the target simplex mesh to which the shading point belongs based on the scaling ratio and the candidate points.

[0199] In some embodiments, the lighting rendering apparatus further includes: a first association relationship establishing module, configured to record first numbering information of a simplex mesh and second numbering information of vertices of the simplex mesh; and establish a first association relationship based on the first numbering information and the second numbering information;

[0200] The second vertex determination module 1605 is configured to determine a reference number of the reference mesh based on the vertices of the reference mesh; and determine a vertex of the target simplex mesh to which the shading point belongs according to the reference number and the first association relationship to obtain a target vertex.

[0201] In some embodiments, the second vertex determination module 1605 is also used to select the target simplex mesh to which the shading point belongs based on the reference number in the simplex mesh; determine the second number information associated with the reference number based on the first association relationship; and determine the target vertex of the target simplex mesh based on the second number information associated with the reference number.

[0202] In some embodiments, the lighting rendering apparatus further includes: a second association relationship establishing module, configured to establish a second association relationship based on second number information of vertices of the simplex mesh and lighting information of the lighting probe at the vertex;

[0203] The lighting rendering device further includes: a lighting information search module, which is used to search for lighting information of the lighting probe at the target vertex according to the second number information and the second association relationship of the target vertex.

[0204] In some embodiments, the target vertices include a first target vertex, a second target vertex, a third target vertex, and a fourth target vertex; the rendering module 1606 is further used to obtain the fusion weights of the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex, respectively; based on the fusion weights, the lighting information of the lighting probes corresponding to the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex are fused to obtain the lighting information of the shading point.

[0205] In some embodiments, the lighting information determination module 1602 is further used to emit a detection ray through the lighting probe and determine the state of the lighting probe based on the detection ray; when the state of the lighting probe indicates that the lighting probe is inside the object, determine the offset value required for the lighting probe to move to the outside of the object; determine the lighting collection position based on the offset value and the position of the lighting probe, and obtain the lighting information of the lighting probe at the lighting collection position.

[0206] Each module in the aforementioned lighting rendering device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0207] In some embodiments, a computer device is provided. The computer device may be a server or a terminal. The computer device is described as a terminal. The internal structure diagram thereof may be as follows: Figure 17As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means. The wireless means can be implemented via Wi-Fi, a mobile cellular network, NFC (near field communication), or other technologies. When executed by the processor, the computer program implements a lighting rendering method. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0208] Those skilled in the art will understand that Figure 17 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0209] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0210] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0211] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0212] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0213] In some embodiments, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0214] The virtual scene is divided according to the simplex structure to obtain the simplex mesh after the scene division; lighting probes are arranged at the vertices of the simplex mesh to determine the lighting information of the lighting probes; the shading points in the virtual scene are skewed to obtain the matching shading points corresponding to the shading points in the skew space; the vertices of the reference mesh to which the matching shading points belong are determined in the skew space; the vertices of the target simplex mesh to which the shading points belong are determined based on the vertices of the reference mesh to obtain the target vertices; the target simplex mesh is a mesh in the simplex mesh; the lighting information of the shading points is determined based on the lighting information of the lighting probes at the target vertices, and the virtual scene is illuminated and rendered based on the lighting information of the shading points.

[0215] 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 this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0216] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0217] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0218] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A lighting rendering method, characterized in that: The method comprises: Divide the virtual scene according to the simplex structure to obtain a simplex grid after the scene division; Arranging light probes at vertices of the simplex mesh and determining lighting information of the light probes; Performing a skew transformation on a shading point in the virtual scene to obtain a matching shading point corresponding to the shading point in the skew space; determining, in the skew space, a vertex of a reference mesh to which the matching shading point belongs; Determine the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh, and obtain a target vertex; the target simplex mesh is a mesh in the simplex mesh; The lighting information of the shading point is determined according to the lighting information of the lighting probe at the target vertex, and the virtual scene is rendered based on the lighting information of the shading point.

2. The method according to claim 1, characterized in that The step of dividing the virtual scene according to the simplex structure to obtain the simplex grid after the scene division includes: Taking the position of the camera model in the virtual scene as the origin, and determining the scene to be processed in the virtual scene according to the origin and grid information; The scene to be processed is divided according to the simplex structure to obtain a simplex grid after the scene division.

3. The method according to claim 1, characterized in that The skew transformation of the shading point in the virtual scene to obtain a matching shading point corresponding to the shading point in the skew space includes: determining a scaling ratio based on a side length of the simplex mesh; Scaling the shading points in the virtual scene based on the scaling ratio to obtain shading points to be processed; Perform a skew transformation on the shading point to be processed to obtain a matching shading point corresponding to the shading point in the skew space.

4. The method according to claim 1, wherein The determining, in the skew space, a vertex of a reference mesh to which the matching shading point belongs, comprises: Splitting the coordinates of the matching shading point into integer coordinates and decimal coordinates; Finding a partition vector corresponding to the matching shading point based on a magnitude relationship between components in the decimal coordinates; The vertex of the reference mesh to which the matching shading point belongs is determined according to the partition vector and the integer coordinates.

5. The method according to claim 4, characterized in that The vertices of the reference grid include a first reference vertex, a second reference vertex, a third reference vertex, and a fourth reference vertex; Determining, based on the partition vector and the integer coordinates, a vertex of a reference mesh to which the matching shading point belongs, comprising: Determining a first displacement vector and a second displacement vector according to the partition vector and a preset grid side length of the reference grid; determining the first reference vertex according to the integer coordinates and the first displacement vector; determining the second reference vertex according to the integer coordinates and the second displacement vector; determining the third reference vertex according to the integer coordinates and the displacement threshold vector; The point pointed to by the integer coordinates is used as the fourth reference vertex.

6. The method according to claim 1, wherein The step of determining the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh to obtain the target vertex includes: Performing an inverse skew transformation on the vertices of the reference grid to obtain candidate points in the virtual scene; determining a scaling ratio based on a side length of the simplex mesh; A vertex of a target simplex mesh to which the shading point belongs is determined according to the scaling ratio and the candidate point.

7. The method according to claim 1, characterized in that After obtaining the simplex grid after scene division, the method further includes: Recording first numbering information of the simplex mesh and second numbering information of vertices of the simplex mesh; Establishing a first association relationship based on the first numbering information and the second numbering information; The step of determining the vertex of the target simplex mesh to which the shading point belongs based on the vertex of the reference mesh to obtain the target vertex includes: determining a reference number of the reference mesh based on the vertices of the reference mesh; According to the reference number and the first association relationship, a vertex of the target simplex mesh to which the shading point belongs is determined to obtain a target vertex.

8. The method according to claim 7, characterized in that The step of determining, based on the reference number and the first association relationship, a vertex of a target simplex mesh to which the shading point belongs, and obtaining a target vertex, includes: In the simplex grid, selecting a target simplex grid to which the colored point belongs according to the reference number; Determining second number information associated with the reference number based on the first association relationship; The target vertex of the target simplex mesh is determined according to the second number information associated with the reference number.

9. The method according to claim 1, characterized in that After determining the lighting information of the lighting probe, the method further includes: Establishing a second association relationship based on the second number information of the vertex of the simplex mesh and the lighting information of the lighting probe at the vertex; After determining the vertices of the target simplex mesh to which the shading point belongs based on the vertices of the reference mesh and obtaining the target vertices, the method further includes: The lighting information of the lighting probe at the target vertex is searched according to the second number information of the target vertex and the second association relationship.

10. The method according to claim 1, characterized in that The target vertices include a first target vertex, a second target vertex, a third target vertex and a fourth target vertex; The determining the lighting information of the shading point based on the lighting information of the lighting probe at the target vertex includes: respectively obtaining fusion weights of the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex; According to the fusion weight, the lighting information of the lighting probes corresponding to the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex are fused to obtain the lighting information of the shading point.

11. The method according to any one of claims 1 to 10, characterized in that Determining the lighting information of the lighting probe includes: emitting a detection ray through the illumination probe, and determining a state of the illumination probe according to the detection ray; When the state of the light probe indicates that the light probe is inside the object, determining an offset value required for the light probe to move outside the object; A lighting collection position is determined according to the offset value and the position of the lighting probe, and lighting information of the lighting probe is obtained at the lighting collection position.

12. A lighting rendering device, characterized in that: The device comprises: A scene division module is used to divide the virtual scene according to the simplex structure to obtain a simplex grid after the scene division; a lighting information determination module, configured to arrange lighting probes at vertices of the simplex mesh and determine lighting information of the lighting probes; a skew transformation module, configured to perform skew transformation on a shading point in the virtual scene to obtain a matching shading point corresponding to the shading point in a skew space; A first vertex determination module, configured to determine, in the skew space, a vertex of a reference mesh to which the matching shading point belongs; A second vertex determination module is configured to determine a vertex of a target simplex mesh to which the shading point belongs based on a vertex of the reference mesh, to obtain a target vertex; the target simplex mesh is a mesh in the simplex mesh; A rendering module is used to determine the lighting information of the shading point according to the lighting information of the lighting probe at the target vertex, and perform lighting rendering on the virtual scene based on the lighting information of the shading point.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.