Method for simulating global illumination on intelligent equipment based on game

文档序号:754057 发布日期:2021-04-06 浏览:9次 中文

阅读说明:本技术 一种基于游戏在智能设备模拟全局光照的方法 (Method for simulating global illumination on intelligent equipment based on game ) 是由 刘泳 许洁明 于 2020-12-29 设计创作,主要内容包括:本发明涉及一种基于游戏在智能设备模拟全局光照的方法,全局光照方程的求解需要递归积分,所以没有精确解,需使用蒙特卡洛等求积分方式计算近似数值解,蒙特卡洛的主要缺点是收敛速度慢,在运算能力和设备电量均受限的智能设备,容易造成游戏掉帧,影响游戏体验。本发明提供一种基于游戏在智能设备模拟全局光照的方法,以较低的实时计算开销和较少的离线和运行时存储空间,实时地模拟场景的全局光照,可以模拟场景静态物体光照信息,且能为动态物体提供可信的全局光照效果,在计算能力、续航能力和发热均受限的智能设备中,可大幅提高游戏画面的真实性。(The invention relates to a method for simulating global illumination on intelligent equipment based on a game, wherein the solution of a global illumination equation needs recursive integrals, so that the solution is not accurate, and an approximate numerical solution needs to be calculated by using integral solving methods such as Monte Carlo and the like. The invention provides a method for simulating global illumination in an intelligent device based on a game, which simulates the global illumination of a scene in real time with lower real-time calculation cost and less off-line and running storage space, can simulate illumination information of static objects of the scene, can provide credible global illumination effect for dynamic objects, and can greatly improve the reality of game pictures in the intelligent device with limited calculation capacity, cruising capacity and heating.)

1. A method for simulating global illumination on an intelligent device based on a game is characterized by comprising the following steps:

step 1: acquiring a target object to be processed in a game scene;

step 2: acquiring all virtual luminous body information in a game scene;

and step 3: dividing the target object into a plurality of continuous patches according to the position of the target object in the game scene and the grid information, wherein the patches are triangular or convex tetrahedrons, and calculating the radiance value of each patch;

and 4, step 4: calculating a shape factor for each pair of patches;

and 5: solving the numerical solution of a radiation degree linear equation system, and calculating the radiation rate of each patch;

step 6: storing a diffuse reflection part in a solving result of the static object as a two-dimensional map, rgbm code; storing the diffuse reflection part of the solution result of the position of the detection point, and coding the diffuse reflection part into a spherical harmonic form; storing the reflection map of the detection point as cubemap and calculating mipmaps;

and 7: using an equation of relating the average spontaneous emission radiance and the reflectivity on all the patches to the average total radiance, and converting the obtained radiance result into the display color of the surface after solving;

the steps 1 to 7 are all carried out in a simulation system, the simulation system is connected with a central control module through wireless, the central control module is used for controlling the operation of each unit, so that the operation processes of the steps 1 to 7 are controlled, and a matrix is arranged in the central control module.

2. A method for simulating global illumination at a smart device based on a game according to claim 1, wherein in the step 3, for each tile, self-emitting radiance and reflectivity is given, and the reflectivity is set to a number between 0 and 1; the total radiance of a patch includes the radiance received by any number of bounces of other patches in the scene, and the radiance of self-emission, and the central control module is provided with a total radiance value Q, and Q is set to be F + M × R × F.

3. The game-based method for simulating global illumination at a smart device according to claim 2, wherein a preset self-emission radiance matrix F0 and a preset absolute distance matrix A0 of a target object and a light source are set in the central control module;

setting F0(F1, F2, F3 and F4) for the preset self-emission radiance matrix F0, wherein F1 is a first preset self-emission radiance, F2 is a second preset self-emission radiance, F3 is a third preset self-emission radiance, F4 is a fourth preset self-emission radiance, and the preset self-emission radiance is gradually increased in sequence;

setting a0(a1, a2, A3, a4) for the absolute distance matrix a0 of the preset target objects and the light source, wherein a1 is the absolute distance between the first preset target object and the light source, a2 is the absolute distance between the second preset target object and the light source, A3 is the absolute distance between the third preset target object and the light source, and a4 is the absolute distance between the fourth preset target object and the light source;

when the central control module selects the self-emission radiation degree of the target object, comparing the absolute distance A between the target object and the light source with the parameters in the A0 matrix, and selecting the corresponding self-emission amplitude value according to the comparison result:

when A is less than or equal to A1, the central control module adopts self-emission radiation degree F1;

when A is more than A1 and less than or equal to A2, the central control module adopts self-emission radiance F2;

when A is more than A2 and less than or equal to A3, the central control module adopts self-emission radiance F3;

when A is greater than A3 and less than or equal to A4, the central control module adopts self-emission radiance F4.

4. The game-based method for simulating global illumination at a smart device according to claim 3, wherein a preset self-emission radiance adjusting coefficient matrix k0 and a preset target object patch number matrix B0 are further arranged in the central control module;

setting a k0(k1, k2, k3 and k4) for the preset self-emission radiance adjusting coefficient matrix k0, wherein k1 is a first preset self-emission radiance adjusting coefficient, k2 is a second preset self-emission radiance adjusting coefficient, k3 is a third preset self-emission radiance adjusting coefficient, and k4 is a fourth preset self-emission radiance adjusting coefficient, and the preset self-emission radiance adjusting coefficients are gradually increased in sequence;

setting B0(B1, B2, B3, B4) for the preset target object patch number matrix B0, where B1 is a first preset target object patch number, B2 is a second preset target object patch number, B3 is a third preset target object patch number, and B4 is a fourth preset target object patch number, and the preset target object patch numbers are gradually increased in sequence;

when the central control module adjusts the preselected self-emission radiance Fi, i is 1,2,3,4, the central control module compares the target object patch number B with parameters in a B0 matrix, and selects a corresponding preset adjusting coefficient from a k0 matrix according to a comparison result to adjust the Fi:

when B is not more than B1, the central control module selects k1 to adjust Fi;

when B is more than B1 and less than or equal to B2, the central control module selects k2 to adjust Fi;

when B is more than B2 and less than or equal to B3, the central control module selects k3 to adjust Fi;

when B is more than B3 and less than or equal to B4, the central control module selects k4 to adjust Fi;

when the central control module selects kj to adjust the preselected Fi, j is 1,2,3 and 4, and the adjusted self-emission radiation degree is Fi 'and Fi' is Fi multiplied by kj.

5. The method for simulating global illumination on a smart device based on a game as claimed in claim 4, wherein the central control module is further provided with a preset reflectivity matrix R0, a preset target object wavelength matrix λ 0, a preset reflectivity correction coefficient matrix Y0 and a preset virtual illuminant number matrix C0;

for the preset reflectivity matrix R0, setting R0(R1, R2, R3, R4), where R1 is a first preset reflectivity, R2 is a second preset reflectivity, R3 is a third preset reflectivity, and R4 is a fourth preset reflectivity, and each preset reflectivity is gradually increased in sequence;

