Model effect processing method and device, equipment and storage medium
By generating a legal line vector and directly calculating the results of the light, the problem of cumbersome and complicated light calculation in the existing technologies has been solved, and the rapid and efficient model light and shadow effect generation and dynamic scene rendering were realized.
Patent Information
- Application Number
- CN202411410565.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, the manual baking normal map process is cumbersome, not suitable for rapid iteration and large-scale production, and the lighting calculation is complex during runtime, with high hardware performance requirements, and lacks flexibility and real-time performance for dynamic scenes and real-time rendering.
Based on the presets of the target model, the position information of the bone node position is generated to generate the legal line vector, directly calculates the results of the light, skipped the baking and transmitted process of the method, reducing the dependence on the external sticker, and the repetitiveness and consistency of the production process.
Realize the effect of rapidly generating models, reduce time and labor costs, improve the efficiency and consistency of the production process, and enhance the flexibility and real -time rendering of dynamic scenes and real -time rendering.
Smart Images

Figure CN119379888A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a model effect processing method, device, equipment and storage medium. Background Art
[0002] In the field of three-dimensional graphics rendering, light and shadow effects are the key to creating visual realism. In the prior art, light and shadow effects can be generated through static normal maps and lighting models. The static normal map method requires first making a smooth normal model, and then passing the smooth normal model to the model that needs to be modified to adjust and change the model normal, and then generating light and shadow effects based on the adjusted normal. The lighting model method requires first making a high-polygon, high-detail high-poly model and a low-polygon model that needs to be adjusted to find the effect, and then using baking software to bake the details of the high-poly model into a normal map based on the normal direction of the low-poly model, and finally performing lighting calculations based on the normal map to generate light and shadow effects.
[0003] However, the production process of the normal model in the static normal map method is complicated, and the normal model needs to be manually adjusted in real time during the transmission process. The manual baking process of the normal map in the lighting model method is cumbersome and not suitable for rapid iteration and large-scale production. The lighting calculation is complex during runtime and has high requirements on hardware performance. In addition, the existing methods lack sufficient flexibility and real-time performance for dynamic scenes and real-time rendering. Summary of the invention
[0004] The purpose of this application is to provide a model effect processing method, device, equipment and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problems in the prior art that the manual baking normal map process is cumbersome, not suitable for rapid iteration and large-scale production, and the lighting calculation is complex at runtime, with high requirements on hardware performance, and lacks sufficient flexibility and real-time performance for dynamic scenes and real-time rendering.
[0005] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0006] In a first aspect, the present application provides a model effect processing method, the method comprising:
[0007] Based on the position information of a plurality of preset bone nodes in the target model, a fitting normal vector of the target model is generated, wherein each of the preset bone nodes is a bone node that is not coplanar with each other;
[0008] Determine an illumination result of the target model according to the fitted normal vector and an illumination vector of the target model in a preset scene, wherein the illumination result is used to characterize an illumination effect of the target model under the action of the illumination vector of the preset scene;
[0009] The target model is rendered and displayed based on the illumination result.
[0010] In a second aspect, the present application provides a model effect processing device, the device comprising:
[0011] A vector generation module, used for generating a fitting normal vector of the target model based on position information of a plurality of preset bone nodes in the target model, wherein each of the preset bone nodes is a bone node that is not coplanar with each other;
[0012] A result generating module, used to determine the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, wherein the illumination result is used to characterize the illumination effect of the target model under the action of the illumination vector of the preset scene;
[0013] A rendering and display module is used to render and display the target model based on the illumination result.
[0014] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the model effect processing method as described in any one of the first aspects.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the model effect processing method as described in any one of the first aspects are executed.
[0016] The beneficial effects of the present application are: the present application does not require the user to manually bake the normals, nor does it require normal transfer. Instead, the fitting normal vector of the target model is calculated directly based on the position information of the preset bone nodes of the target model, eliminating the reliance on external maps, thereby reducing memory usage and data transmission. In addition, the method of the present application skips the normal baking process, further saving time and labor costs, speeding up the production process of model lighting effects, automatically calculating the fitting normal vector based on the position information of the bones, and also improving the repeatability and consistency of the production process. When applied to dynamic scenes and real-time rendering, the method of the present application does not need to re-bake or import a large number of map resources, but instead adjusts the fitting normal vector in real time or performs real-time calculations based on the new illumination vector, thereby re-obtaining the illumination result of the target model, with better flexibility and real-time performance.
[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flow chart of a model effect processing method provided in an embodiment of the present application is shown;
[0020] Figure 2 A flow chart for generating a fitted normal vector provided by an embodiment of the present application is shown;
[0021] Figure 3 A schematic diagram of a target model and a fitting sphere provided in an embodiment of the present application is shown;
[0022] Figure 4 A flow chart for determining a fitting sphere provided in an embodiment of the present application is shown;
[0023] Figure 5 A flowchart of another method of generating a fitted normal vector provided by an embodiment of the present application is shown;
[0024] Figure 6 A flowchart of another method of generating a fitted normal vector provided by an embodiment of the present application is shown;
[0025] Figure 7 A flowchart of another method of generating a fitted normal vector provided by an embodiment of the present application is shown;
[0026] Figure 8 A flowchart of another method of generating a fitted normal vector provided by an embodiment of the present application is shown;
[0027] Fig. 9 A flowchart of another method of generating a fitted normal vector provided by an embodiment of the present application is shown;
[0028] Fig.10 A flow chart for generating a lighting result provided by an embodiment of the present application is shown;
[0029] Fig.11 A schematic diagram of the structure of a model effect processing device provided in an embodiment of the present application is shown;
[0030] Fig.12A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0031] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0032] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0033] When generating the light and shadow effects of a model, the prior art includes two methods: static normal map and lighting model.
[0034] Static normal mapping means making a smooth normal model first, and then transferring the smooth model normal to the model that needs to be modified. During the transfer process, the smooth normal model needs to be adjusted in real time to ensure the best normal effect.
[0035] However, when using this method to achieve lighting effects, it is necessary to manually bake the normal map, which is a cumbersome process and not suitable for rapid iteration and large-scale production. It lacks sufficient flexibility and real-time performance for dynamic scenes and real-time rendering.
[0036] The lighting model means first making a high-polygon model with high polygon count and high details, then making a low-polygon model that needs to adjust the normal effect, and then using baking software to bake the details of the high-polygon model into a normal map, and finally passing the normal map into the tool to calculate the light and shadow information.
[0037] However, this method requires lighting calculations to be performed at runtime, which has high requirements on hardware performance and is not conducive to cross-platform compatibility. It also lacks sufficient flexibility and real-time performance for dynamic scenes and real-time rendering.
[0038] Based on this, the present application proposes a model effect processing method, which automatically calculates the position information of the character's bones based on an algorithm, fits the normals suitable for rendering, skips the time-consuming and labor-intensive process of manual baking and normal transfer, achieves smooth light and shadow effects, and improves the efficiency of light and shadow effect generation.
[0039] In one implementation, the method of the present application can be applied to a virtual model in a three-dimensional scene where the lighting angle changes in real time. The fitted normal of the virtual model can be fitted in the design phase, and previewable light and shadow effects can be generated based on the fitted normal in the design phase. Or, the lighting result can be obtained based on the fitted normal of the virtual model and real-time lighting in the running phase, and the lighting effect of the virtual model can be rendered based on the lighting result.
[0040] In the second implementation, the method of the present application can be applied to a virtual model in a two-dimensional scene with a fixed lighting angle and a fixed viewing angle or a virtual model in a three-dimensional display scene. In the design phase, the fitting normal of the virtual model is obtained, and the light and shadow calculation results are generated according to the fitting normal and the current lighting, and in the game running phase, the lighting effect of the virtual model is rendered based on the light and shadow calculation results.
[0041] Next, combine Figure 1 The model effect processing method of the present application is described. The method can be applied to game engines, such as Unreal Engine (UE) UE4, UE5, etc. Figure 1 As shown, the method includes:
[0042] S101. Generate a fitting normal vector of the target model based on position information of a plurality of preset bone nodes in the target model, wherein the preset bone nodes are bone nodes that are not coplanar with each other.
[0043] The target model may be a virtual model of a game character in different postures. In one possible implementation, normals may be generated for the virtual models of the game character in different postures to obtain fitted normal vectors of the virtual models in each posture. In another possible implementation, fitted normal vectors may also be generated for the virtual model of the game character in the initial posture or the binding posture.
[0044] The preset bone nodes may be at least three non-coplanar bone nodes in the virtual model, and the position information of the preset bone nodes may be the world space position coordinates of the preset bone nodes.
[0045] For example, if the virtual model is a human model or a humanoid model, three non-coplanar bone nodes can be determined at the head, waist and foot positions of the virtual model as preset bone nodes. The selection of preset bone nodes is not limited here, but the preset bone nodes can be dispersed in the virtual model to obtain a more reasonable fitting normal vector.
[0046] Optionally, the fitted normal vector can be the normal of each vertex on the surface of the target model, which is used to define the orientation of the vertex or face, and determines the angle and intensity of the light shining on the surface of the target model. The game engine can determine the position and angle of the light shining on the model based on the normal, and the position and angle of the light reflected or refracted on the vertex, so that the game engine can determine how to illuminate the target model. Among them, the normal is perpendicular to the local area of the target model surface. The fitted normal vector can be used to determine the way the light is reflected or refracted on the model, thereby affecting the light and shadow effects of the target model.
[0047] In a possible implementation, the spherical surface is smooth and has a uniform transition, so a sphere that wraps the target model can be fitted based on preset bone nodes, and then the fitting normal vector of the target model can be determined based on the normal of the sphere.
[0048] S102, determining an illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, where the illumination result is used to characterize an illumination effect of the target model under the action of the illumination vector of the preset scene.
[0049] Among them, the illumination vector of the target model in the preset scene can describe the relative position relationship between the surface of the target model and the direction of the light source. According to the fitted normal vector of each vertex and the illumination vector in the preset scene, the illumination result of each vertex can be determined. The preset scene can be a design scene in the game design stage, or a game scene where the target model is currently located in the game running stage. Taking the game running stage as an example, there can be at least one light source in the game scene where the target model is currently located, and the illumination vector of the target model in the preset scene can describe the relative position relationship between the surface of the target model and the light source in the current game scene.
[0050] Optionally, the illumination result is used to characterize the illumination effect of the vertices of the target model under the action of the illumination vector of the preset scene. In a possible implementation, the illumination result can be the dot product result of the fitted normal vector of the vertex and the illumination vector, and the dot product result is used to characterize whether the fitted normal vector is the same as the illumination vector, thereby obtaining the degree of illumination of the model surface.
[0051] For example, when the fitted normal vector and the illumination vector are the same, the model surface will be affected by the illumination. When the fitted normal vector and the illumination vector are opposite, the model surface will not be affected by the illumination. Based on this, the brightness of the model surface can be adjusted according to the positive and negative value of the dot product result, thereby achieving a more realistic lighting effect.
[0052] As a possible implementation method, after the fitted normal vector of the target model is determined, the illumination vector can be changed in real time. At this time, the illumination result of the target model can be recalculated based on the new illumination vector and the fitted normal vector.
[0053] As another possible implementation method, when the illumination vector remains unchanged, the fitted normal vector of the target model is in the same coordinate system. In one possible implementation method, the user can adjust the coordinate system of the target model to adjust the direction of the fitted normal vector of the target model, thereby affecting the illumination effect of the target model.
[0054] For example, the initial coordinate system positive direction of the fitted normal vector of the target model is the positive direction of the X-axis. The X-axis can be rotated 0-360° on the Y-axis with the center of the circle through a rotation matrix to change the direction of the fitted normal vector, thereby affecting the lighting effect.
[0055] S103: Render and display the target model based on the illumination result.
[0056] The illumination result can characterize the brightness of each vertex of the target model. By rendering the target model based on the illumination result, the light and shadow effect of the target model under the action of the illumination vector of the preset scene can be obtained.
[0057] It should be noted that the above step S101 can be implemented in the design stage. After determining the fitted normal vector of the target model, if the illumination vector is fixed, steps S102 and S103 can be performed in the design stage to directly determine the illumination result of the target model based on the fitted normal vector and the illumination vector, and render and display the target model based on the illumination result. If the illumination vector is not fixed, steps S102 and S103 can be performed in the running stage to obtain the illumination result of the target model based on the fitted normal vector and the illumination vector.
[0058] Exemplarily, for a scene with a fixed illumination vector and a relatively fixed viewing angle, such as a scene for model preview display, the above steps S101-S103 can be performed in the design stage to obtain and save the rendering result of the target model.
[0059] In an embodiment of the present application, a fitting normal vector of the target model is generated based on position information of multiple preset bone nodes in the target model, wherein each preset bone node is a non-coplanar bone node. According to the fitting normal vector and the illumination vector of the target model in a preset scene, the illumination result of the target model is determined. The illumination result is used to characterize the illumination effect of the target model under the action of the illumination vector of the preset scene, and the target model is rendered and displayed based on the illumination result.
[0060] Compared with the prior art, the method of the present application does not require the user to manually bake the normals, nor does it require normal transfer. Instead, the fitting normal vector of the target model is calculated directly based on the position information of the preset bone nodes of the target model, eliminating the reliance on external maps, thereby reducing memory usage and data transmission. In addition, the method of the present application skips the normal baking process, saving more time and labor costs, speeding up the production process of the model's light and shadow effects, automatically calculating the fitting normal vector based on the position information of the bones, and also improving the repeatability and consistency of the production process. When applied to dynamic scenes and real-time rendering, the method of the present application does not need to re-bake or import a large amount of map resources, but instead adjusts the fitting normal vector in real time or performs real-time calculation based on the new illumination vector, thereby re-obtaining the illumination result of the target model, with better flexibility and real-time performance.
[0061] Furthermore, the process of generating the fitted normal vector of the target model based on the position information of multiple preset bone nodes in the target model includes:
[0062] Based on the position information of multiple preset bone nodes and the material processing module in the game engine, the fitting normal vector of the target model is generated.
[0063] The material processing module in the game engine is used to process material-related calculations. For example, the material processing module can be a material blueprint in the game engine, which is used to provide a visual interface so that users can create nodes in the material blueprint and achieve complex material effects by creating and modifying nodes. The material processing module can calculate the position information of multiple preset bone nodes of the target model to obtain the fitted normal vector of the target model.
[0064] In the embodiment of the present application, the material processing module directly performs calculation based on the position information of the preset bone nodes, which can eliminate the reliance on external normal maps, thereby reducing the use of memory and data transmission. In addition, the material processing module in the game engine directly calculates, so that the calculation process runs directly on the GPU, reducing the need for data transmission between the server and the client.
[0065] The following is a further explanation of the above-mentioned fitting normal vector of the target model obtained by fitting in the material processing module of the target model based on the position information of multiple preset bone nodes in the target model, such as Figure 2 As shown, the step includes:
[0066] S201. The position information of a plurality of preset bone nodes is transmitted to a material processing module, and the material processing module performs calculation based on the position information of each preset bone node to obtain a fitting sphere of a target model.
[0067] Taking the game engine UE4 as an example, create a C++ processing module in UE4 to automatically obtain the world position of the bone. Use the Get Bone Location By Name node to obtain the corresponding world space position according to the bone name, and use the Set MPC Vector Parameter Value node to pass the position information to the material processing module.
[0068] It is worth noting that the data calculated by the C++ processing module cannot be directly passed to the material processing module for calculation. At this time, the position information of multiple preset bone nodes can be passed to the material parameter set first, and then passed to the material processing module for subsequent calculation.
[0069] Optionally, the fitting sphere of the target model may be a sphere that encloses the entire target model. Figure 3 , is a schematic diagram of a target model and a fitting sphere provided in the present application. The target model is completely wrapped inside the fitting sphere, and the center of the fitting sphere is located inside the target model.
[0070] S202 , performing fitting calculation based on the normal vector of the fitting sphere and the target model to obtain a fitting normal vector of the target model.
[0071] The normal vector of the fitted sphere may be a vector from the center of the fitted sphere to the fitted sphere surface point A. The normal vector is perpendicular to the tangent plane of the fitted sphere point A and points to the outside of the spherical surface.
[0072] As a possible implementation, the normal vector of the fitting sphere can be modified to obtain the fitting normal vector of the target model. In another possible implementation, the normal vector of the fitting sphere and the initial normal of the target model can also be fitted and calculated to obtain the fitting normal vector of the target model.
[0073] The above process of transmitting the position information of multiple preset bone nodes to the material processing module includes:
[0074] The position information of the plurality of preset bone nodes is stored in a target container in the game engine, and the material processing module obtains the position information of the plurality of preset bone nodes from the target container.
[0075] The target container can be used to store the position information of the preset bone nodes. The target container is set in the game engine. In a possible implementation, the C++ processing module can obtain the position information of the preset bone nodes according to the names of the preset bone nodes, and store the position information of the preset bone nodes in the target container, so that the material processing module can obtain the position information of multiple preset bone nodes from the target container, and reduce the need for data transmission between the server and the client.
[0076] It is worth noting that the target container only stores information and does not change the content of the information. The target container can also be connected to other links in the design process. For example, the rendering process and the lighting process can also directly obtain information from the target container and perform calculations.
[0077] The following is a further description of the above calculation based on the position information of each preset bone node to obtain the fitting sphere of the target model, such as Figure 4 As shown, the above step S201 includes:
[0078] S401. Calculate based on the position information of each preset skeleton node to obtain the position of the target point, and use the position of the target point as the center position of the fitted sphere.
[0079] The preset bone nodes are at least three non-coplanar points. Based on the three non-coplanar points, a unique sphere can be fitted. Assuming that the position coordinates of the preset bone nodes are A(x1,y1,z1), B(x2,y2,z2) and C(x3,y3,z3), the position of the target point (x,y,z) can be calculated by solving the following set of equations.
[0080] (x1-x) 2 +(y1-y) 2 +(z1-z) 2 =r 2
[0081] (x2-x) 2 +(y2-y) 2 +(z2-z) 2 =r 2
[0082] (x3-x) 2 +(y3-y) 2 +(z3-z) 2 =r 2
[0083] Or the position of the target point can be obtained by solving the following set of equations.
[0084]
[0085] Among them, m and n are the normal vectors of the line passing through points A and B, and r is the radius of the sphere. After determining the normal vector and the radius of the sphere, the position of the center of the sphere can be determined based on the normal vector and the radius of the sphere.
[0086] S402: Calculate based on the position information of each preset bone node to obtain the length of the target radius, and use the length of the target radius as the radius of the fitted sphere.
[0087] After obtaining the center position (x, y, z) of the sphere, the radius of the fitted sphere can be calculated using the following formula.
[0088]
[0089] The center position and radius of the sphere can uniquely determine the fitting sphere. After the fitting sphere is determined, a fitting calculation can be performed based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model, such as Figure 5 As shown, the above steps include:
[0090] S501 , connecting the center of the fitted sphere and the first vertex of the target model to obtain a connecting line of the first vertex.
[0091] S502: Determine a fitted normal vector of the first vertex according to the connecting line and the normal vector of the fitted sphere.
[0092] Optionally, after obtaining the position of the center of the sphere, the normal vector N of any point P on the fitted sphere on the spherical surface can be calculated. The normal vector is perpendicular to the vector from the center of the sphere to the point P. The calculation method is shown in the following formula. Wherein, point O is the center of the sphere.
[0093]
[0094] The first vertex may be any point on the target model. When determining the fitted normal vector of the target model, all vertices of the target model may be traversed, and for each vertex, the vertex and the center of the fitted sphere are connected respectively, and the fitted normal vector of each vertex is determined based on the connecting line of each vertex and the normal vector of the fitted sphere.
[0095] Further, such as Figure 6 As shown, the process of determining the fitted normal vector of the first vertex according to the connecting line and the normal vector of the fitted sphere in the above step S502 includes:
[0096] S601: Determine a first normal vector that meets a first preset requirement with respect to the connecting line.
[0097] The first preset requirement may be the same direction as the connection line, or approximately parallel, for example, the distance between any two points on the connection line and the first normal vector is less than a preset distance threshold, and the distance difference is less than a preset distance difference threshold.
[0098] S602: Perform fitting calculation on the first normal vector and the connecting line to obtain a fitting normal vector of the first vertex.
[0099] By fitting and calculating the normal vectors on the fitted sphere and the connecting lines between each vertex and the center of the circle, the fitted normal vectors of each vertex of the target model can be obtained. Since the normal vectors of the sphere are uniform, the fitted normal vectors determined based on the normal vectors of the sphere and the connecting lines are also uniformly distributed.
[0100] The above process of fitting the first normal vector and the connecting line to obtain the fitting normal vector of the first vertex is as follows: Figure 7 As shown, including:
[0101] S701. Fit a first normal vector and a connecting line to obtain a first initial fitting normal vector.
[0102] S702: Determine the direction of a first initial fitting normal vector based on the first vertex to obtain a fitting normal vector of the first vertex.
[0103] The fitting of the first normal vector and the connecting line may be performed by taking the points of the first normal vector and the connecting line as a data point set, and performing fitting calculation on the data point set to obtain the first initial fitting normal vector.
[0104] As a possible implementation method, after determining the first initial fitting normal vector, the connecting line between the first vertex and the center of the circle can be extended to a straight line, the two intersection points M and N of the extended straight line and the fitting sphere are determined, and it is determined which of the two intersection points is closest to the vertex of the model. The direction of the vertex and the intersection point that is closer is used as the direction of the first initial fitting normal vector.
[0105] In the second implementation method of performing fitting calculation based on the normal vector of the fitted sphere and the target model to obtain the fitted normal vector of the target model, the normal of the target model can also be corrected based on the normal vector of the fitted sphere to obtain the fitted normal vector of the target model, such as Figure 8 As shown, the above step S202 includes:
[0106] S801, determining a second normal vector in the fitting sphere that satisfies a second preset condition with respect to a first target normal vector of the target model.
[0107] The first target normal vector may be a normal vector of any vertex in the target model. The second preset condition may be that the first target normal vector and the second normal vector have the same direction or are approximately parallel.
[0108] S802: Perform fitting calculation on the first target normal vector and the second normal vector to obtain a fitting normal vector of the target model.
[0109] By correcting the normal vector on the target model based on the second normal vector on the fitted sphere, the normal vector of the target model can be made more uniform, thereby achieving a smoother light and shadow effect.
[0110] The following is a further explanation of the above-mentioned fitting calculation of the first target normal vector and the second normal vector to obtain the fitting normal vector of the target model, such as Fig. 9 As shown, the above step S802 includes:
[0111] S901. Perform fitting calculation on the first target normal vector and the second normal vector to obtain a second initial fitting normal vector.
[0112] The fitting calculation of the first target normal vector and the second normal vector can be performed by treating the points on the first target normal vector and the points on the second normal vector as a data point set, and performing the fitting calculation based on the data point set to realize the correction of the first target normal vector and obtain the fitting normal vector of the target model.
[0113] S902: Determine the direction of the second initial fitting normal vector based on the direction of the first target normal vector to obtain a fitting normal vector of the target model.
[0114] The second initial fitting normal vector may be a fitting straight line, the direction of which depends on the direction of the first target normal vector. In a possible implementation, the direction with a smaller angle difference with the first target normal vector may be used as the direction of the second initial fitting vector.
[0115] After determining the fitted normal vector, the illumination result of the target model can be determined based on the fitted normal vector and the illumination vector of the target model, such as Fig.10 As shown, the above step S102 includes:
[0116] S1001. Perform dot multiplication processing on the fitted normal vector and the illumination vector of the target model to obtain the dot product result of each fitted normal vector.
[0117] Taking the UE4 game engine as an example, the Dot node in the material processing module can be used to perform dot multiplication processing on each fitted normal vector and illumination vector of the target model to obtain the dot product results of each fitted normal vector.
[0118] S1002: Binarize the dot product result to obtain the illumination result of the target model.
[0119] After binarization of the dot product result, the dot product result can be limited to a preset threshold range, such as a range of 0 to 0.5, to obtain the illumination result of the target model. The illumination result is rendered to obtain the light and shadow effect of the target model.
[0120] It should be noted that after the above-mentioned determination of the fitted normal vector, the fitted normal vector can also be adjusted to change the light and shadow effect of the target model. After the above-mentioned generation of the fitted normal vector of the target model based on the position information of multiple preset bone nodes in the target model, it also includes:
[0121] In response to the normal adjustment operation, the fitted normal vector of the target model is adjusted to the target position to obtain a new fitted normal vector.
[0122] The normal adjustment operation may be an operation of adjusting the coordinate system of the fitted normal vector. After the user adjusts the coordinate system of the fitted normal vector in the graphical user interface, the game engine may determine the rotation matrix based on the adjustment angle, and then calculate the adjusted coordinate system and the positions of each fitted normal vector in the coordinate system based on the rotation matrix and the initial coordinate system.
[0123] The above process of determining the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in the preset scene includes:
[0124] Based on the new fitted normal vector and the illumination vector of the target model, an illumination result of the target model is generated.
[0125] After obtaining the new fitted normal vector, the new fitted normal vector and the illumination vector of the target model may be dot-multiplied and binarized to obtain the illumination result of the target model.
[0126] In the embodiment of the present application, by rotating the axis of the fitted normal vector, the target model light and shadow effects can be dynamically updated. In this process, there is no need to re-make the normal map or perform manual baking, which simplifies the process of generating the target model normal and improves the efficiency of generating light and shadow effects.
[0127] Based on the same inventive concept, a model effect processing device corresponding to the model effect processing method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned model effect processing method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0128] Fig.11 A schematic diagram of the structure of a model effect processing device provided in an embodiment of the present application is shown.
[0129] A vector generation module 1101 is used to generate a fitting normal vector of the target model based on position information of a plurality of preset bone nodes in the target model, wherein each preset bone node is a bone node that is not coplanar with each other;
[0130] A result generation module 1102 is used to determine the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in the preset scene, where the illumination result is used to characterize the illumination effect of the target model under the action of the illumination vector of the preset scene;
[0131] The rendering and display module 1103 is used to render and display the target model based on the illumination result.
[0132] In a feasible implementation, the vector generation module 1101 is used to:
[0133] Based on the position information of multiple preset bone nodes and the material processing module in the game engine, the fitting normal vector of the target model is generated.
[0134] In a feasible implementation, the vector generation module 1101 is used to:
[0135] The position information of the plurality of preset bone nodes is transmitted to the material processing module, and the material processing module performs calculation based on the position information of each preset bone node to obtain a fitting sphere of the target model;
[0136] A fitting calculation is performed based on the normal vector of the fitted sphere and the target model to obtain a fitting normal vector of the target model.
[0137] In a feasible implementation, the vector generation module 1101 is used to:
[0138] The position information of the plurality of preset bone nodes is stored in a target container in the game engine, and the material processing module obtains the position information of the plurality of preset bone nodes from the target container.
[0139] In a feasible implementation, the vector generation module 1101 is used to:
[0140] Calculate based on the position information of each preset bone node to obtain the position of the target point, and use the position of the target point as the center position of the fitted sphere;
[0141] The length of the target radius is obtained by calculation based on the position information of each preset bone node, and the length of the target radius is used as the radius of the fitting sphere.
[0142] In a feasible implementation, the vector generation module 1101 is used to:
[0143] Connect the center of the fitted sphere to the first vertex of the target model to obtain a connecting line of the first vertex;
[0144] The fitted normal vector of the first vertex is determined according to the connecting line and the normal vector of the fitted sphere.
[0145] In a feasible implementation, the vector generation module 1101 is used to:
[0146] Determine a first normal vector that satisfies a first preset requirement with respect to the connecting line;
[0147] A fitting calculation is performed on the first normal vector and the connecting line to obtain a fitting normal vector of the first vertex.
[0148] In a feasible implementation, the vector generation module 1101 is used to:
[0149] Fitting the first normal vector and the connecting line to obtain a first initial fitting normal vector;
[0150] The direction of the first initial fitting normal vector is determined based on the first vertex to obtain the fitting normal vector of the first vertex.
[0151] In a feasible implementation, the vector generation module 1101 is used to:
[0152] Determine a second normal vector in the fitting sphere that satisfies a second preset condition with respect to the first target normal vector of the target model;
[0153] A fitting calculation is performed on the first target normal vector and the second normal vector to obtain a fitting normal vector of the target model.
[0154] In a feasible implementation, the vector generation module 1101 is used to:
[0155] Performing fitting calculation on the first target normal vector and the second normal vector to obtain a second initial fitting normal vector;
[0156] The direction of the second initial fitting normal vector is determined based on the direction of the first target normal vector to obtain a fitting normal vector of the target model.
[0157] In a feasible implementation, the result generation module 1102 is used to:
[0158] Perform dot multiplication on the fitted normal vector and the illumination vector of the target model to obtain the dot product results of each fitted normal vector;
[0159] The dot product result is binarized to obtain the illumination result of the target model.
[0160] In a feasible implementation scheme, the vector generation module 1101 is further used for:
[0161] In response to the normal adjustment operation, the fitted normal vector of the target model is adjusted to the target position to obtain a new fitted normal vector;
[0162] The result generation module 1102 is also used for:
[0163] Based on the new fitted normal vector and the illumination vector of the target model, an illumination result of the target model is generated.
[0164] The method of the present application does not require the user to manually bake the normals, nor does it require normal transfer. Instead, the fitting normal vector of the target model is calculated directly based on the position information of the preset bone nodes of the target model, eliminating the reliance on external maps, thereby reducing memory usage and data transmission. In addition, the method of the present application skips the normal baking process, saving more time and labor costs, speeding up the production process of the model's light and shadow effects, automatically calculating the fitting normal vector based on the position information of the bones, and also improving the repeatability and consistency of the production process. When applied to dynamic scenes and real-time rendering, the method of the present application does not need to re-bake or import a large number of map resources, but instead adjusts the fitting normal vector in real time or performs real-time calculations based on the new illumination vector, thereby re-obtaining the illumination result of the target model, with better flexibility and real-time performance.
[0165] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown, including: a processor 1201, a storage medium 1202 and a bus 1203, wherein the storage medium 1202 stores machine-readable instructions executable by the processor 1201. When the electronic device runs the model effect processing method in the embodiment, the processor 1201 communicates with the storage medium 1202 through the bus 1203, and the processor 1201 executes the machine-readable instructions. The processor 1201 performs the preamble of the method item to perform the following steps:
[0166] Based on the position information of a plurality of preset bone nodes in the target model, a fitting normal vector of the target model is generated, wherein the preset bone nodes are bone nodes that are not coplanar with each other;
[0167] Determine the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in the preset scene, where the illumination result is used to characterize the illumination effect of the target model under the action of the illumination vector of the preset scene;
[0168] The target model is rendered and displayed based on the lighting results.
[0169] In a feasible implementation manner, when the processor 1201 generates a fitting normal vector of the target model based on the position information of a plurality of preset bone nodes in the target model, it is specifically used to:
[0170] Based on the position information of multiple preset bone nodes and the material processing module in the game engine, the fitting normal vector of the target model is generated.
[0171] In a feasible implementation, the processor 1201, when executing the generation of the fitting normal vector of the target model based on the position information of a plurality of preset skeleton nodes and the material processing module in the game engine, is specifically used to:
[0172] The position information of the plurality of preset bone nodes is transmitted to the material processing module, and the material processing module performs calculation based on the position information of each preset bone node to obtain a fitting sphere of the target model;
[0173] A fitting calculation is performed based on the normal vector of the fitted sphere and the target model to obtain a fitting normal vector of the target model.
[0174] In a feasible implementation manner, when the processor 1201 executes the transmission of the position information of the plurality of preset skeleton nodes to the material processing module, it is specifically used to:
[0175] The position information of the plurality of preset bone nodes is stored in a target container in the game engine, and the material processing module obtains the position information of the plurality of preset bone nodes from the target container.
[0176] In a feasible implementation scheme, when the processor 1201 performs the calculation by the material processing module based on the position information of each preset bone node to obtain the fitting sphere of the target model, it is specifically used to:
[0177] Calculate based on the position information of each preset bone node to obtain the position of the target point, and use the position of the target point as the center position of the fitted sphere;
[0178] The length of the target radius is obtained by calculation based on the position information of each preset bone node, and the length of the target radius is used as the radius of the fitting sphere.
[0179] In a feasible implementation manner, when the processor 1201 performs fitting calculation based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model, it is specifically used to:
[0180] Connect the center of the fitted sphere to the first vertex of the target model to obtain a connecting line of the first vertex;
[0181] The fitted normal vector of the first vertex is determined according to the connecting line and the normal vector of the fitted sphere.
[0182] In a feasible implementation manner, when the processor 1201 determines the fitted normal vector of the first vertex according to the connecting line and the normal vector of the fitted sphere, it is specifically used to:
[0183] Determine a first normal vector that satisfies a first preset requirement with respect to the connecting line;
[0184] A fitting calculation is performed on the first normal vector and the connecting line to obtain a fitting normal vector of the first vertex.
[0185] In a feasible implementation manner, when the processor 1201 performs fitting calculation on the first normal vector and the connecting line to obtain the fitting normal vector of the first vertex, it is specifically used to:
[0186] Fitting the first normal vector and the connecting line to obtain a first initial fitting normal vector;
[0187] The direction of the first initial fitting normal vector is determined based on the first vertex to obtain the fitting normal vector of the first vertex.
[0188] In a feasible implementation manner, when the processor 1201 performs fitting calculation based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model, it is specifically used to:
[0189] Determine a second normal vector in the fitting sphere that satisfies a second preset condition with respect to the first target normal vector of the target model;
[0190] A fitting calculation is performed on the first target normal vector and the second normal vector to obtain a fitting normal vector of the target model.
[0191] In a feasible implementation manner, when the processor 1201 performs fitting calculation on the first target normal vector and the second normal vector to obtain the fitting normal vector of the target model, it is specifically used to:
[0192] Performing fitting calculation on the first target normal vector and the second normal vector to obtain a second initial fitting normal vector;
[0193] The direction of the second initial fitting normal vector is determined based on the direction of the first target normal vector to obtain a fitting normal vector of the target model.
[0194] In a feasible implementation manner, when the processor 1201 determines the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, it is specifically used to:
[0195] Perform dot multiplication on the fitted normal vector and the illumination vector of the target model to obtain the dot product results of each fitted normal vector;
[0196] The dot product result is binarized to obtain the illumination result of the target model.
[0197] In a feasible implementation manner, after executing the process of generating the fitting normal vector of the target model based on the position information of a plurality of preset bone nodes in the target model, the processor 1201 is further configured to:
[0198] In response to the normal adjustment operation, the fitted normal vector of the target model is adjusted to the target position to obtain a new fitted normal vector;
[0199] In a feasible implementation manner, when the processor 1201 determines the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, it is specifically used to:
[0200] Based on the new fitted normal vector and the illumination vector of the target model, an illumination result of the target model is generated.
[0201] The method of the present application does not require the user to manually bake the normals, nor does it require normal transfer. Instead, the fitting normal vector of the target model is calculated directly based on the position information of the preset bone nodes of the target model, eliminating the reliance on external maps, thereby reducing memory usage and data transmission. In addition, the method of the present application skips the normal baking process, saving more time and labor costs, speeding up the production process of the model's light and shadow effects, automatically calculating the fitting normal vector based on the position information of the bones, and also improving the repeatability and consistency of the production process. When applied to dynamic scenes and real-time rendering, the method of the present application does not need to re-bake or import a large number of map resources, but instead adjusts the fitting normal vector in real time or performs real-time calculations based on the new illumination vector, thereby re-obtaining the illumination result of the target model, with better flexibility and real-time performance.
[0202] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed when a processor is running, and the processor performs the following steps:
[0203] Based on the position information of a plurality of preset bone nodes in the target model, a fitting normal vector of the target model is generated, wherein the preset bone nodes are bone nodes that are not coplanar with each other;
[0204] Determine the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in the preset scene, where the illumination result is used to characterize the illumination effect of the target model under the action of the illumination vector of the preset scene;
[0205] The target model is rendered and displayed based on the lighting results.
[0206] In a feasible implementation manner, when the processor generates a fitting normal vector of the target model based on the position information of a plurality of preset bone nodes in the target model, the processor is specifically used to:
[0207] Based on the position information of multiple preset bone nodes and the material processing module in the game engine, the fitting normal vector of the target model is generated.
[0208] In a feasible implementation scheme, when the processor generates a fitting normal vector of a target model based on position information of a plurality of preset bone nodes and a material processing module in a game engine, the processor is specifically used to:
[0209] The position information of the plurality of preset bone nodes is transmitted to the material processing module, and the material processing module performs calculation based on the position information of each preset bone node to obtain a fitting sphere of the target model;
[0210] A fitting calculation is performed based on the normal vector of the fitted sphere and the target model to obtain a fitting normal vector of the target model.
[0211] In a feasible implementation manner, when the processor executes the transmission of the position information of the plurality of preset skeleton nodes to the material processing module, the processor is specifically used to:
[0212] The position information of the plurality of preset bone nodes is stored in a target container in the game engine, and the material processing module obtains the position information of the plurality of preset bone nodes from the target container.
[0213] In a feasible implementation scheme, when the processor performs the calculation by the material processing module based on the position information of each preset bone node to obtain the fitting sphere of the target model, it is specifically used to:
[0214] Calculate based on the position information of each preset bone node to obtain the position of the target point, and use the position of the target point as the center position of the fitted sphere;
[0215] The length of the target radius is obtained by calculation based on the position information of each preset bone node, and the length of the target radius is used as the radius of the fitting sphere.
[0216] In a feasible implementation manner, when the processor performs a fitting calculation based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model, it is specifically used to:
[0217] Connect the center of the fitted sphere to the first vertex of the target model to obtain a connecting line of the first vertex;
[0218] The fitted normal vector of the first vertex is determined according to the connecting line and the normal vector of the fitted sphere.
[0219] In a feasible implementation manner, when the processor determines the fitted normal vector of the first vertex according to the connecting line and the normal vector of the fitted sphere, it is specifically used to:
[0220] Determine a first normal vector that satisfies a first preset requirement with respect to the connecting line;
[0221] A fitting calculation is performed on the first normal vector and the connecting line to obtain a fitting normal vector of the first vertex.
[0222] In a feasible implementation manner, when the processor performs fitting calculation on the first normal vector and the connecting line to obtain the fitting normal vector of the first vertex, it is specifically used to:
[0223] Fitting the first normal vector and the connecting line to obtain a first initial fitting normal vector;
[0224] The direction of the first initial fitting normal vector is determined based on the first vertex to obtain the fitting normal vector of the first vertex.
[0225] In a feasible implementation manner, when the processor performs a fitting calculation based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model, it is specifically used to:
[0226] Determine a second normal vector in the fitting sphere that satisfies a second preset condition with respect to the first target normal vector of the target model;
[0227] A fitting calculation is performed on the first target normal vector and the second normal vector to obtain a fitting normal vector of the target model.
[0228] In a feasible implementation manner, when the processor performs fitting calculation on the first target normal vector and the second normal vector to obtain the fitting normal vector of the target model, it is specifically used to:
[0229] Performing fitting calculation on the first target normal vector and the second normal vector to obtain a second initial fitting normal vector;
[0230] The direction of the second initial fitting normal vector is determined based on the direction of the first target normal vector to obtain a fitting normal vector of the target model.
[0231] In a feasible implementation manner, when the processor determines the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, it is specifically used to:
[0232] Perform dot multiplication on the fitted normal vector and the illumination vector of the target model to obtain the dot product results of each fitted normal vector;
[0233] The dot product result is binarized to obtain the illumination result of the target model.
[0234] In a feasible implementation manner, after the processor generates the fitting normal vector of the target model based on the position information of a plurality of preset bone nodes in the target model, the processor is further used to:
[0235] In response to the normal adjustment operation, the fitted normal vector of the target model is adjusted to the target position to obtain a new fitted normal vector;
[0236] In a feasible implementation manner, when the processor determines the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, it is specifically used to:
[0237] Based on the new fitted normal vector and the illumination vector of the target model, an illumination result of the target model is generated.
[0238] The method of the present application does not require the user to manually bake the normals, nor does it require normal transfer. Instead, the fitting normal vector of the target model is calculated directly based on the position information of the preset bone nodes of the target model, eliminating the reliance on external maps, thereby reducing memory usage and data transmission. In addition, the method of the present application skips the normal baking process, saving more time and labor costs, speeding up the production process of the model's light and shadow effects, automatically calculating the fitting normal vector based on the position information of the bones, and also improving the repeatability and consistency of the production process. When applied to dynamic scenes and real-time rendering, the method of the present application does not need to re-bake or import a large number of map resources, but instead adjusts the fitting normal vector in real time or performs real-time calculations based on the new illumination vector, thereby re-obtaining the illumination result of the target model, with better flexibility and real-time performance.
[0239] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.
[0240] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0241] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0242] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0243] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0244] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0245] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A model effect processing method, characterized in that: include: Based on the position information of a plurality of preset bone nodes in the target model, a fitting normal vector of the target model is generated, wherein each of the preset bone nodes is a bone node that is not coplanar with each other; Determine an illumination result of the target model according to the fitted normal vector and an illumination vector of the target model in a preset scene, wherein the illumination result is used to characterize an illumination effect of the target model under the action of the illumination vector of the preset scene; The target model is rendered and displayed based on the illumination result.
2. The method according to claim 1, characterized in that The step of generating a fitting normal vector of the target model based on position information of a plurality of preset bone nodes in the target model comprises: Based on the position information of the plurality of preset skeleton nodes and a material processing module in a game engine, a fitting normal vector of the target model is generated.
3. The method according to claim 2, characterized in that The generating of the fitting normal vector of the target model based on the position information of the plurality of preset skeleton nodes and the material processing module in the game engine comprises: The position information of the plurality of preset bone nodes is transmitted to the material processing module, and the material processing module performs calculation based on the position information of each preset bone node to obtain a fitting sphere of the target model; A fitting calculation is performed based on the normal vector of the fitting sphere and the target model to obtain a fitting normal vector of the target model.
4. The method according to claim 3, characterized in that The step of transmitting the position information of the plurality of preset skeleton nodes to the material processing module comprises: The position information of the plurality of preset bone nodes is stored in a target container in the game engine, and the material processing module obtains the position information of the plurality of preset bone nodes from the target container.
5. The method according to claim 3, characterized in that: The material processing module performs calculation based on the position information of each preset skeleton node to obtain the fitting sphere of the target model, including: Calculate based on the position information of each preset skeleton node to obtain the position of the target point, and use the position of the target point as the center position of the fitting sphere; A calculation is performed based on the position information of each of the preset bone nodes to obtain the length of the target radius, and the length of the target radius is used as the radius of the fitting sphere.
6. The method according to claim 3, characterized in that The performing fitting calculation based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model includes: Connecting the center of the fitted sphere to the first vertex of the target model to obtain a connecting line of the first vertex; A fitting normal vector of the first vertex is determined according to the connecting line and the normal vector of the fitting sphere.
7. The method according to claim 6, characterized in that The step of determining the fitted normal vector of the first vertex according to the connecting line and the normal vector of the fitted sphere comprises: Determine a first normal vector that satisfies a first preset requirement with respect to the connecting line; A fitting calculation is performed on the first normal vector and the connecting line to obtain a fitting normal vector of the first vertex.
8. The method according to claim 7, characterized in that The performing fitting calculation on the first normal vector and the connecting line to obtain the fitted normal vector of the first vertex includes: Fitting the first normal vector and the connecting line to obtain a first initial fitting normal vector; The direction of the first initial fitting normal vector is determined based on the first vertex to obtain the fitting normal vector of the first vertex.
9. The method according to claim 3, characterized in that: The performing fitting calculation based on the normal vector of the fitting sphere and the target model to obtain the fitting normal vector of the target model includes: Determine a second normal vector in the fitting sphere that satisfies a second preset condition with respect to the first target normal vector of the target model; A fitting calculation is performed on the first target normal vector and the second normal vector to obtain a fitting normal vector of the target model.
10. The method according to claim 9, characterized in that The performing fitting calculation on the first target normal vector and the second normal vector to obtain a fitting normal vector of the target model includes: Performing a fitting calculation on the first target normal vector and the second normal vector to obtain a second initial fitting normal vector; The direction of the second initial fitting normal vector is determined based on the direction of the first target normal vector to obtain a fitting normal vector of the target model.
11. The method according to claim 1, characterized in that: The step of determining the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene includes: Performing a dot multiplication process on the fitted normal vector and the illumination vector of the target model to obtain a dot multiplication result of each of the fitted normal vectors; The dot product result is binarized to obtain the illumination result of the target model.
12. The method according to claim 1, characterized in that After generating the fitting normal vector of the target model based on the position information of a plurality of preset bone nodes in the target model, the method further includes: In response to the normal adjustment operation, adjusting the fitted normal vector of the target model to the target position to obtain a new fitted normal vector; Determining an illumination result of the target model according to the fitted normal vector and an illumination vector of the target model in a preset scene includes: An illumination result of the target model is generated based on the new fitting normal vector and the illumination vector of the target model.
13. A model effect processing device, characterized in that: include: A vector generation module, used for generating a fitting normal vector of the target model based on position information of a plurality of preset bone nodes in the target model, wherein each of the preset bone nodes is a bone node that is not coplanar with each other; A result generating module, used to determine the illumination result of the target model according to the fitted normal vector and the illumination vector of the target model in a preset scene, wherein the illumination result is used to characterize the illumination effect of the target model under the action of the illumination vector of the preset scene; A rendering and display module is used to render and display the target model based on the illumination result.
14. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the model effect processing method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the model effect processing method according to any one of claims 1 to 12 are executed.