Methods, apparatus, equipment and storage media for specular rendering of eye models

By obtaining eyeball textures and calculating the range of highlight movement in the game engine, and using a physically based lighting model for specular rendering, the problem of fixed initial position of the lighting model was solved, enabling flexible setting of highlights and rendering of realistic effects, thus improving the quality of virtual characters.

CN116245992BActive Publication Date: 2026-11-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310142858.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2026-11-10
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

Existing lighting models cannot change the initial highlight position, lack flexibility, and affect the shape characteristics and visual aesthetics of virtual characters.

Method used

By obtaining the eye map from the game development engine, sampling the map, calculating the range of highlight movement, and using a preset physical lighting model to render highlights at the initial position, the highlight can be freely set.

Benefits of technology

It achieves realistic highlight rendering, improving the quality of virtual characters and giving artists more flexible control over the effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116245992B_ABST
    Figure CN116245992B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, device, and storage medium for rendering specular highlights on an eye model. The method includes: acquiring an eye map of an eye model from a game development engine, and sampling the eye map to obtain a sampling result; calculating the movement range of highlight points on the eye model based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in world space; obtaining the initial position of the highlight points calculated based on the movement range, and rendering highlights at the initial position of the highlight points on the eye model using a preset physical lighting model combined with the sampling result. This method achieves a realistic highlight effect through a physical lighting model, and also allows for free setting of the initial position of the highlight points, making the physical lighting model independent of the direction of direct light, providing more flexible parameter settings, meeting the artist's effect requirements, and improving character quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphics processing, and more particularly to a method, apparatus, device, and storage medium for rendering specular highlights on an eye model. Background Technology

[0002] In games, lighting models are often used to simulate real-world objects. There are many types of lighting models, including base color and specular highlights. The final lighting effect of an object in game rendering is the sum of its base color, specular highlights, and other lighting components. Lighting effects are particularly important for the performance of virtual characters. In some games, users can choose to control virtual characters during gameplay or other tasks. The lighting effects of virtual characters affect the realism of their form and the aesthetics of their visual display, which in turn impacts the user's operational experience. Currently, in PBR (Physically Based Rendering), the initial highlight position of the virtual character's eyeball model, formed using the GGX lighting model, is fixed and cannot be changed. This lack of flexibility and heavy reliance on direct lighting direction leads to poor highlight effects, affecting the realism of the virtual character's form and the aesthetics of its visual display. Summary of the Invention

[0003] The main objective of this invention is to solve the technical problem that existing lighting models cannot set and change the initial position, thus lacking flexibility.

[0004] The first aspect of this invention provides a method for rendering specular highlights on an eye model, the method comprising: Obtain the eyeball texture of the eyeball model in the game development engine, and perform texture sampling on the eyeball texture to obtain the sampling result; The range of motion of the highlight point on the eyeball model is calculated based on the orientation of the eyeball model, the camera orientation in the game development engine, and the upward direction of the world space. The initial position of the highlight point is obtained based on the movement range of the highlight point, and the highlight is rendered on the eyeball model at the initial position of the highlight point by combining the sampling results with the preset physical lighting model.

[0005] A second aspect of the present invention provides an eyeball model specular rendering apparatus, comprising: The acquisition module is used to acquire the eyeball texture of the eyeball model in the game development engine, and to perform texture sampling on the eyeball texture to obtain the sampling result; The range calculation module is used to calculate the movement range of the highlight point on the eye model based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in world space. The rendering module is used to obtain the initial position of the highlight point calculated based on the movement range of the highlight point, and to perform highlight rendering on the eyeball model at the initial position of the highlight point by combining the sampling results with a preset physical lighting model.

[0006] A third aspect of the present invention provides an eye model specular rendering device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the eye model specular rendering device to perform the steps of the above-described eye model specular rendering method.

[0007] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described method for rendering specular highlights on an eye model.

[0008] The aforementioned method, apparatus, device, and storage medium for rendering specular highlights on an eye model involves acquiring an eye texture map from a game development engine and sampling the map to obtain a sampling result. The movement range of the highlight points on the eye model is calculated based on the eye model's orientation, the camera direction in the game development engine, and the upward direction in world space. The initial position of the highlight points, calculated based on this movement range, is obtained, and specular rendering is performed at the initial position of the highlight points on the eye model using a preset physical lighting model combined with the sampling result. This method achieves a realistic highlight effect through a physical lighting model, while also allowing for free setting of the initial position of the highlight points. This makes the physical lighting model independent of the direction of direct light, providing more flexible parameter settings to meet the artist's requirements and improve character quality.