setting lambda 0 (lambda 1, lambda 2, lambda 3, lambda 4) for the preset target object wavelength matrix lambda 0, wherein lambda 1 is a first preset target object wavelength, lambda 2 is a second preset target object wavelength, lambda 3 is a third preset target object wavelength, and lambda 4 is a fourth preset target object wavelength, and the preset target object wavelengths are gradually increased in sequence;

when the central control module selects the reflectivity, the actual wavelength lambda of the target object is compared with the parameters in lambda 0, and the corresponding reflectivity is selected according to the comparison result:

when the lambda is less than or equal to lambda 1, the reflectivity R1 is selected as the central control module;

when the lambda is more than or equal to lambda 1 and less than or equal to lambda 2, the reflectivity R2 is selected as the central control module;

when lambda 2 is larger than lambda and smaller than or equal to lambda 3, the reflectivity R3 is selected as the central control module;

when the lambda is more than 3 and less than or equal to 4, the reflectivity R4 is selected as the central control module;

setting Y0(Y1, Y2, Y3 and Y4) for the preset reflectivity correction coefficient matrix Y0, wherein Y1 is a first preset reflectivity correction coefficient, Y2 is a second preset reflectivity correction coefficient, Y3 is a third preset reflectivity correction coefficient, Y4 is a fourth preset reflectivity correction coefficient, and the preset reflectivity correction coefficients are gradually increased in sequence;

setting C0(C1, C2, C3 and C4) for the preset virtual illuminant number matrix C0, wherein C1 is the number of first preset virtual illuminants, C2 is the number of second preset virtual illuminants, C3 is the number of third preset virtual illuminants, C4 is the number of fourth preset virtual illuminants, and the number of the preset virtual illuminants is gradually increased in sequence;

when the central control module adjusts the reflectivity Ri selected in advance, i is 1,2,3,4, the central control module compares the number C of the virtual illuminants with the parameters in the C0 matrix, and selects a corresponding preset adjustment coefficient from the Y0 matrix according to the comparison result to adjust Ri:

when C is less than or equal to C1, the central control module selects Y1 to regulate Ri;

when C is more than C1 and less than or equal to C2, the central control module selects Y2 to regulate Ri;

when C is more than C2 and less than or equal to C3, the central control module selects Y3 to regulate Ri;

when C is more than C3 and less than or equal to C4, the central control module selects Y4 to regulate Ri;

when the central control module selects Yj to adjust the preselected Ri, j is 1,2,3,4, and the adjusted reflectivity is Ri', Ri ═ Ri × Yj.

6. The method for simulating global illumination on a smart device based on games as claimed in claim 5, wherein the central control module is further configured with a preset other patch bounce quantity matrix M0 and a preset other patch bounce quantity correction coefficient matrix Z0;

setting M0(M1, M2, M3 and M4) for the matrix M0 of the preset number of the rebounding of other patches, wherein M1 is the first preset number of the rebounding of other patches, M2 is the second preset number of the rebounding of other patches, M3 is the third preset number of the rebounding of other patches, M4 is the fourth preset number of the rebounding of other patches, and the number of the rebounding of other patches is gradually increased in sequence;

when the central control module selects other patch rebounding quantities, the central control module compares the virtual illuminant number C with the parameters in the C0 matrix and selects other patch rebounding quantities according to the comparison result:

when C is less than or equal to C1, the central control module selects the rebound quantity M1 of other patches;

when C is more than C1 and less than or equal to C2, the central control module selects the rebound quantity M2 of other patches;

when C is more than C2 and less than or equal to C3, the central control module selects the rebound quantity M3 of other patches;

when C is more than C3 and less than or equal to C4, the central control module selects the rebound quantity M4 of other patches;

for the other patch bounce quantity correction coefficient matrix Z0, setting Z0(Z1, Z2, Z3, Z4), where Z1 is a first preset other patch bounce quantity correction coefficient, Z2 is a second preset other patch bounce quantity correction coefficient, Z3 is a third preset other patch bounce quantity correction coefficient, Z4 is a fourth preset other patch bounce quantity correction coefficient, and each preset other patch bounce quantity correction coefficient gradually increases in sequence;

when the central control module adjusts the pre-selected other patch rebounding quantity Mi, i is 1,2,3,4, the central control module compares the target object patch quantity B with the parameters in the B0 matrix, and selects a corresponding preset adjusting coefficient from the Z0 matrix according to the comparison result to adjust the Mi:

when B is not more than B1, the central control module selects Z1 to adjust Mi;

when B is more than B1 and less than or equal to B2, Z2 is selected by the central control module to adjust Mi;

when B is more than B2 and less than or equal to B3, Z3 is selected by the central control module to adjust Mi;

when B is more than B3 and less than or equal to B4, Z4 is selected by the central control module to adjust Mi;

when the central control module selects Zj to adjust the preselected Mi, j is 1,2,3 and 4, and the adjusted rebounding quantity of other patches is Mi ', Mi' is Mi multiplied by Zj.

7. The game-based method for simulating global illumination in intelligent equipment according to claim 2, wherein a preset target patch-to-light source included angle matrix θ 0 and a self-emission radiance secondary adjustment coefficient a0 are further arranged in the central control module;

setting theta 0 (theta 1, theta 2, theta 3 and theta 4) for the matrix theta 0 of the included angles between the target patches and the light source, wherein theta 1 is the included angle between a first preset target patch and the light source, theta 2 is the included angle between a second preset target patch and the light source, theta 3 is the included angle between a third preset target patch and the light source, theta 4 is the included angle between a fourth preset target patch and the light source, and the included angles between the preset target patches and the light source gradually increase in sequence;

setting a0(a1, a2, a3 and a4) for the self-emission radiance secondary regulating coefficient a0, wherein a1 is a first preset self-emission radiance secondary regulating coefficient, a2 is a second preset self-emission radiance secondary regulating coefficient, a3 is a third preset self-emission radiance secondary regulating coefficient, a4 is a fourth preset self-emission radiance secondary regulating coefficient, and the preset self-emission radiance secondary regulating coefficients are gradually increased in sequence;

when the central control module adjusts the pre-selected self-emission radiance Fi, the central control module compares the included angle theta between the target patch and the light source with the parameters in the theta 0 matrix, and selects a corresponding preset adjusting coefficient from the a0 matrix according to the comparison result to adjust the Fi:

when theta is not less than theta 1, the central control module selects a1 to adjust Fi;

when theta 1 is larger than theta and is not larger than theta 2, the central control module selects a2 to adjust Fi;

when theta 2 is larger than theta and smaller than or equal to theta 3, the central control module selects a3 to adjust Fi;

when theta 3 is larger than theta and is not larger than theta 4, the central control module selects a4 to adjust Fi;

