A method and device for rendering the refraction effect of a virtual human eye model
By approximate geometric modeling and pre-calculating the refractive index coefficients of the virtual character eye model, a lookup table is constructed, which solves the problems of insufficient refractive accuracy and high computational complexity in real-time rendering of the virtual character eye model, and achieves high-quality refractive effect rendering.
Patent Information
- Application Number
- CN202311260981.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2043-09-27
AI Technical Summary
The prior art has problems such as insufficient refractive accuracy, high computational complexity and difficulty in real-time rendering in real-time rendering of virtual character eyeball models.
By approximate geometric modeling of the corneal shape of the eyeball from a physical perspective and pre-calculate a series of refractive index coefficients, a refractive index lookup table is constructed to quickly and accurately render the refractive effect of the eyeball through the lookup table during real-time rendering.
The refraction effect rendering of high-quality virtual human eyeball models is realized, reducing the computational complexity and consumption, and improving the accuracy and efficiency of rendering.
Smart Images

Figure CN117333606B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of real-time rendering, and particularly relates to a method and device for rendering the refraction effect of a virtual human eye model. Background Art
[0002] Virtual humans have been widely used in fields such as game development and film production. With the continuous development of graphics technology, the requirements for the appearance performance of virtual humans are also increasing day by day. Among them, the eyes, as one of the most expressive parts of the character model, play a crucial role in presenting the realism and emotions of virtual humans. Realistic eye rendering can not only increase the realism of the character, but also guide the audience's attention and enhance emotional communication. As the window of emotions, the optical effects on the surface of the eyes directly affect the emotional expression of virtual humans. Therefore, accurately simulating the appearance and optical characteristics of the eyeballs of virtual characters is important for enhancing the credibility and immersion of virtual humans.
[0003] There is a refraction phenomenon between the transparent medium on the surface of the eyeball and the air. This refraction phenomenon produces many interesting visual effects in the eyeball model, such as the light refraction of the iris and the shape change of the cornea. These effects directly affect the appearance of the eyes of virtual characters. Therefore, accurately simulating the refraction phenomenon is crucial for achieving highly realistic eyeball rendering. When light enters the eyeball from the side, after refraction and transmission, a relatively strong light ring will be generated on the other side. By simulating the refraction phenomenon, the appearance of the eyeballs in the real world can be reproduced more accurately. However, to achieve high-quality eyeball refraction effects, technical challenges such as the complexity of refraction calculation, efficiency issues, and the accuracy of the eyeball optical model need to be overcome.
[0004] There has been some research and application on the rendering technology of virtual character eyeballs. In the establishment of a virtual human eyeball model, anatomical, physiological, and optical knowledge serves as the foundation. G Francois et al. provided materials and laid the foundation for the real-time rendering of the iris part of the eyeball by deeply studying the structure of real human eyes and processing high-definition scanned images of the eyes. Pascal Berard et al. further expanded and established the eyeball as a three-dimensional model including various components such as the cornea, lens, iris, and sclera, and performed texture mapping generation and effect optimization for each part of the model. Of course, when rendering the eyeball model, not only the external shape but also internal structures such as the refraction effect of the lens and the optical changes of the iris need to be considered. However, in the field of real-time rendering, the research on the refraction effect of the eyeball is relatively less. Although the research by Pascal Berard et al. proposed a method for calculating refraction constraints, its computational complexity is large, and it can only meet the requirements under the condition of offline rendering. MattChiang et al. proposed a method for approximately calculating the refraction of the iris edge during real-time rendering, but this method is based on a refraction function independently designed by artists, and its accuracy is insufficient and it is difficult to meet the production process under physically based rendering technology (PBR). In summary, the existing technologies may have technical problems such as insufficient accuracy in dealing with refraction, high computational complexity, and difficulty in real-time rendering. Therefore, it is necessary to explore a more efficient and accurate virtual character eyeball refraction rendering technology to meet the needs of real-time realistic rendering. Summary of the Invention
[0005] In view of the above, the purpose of the present invention is to provide a method and device for rendering the refraction effect of a virtual human eyeball model, approximately geometrically model the shape of the cornea of the eyeball from a physical perspective, and pre-calculate a series of refraction coefficients based on the modeled shape. During real-time rendering, by looking up the pre-calculated refraction coefficient table, the refraction effect of the eyeball can be conveniently and accurately rendered.
[0006] To achieve the above-mentioned invention purpose, a method for rendering the refraction effect of a virtual human eyeball model provided by an embodiment includes the following steps:
[0007] Construct the shape of the cornea based on the virtual human eyeball model;
[0008] Based on the shape of the cornea, according to a preset set of incident light rays and a set of points on the iris plane, pre-calculate the incident point of the incident light ray on the cornea, the normal vector at the incident point, and the refraction direction;
[0009] Calculate a series of refraction coefficients based on the normal vector and refraction direction at the incident point and construct a refraction coefficient lookup table;
[0010] During real-time rendering, find the refraction coefficients from the refraction coefficient lookup table to participate in the rendering to obtain the refraction effect of the virtual human eyeball model.
[0011] Preferably, constructing the corneal shape based on the virtual human eye model includes:
[0012] According to the virtual human eye model, the cross-section of the corneal layer is regarded as the splicing of an arc and a cone, and the parabolic formula is used for approximate fitting expression to determine the final corneal shape.
[0013] Preferably, pre-calculating the incident point of the incident light on the cornea, the normal vector and the refraction direction at the incident point includes:
[0014] Taking the plane where the iris of the eye is located as the xy plane, the line-of-sight direction as the z-axis, and the center of the iris as the origin, an eye coordinate system is established. The distance from the iris to the cornea is expressed as the iris depth id, and let And the quadratic function between z and r is: 14.5z + r 2 -id = 0. After solving for the incident point of the incident light on the cornea according to an incident light, for the incident point on the cornea, its tangent vector is obtained by taking the derivative of the quadratic function, and then the normal vector is obtained. Based on the incident light, the normal vector at the incident point, and the refraction law, the refraction direction at the incident point is obtained.
[0015] Preferably, calculating a series of refractive indices according to the normal vector and the refraction direction at the incident point includes:
[0016] f r (P i , ω i ) = T r ×(1 - F i )×ω r
[0017]
[0018] F i = R 0 +(1 - R 0 )(1 - cosθ i ) 5
[0019]
[0020] where f r (P i , ω i ) represents the refractive index calculated based on the i-th point on the iris and the i-th incident light, ω r represents the refracted light at the incident point K, T r represents the transmittance of the cornea, represents the absorbance of water, ||KP|| represents the distance between the incident point K on the cornea and the i-th point on the iris, Fi represents the Fresnel function, n 1 represents the refractive index of the outer medium at the incident point K, represents the refractive index of the inner medium at the incident point K, θ i represents the angle between the incident light and the normal at the incident point K.
[0021] Preferably, when constructing the refractive index lookup table, the refractive index is stored in the rgba format, where the rgb components store the position of the incident point K on the cornea, and the a component stores the refractive index of the incident point K.
[0022] Preferably, during real-time rendering, it is divided into two passes for drawing. When the first pass is executed, each point on the cornea is projected onto the iris plane along the z-axis direction of the eye coordinate system to obtain the coordinates of the projection point P. Based on the position of the projection point P and the center of the cornea, the iris radius rp at point P is calculated. Based on the z coordinate zp of the projection point P and the iris radius rp, the refractive index lookup table is searched to obtain the incident point K on the cornea and the refractive index f at the incident point r and multiply the iris color at the projection point P by the refractive index f r to obtain the coloring at the incident point K, which forms the coloring map;
[0023] When the second pass is executed, the coloring map generated in the first pass is superimposed as the refractive color onto the drawn eyeball.
[0024] To achieve the above object of the invention, the embodiment also provides a method for rendering the refractive effect of a virtual human eyeball model, including a cornea shape construction module, an intersection calculation module, a lookup table construction module, and a real-time rendering module;
[0025] The cornea shape construction module is used to construct the cornea shape based on the virtual human eyeball model;
[0026] The intersection calculation module is used to pre-calculate the incident point of the incident light on the cornea, the normal vector and the refraction direction at the incident point based on the cornea shape according to a preset set of incident lights and a set of points on the iris plane;
[0027] The lookup table construction module is used to calculate a series of refractive indices based on the normal vector and the refraction direction at the incident point and construct a refractive index lookup table;
[0028] When the real-time rendering module performs real-time rendering, it searches for the refractive index from the refractive index lookup table to participate in the rendering to obtain the refractive effect of the virtual human eyeball model.
[0029] To achieve the above-mentioned invention objectives, an embodiment further provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned rendering method for the refractive effect of the virtual human eye model are implemented.
[0030] To achieve the above-mentioned invention objectives, an embodiment further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is processed and executed, the steps of the above-mentioned rendering method for the refractive effect of the virtual human eye model are implemented.
[0031] Compared with the prior art, the beneficial effects of the present invention at least include:
[0032] When constructing the corneal shape, the cross-section of the corneal layer is regarded as the splicing of an arc and a cone, and the parabolic formula is used for approximate fitting expression. In this way, the obtained corneal shape is more accurate and realistic. Through the pre-computed refractive index lookup table, the refractive offset effect can be accurately and quickly rendered according to the light direction and the points on the iris plane during real-time rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0034] Figure 1 is a flowchart of the rendering method for the refractive effect of the virtual human eye model provided by the embodiment;
[0035] Figure 2 is a schematic diagram of constructing the corneal shape provided by the embodiment;
[0036] Figure 3 is a flowchart of pre-computing the refractive index lookup table provided by the embodiment;
[0037] Figure 4 is a schematic diagram of the structure of the rendering device for the refractive effect of the virtual human eye model provided by the embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further details the present invention with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the protection scope of the present invention.
[0039] The inventive concept of the present invention is as follows: Aiming at the technical problems of insufficient refraction accuracy, high computational complexity, and difficult real-time rendering during the real-time rendering of virtual character eyeballs, the embodiments of the present invention provide a method and device for rendering the refraction effect of a virtual human eyeball model. On the basis of constructing an accurate corneal shape, a series of refraction coefficients are pre-calculated based on the corneal shape. During real-time rendering, by looking up the pre-calculated refraction coefficient lookup table, the refraction effect of the eyeball can be rendered conveniently and accurately. This process is simple in calculation, low in consumption, and can obtain a high-quality eyeball refraction effect.
[0040] Based on the above inventive concept, an embodiment provides a method for rendering the refraction effect of a virtual human eyeball model, as Figure 1 shown, including the following steps:
[0041] S110, construct a corneal shape based on the virtual human eyeball model.
[0042] In the embodiment, the virtual human eyeball model is generally divided into two independent surfaces. One surface provides the sclera, iris, and pupil, and the other surface is located on the top and provides the cornea and the overall moisture of the eye. As Figure 2 shown, the green plane is the plane where the iris is located, the arc surface above it is the cornea, and the space between the cornea and the iris is filled with liquid. In general eyeball rendering methods, the cornea is often regarded as an ellipsoidal shape for calculation, as Figure 2 shown by the blue arc in. In the embodiment of the present invention, it is considered that the corneal shape is actually more inclined to a structure of a dome plus a cone. The cross-section of the corneal layer is regarded as a splicing of an arc and a cone, and a parabolic formula is used for approximate fitting expression to determine the final corneal shape, as Figure 2 shown by the yellow line in. The corneal shape obtained in this way is more accurate and realistic.
[0043] S120, based on the corneal shape, and according to a preset group of incident light rays and a group of points on the iris plane, pre-calculate the incident point of the incident light ray on the cornea, the normal vector at the incident point, and the refraction direction.
[0044] In the embodiment, according to the virtual human eyeball model and the constructed corneal shape, a three-dimensional eyeball coordinate system in the eyeball space is established based on the line-of-sight direction of the eyeball and the plane where the iris is located. The specific process is as follows: As Figure 2 shown, taking the plane where the iris of the eyeball is located as the xy plane, the line-of-sight direction as the z axis, and the center of the iris as the origin, an eyeball coordinate system is established. The distance from the iris to the cornea is expressed as the iris depth iris depth, abbreviated as id, and let and the quadratic function between z and r is: 14.5z + r 2-id = 0. For any point (x, y, z) on the cornea, that is, (r, z), the tangent vector can be calculated by taking the derivative of the quadratic function, and then the normal vector perpendicular to it can be obtained. Therefore, after finding the incident point K of the incident light ray ωi on the cornea, for the incident point K on the cornea, the tangent vector is obtained by taking the derivative of the quadratic function, and then the normal vector N is obtained. Regarding the liquid inside the cornea as water and the outside as air, the refractive indices on both sides of the incident point are known, and the angle between the incident light ray and the normal is known. Then, based on the incident light ray, the normal vector at the incident point, and the law of refraction, the refraction direction at the incident point is obtained.
[0045] S130. Calculate a series of refraction coefficients based on the normal vector and the refraction direction at the incident point and construct a refraction coefficient lookup table.
[0046] Since in real-time rendering, calculating the refracted light ray and the refraction offset point is very time-consuming and cumbersome. Therefore, pre-calculation of the refraction point is performed in the present invention. In the pre-calculation stage, as Figure 3 shown, the input is a set of points Pi {P1, P2,..., Pn} on the iris plane and a set of random incident light ray directions ω i {ω 1 , ω 2 ,..., ω n}, and the output is a refraction coefficient lookup table. The lookup table uses Pi and ω i as the coordinate axes and stores the pre-calculated refraction results.
[0047] The calculation process of the refraction coefficient lookup table can be expressed by the following formula:
[0048] f r (P i , ω i ) = T r ×(1 - F i )×ω r
[0049] where ω r is the refracted light ray, K is the incident point. For an incident direction ω i and a point P i on the iris, by moving the incident direction on the cornea plane, an incident point K can always be found. After the light ray is incident at this incident point K, it travels along the minimum optical path and intersects the iris plane at point P r . Thus, ω i and the incident point K can be obtained. r
[0050] T ris the transmittance of the cornea, which is used to simulate the energy attenuation caused by absorption and scattering phenomena when light propagates through the liquid inside the cornea. According to the Beer-Lambert law, the transmittance of light when propagating from one point to another in a specific medium can be calculated. Among them, σ t (x) is the absorbance of the specific medium x, and the result can be obtained by looking up the table.
[0051]
[0052] In the embodiment, the propagation path of the light is the line connecting K and P, and ||KP|| is the distance between the two points. Regarding the liquid inside the cornea as water, the absorbance of water can be used to calculate, and the final derivation formula is as follows:
[0053]
[0054] F i is the Fresnel function. When light hits a surface, the Fresnel equation tells the percentage of the reflected light according to the viewing angle. Using this reflection ratio and the principle of energy conservation, the refracted part of the light and the remaining energy of the light can be directly obtained. In actual calculation, this method uses the Schlick function to approximate the Fresnel equation, and the formula is as follows:
[0055]
[0056] Among them, n 1 is the refractive index of the outer medium at the incident point, n 2 is the refractive index of the inner medium at the incident point. In this method, n 1 is the refractive index of air, which is 1.0, and n 2 is the refractive index of water, which is 1.33. θ i is the angle between the incident light and the normal at the incident point K.
[0057] In summary, for any incident direction ω i and any point P i on the iris, the corresponding incident point K can be obtained, and the f r at point K can be calculated according to the formula, that is, the refractive index of the color observed at point K.
[0058] In the embodiment, the calculated refractive index is stored as a lookup table for subsequent real-time rendering. The refractive indices in the lookup table are stored in rgba format, where the rgb components store the position of point K, and the a component stores the refractive index f rSince the virtual human eye model can be regarded as symmetric during rendering, only points need to be randomly generated in a certain radial direction of the iris plane to represent all points, which greatly reduces the amount of calculation data during preprocessing.
[0059] S140. During real-time rendering, find the refractive index from the refractive index lookup table and participate in the rendering to obtain the refractive effect of the virtual human eye model.
[0060] After the precomputation stage is completed, the refractive effect of the eye is obtained through real-time rendering. The specific process is as follows:
[0061] (a) Normally render other parts of the eye, such as the sclera, blood vessels on the sclera, iris without refractive effect, pupil, etc. There are no restrictions on this rendering process. However, it should be noted that the eye model used during rendering should be a model with a bulge at the cornea of the virtual human.
[0062] (b) Establish an eye coordinate system. Obtain the eye's line-of-sight direction, which is the vector pointing from the center of the sphere of the virtual human eye model to the center of the pupil. The center of the pupil should be the value set and calculated in step (a). At the same time, provide iris depth as a parameter for setting the iris depth. According to the position of the center of the pupil and iris depth, a point can be determined as the center point on the iris plane, and it is set as the origin of the eye coordinate system. The eye's line-of-sight direction is the Z-axis of the coordinate system. Arbitrarily select two mutually perpendicular vector bases on the eye plane as the XY axes of the coordinate system. Thus, the eye coordinate system is established. Using the representations of the three coordinate axis vectors of the eye coordinate system in the model space as the first 3 columns of the matrix, the transformation matrix from the eye coordinate system to the model space coordinate system is obtained. Correspondingly, the transformation matrix from the model coordinate system to the eye coordinate system can also be calculated. Therefore, during actual calculation, all calculations are converted to be carried out in the eye coordinate system.
[0063] (c) Start real-time rendering of the refractive effect of the eye, which is divided into two passes for drawing. When the first pass is executed, for each point on the cornea of the virtual human eye, project it along the z-axis direction of the eye coordinate system onto the iris plane to obtain the coordinates (xp, yp, zp) of the projection point P in the eye coordinate system. Use the formula to find the coordinates (rp, Zp) of the projection point P expressed in terms of the iris radius r. Convert the current light direction to the eye coordinate system. According to the above coordinates (rp, Zp), look up the refractive index lookup table obtained in the preprocessing stage to obtain the refractive offset point K of the projection point P and its refractive index f r Multiply the iris color at the projection point P by the refractive index f rMultiply them to obtain the coloring at the refraction offset point K. Map this coloring result to a real-time updated coloring map. When the second pass is executed, sample the coloring map generated in the first pass and superimpose it as the refraction color on the drawn eyeball, then the refraction effect rendering is completed.
[0064] Based on the same inventive concept, the embodiment also provides a refraction effect rendering device for a virtual human eyeball model, as Figure 4 shown, including a corneal shape construction module 410, an intersection calculation module 420, a look-up table construction module 430, and a real-time rendering module 440;
[0065] The corneal shape construction module 410 is used to construct the corneal shape based on the virtual human eyeball model;
[0066] The intersection calculation module 420 is used to pre-calculate the incident point of the incident light on the cornea, the normal vector and the refraction direction at the incident point based on the corneal shape, according to a preset set of incident light rays and a set of points on the iris plane;
[0067] The look-up table construction module 430 is used to calculate a series of refraction coefficients based on the normal vector and the refraction direction at the incident point and construct a refraction coefficient look-up table;
[0068] When the real-time rendering module 440 performs real-time rendering, it searches for the refraction coefficient from the refraction coefficient look-up table to participate in the rendering, and obtains the refraction effect of the virtual human eyeball model.
[0069] It should be noted that when the above-mentioned refraction effect rendering device for the virtual human eyeball model performs refraction effect rendering, the above-mentioned division of each functional module should be used for illustration. The above functions can be allocated to different functional modules according to needs, that is, the internal structure of the terminal or server is divided into different functional modules to complete all or part of the functions described above. In addition, the above-mentioned refraction effect rendering device for the virtual human eyeball model and the embodiment of the refraction effect rendering method for the virtual human eyeball model belong to the same concept, and the specific implementation process can be seen in the embodiment of the refraction effect rendering method for the virtual human eyeball model, which will not be elaborated here.
[0070] The embodiment also provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-mentioned refraction effect rendering method for the virtual human eyeball model, specifically including:
[0071] S110, constructing a corneal shape based on the virtual human eyeball model;
[0072] S120. Based on the corneal shape, according to a preset set of incident light rays and a set of points on the iris plane, pre-calculate the incident point of the incident light ray on the cornea, the normal vector and the refraction direction at the incident point;
[0073] S130. Calculate a series of refractive indices based on the normal vector and the refraction direction at the incident point and construct a refractive index lookup table;
[0074] S140. When performing real-time rendering, find the refractive index from the refractive index lookup table to participate in the rendering, and obtain the refraction effect of the virtual human eye model.
[0075] In practical applications, the memory can be a volatile memory at the proximal end, such as RAM, or a non-volatile memory, such as ROM, FLASH, floppy disk, mechanical hard disk, etc., or a remote storage cloud. The computer processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), that is, the steps of the refraction effect rendering method of the virtual human eye model can be implemented through these processors.
[0076] The embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is processed and executed, the steps of the above-mentioned refraction effect rendering method of the virtual human eye model are implemented, specifically including the following steps:
[0077] S110. Construct the corneal shape based on the virtual human eye model;
[0078] S120. Based on the corneal shape, according to a preset set of incident light rays and a set of points on the iris plane, pre-calculate the incident point of the incident light ray on the cornea, the normal vector and the refraction direction at the incident point;
[0079] S130. Calculate a series of refractive indices based on the normal vector and the refraction direction at the incident point and construct a refractive index lookup table;
[0080] S140. When performing real-time rendering, find the refractive index from the refractive index lookup table to participate in the rendering, and obtain the refraction effect of the virtual human eye model.
[0081] Among them, the computer-readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
[0082] The above-mentioned specific embodiments have elaborated on the technical solutions and beneficial effects of the present invention in detail. It should be understood that the above is only the most preferred embodiment of the present invention and is not used to limit the present invention. Any modifications, supplements, equivalent replacements, etc. made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A rendering method for the refractive effect of a virtual human eye model, characterized in that, it includes the following steps: Construct the corneal shape based on the virtual human eye model; Based on the corneal shape, according to a preset set of incident light rays and a set of points on the iris plane, pre-calculate the incident point of the incident light ray on the cornea, the normal vector and the refraction direction at the incident point; Calculate a series of refractive coefficients based on the normal vector and the refraction direction at the incident point and construct a refractive coefficient lookup table; When rendering in real time, the refractive index is found from the refractive index lookup table to participate in rendering, and the refractive effect of the virtual human eyeball model is obtained, including: when rendering in real time, it is divided into two passes to draw. When the first pass is executed, the incident point K on the cornea is calculated and the refractive index f of the incident point K is obtained by looking up the refractive index lookup table. r , and according to the refractive index f r The shading composition shading map at the incident point K is calculated. When the second pass is executed, the shading map generated in the first pass is superimposed on the drawn eyeball as the refraction color.
2. The rendering method for the refractive effect of a virtual human eye model according to claim 1, characterized in that, The constructing the corneal shape based on the virtual human eye model includes: According to the virtual human eye model, regard the cross-section of the corneal layer as the splicing of an arc and a cone, and use the parabolic formula for approximate fitting expression to determine the final corneal shape.
3. The rendering method for the refractive effect of a virtual human eye model according to claim 1, characterized in that, The pre-calculating the incident point of the incident light ray on the cornea, the normal vector and the refraction direction at the incident point includes: Taking the plane where the iris of the eyeball is located as the xy plane, the line-of-sight direction as the z axis, and the center of the iris as the origin, an eyeball coordinate system is established, and the distance from the iris to the cornea is expressed as the iris depth. id , let , and the quadratic function between z and r is: , after obtaining the incident point of the incident light on the cornea by solving according to a single incident light, for the incident point on the cornea, its tangent vector is obtained by taking the derivative of the quadratic function, and then the normal vector is obtained. Based on the incident light, the normal vector of the incident point, and the refraction law, the refraction direction of the incident point is obtained.
4. The rendering method for the refractive effect of a virtual human eye model according to claim 1, characterized in that, The calculating a series of refractive coefficients based on the normal vector and the refraction direction at the incident point includes: ; ; ; ; Among them, represents the refractive index calculated based on the i th point on the iris and the i th incident ray, represents the refracted ray at the incident point K, represents the transmittance of the cornea, represents the absorbance of water, represents the distance between the incident point K on the cornea and the i th point on the iris, represents the Fresnel function, represents the refractive index of the outer medium at the incident point K and the refractive index of the inner medium at the incident point K, represents the angle between the incident ray and the normal at the incident point K.
5. The rendering method for the refractive effect of a virtual human eye model according to claim 1, characterized in that, When constructing the refractive coefficient lookup table, the refractive coefficients are stored in the rgba format, where the rgb components store the position of the incident point K on the cornea, and the a component stores the refractive coefficient of the incident point K.
6. A rendering device for the refractive effect of a virtual human eye model, characterized in that, it includes a corneal shape construction module, an intersection calculation module, a lookup table construction module and a real-time rendering module; The corneal shape construction module is used to construct the corneal shape based on the virtual human eye model; The intersection calculation module is used to pre-calculate the incident point of the incident light ray on the cornea, the normal vector and the refraction direction at the incident point based on the corneal shape, according to a preset set of incident light rays and a set of points on the iris plane; The lookup table construction module is used to calculate a series of refractive coefficients based on the normal vector and the refraction direction at the incident point and construct a refractive coefficient lookup table; The real-time rendering module is used to find the refractive index from the refractive index lookup table during real-time rendering and participate in the rendering to obtain the refractive effect of the virtual human eye model, including: during real-time rendering, it is divided into two passes for drawing. When the first pass is executed, the incident point K on the cornea is calculated and the refractive index f of the incident point K is obtained by looking up the refractive index lookup table. r , and according to the refractive index f r Calculate the shading composition at the incident point K to form a shading map. When the second pass is executed, the shading map generated in the first pass is superimposed on the drawn eyeball as the refractive color.
7. A computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the steps of the rendering method for the refractive effect of a virtual human eye model according to any one of claims 1-5.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is processed and executed, it implements the steps of the rendering method for the refractive effect of a virtual human eye model according to any one of claims 1-5.