[0009] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the first embodiment of the specular rendering method for the eyeball model in this invention; Figure 2 This is a schematic diagram of one embodiment of the specular rendering device for an eyeball model in this invention; Figure 3This is a schematic diagram of another embodiment of the specular rendering device for the eyeball model in this invention; Figure 4 This is a schematic diagram of an embodiment of the specular rendering device for an eyeball model in this invention. Detailed Implementation

[0012] This invention provides a method, apparatus, device, and storage medium for rendering specular highlights on an eye model. The method involves acquiring an eye texture map from a game development engine and sampling the map to obtain a sampling result. The movement range of highlight points on the eye model is calculated based on the eye model's orientation, the camera direction in the game development engine, and the upward direction in world space. The initial position of the highlight points, calculated based on this movement range, is obtained. Specular rendering is then performed at the initial position of the highlight points on the eye model using a preset physical lighting model combined with the sampling result. This method achieves a realistic highlight effect through a physical lighting model, while also allowing for free setting of the initial position of the highlight points. This makes the physical lighting model independent of the direction of direct light, providing more flexible parameter settings to meet the artist's requirements and improve character quality.

[0013] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the specular rendering method for the eye model in this invention includes: 101. Obtain the eye texture of the eye model in the game development engine, and perform texture sampling on the eye texture to obtain the sampling result; It is understood that the execution subject of this invention can be an eye model specular rendering device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.

[0015] In this embodiment, the game development engine can be Unreal Engine, Unity, NeoX, etc., and the solution can be applied to other game development engines. This application does not limit the game development engine. The sampling result obtained by sampling the eye map is used to implement the eye highlight effect rendering.

[0016] In this embodiment, the step of sampling the eye map to obtain the sampling result includes: obtaining the UV coordinates of the eye model in each two-dimensional plane in the world space based on the position coordinates of the eye model in the world space; and sampling the eye map according to the UV coordinates to obtain the texture of the eye model in each dimensional direction in the world space as the sampling result.

[0017] Specifically, the eye model can be pre-built using 3D modeling software. The pre-built eye model includes information on several mesh vertices. Furthermore, since the vertex information includes the vertex's 3D spatial coordinates and the vertex's normal orientation, the UV coordinates of each vertex in each of the three dimensions (X, Y, and Z directions) can be determined in the shader based on the vertex's 3D spatial coordinates. In other words, the 3D spatial position coordinates include the spatial 3D position coordinates of each vertex in the three dimensions of 3D space. Both left and right eyes can be sampled normally using UVs, and the sampling result is the eye texture.

[0018] It should be noted that in the coordinate description of this scheme, the three-dimensional spatial coordinates can be the model space coordinates where the eyeball model is located, or the world space coordinates. The three dimensions are X dimension, Y dimension and Z dimension, and the corresponding two-dimensional planes are: YZ plane, XZ plane and XY plane.

[0019] 102. Calculate the range of motion of the highlight points on the eye model based on the orientation of the eye model, the camera orientation in the game development engine, and the upward direction in world space; In this embodiment, calculating the movement range of the highlight point on the eyeball model based on the orientation of the eyeball model, the camera direction in the game development engine, and the upward direction of the world space includes: reconstructing a three-dimensional spatial coordinate system based on the orientation of the eyeball model, the camera direction, and the upward direction of the eyeball model in the world space of the game development engine; calculating a movement factor of the highlight point movement range based on vector information in the three-dimensional spatial coordinate system; and interpolating the movement factor to obtain the movement range of the highlight point on the eyeball model.

[0020] Furthermore, the step of reconstructing the three-dimensional spatial coordinate system based on the orientation of the eye model, the camera direction, and the upward direction of the eye model in the world space of the game development engine includes: obtaining the world space matrix in the game development engine, and extracting a first direction vector of the orientation of the eye model from the world space matrix; determining the world space coordinate system of the world space, and generating a second direction vector of the upward direction of the world space coordinate system; generating a third direction vector in the camera direction based on the camera direction in the world space; and reconstructing the three-dimensional spatial coordinate system based on the first direction vector, the second direction vector, and the third direction vector.