when the central control module selects aj to adjust the preselected Fi, j is 1,2,3 and 4, the adjusted self-emission radiation degree is Fi, and Fi is Fi' × aj.

8. The method for simulating global illumination on intelligent equipment based on games of claim 7, wherein the central control module is further provided with a matrix β 0 for average included angles between other tiles and a light source, a matrix P0 for radiance of other tiles rebounding, and a matrix b0 for radiance of other tiles rebounding correction coefficients;

setting beta 0 (beta 1, beta 2, beta 3, beta 4) for the matrix beta 0 of the average included angles between the other patches and the light source, wherein beta 1 is a first preset average included angle between the other patches and the light source, beta 2 is a second preset average included angle between the other patches and the light source, beta 3 is a third preset average included angle between the other patches and the light source, beta 4 is a fourth preset average included angle between the other patches and the light source, and the preset average included angles between the other patches and the light source gradually increase in sequence;

for the other patch rebound radiance P0, setting P0(P1, P2, P3, P4), where P1 is a first preset other patch rebound radiance, P2 is a second preset other patch rebound radiance, P3 is a third preset other patch rebound radiance, P4 is a fourth preset other patch rebound radiance, and the preset other patch rebound radiances gradually increase in sequence, and setting P to M × R × F;

b0(b1, b2, b3 and b4) is set for the other patch rebound radiance correction coefficient b0, wherein b1 is a first preset other patch rebound radiance correction coefficient, b2 is a second preset other patch rebound radiance correction coefficient, b3 is a third preset other patch rebound radiance correction coefficient, b4 is a fourth preset other patch rebound radiance correction coefficient, and the preset other patch rebound radiance correction coefficients gradually increase in sequence;

when the central control module adjusts the rebound radiance Pi of other pre-selected patches, i is 1,2,3,4, the central control module compares the average included angle beta between the other patches and the light source with the parameters in the beta 0 matrix, and selects a corresponding preset adjusting coefficient from the b0 matrix according to the comparison result to adjust Pi:

when beta is not more than beta 1, b1 is selected by the central control module to adjust Pi;

when beta 1 is larger than beta and is not larger than beta 2, the central control module selects b2 to regulate Pi;

when beta 2 is more than beta and less than or equal to beta 3, the central control module selects b3 to adjust Pi;

when the beta 3 is larger than the theta and is not larger than the beta 4, the central control module selects b4 to adjust Pi;

when the central control module selects bj to adjust the preselected Pi, j is 1,2,3 and 4, and the adjusted rebound radiances of other patches are Pi ', Pi' is Pi × bj.

9. A game-based method for simulating global lighting at a smart device according to claim 1, wherein in said step 4 calculating the form factor of each pair of tiles, a half-cube algorithm is used, while using discontinuous meshing, adaptive and hierarchical segmentation and clustering.

10. The game-based method for simulating global illumination at a smart device according to claim 1, wherein the iterative method used in solving the numerical solution of the system of radiance linear equations in the step 5 is Gauss Seidel iterative method.

Technical Field

The invention relates to the technical field of computer image processing, in particular to a method for simulating global illumination on intelligent equipment based on a game.

Background

The global illumination technology in real-time rendering is always a hotspot in the field of computer image processing, and through reasonable modeling of the real world illumination environment and solving of a global illumination equation, the effect that a light source directly irradiates an object can be simulated, the illumination effect of light rebounded by the object on the object can also be simulated, and the sense of reality of a rendering result can be greatly improved.

The solution of the global illumination equation needs recursive integration, so that an accurate solution is not available, an approximate numerical solution needs to be calculated by using Monte Carlo and other integration modes, and the Monte Carlo has the main defect of low convergence speed. In the intelligent device with limited operation capability and limited device electric quantity, the game frame is easy to drop, and the game experience is influenced.

In the related art, one solution is to use a ray tracing method, which has a simple principle but a large computational overhead in operation, especially for mobile devices, because a series of recursive products of rendering equations are required; the calculation result of the method has serious limitation, and the effects of color mixing, diffuse reflection and the like are difficult to simulate by using the method.

In the related art, another processing method is to generate an illumination map by a pre-calculation method, and realize global illumination on a static object; however, a large number of dynamic objects are usually present in the game to allow the interaction of the players, the relative positions of the dynamic objects can be changed continuously, meanwhile, the illumination results of the dynamic objects are also changed, and the illumination condition after the change of the dynamic objects can not be determined through offline pre-calculated illumination maps.

Disclosure of Invention

Therefore, the invention provides a method for simulating global illumination in intelligent equipment based on a game, which is used for solving the problem of low illumination simulation efficiency of the game in the intelligent equipment in the prior art.

The invention provides a method for simulating global illumination on intelligent equipment based on games, which comprises the following steps:

step 1: acquiring a target object to be processed in a game scene;

step 2: acquiring all virtual luminous body information in a game scene;

and step 3: dividing the target object into a plurality of continuous patches according to the position of the target object in the game scene and the grid information, wherein the patches are triangular or convex tetrahedrons, and calculating the radiance value of each patch;

and 4, step 4: calculating a shape factor for each pair of patches;

and 5: solving the numerical solution of a radiation degree linear equation system, and calculating the radiation rate of each patch;

step 6: storing a diffuse reflection part in a solving result of the static object as a two-dimensional map, rgbm code; storing the diffuse reflection part of the solution result of the position of the detection point, and coding the diffuse reflection part into a spherical harmonic form; storing the reflection map of the detection point as cubemap and calculating mipmaps;

and 7: using an equation of relating the average spontaneous emission radiance and the reflectivity on all the patches to the average total radiance, and converting the obtained radiance result into the display color of the surface after solving;

the steps 1 to 7 are all carried out in a simulation system, the simulation system is connected with a central control module through wireless, the central control module is used for controlling the operation of each unit, so that the operation processes of the steps 1 to 7 are controlled, and a matrix is arranged in the central control module.

Further, in the step 3, for each patch, a self-emission radiance and a reflectivity are given, and the reflectivity is set to be a number between 0 and 1; the total radiance of a patch includes the radiance received by any number of bounces of other patches in the scene, and the radiance of self-emission, and the central control module is provided with a total radiance value Q, and Q is set to be F + M × R × F.

Further, a preset self-emission radiance matrix F0 and a preset absolute distance matrix A0 of the target object and the light source are arranged in the central control module;

setting F0(F1, F2, F3 and F4) for the preset self-emission radiance matrix F0, wherein F1 is a first preset self-emission radiance, F2 is a second preset self-emission radiance, F3 is a third preset self-emission radiance, F4 is a fourth preset self-emission radiance, and the preset self-emission radiance is gradually increased in sequence;

setting a0(a1, a2, A3, a4) for the absolute distance matrix a0 of the preset target objects and the light source, wherein a1 is the absolute distance between the first preset target object and the light source, a2 is the absolute distance between the second preset target object and the light source, A3 is the absolute distance between the third preset target object and the light source, and a4 is the absolute distance between the fourth preset target object and the light source;

when the central control module selects the self-emission radiation degree of the target object, comparing the absolute distance A between the target object and the light source with the parameters in the A0 matrix, and selecting the corresponding self-emission amplitude value according to the comparison result:

when A is less than or equal to A1, the central control module adopts self-emission radiation degree F1;

when A is more than A1 and less than or equal to A2, the central control module adopts self-emission radiance F2;

when A is more than A2 and less than or equal to A3, the central control module adopts self-emission radiance F3;

when A is more than A3 and less than or equal to A4, the central control module adopts self-emission radiance F4;

further, a preset self-emission radiance adjusting coefficient matrix k0 and a preset target object patch number matrix B0 are also arranged in the central control module;

setting a k0(k1, k2, k3 and k4) for the preset self-emission radiance adjusting coefficient matrix k0, wherein k1 is a first preset self-emission radiance adjusting coefficient, k2 is a second preset self-emission radiance adjusting coefficient, k3 is a third preset self-emission radiance adjusting coefficient, and k4 is a fourth preset self-emission radiance adjusting coefficient, and the preset self-emission radiance adjusting coefficients are gradually increased in sequence;

setting B0(B1, B2, B3, B4) for the preset target object patch number matrix B0, where B1 is a first preset target object patch number, B2 is a second preset target object patch number, B3 is a third preset target object patch number, and B4 is a fourth preset target object patch number, and the preset target object patch numbers are gradually increased in sequence;

when the central control module adjusts the preselected self-emission radiance Fi, i is 1,2,3,4, the central control module compares the target object patch number B with parameters in a B0 matrix, and selects a corresponding preset adjusting coefficient from a k0 matrix according to a comparison result to adjust the Fi:

when B is not more than B1, the central control module selects k1 to adjust Fi;

when B is more than B1 and less than or equal to B2, the central control module selects k2 to adjust Fi;

when B is more than B2 and less than or equal to B3, the central control module selects k3 to adjust Fi;

when B is more than B3 and less than or equal to B4, the central control module selects k4 to adjust Fi;

when the central control module selects kj to adjust the preselected Fi, j is 1,2,3 and 4, and the adjusted self-emission radiation degree is Fi 'and Fi' is Fi multiplied by kj.

Further, a preset reflectivity matrix R0, a preset target object wavelength matrix λ 0, a preset reflectivity correction coefficient matrix Y0 and a preset virtual illuminant number matrix C0 are also arranged in the central control module;

for the preset reflectivity matrix R0, setting R0(R1, R2, R3, R4), where R1 is a first preset reflectivity, R2 is a second preset reflectivity, R3 is a third preset reflectivity, and R4 is a fourth preset reflectivity, and each preset reflectivity is gradually increased in sequence;

setting lambda 0 (lambda 1, lambda 2, lambda 3, lambda 4) for the preset target object wavelength matrix lambda 0, wherein lambda 1 is a first preset target object wavelength, lambda 2 is a second preset target object wavelength, lambda 3 is a third preset target object wavelength, and lambda 4 is a fourth preset target object wavelength, and the preset target object wavelengths are gradually increased in sequence;

when the central control module selects the reflectivity, the actual wavelength lambda of the target object is compared with the parameters in lambda 0, and the corresponding reflectivity is selected according to the comparison result:

when the lambda is less than or equal to lambda 1, the reflectivity R1 is selected as the central control module;

when the lambda is more than or equal to lambda 1 and less than or equal to lambda 2, the reflectivity R2 is selected as the central control module;

when lambda 2 is larger than lambda and smaller than or equal to lambda 3, the reflectivity R3 is selected as the central control module;

when the lambda is more than 3 and less than or equal to 4, the reflectivity R4 is selected as the central control module;

setting Y0(Y1, Y2, Y3 and Y4) for the preset reflectivity correction coefficient matrix Y0, wherein Y1 is a first preset reflectivity correction coefficient, Y2 is a second preset reflectivity correction coefficient, Y3 is a third preset reflectivity correction coefficient, Y4 is a fourth preset reflectivity correction coefficient, and the preset reflectivity correction coefficients are gradually increased in sequence;

setting C0(C1, C2, C3 and C4) for the preset virtual illuminant number matrix C0, wherein C1 is the number of first preset virtual illuminants, C2 is the number of second preset virtual illuminants, C3 is the number of third preset virtual illuminants, C4 is the number of fourth preset virtual illuminants, and the number of the preset virtual illuminants is gradually increased in sequence;

when the central control module adjusts the reflectivity Ri selected in advance, i is 1,2,3,4, the central control module compares the number C of the virtual illuminants with the parameters in the C0 matrix, and selects a corresponding preset adjustment coefficient from the Y0 matrix according to the comparison result to adjust Ri:

when C is less than or equal to C1, the central control module selects Y1 to regulate Ri;

when C is more than C1 and less than or equal to C2, the central control module selects Y2 to regulate Ri;

when C is more than C2 and less than or equal to C3, the central control module selects Y3 to regulate Ri;

when C is more than C3 and less than or equal to C4, the central control module selects Y4 to regulate Ri;

when the central control module selects Yj to adjust the preselected Ri, j is 1,2,3,4, and the adjusted reflectivity is Ri', Ri ═ Ri × Yj.

Furthermore, a preset matrix M0 for the number of other patch rebounds and a preset matrix Z0 for the correction coefficient of the number of other patch rebounds are also arranged in the central control module;

setting M0(M1, M2, M3 and M4) for the matrix M0 of the preset number of the rebounding of other patches, wherein M1 is the first preset number of the rebounding of other patches, M2 is the second preset number of the rebounding of other patches, M3 is the third preset number of the rebounding of other patches, M4 is the fourth preset number of the rebounding of other patches, and the number of the rebounding of other patches is gradually increased in sequence;

when the central control module selects other patch rebounding quantities, the central control module compares the virtual illuminant number C with the parameters in the C0 matrix and selects other patch rebounding quantities according to the comparison result:

when C is less than or equal to C1, the central control module selects the rebound quantity M1 of other patches;

when C is more than C1 and less than or equal to C2, the central control module selects the rebound quantity M2 of other patches;

when C is more than C2 and less than or equal to C3, the central control module selects the rebound quantity M3 of other patches;

when C is more than C3 and less than or equal to C4, the central control module selects the rebound quantity M4 of other patches;

for the other patch bounce quantity correction coefficient matrix Z0, setting Z0(Z1, Z2, Z3, Z4), where Z1 is a first preset other patch bounce quantity correction coefficient, Z2 is a second preset other patch bounce quantity correction coefficient, Z3 is a third preset other patch bounce quantity correction coefficient, Z4 is a fourth preset other patch bounce quantity correction coefficient, and each preset other patch bounce quantity correction coefficient gradually increases in sequence;