[0021] Furthermore, the step of calculating the movement factor of the highlight point movement range based on the vector information in the three-dimensional spatial coordinate system includes: performing a cross product of the first direction vector and the second direction vector, and obtaining a fourth direction vector in the three-dimensional spatial coordinate system based on the cross product result; performing a dot product of the fourth direction vector and the third direction vector, and obtaining the movement factor of the highlight point movement range based on the dot product result.

[0022] Specifically, the real-time orientation vector of the face is first calculated using an array of world space matrices. Then, an upward-facing vector is set, and the face vector and the upward-facing vector are cross-multiplied to obtain a new vector. Finally, the camera's orientation vector is calculated. The algorithm for reconstructing 3D space defines new orientation information, which is used to recalculate the movement range of the highlight. Based on the new orientation information obtained by the cross-multiplication of the face vector and the upward-facing vector defined by the algorithm for reconstructing 3D space, the dot product of the camera's orientation vector is used as the movement factor. Finally, the movement range of the highlight is obtained by interpolation.

[0023] 103. Obtain the initial position of the highlight point calculated based on the movement range of the highlight point, and perform highlight rendering on the eyeball model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results.

[0024] In this embodiment, obtaining the initial position of the highlight point calculated based on the highlight point movement range, and performing highlight rendering on the eye model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results includes: obtaining initial position parameters input by the user; calculating the initial position of the highlight point corresponding to the initial position parameters according to the highlight point movement range; and performing highlight rendering on the eye model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results.

[0025] Specifically, in this embodiment, a specular highlight with a trailing effect is drawn at the initial position of the specular highlight using a GGX-based physical lighting model and a newly created algorithm. A circle is drawn to simulate the effect of a real highlight, so the drawn circle can be placed anywhere, and the initial position of all specular highlights can be freely set. In practical applications, GGX is a micro-surface reflection lighting model. This lighting model can better represent the dissipation (trailing) effect of metallic specular edges. However, the GGX lighting model directly calculates the specular highlights directly illuminating the object, making it impossible to set or change the initial position of the calculated highlights. This embodiment uses the GGX physical lighting model to draw specular highlights with a trailing effect at the calculated initial position of the specular highlight. Furthermore, other physical lighting models can also be used; this invention is not limited to any particular model.

[0026] Furthermore, after performing specular rendering at the initial position of the specular point using a preset physical lighting model combined with the sampling results, the method further includes: acquiring the changed camera direction or direct light direction in real time when the camera direction or direct light direction in the game development engine changes; calculating the real-time position of the specular point on the eyeball model based on the changed camera direction or direct light direction and the initial position of the specular point; and performing specular rendering at the real-time position of the specular point using the physical lighting model combined with the sampling results.

[0027] Specifically, the initial highlight position refers to the position where the direct light just hits the object. This position is generally fixed, but in this embodiment, after algorithm modification, the initial highlight position can be set arbitrarily. The real-time highlight position refers to the position of the highlight as the direct light is rotated to hit the eye model from different angles. When the camera direction or the direction of the direct light changes, the position of the highlight on the eye model needs to be changed. After determining the real-time highlight position based on the initial highlight position and the angle of adjustment of the camera direction or the direction of the direct light, the highlight is rendered again at the real-time highlight position.

[0028] In this embodiment, an eye texture map of the eye model in the game development engine is obtained, and the eye texture map is sampled to obtain a sampling result. The movement range of the highlight point on the eye model is calculated based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in world space. The initial position of the highlight point calculated based on the movement range is obtained, and specular rendering is performed at the initial position of the highlight point on the eye model using a preset physical lighting model combined with the sampling result. This method achieves a realistic highlight effect through a physical lighting model, and the initial position of the highlight point can be freely set, making the physical lighting model independent of the direction of direct light, providing more flexible parameter settings, meeting the artist's effect requirements, and improving character quality.

[0029] The above describes the specular rendering method for the eye model in the embodiments of the present invention. The following describes the specular rendering apparatus for the eye model in the embodiments of the present invention. Please refer to [link / reference]. Figure 2 One embodiment of the specular rendering device for the eye model in this invention includes: The acquisition module 201 is used to acquire the eyeball texture of the eyeball model in the game development engine, and to perform texture sampling on the eyeball texture to obtain the sampling result; The range calculation module 202 is used to calculate the movement range of the highlight point on the eye model based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in the world space. The rendering module 203 is used to obtain the initial position of the highlight point calculated based on the movement range of the highlight point, and to perform highlight rendering on the eyeball model at the initial position of the highlight point by combining the sampling results with a preset physical lighting model.