when the central control module adjusts the pre-selected other patch rebounding quantity Mi, i is 1,2,3,4, the central control module compares the target object patch quantity B with the parameters in the B0 matrix, and selects a corresponding preset adjusting coefficient from the Z0 matrix according to the comparison result to adjust the Mi:

when B is not more than B1, the central control module selects Z1 to adjust Mi;

when B is more than B1 and less than or equal to B2, Z2 is selected by the central control module to adjust Mi;

when B is more than B2 and less than or equal to B3, Z3 is selected by the central control module to adjust Mi;

when B is more than B3 and less than or equal to B4, Z4 is selected by the central control module to adjust Mi;

when the central control module selects Zj to adjust the preselected Mi, j is 1,2,3 and 4, and the adjusted rebounding quantity of other patches is Mi ', Mi' is Mi multiplied by Zj.

Furthermore, the central control module is also provided with a preset target patch and light source included angle matrix theta 0 and a self-emission radiance secondary adjusting coefficient a 0;

setting theta 0 (theta 1, theta 2, theta 3 and theta 4) for the matrix theta 0 of the included angles between the target patches and the light source, wherein theta 1 is the included angle between a first preset target patch and the light source, theta 2 is the included angle between a second preset target patch and the light source, theta 3 is the included angle between a third preset target patch and the light source, theta 4 is the included angle between a fourth preset target patch and the light source, and the included angles between the preset target patches and the light source gradually increase in sequence;

setting a0(a1, a2, a3 and a4) for the self-emission radiance secondary regulating coefficient a0, wherein a1 is a first preset self-emission radiance secondary regulating coefficient, a2 is a second preset self-emission radiance secondary regulating coefficient, a3 is a third preset self-emission radiance secondary regulating coefficient, a4 is a fourth preset self-emission radiance secondary regulating coefficient, and the preset self-emission radiance secondary regulating coefficients are gradually increased in sequence;

when the central control module adjusts the pre-selected self-emission radiance Fi, the central control module compares the included angle theta between the target patch and the light source with the parameters in the theta 0 matrix, and selects a corresponding preset adjusting coefficient from the a0 matrix according to the comparison result to adjust the Fi:

when theta is not less than theta 1, the central control module selects a1 to adjust Fi;

when theta 1 is larger than theta and is not larger than theta 2, the central control module selects a2 to adjust Fi;

when theta 2 is larger than theta and smaller than or equal to theta 3, the central control module selects a3 to adjust Fi;

when theta 3 is larger than theta and is not larger than theta 4, the central control module selects a4 to adjust Fi;

when the central control module selects aj to adjust the preselected Fi, j is 1,2,3 and 4, the adjusted self-emission radiation degree is Fi, and Fi is Fi' × aj.

Furthermore, the central control module is also provided with a matrix beta 0 for presetting the average included angle between other patches and the light source, a matrix P0 for the radiation degree of rebounding of other patches and a matrix b0 for the correction coefficient of the radiation degree of rebounding of other patches;

setting beta 0 (beta 1, beta 2, beta 3, beta 4) for the matrix beta 0 of the average included angles between the other patches and the light source, wherein beta 1 is a first preset average included angle between the other patches and the light source, beta 2 is a second preset average included angle between the other patches and the light source, beta 3 is a third preset average included angle between the other patches and the light source, beta 4 is a fourth preset average included angle between the other patches and the light source, and the preset average included angles between the other patches and the light source gradually increase in sequence;

for the other patch rebound radiance P0, setting P0(P1, P2, P3, P4), where P1 is a first preset other patch rebound radiance, P2 is a second preset other patch rebound radiance, P3 is a third preset other patch rebound radiance, P4 is a fourth preset other patch rebound radiance, and the preset other patch rebound radiances gradually increase in sequence, and setting P to M × R × F;

b0(b1, b2, b3 and b4) is set for the other patch rebound radiance correction coefficient b0, wherein b1 is a first preset other patch rebound radiance correction coefficient, b2 is a second preset other patch rebound radiance correction coefficient, b3 is a third preset other patch rebound radiance correction coefficient, b4 is a fourth preset other patch rebound radiance correction coefficient, and the preset other patch rebound radiance correction coefficients gradually increase in sequence;

when the central control module adjusts the rebound radiance Pi of other pre-selected patches, i is 1,2,3,4, the central control module compares the average included angle beta between the other patches and the light source with the parameters in the beta 0 matrix, and selects a corresponding preset adjusting coefficient from the b0 matrix according to the comparison result to adjust Pi:

when beta is not more than beta 1, b1 is selected by the central control module to adjust Pi;

when beta 1 is larger than beta and is not larger than beta 2, the central control module selects b2 to regulate Pi;

when beta 2 is more than beta and less than or equal to beta 3, the central control module selects b3 to adjust Pi;

when the beta 3 is larger than the theta and is not larger than the beta 4, the central control module selects b4 to adjust Pi;

when the central control module selects bj to adjust the preselected Pi, j is 1,2,3 and 4, and the adjusted rebound radiances of other patches are Pi ', Pi' is Pi × bj.

Further, in said step 4, when calculating the shape factor of each pair of patches, a half-cube algorithm is used, and at the same time, discontinuous meshing, adaptive and hierarchical subdivision and clustering are used.

Further, when the numerical solution of the system of the linear equation system of the radiometric degree is solved in the step 5, the iteration method used is a gaussian seidel iteration method.

Compared with the prior art, the method has the advantages that in actual operation, the real-time calculation cost is low, the storage space occupied by offline and operation is small, the global illumination of the scene can be simulated in real time, the illumination information of static objects of the scene can be simulated, the credible global illumination effect can be provided for dynamic objects, and the reality of game pictures can be greatly improved in intelligent equipment with limited calculation capacity, cruising capacity and heating.

Further, when discretizing a scene, the patches are small enough and the radiance on each patch is approximately constant, lighting variations such as nearby shadow boundaries can be captured, while the number of patches generated is not too large, avoiding huge storage requirements and lengthy computation times.

Furthermore, the central control module compares the absolute distance A between the target object and the light source with the parameters in the A0 matrix to select a corresponding self-emission amplitude value Fi, and compares the target object patch number B with the parameters in the B0 matrix to select a corresponding preset adjustment coefficient to adjust the Fi, so that a more accurate self-emission amplitude value is obtained, the calculation accuracy is improved, and the illumination simulation effect of the target object is further improved.

Furthermore, the central control module compares the actual wavelength λ of the target object with the parameter in λ 0 to select the corresponding reflectivity Ri, and then compares the number C of the virtual illuminants with the parameter in the C0 matrix to select the corresponding preset adjustment coefficient to adjust Ri, so as to obtain a more accurate reflectivity value, thereby improving the accuracy of calculation and further improving the illumination simulation effect of the target object.

Furthermore, the central control module compares the number C of the virtual luminous bodies with parameters in the C0 matrix to select other patch bounce numbers Mi, and compares the number B of the target object patches with parameters in the B0 matrix to select corresponding preset adjustment coefficients to adjust Mi, so as to obtain more accurate values of other patch bounce numbers, thereby improving the accuracy of calculation and further improving the illumination simulation effect of the target object.

Furthermore, the method uses a random radiometric algorithm to determine the surface radiometric of the scene object in a pre-calculation mode in the world space of the three-dimensional scene, and the radiometric of the static object is stored as an illumination map by using RGBM coding, so that the diffuse reflection effect of global illumination can be restored; the mirror reflection part effect captures the reflection mapping through a reflection probe which is arranged in advance, and the mipmaps are used for simulating the reflection with different roughness, so that the illumination information of the static object of the scene can be simulated.

Furthermore, the detection points are arranged in advance in the scene, after global illumination information is obtained through precomputation, the global illumination information on the space points is stored by using a spherical harmonic function, and the effect of the diffuse reflection part of the global illumination dynamically moving to the object near the detection points can be restored through interpolating the illumination data on the discrete detection points; the effect of the specular reflection part is calculated by interpolation of the reflection map, so that the global illumination of the scene can be simulated in real time.

Furthermore, when the shape factors of each pair of patches are calculated, a half-cube algorithm is used, the number of the shape factors is very large, and the method can effectively reduce the real-time calculation cost.

Furthermore, when the numerical solution of the system of the radiation degree linear equation set is solved, the used iteration method is a Gauss Seidel iteration method, the calculation time length is greatly reduced, and the game experience is effectively improved.

Drawings

FIG. 1 is a schematic flow chart of a method for simulating global illumination at a smart device based on a game according to the present invention;

FIG. 2 is a block diagram of a system for simulating global illumination at an intelligent device based on a game according to the present invention;

Detailed Description

Preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only for explaining the technical principle of the present invention, and do not limit the scope of the present invention.

Fig. 1 is a block flow diagram illustrating a method for simulating global illumination at an intelligent device based on a game according to the present invention.

The invention discloses a method for simulating global illumination on intelligent equipment based on games, which comprises the following steps:

step 1: acquiring a target object to be processed in a game scene;

step 2: acquiring all virtual luminous body information in a game scene;

and step 3: dividing the target object into a plurality of continuous patches according to the position of the target object in the game scene and the grid information, wherein the patches are triangular or convex tetrahedrons, and calculating the radiance value of each patch;

and 4, step 4: calculating a shape factor for each pair of patches;

and 5: solving the numerical solution of a radiation degree linear equation system, and calculating the radiation rate of each patch;

step 6: storing a diffuse reflection part in a solving result of the static object as a two-dimensional map, rgbm code; storing the diffuse reflection part of the solution result of the position of the detection point, and coding the diffuse reflection part into a spherical harmonic form; storing the reflection map of the detection point as cubemap and calculating mipmaps;

and 7: using an equation of relating the average spontaneous emission radiance and the reflectivity on all the patches to the average total radiance, and converting the obtained radiance result into the display color of the surface after solving;

the steps 1 to 7 are all carried out in a simulation system, the simulation system is connected with a central control module through wireless, the central control module is used for controlling the operation of each unit, so that the operation processes of the steps 1 to 7 are controlled, and a matrix is arranged in the central control module.

Specifically, in the step 3, for each patch, a self-emission radiance and a reflectance are given, and the reflectance is set to a number between 0 and 1; the total radiance of a patch includes the radiance received by any number of bounces of other patches in the scene, and the radiance of self-emission, and the central control module is provided with a total radiance value Q, and Q is set to be F + M × R × F.

Specifically, a preset self-emission radiance matrix F0 and a preset absolute distance matrix A0 of the target object and the light source are arranged in the central control module;

setting F0(F1, F2, F3 and F4) for the preset self-emission radiance matrix F0, wherein F1 is a first preset self-emission radiance, F2 is a second preset self-emission radiance, F3 is a third preset self-emission radiance, F4 is a fourth preset self-emission radiance, and the preset self-emission radiance is gradually increased in sequence;

setting a0(a1, a2, A3, a4) for the absolute distance matrix a0 of the preset target objects and the light source, wherein a1 is the absolute distance between the first preset target object and the light source, a2 is the absolute distance between the second preset target object and the light source, A3 is the absolute distance between the third preset target object and the light source, and a4 is the absolute distance between the fourth preset target object and the light source;

when the central control module selects the self-emission radiation degree of the target object, comparing the absolute distance A between the target object and the light source with the parameters in the A0 matrix, and selecting the corresponding self-emission amplitude value according to the comparison result:

when A is less than or equal to A1, the central control module adopts self-emission radiation degree F1;

when A is more than A1 and less than or equal to A2, the central control module adopts self-emission radiance F2;

when A is more than A2 and less than or equal to A3, the central control module adopts self-emission radiance F3;

when A is more than A3 and less than or equal to A4, the central control module adopts self-emission radiance F4;

specifically, the central control module is further provided with a preset self-emission radiance adjusting coefficient matrix k0 and a preset target object patch number matrix B0;

setting a k0(k1, k2, k3 and k4) for the preset self-emission radiance adjusting coefficient matrix k0, wherein k1 is a first preset self-emission radiance adjusting coefficient, k2 is a second preset self-emission radiance adjusting coefficient, k3 is a third preset self-emission radiance adjusting coefficient, and k4 is a fourth preset self-emission radiance adjusting coefficient, and the preset self-emission radiance adjusting coefficients are gradually increased in sequence;

setting B0(B1, B2, B3, B4) for the preset target object patch number matrix B0, where B1 is a first preset target object patch number, B2 is a second preset target object patch number, B3 is a third preset target object patch number, and B4 is a fourth preset target object patch number, and the preset target object patch numbers are gradually increased in sequence;

when the central control module adjusts the preselected self-emission radiance Fi, i is 1,2,3,4, the central control module compares the target object patch number B with parameters in a B0 matrix, and selects a corresponding preset adjusting coefficient from a k0 matrix according to a comparison result to adjust the Fi:

when B is not more than B1, the central control module selects k1 to adjust Fi;

when B is more than B1 and less than or equal to B2, the central control module selects k2 to adjust Fi;

when B is more than B2 and less than or equal to B3, the central control module selects k3 to adjust Fi;

when B is more than B3 and less than or equal to B4, the central control module selects k4 to adjust Fi;

when the central control module selects kj to adjust the preselected Fi, j is 1,2,3 and 4, and the adjusted self-emission radiation degree is Fi 'and Fi' is Fi multiplied by kj.

The central control module selects a corresponding self-emission amplitude value Fi by comparing the absolute distance A between the target object and the light source with the parameters in the A0 matrix, and then selects a corresponding preset adjusting coefficient to adjust the Fi by comparing the number B of the target object patches with the parameters in the B0 matrix, so that a more accurate self-emission amplitude value is obtained, the calculation accuracy is improved, and the illumination simulation effect of the target object is further improved.