[0030] In this embodiment of the invention, the eye model specular rendering device runs the aforementioned eye model specular rendering method. The device acquires an eye texture map of the eye model from a game development engine and samples the texture map to obtain a sampling result. Based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in world space, the device calculates the movement range of the highlight points on the eye model. It then obtains the initial position of the highlight points calculated based on the movement range and performs specular rendering at the initial position of the highlight points on the eye model using a preset physical lighting model combined with the sampling result. This method achieves a realistic highlight effect through a physical lighting model, while also allowing for free setting of the initial position of the highlight points. This makes the physical lighting model independent of the direction of direct light, providing more flexible parameter settings to meet the artist's requirements and improve character quality.

[0031] Please see Figure 3A second embodiment of the specular rendering device for the eye model in this invention includes: The acquisition module 201 is used to acquire the eyeball texture of the eyeball model in the game development engine, and to perform texture sampling on the eyeball texture to obtain the sampling result; The range calculation module 202 is used to calculate the movement range of the highlight point on the eye model based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in the world space. The rendering module 203 is used to obtain the initial position of the highlight point calculated based on the movement range of the highlight point, and to perform highlight rendering on the eyeball model at the initial position of the highlight point by combining the sampling results with a preset physical lighting model.

[0032] In this embodiment, the acquisition module 201 is used for: Based on the position coordinates of the eye model in the world space, obtain the UV coordinates of the eye model in each two-dimensional plane in the world space; The eyeball texture is sampled according to the UV coordinates to obtain the texture of the eyeball model in each dimension of the world space as the sampling result.

[0033] In this embodiment, the range calculation module 202 includes: The coordinate system reconstruction unit 2021 reconstructs a three-dimensional spatial coordinate system based on the orientation of the eyeball model, the camera direction, and the upward direction of the eyeball model in the world space of the game development engine. The factor calculation unit 2022 is used to calculate the movement factor of the highlight point movement range based on the vector information in the three-dimensional spatial coordinate system. Interpolation unit 2023 is used to perform interpolation calculation on the movement factor to obtain the movement range of the highlight point on the eyeball model.

[0034] In this embodiment, the coordinate system reconstruction unit 2021 is specifically used for: Obtain the world space matrix from the game development engine, and extract the first direction vector of the eyeball model's orientation from the world space matrix; Determine the world space coordinate system of the world space, and generate a second direction vector for the upward direction of the world space coordinate system; Generate a third-direction vector in the direction of the camera based on the camera orientation in the world space; The three-dimensional spatial coordinate system is reconstructed based on the first direction vector, the second direction vector, and the third direction vector.

[0035] In this embodiment, the factor calculation unit 2022 is specifically used for: Perform a cross product between the first direction vector and the second direction vector, and obtain the fourth direction vector in the three-dimensional spatial coordinate system based on the cross product result. Perform a dot product between the fourth direction vector and the third direction vector, and obtain the movement factor of the highlight point movement range based on the dot product result.

[0036] In this embodiment, the rendering module 203 is specifically used for: Get the initial position parameters input by the user; Based on the range of highlight movement, calculate the initial position of the highlight corresponding to the initial position parameter; Highlight rendering is performed at the initial position of the highlight point on the eyeball model using a preset physical lighting model combined with the sampling results.

[0037] In this embodiment, the eyeball model specular rendering device further includes a moving rendering module 204, which is specifically used for: When the camera direction or direct light direction in the game development engine changes, the changed camera direction or direct light direction is acquired in real time. The real-time position of the highlight point on the eyeball model is calculated based on the changed camera direction or direct light direction and the initial position of the highlight point. Specular rendering is performed at the real-time location of the highlight point using the physical lighting model combined with the sampling results.