Specifically, the central control module is further provided with a preset reflectivity matrix R0, a preset target object wavelength matrix λ 0, a preset reflectivity correction coefficient matrix Y0 and a preset virtual illuminant number matrix C0;

for the preset reflectivity matrix R0, setting R0(R1, R2, R3, R4), where R1 is a first preset reflectivity, R2 is a second preset reflectivity, R3 is a third preset reflectivity, and R4 is a fourth preset reflectivity, and each preset reflectivity is gradually increased in sequence;

setting lambda 0 (lambda 1, lambda 2, lambda 3, lambda 4) for the preset target object wavelength matrix lambda 0, wherein lambda 1 is a first preset target object wavelength, lambda 2 is a second preset target object wavelength, lambda 3 is a third preset target object wavelength, and lambda 4 is a fourth preset target object wavelength, and the preset target object wavelengths are gradually increased in sequence;

when the central control module selects the reflectivity, the actual wavelength lambda of the target object is compared with the parameters in lambda 0, and the corresponding reflectivity is selected according to the comparison result:

when the lambda is less than or equal to lambda 1, the reflectivity R1 is selected as the central control module;

when the lambda is more than or equal to lambda 1 and less than or equal to lambda 2, the reflectivity R2 is selected as the central control module;

when lambda 2 is larger than lambda and smaller than or equal to lambda 3, the reflectivity R3 is selected as the central control module;

when the lambda is more than 3 and less than or equal to 4, the reflectivity R4 is selected as the central control module;

setting Y0(Y1, Y2, Y3 and Y4) for the preset reflectivity correction coefficient matrix Y0, wherein Y1 is a first preset reflectivity correction coefficient, Y2 is a second preset reflectivity correction coefficient, Y3 is a third preset reflectivity correction coefficient, Y4 is a fourth preset reflectivity correction coefficient, and the preset reflectivity correction coefficients are gradually increased in sequence;

setting C0(C1, C2, C3 and C4) for the preset virtual illuminant number matrix C0, wherein C1 is the number of first preset virtual illuminants, C2 is the number of second preset virtual illuminants, C3 is the number of third preset virtual illuminants, C4 is the number of fourth preset virtual illuminants, and the number of the preset virtual illuminants is gradually increased in sequence;

when the central control module adjusts the reflectivity Ri selected in advance, i is 1,2,3,4, the central control module compares the number C of the virtual illuminants with the parameters in the C0 matrix, and selects a corresponding preset adjustment coefficient from the Y0 matrix according to the comparison result to adjust Ri:

when C is less than or equal to C1, the central control module selects Y1 to regulate Ri;

when C is more than C1 and less than or equal to C2, the central control module selects Y2 to regulate Ri;

when C is more than C2 and less than or equal to C3, the central control module selects Y3 to regulate Ri;

when C is more than C3 and less than or equal to C4, the central control module selects Y4 to regulate Ri;

when the central control module selects Yj to adjust the preselected Ri, j is 1,2,3,4, and the adjusted reflectivity is Ri', Ri ═ Ri × Yj.

The central control module compares the actual wavelength lambda of the target object with the parameters in the lambda 0 to select the corresponding reflectivity Ri, and then compares the number C of the virtual luminous bodies with the parameters in the C0 matrix to select the corresponding preset adjusting coefficient to adjust the Ri, so that a more accurate reflectivity value is obtained, the calculation accuracy is improved, and the illumination simulation effect of the target object is further improved.

Specifically, the central control module is also provided with a preset other patch bounce quantity matrix M0 and a preset other patch bounce quantity correction coefficient matrix Z0;

setting M0(M1, M2, M3 and M4) for the matrix M0 of the preset number of the rebounding of other patches, wherein M1 is the first preset number of the rebounding of other patches, M2 is the second preset number of the rebounding of other patches, M3 is the third preset number of the rebounding of other patches, M4 is the fourth preset number of the rebounding of other patches, and the number of the rebounding of other patches is gradually increased in sequence;

when the central control module selects other patch rebounding quantities, the central control module compares the virtual illuminant number C with the parameters in the C0 matrix and selects other patch rebounding quantities according to the comparison result:

when C is less than or equal to C1, the central control module selects the rebound quantity M1 of other patches;

when C is more than C1 and less than or equal to C2, the central control module selects the rebound quantity M2 of other patches;

when C is more than C2 and less than or equal to C3, the central control module selects the rebound quantity M3 of other patches;

when C is more than C3 and less than or equal to C4, the central control module selects the rebound quantity M4 of other patches;

for the other patch bounce quantity correction coefficient matrix Z0, setting Z0(Z1, Z2, Z3, Z4), where Z1 is a first preset other patch bounce quantity correction coefficient, Z2 is a second preset other patch bounce quantity correction coefficient, Z3 is a third preset other patch bounce quantity correction coefficient, Z4 is a fourth preset other patch bounce quantity correction coefficient, and each preset other patch bounce quantity correction coefficient gradually increases in sequence;

when the central control module adjusts the pre-selected other patch rebounding quantity Mi, i is 1,2,3,4, the central control module compares the target object patch quantity B with the parameters in the B0 matrix, and selects a corresponding preset adjusting coefficient from the Z0 matrix according to the comparison result to adjust the Mi:

when B is not more than B1, the central control module selects Z1 to adjust Mi;

when B is more than B1 and less than or equal to B2, Z2 is selected by the central control module to adjust Mi;

when B is more than B2 and less than or equal to B3, Z3 is selected by the central control module to adjust Mi;

when B is more than B3 and less than or equal to B4, Z4 is selected by the central control module to adjust Mi;

when the central control module selects Zj to adjust the preselected Mi, j is 1,2,3 and 4, and the adjusted rebounding quantity of other patches is Mi ', Mi' is Mi multiplied by Zj.

The central control module compares the number C of the virtual luminous bodies with parameters in a C0 matrix to select other patch rebound numbers Mi, compares the number B of the target object patches with parameters in a B0 matrix to select corresponding preset adjustment coefficients to adjust Mi, so that more accurate values of the other patch rebound numbers are obtained, the calculation accuracy is improved, and the illumination simulation effect of the target object is further improved.

Specifically, the central control module is also provided with a preset target patch and light source included angle matrix theta 0 and a self-emission radiance secondary adjusting coefficient a 0;

setting theta 0 (theta 1, theta 2, theta 3 and theta 4) for the matrix theta 0 of the included angles between the target patches and the light source, wherein theta 1 is the included angle between a first preset target patch and the light source, theta 2 is the included angle between a second preset target patch and the light source, theta 3 is the included angle between a third preset target patch and the light source, theta 4 is the included angle between a fourth preset target patch and the light source, and the included angles between the preset target patches and the light source gradually increase in sequence;

setting a0(a1, a2, a3 and a4) for the self-emission radiance secondary regulating coefficient a0, wherein a1 is a first preset self-emission radiance secondary regulating coefficient, a2 is a second preset self-emission radiance secondary regulating coefficient, a3 is a third preset self-emission radiance secondary regulating coefficient, a4 is a fourth preset self-emission radiance secondary regulating coefficient, and the preset self-emission radiance secondary regulating coefficients are gradually increased in sequence;

when the central control module adjusts the pre-selected self-emission radiance Fi, the central control module compares the included angle theta between the target patch and the light source with the parameters in the theta 0 matrix, and selects a corresponding preset adjusting coefficient from the a0 matrix according to the comparison result to adjust the Fi:

when theta is not less than theta 1, the central control module selects a1 to adjust Fi;

when theta 1 is larger than theta and is not larger than theta 2, the central control module selects a2 to adjust Fi;

when theta 2 is larger than theta and smaller than or equal to theta 3, the central control module selects a3 to adjust Fi;

when theta 3 is larger than theta and is not larger than theta 4, the central control module selects a4 to adjust Fi;

when the central control module selects aj to adjust the preselected Fi, j is 1,2,3 and 4, the adjusted self-emission radiation degree is Fi, and Fi is Fi' × aj.

Specifically, the central control module is also provided with a matrix beta 0 for presetting the average included angle between other patches and the light source, a matrix P0 for the radiation degree of rebounding of other patches and a matrix b0 for the correction coefficient of the radiation degree of rebounding of other patches;

setting beta 0 (beta 1, beta 2, beta 3, beta 4) for the matrix beta 0 of the average included angles between the other patches and the light source, wherein beta 1 is a first preset average included angle between the other patches and the light source, beta 2 is a second preset average included angle between the other patches and the light source, beta 3 is a third preset average included angle between the other patches and the light source, beta 4 is a fourth preset average included angle between the other patches and the light source, and the preset average included angles between the other patches and the light source gradually increase in sequence;

for the other patch rebound radiance P0, setting P0(P1, P2, P3, P4), where P1 is a first preset other patch rebound radiance, P2 is a second preset other patch rebound radiance, P3 is a third preset other patch rebound radiance, P4 is a fourth preset other patch rebound radiance, and the preset other patch rebound radiances gradually increase in sequence, and setting P to M × R × F;

b0(b1, b2, b3 and b4) is set for the other patch rebound radiance correction coefficient b0, wherein b1 is a first preset other patch rebound radiance correction coefficient, b2 is a second preset other patch rebound radiance correction coefficient, b3 is a third preset other patch rebound radiance correction coefficient, b4 is a fourth preset other patch rebound radiance correction coefficient, and the preset other patch rebound radiance correction coefficients gradually increase in sequence;

when the central control module adjusts the rebound radiance Pi of other pre-selected patches, i is 1,2,3,4, the central control module compares the average included angle beta between the other patches and the light source with the parameters in the beta 0 matrix, and selects a corresponding preset adjusting coefficient from the b0 matrix according to the comparison result to adjust Pi:

when beta is not more than beta 1, b1 is selected by the central control module to adjust Pi;

when beta 1 is larger than beta and is not larger than beta 2, the central control module selects b2 to regulate Pi;

when beta 2 is more than beta and less than or equal to beta 3, the central control module selects b3 to adjust Pi;

when the beta 3 is larger than the theta and is not larger than the beta 4, the central control module selects b4 to adjust Pi;

when the central control module selects bj to adjust the preselected Pi, j is 1,2,3 and 4, and the adjusted rebound radiances of other patches are Pi ', Pi' is Pi × bj.

Specifically, in said step 4 calculating the shape factor of each pair of patches, a half-cube algorithm is used, while discontinuous meshing, adaptive and hierarchical subdivision and clustering are used.

Specifically, when the numerical solution of the system of the linear equation system of the radiometric degree is obtained in step 5, the iterative method used is the gaussian seidel iterative method.

In order that the objects and advantages of the invention will be more readily apparent, the invention is further described below in connection with a simulation system; it should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Fig. 2 is a block diagram of a system for simulating global illumination at an intelligent device based on a game according to the present invention.

A system for simulating global lighting at a smart device based on a game, comprising:

a setting unit for setting a virtual light-emitting body position and light source information; the device is used for setting the positions and distribution of the diffuse reflection detection points; the system is used for setting the position and the precision of the specular reflection detection point; the method is used for adjusting the accuracy of pre-calculated illumination data, calculating time consumption, storage precision and compression mode.

And the calculating unit is used for calculating the result of the global illumination in an off-line manner according to the parameters of the setting device and the method of the first aspect.

The storage unit is used for storing the global light diffuse reflection component of the static object by using the two-dimensional map; storing the calculation result of the diffuse reflection detection point in a user-defined binary format; the cubemap stores the specular reflection result of the detection point and automatically calculates mipmaps; all data is compressed according to the set device parameters.

And the display unit loads the pre-calculated global illumination components of all parts during running and displays the global illumination result of the scene in real time.

Wherein, set up the unit, include:

the first setting module is used for setting the direct light emission density, the unit is a strip/square unit, and a more accurate result can be obtained by higher density, but the generation time of the computing device is prolonged;

the second setting module is used for setting the emission density of the rebound light, the unit is a strip/square unit, more accurate results can be obtained by higher density, but the generation time of the computing device can be quickly prolonged;

the third setting module is used for calculating the generation time of the device to be longer as the rebound times of the indirect light are larger;

the fourth setting module is used for carrying out noise reduction operation on the intermediate result of the off-line calculation by the calculating device;

the fifth setting module is used for setting the number of the illumination paste image pixels occupied by 1 square unit of a game scene, the larger the number of the illumination paste image pixels is, the more accurate the result stored by the storage device is, but the longer the calculation time is, the larger the storage space is;

a sixth setting module, wherein the upper limit of the size of 1 illumination map is divided into additional maps when the exceeding part is divided;

and a seventh setting module for lighting the data compression format of the map.

A display unit comprising:

the first display module loads a corresponding illumination map according to scene pre-calculated information, sets the illumination map to a rendering component of an object, and is used for calculating the diffuse reflection component of global light during coloring;

the second display module is used for screening a group of probe data near a corresponding space from the pre-calculated and stored probe data according to the position information and the bounding box information, interpolating the probe data, setting the probe data to a rendering component of the dynamic object, and calculating the diffuse reflection component of the global light during coloring;

and the third display module is used for collecting the current position information of the object by the display device according to the global light component reflected by the mirror surface, determining the selected environment probe data and allowing interpolation between the two probe data at most.

So far, the technical solutions of the present invention have been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of the present invention is obviously not limited to these specific embodiments. Equivalent changes or substitutions of related technical features can be made by those skilled in the art without departing from the principle of the invention, and the technical scheme after the changes or substitutions can fall into the protection scope of the invention.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention; various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种特效显示方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类