[0038] This embodiment, based on the previous embodiment, describes in detail the specific functions of each module. These modules acquire the eyeball texture of the eyeball model from the game development engine and perform texture sampling on the eyeball texture to obtain sampling results. Based on the orientation of the eyeball model, the camera direction in the game development engine, and the upward direction in world space, the movement range of the highlight points on the eyeball model is calculated. The initial position of the highlight points calculated based on the movement range is obtained, and highlight rendering is performed on the initial position of the highlight points on the eyeball model using a preset physical lighting model combined with the sampling results. In this method, a realistic highlight effect is achieved through a physical lighting model. Furthermore, the initial position of the highlight points can be freely set, making the physical lighting model independent of the direction of direct light, allowing for more flexible parameter settings, meeting the artist's effect requirements, and improving character quality.

[0039] above Figure 2 and Figure 3 The specular rendering device for the eye model in this embodiment of the invention is described in detail from the perspective of modular functional entities. The specular rendering device for the eye model in this embodiment of the invention is described in detail from the perspective of hardware processing.

[0040] Figure 4 This is a schematic diagram of the structure of an eye model specular rendering device 400 provided in an embodiment of the present invention. The eye model specular rendering device 400 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 410 (e.g., one or more processors) and a memory 420, and one or more storage media 430 (e.g., one or more mass storage devices) for storing application programs 433 or data 432. The memory 420 and storage media 430 can be temporary or persistent storage. The program stored in the storage media 430 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the eye model specular rendering device 400. Furthermore, the processor 410 may be configured to communicate with the storage media 430 and execute a series of instruction operations on the eye model specular rendering device 400 to achieve the following steps: Obtain the eyeball texture of the eyeball model in the game development engine, and perform texture sampling on the eyeball texture to obtain the sampling result; The range of motion of the highlight point on the eyeball model is calculated based on the orientation of the eyeball model, the camera orientation in the game development engine, and the upward direction of the world space. The initial position of the highlight point is obtained based on the movement range of the highlight point, and the highlight is rendered on the eyeball model at the initial position of the highlight point by combining the sampling results with the preset physical lighting model.

[0041] Optionally, the step of sampling the eyeball texture to obtain the sampling result includes: Based on the position coordinates of the eye model in the world space, obtain the UV coordinates of the eye model in each two-dimensional plane in the world space; The eyeball texture is sampled according to the UV coordinates to obtain the texture of the eyeball model in each dimension of the world space as the sampling result.

[0042] Optionally, calculating the range of motion of the highlight point on the eye model based on the orientation of the eye model, the camera orientation in the game development engine, and the upward direction in world space includes: The three-dimensional spatial coordinate system is reconstructed based on the orientation of the eyeball model, the camera direction, and the upward direction of the eyeball model in the world space of the game development engine; The movement factor of the highlight point's movement range is calculated based on the vector information in the three-dimensional spatial coordinate system. The movement factor is interpolated to obtain the range of movement of the highlight point on the eyeball model.

[0043] Optionally, reconstructing the three-dimensional spatial coordinate system based on the orientation of the eye model, the camera direction, and the upward direction of the eye model in the world space of the game development engine includes: Obtain the world space matrix from the game development engine, and extract the first direction vector of the eyeball model's orientation from the world space matrix; Determine the world space coordinate system of the world space, and generate a second direction vector for the upward direction of the world space coordinate system; Generate a third-direction vector in the direction of the camera based on the camera orientation in the world space; The three-dimensional spatial coordinate system is reconstructed based on the first direction vector, the second direction vector, and the third direction vector.

[0044] Optionally, the step of calculating the movement factor of the highlight point movement range based on the vector information in the three-dimensional spatial coordinate system includes: Perform a cross product between the first direction vector and the second direction vector, and obtain the fourth direction vector in the three-dimensional spatial coordinate system based on the cross product result. Perform a dot product between the fourth direction vector and the third direction vector, and obtain the movement factor of the highlight point movement range based on the dot product result.

[0045] Optionally, obtaining the initial position of the highlight point calculated based on the highlight point movement range, and performing highlight rendering on the eye model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results, includes: Get the initial position parameters input by the user; Based on the range of highlight movement, calculate the initial position of the highlight corresponding to the initial position parameter; Highlight rendering is performed at the initial position of the highlight point on the eyeball model using a preset physical lighting model combined with the sampling results.

[0046] Optionally, after performing specular rendering at the initial position of the specular point using a preset physical lighting model combined with the sampling results, the method further includes: When the camera direction or direct light direction in the game development engine changes, the changed camera direction or direct light direction is acquired in real time. The real-time position of the highlight point on the eyeball model is calculated based on the changed camera direction or direct light direction and the initial position of the highlight point. Specular rendering is performed at the real-time location of the highlight point using the physical lighting model combined with the sampling results.

[0047] The eye model specular rendering device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input / output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 4 The illustrated structure of the eye model specular rendering device does not constitute a limitation on the eye model specular rendering device provided by the present invention. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0048] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the following steps: Obtain the eyeball texture of the eyeball model in the game development engine, and perform texture sampling on the eyeball texture to obtain the sampling result; The range of motion of the highlight point on the eyeball model is calculated based on the orientation of the eyeball model, the camera orientation in the game development engine, and the upward direction of the world space. The initial position of the highlight point is obtained based on the movement range of the highlight point, and the highlight is rendered on the eyeball model at the initial position of the highlight point by combining the sampling results with the preset physical lighting model.

[0049] Optionally, the step of sampling the eyeball texture to obtain the sampling result includes: Based on the position coordinates of the eye model in the world space, obtain the UV coordinates of the eye model in each two-dimensional plane in the world space; The eyeball texture is sampled according to the UV coordinates to obtain the texture of the eyeball model in each dimension of the world space as the sampling result.

[0050] Optionally, calculating the range of motion of the highlight point on the eye model based on the orientation of the eye model, the camera orientation in the game development engine, and the upward direction in world space includes: The three-dimensional spatial coordinate system is reconstructed based on the orientation of the eyeball model, the camera direction, and the upward direction of the eyeball model in the world space of the game development engine; The movement factor of the highlight point's movement range is calculated based on the vector information in the three-dimensional spatial coordinate system. The movement factor is interpolated to obtain the range of movement of the highlight point on the eyeball model.

[0051] Optionally, reconstructing the three-dimensional spatial coordinate system based on the orientation of the eye model, the camera direction, and the upward direction of the eye model in the world space of the game development engine includes: Obtain the world space matrix from the game development engine, and extract the first direction vector of the eyeball model's orientation from the world space matrix; Determine the world space coordinate system of the world space, and generate a second direction vector for the upward direction of the world space coordinate system; Generate a third-direction vector in the direction of the camera based on the camera orientation in the world space; The three-dimensional spatial coordinate system is reconstructed based on the first direction vector, the second direction vector, and the third direction vector.

[0052] Optionally, the step of calculating the movement factor of the highlight point movement range based on the vector information in the three-dimensional spatial coordinate system includes: Perform a cross product between the first direction vector and the second direction vector, and obtain the fourth direction vector in the three-dimensional spatial coordinate system based on the cross product result. Perform a dot product between the fourth direction vector and the third direction vector, and obtain the movement factor of the highlight point movement range based on the dot product result.

[0053] Optionally, obtaining the initial position of the highlight point calculated based on the highlight point movement range, and performing highlight rendering on the eye model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results, includes: Get the initial position parameters input by the user; Based on the range of highlight movement, calculate the initial position of the highlight corresponding to the initial position parameter; Highlight rendering is performed at the initial position of the highlight point on the eyeball model using a preset physical lighting model combined with the sampling results.

[0054] Optionally, after performing specular rendering at the initial position of the specular point using a preset physical lighting model combined with the sampling results, the method further includes: When the camera direction or direct light direction in the game development engine changes, the changed camera direction or direct light direction is acquired in real time. The real-time position of the highlight point on the eyeball model is calculated based on the changed camera direction or direct light direction and the initial position of the highlight point. Specular rendering is performed at the real-time location of the highlight point using the physical lighting model combined with the sampling results.

[0055] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0056] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0057] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for rendering specular highlights on an eyeball model, characterized in that, The method for rendering specular highlights in the eye model includes: Obtain the eyeball texture of the eyeball model in the game development engine, and perform texture sampling on the eyeball texture to obtain the sampling result; The range of motion of the highlight point on the eyeball model is calculated based on the orientation of the eyeball model, the camera orientation in the game development engine, and the upward direction of the world space. Obtain the initial position of the highlight point calculated based on the movement range of the highlight point, and perform highlight rendering on the eyeball model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results; The calculation of the movement range of the highlight point on the eye model based on the orientation of the eye model, the camera orientation in the game development engine, and the upward direction in world space includes: The three-dimensional spatial coordinate system is reconstructed based on the orientation of the eyeball model, the camera direction, and the upward direction of the eyeball model in the world space of the game development engine; The movement factor of the highlight point's movement range is calculated based on the vector information in the three-dimensional spatial coordinate system. The movement factor is interpolated to obtain the range of movement of the highlight point on the eyeball model.

2. The method for rendering specular highlights in an eye model according to claim 1, characterized in that, The sampling of the eyeball texture to obtain the sampling results includes: Based on the position coordinates of the eye model in the world space, obtain the UV coordinates of the eye model in each two-dimensional plane in the world space; The eyeball texture is sampled according to the UV coordinates to obtain the texture of the eyeball model in each dimension of the world space as the sampling result.

3. The method for rendering specular highlights on an eye model according to claim 1, characterized in that, The process of reconstructing the three-dimensional spatial coordinate system based on the orientation of the eye model, the camera direction, and the upward direction of the eye model in the world space of the game development engine includes: Obtain the world space matrix from the game development engine, and extract the first direction vector of the eyeball model's orientation from the world space matrix; Determine the world space coordinate system of the world space, and generate a second direction vector for the upward direction of the world space coordinate system; Generate a third-direction vector in the direction of the camera based on the camera's direction in the world space; The three-dimensional spatial coordinate system is reconstructed based on the first direction vector, the second direction vector, and the third direction vector.

4. The method for rendering specular highlights on an eye model according to claim 3, characterized in that, The step of calculating the movement factor of the highlight point movement range based on the vector information in the three-dimensional spatial coordinate system includes: Perform a cross product between the first direction vector and the second direction vector, and obtain the fourth direction vector in the three-dimensional spatial coordinate system based on the cross product result. Perform a dot product between the fourth direction vector and the third direction vector, and obtain the movement factor of the highlight point movement range based on the dot product result.

5. The method for rendering specular highlights on an eye model according to claim 1, characterized in that, The step of obtaining the initial position of the highlight point calculated based on the highlight point movement range, and performing highlight rendering on the eyeball model at the initial position of the highlight point using a preset physical lighting model combined with the sampling results, includes: Get the initial position parameters input by the user; Based on the range of highlight movement, calculate the initial position of the highlight corresponding to the initial position parameter; Highlight rendering is performed at the initial position of the highlight point on the eyeball model using a preset physical lighting model combined with the sampling results.

6. The method for rendering specular highlights on an eye model according to claim 1, characterized in that, After rendering specular highlights at the initial position of the highlight point using a preset physical lighting model combined with the sampling results, the process further includes: When the camera direction or direct light direction in the game development engine changes, the changed camera direction or direct light direction is acquired in real time. The real-time position of the highlight point on the eyeball model is calculated based on the changed camera direction or direct light direction and the initial position of the highlight point. Specular rendering is performed at the real-time location of the highlight point using the physical lighting model combined with the sampling results.

7. A specular rendering device for an eyeball model, characterized in that, The specular rendering device for the eyeball model includes: The acquisition module is used to acquire the eyeball texture of the eyeball model in the game development engine, and to perform texture sampling on the eyeball texture to obtain the sampling result; The range calculation module is used to calculate the movement range of the highlight point on the eye model based on the orientation of the eye model, the camera direction in the game development engine, and the upward direction in world space. The rendering module is used to obtain the initial position of the highlight point calculated based on the movement range of the highlight point, and to perform highlight rendering on the eyeball model at the initial position of the highlight point by combining the sampling results with a preset physical lighting model; The range calculation module includes: The coordinate system reconstruction unit reconstructs a three-dimensional spatial coordinate system based on the orientation of the eyeball model, the camera direction, and the upward direction of the eyeball model in the world space of the game development engine. The factor calculation unit is used to calculate the movement factor of the highlight point movement range based on the vector information in the three-dimensional spatial coordinate system. An interpolation unit is used to perform interpolation calculations on the movement factor to obtain the range of movement of the highlight point on the eyeball model.

8. A specular rendering device for an eyeball model, characterized in that, The specular rendering device for the eye model includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the eye model specular rendering device to perform the steps of the eye model specular rendering method as described in any one of claims 1-6.

9. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the eye model specular rendering method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Highlight rendering method and device, medium and electronic equipment

    CN114693860A

  • Virtual character eye rendering method and device, electronic equipment and storage medium

    CN114949863A