System, storage medium and device for simulating visual enhancement of reflective effect on the surface of digital three-dimensional model

By introducing a lighting calculation module and a reflection effect simulation module in the three-dimensional model system, combining the contribution rate calculation of texture map images and the Lambert lighting model, the problem of the weak texture detail expression ability of the three-dimensional model under strong lighting conditions is solved, and the details are improved without changing the lighting conditions.

CN119206029BActive Publication Date: 2025-04-29SHENZHEN YIDINGCHUAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411316318.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-04-29
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

Under strong light conditions, the texture detail expression ability of the three-dimensional model will become weak, and it is difficult for the prior art to effectively improve the detail expression ability without changing the lighting conditions.

Method used

By introducing a lighting calculation module, a reflection vector calculation module and a reflection effect simulation module into the system, combining the contribution rate calculation of the texture map image and the Lambert lighting model, the reflection effect simulation of the three-dimensional model surface is enhanced to highlight texture information.

Benefits of technology

Without changing the lighting conditions, the expression ability of the three-dimensional model texture details is significantly improved and the visual effect is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206029B_ABST
    Figure CN119206029B_ABST
Patent Text Reader

Abstract

The system, storage medium and device for visual enhancement of digital three-dimensional model surface reflective effect simulation belong to the field of computer vision technology. In order to solve the problem that the three-dimensional model texture detail expression ability is weakened under lighting conditions, the present invention first calculates the texture map image contribution rate, and obtains the texture map enhanced image based on the contribution to determine the texture features that need to be highlighted, and fuses the object surface color map through the texture map to highlight the texture information of the object surface. Finally, the lighting influence is added through the Lambert lighting model formula to obtain the diffuse reflection color, and then the reflection vector is calculated and the reflective effect is simulated to achieve the visual enhancement of the three-dimensional model surface reflective effect simulation. The present invention can improve the three-dimensional model texture detail expression ability without changing the lighting conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision technology, and in particular relates to a visual enhancement system, storage medium and device for model reflective effect. Background Art

[0002] In the field of computer vision technology, digital three-dimensional models are a very critical processing direction. Digital three-dimensional models obtain the three-dimensional morphological information of objects through three-dimensional reconstruction. The existing three-dimensional model simulation and visual effect presentation systems can effectively and realistically simulate three-dimensional model objects, but when it comes to the need to simulate 3D objects in natural scenes, including 3D games and 3D animations, there is often a need to strictly consider the impact of light on the surface of the three-dimensional model. Although the existing three-dimensional model simulation and visual effect presentation methods can simulate the reflective effect of the three-dimensional model, when encountering a stronger lighting environment, the reflective effect of the general three-dimensional model will be white because the local image has a strong reflective effect, which weakens or loses the texture information of the three-dimensional model, resulting in a weakened ability to present details. When encountering such a situation that requires illumination, especially a specific environment with strong illumination, the current general processing method is "like this" (i.e. no special processing is performed), and it is generally believed that under strong illumination, the object itself should be "missing details" to a certain extent. For example, when we look at objects outdoors in the summer with strong illumination, it is not easy to see the details clearly. However, it should be noted that the reason why we subjectively think that "details are missing" when looking at objects in this truly natural strong light environment is that our instinctive through-hole contraction is essentially to reduce the amount of light entering and avoid damage to the eyes, but it does not mean that the details are really missing. For example, when we use two cameras, especially the cameras that come with two different mobile phones, to collect images, even if we think that the pixels of the two are the same, due to the differences in aperture adjustment and photosensitive elements, they will definitely present completely different effects. Some image details will be presented more clearly, while the details of the other may not be so clear. Therefore, it is not appropriate to use this method to process objects in images or three-dimensional views. Moreover, when there is a need, such as highlighting certain themes, emotions, or rendering the atmosphere of the environment, it is necessary to display the details under lighting conditions; or when it is necessary to display the details under contrast conditions for the needs of visual senses, this "lack of details" needs to be considered and improved. In fact, in the existing methods, the influence of lighting on texture details can be reduced by weakening the lighting to a certain extent, but this is obviously a last resort. Therefore, a method is needed to improve the ability to express texture details without changing the lighting conditions as much as possible. Summary of the invention

[0003] In order to solve the problem that the ability to express the texture details of a three-dimensional model becomes weak under lighting conditions, the present invention provides a method for simulating visual enhancement of the reflective effect on the surface of a three-dimensional model.

[0004] A system for visual enhancement of digital three-dimensional model surface reflective effect simulation, which at least includes an illumination calculation module, a reflection vector calculation module and a reflective effect simulation module; wherein

[0005] Lighting calculation module: According to the loaded 3D model data, the angle relationship between the light intensity and the 3D model surface is calculated to determine the light contribution; the specific process includes the following steps:

[0006] First, determine all vertices based on the face data, traverse the vertices and normals of the 3D model, and use the zip function to combine the two lists into a tuple list, each tuple contains a vertex and a normal; calculate the distance from the light source to the vertex, and calculate the light source direction vector based on the distance from the light source to the vertex;

[0007] Calculate the dot product dot_product of the light source direction vector and the vertex normal, denoted as d p , judge d p Is it greater than 0? If the dot product is greater than 0, it means that the angle between the light source direction and the vertex normal is less than 90 degrees, that is, the light source is in front of the vertex and the vertex is affected by the light source; if the dot product is not greater than 0, it means that the light source is behind or directly below the vertex and the vertex is not affected by the light source;

[0008] Use light.intensity to represent the intensity of the light source, denoted as l i ; Use light_distance to represent the light source distance, denoted as l d , light_contribution is used to represent the lighting contribution, denoted as l c ; When a vertex is affected by a light source, calculate the lighting contribution l c =d p *l i / l d 2 ; Vertices are not affected by light sources to calculate lighting contribution l c =0; add the lighting contribution to the light_effect list, and represent the lighting contribution of all points in the list as the lighting contribution map L2;

[0009] Reflection vector calculation module: obtains diffuse reflection color based on the object surface color map L0, texture map image L1 and illumination contribution map L2; the specific process includes the following steps:

[0010] First, the texture map image L1 is processed as follows to obtain the texture map enhanced image L1′:

[0011]

[0012] in, Represents the value of the nth channel of L1, n∈{r,g,b}; Texture map image channel contribution rate, is the intermediate variable, Indicates r, g, b The minimum value of

[0013] Then, based on the object surface color map L0 and the texture map enhanced image L1′, the fusion calculation is performed according to the following formula:

[0014] L c =L0+L1′

[0015] Among them, L c represents the fused image;

[0016] Based on the Lambert lighting model, the diffuse color is obtained:

[0017] Diffuse=L2×L c ×Reflection

[0018] Reflection effect simulation module: Based on the diffuse color, the reflection is calculated in the screen space, the depth buffer and normal buffer are used to trace the path of the light in the screen space, obtain the reflection information, and generate the reflection effect.

[0019] Furthermore, the system for visual enhancement of digital three-dimensional model surface reflective effect simulation also includes a rendering module; the rendering module performs rendering based on the reflective effect generated by the reflective effect simulation module, and calculates the final color output in combination with a shader.

[0020] Furthermore, the system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model also includes a three-dimensional model loading module for loading three-dimensional model data.

[0021] Furthermore, the three-dimensional model loading module includes:

[0022] 3D model reading unit: loads different types of 3D model files according to the provided file path; in the process of recording the 3D model, the file format is judged and determined through the conditional function, and the corresponding function is called to load the 3D model;

[0023] Spatial geometry data extraction unit: used to extract spatial geometry features of a three-dimensional model, wherein the spatial geometry features include vertices, texture coordinates, normals and surface data;

[0024] Material property extraction unit: used to extract material properties of 3D models.

[0025] Furthermore, in the 3D model loading unit, file_path is used to represent the path of the 3D model file;

[0026] By checking whether the file_path string ends with .obj, if it does, it means that this is a 3D model file in OBJ format. The function will call the load_obj function and pass in the file_path, and then return the result of the load_obj function; here, it is assumed that load_obj is a pre-defined function used to load 3D models in OBJ format;

[0027] Then check if the file path ends with .fbx. If so, it means this is a 3D model file in FBX format. The function will call the load_fbx function and pass in the file_path, and then return the result of the load_fbx function. Here, it is assumed that load_fbx is a pre-defined function used to load 3D models in FBX format.

[0028] Then check whether the file path ends with .gltf. If so, it means that this is a 3D model file in GLTF format. The function will call the load_gltf function and pass in the file_path, and then return the result of the load_gltf function. It is assumed here that load_gltf is a defined function used to load 3D models in GLTF format.

[0029] Furthermore, in the process of extracting the spatial geometric features of the three-dimensional model, the spatial geometric data extraction unit first initializes four empty lists: the vertex data list vertices, the normal data list normals, the texture coordinate data list tex_coords, and the face data list faces; then it traverses each line in the three-dimensional model file, and first determines whether the current line is a vertex, texture coordinate, normal, or face based on the data information of the current line; if it is a vertex, remove the newline character and the separator line at the end of the line, and convert each component of the vertex into a floating point number, and then add it to the vertices list; if it is a texture coordinate or a normal, perform the same processing as the vertex, and add it to the tex_coords list or the normals list accordingly; if it is face data, create a list derivation, convert each vertex index of the face into an integer, adjust it to a Python index, and add it to the faces list.

[0030] Furthermore, in the process of extracting the material properties of the three-dimensional model by the material property extraction unit, an empty dictionary materials is first initialized to store the properties of all materials; then each line in the material property file is traversed, and the data of the material definition content is first determined according to the data information of the current line, and the material name is obtained, and the material name is used as the key and its corresponding attribute dictionary is used as the value to add it to the materials dictionary; the RGB components of the material's object surface color are obtained, converted into floating point numbers, and stored under the 'color' key of the current material in the materials dictionary, and the object surface color representation listed under the 'color' key is used as the object surface color map L0, and the reflection coefficient is stored under the 'specular' key of the current material in the materials dictionary; the texture map of the material is obtained and stored under the 'texture' key of the current material in the materials dictionary, and the texture map representation listed under the 'texture' key is used as the texture map image L1.

[0031] A computer storage medium stores at least one instruction, which is loaded and executed by a processor to execute a system for visual enhancement of digital three-dimensional model surface reflective effect simulation.

[0032] A device for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model, the device comprising a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor, a system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model.

[0033] Beneficial effects:

[0034] The present invention first calculates the contribution rate of the texture map image L1, and obtains the texture map enhanced image based on the contribution to determine the texture features that need to be highlighted, fuses the object surface color map through the texture map to highlight the texture information of the object surface, and finally adds the lighting influence through the Lambert lighting model formula to obtain the diffuse reflection color, and then calculates the reflection vector and simulates the reflection effect to achieve visual enhancement of the reflection effect simulation of the three-dimensional model surface. The present invention can improve the ability to express the texture details of the three-dimensional model without changing the lighting conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A rendering of the visual effects generated using the traditional Lambert lighting model.

[0036] Figure 2 A rendering of the visual effect of simulating visual enhancement of the reflective effect of the present invention.

[0037] Figure 3 for Figure 1 and Figure 2 Detail comparison chart. DETAILED DESCRIPTION Specific implementation method one:

[0039] This embodiment is a system for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model, which includes:

[0040] The 3D model loading module is used to load 3D model data, including:

[0041] 3D model reading unit: loads different types of 3D model files according to the provided file path. In the process of recording the 3D model, the file format is judged and determined through the conditional function, and the corresponding function is called to load the 3D model.

[0042] In the 3D model loading unit, file_path is used to represent the path of the 3D model file;

[0043] By checking whether the file_path string ends with .obj, if it does, it means that this is a 3D model file in OBJ format. The function will call the load_obj function and pass in the file_path, and then return the result of the load_obj function. Here, it is assumed that load_obj is a defined function used to load 3D models in OBJ format.

[0044] Then check if the file path ends with .fbx. If so, it means this is a 3D model file in FBX format. The function will call the load_fbx function and pass in the file_path, and then return the result of the load_fbx function. Here, it is assumed that load_fbx is a defined function for loading 3D models in FBX format.

[0045] Then check if the file path ends with .gltf. If so, it means this is a 3D model file in GLTF format. The function will call the load_gltf function and pass in the file_path, and then return the result of the load_gltf function. Here, it is assumed that load_gltf is a pre-defined function used to load 3D models in GLTF format.

[0046] The above description of the present invention is mainly aimed at the method adopted by the present invention to achieve compatible processing of multiple formats. In fact, the specific processing of this unit can be implemented using the existing file reading method, and the present invention will not go into details about the specific method of reading files.

[0047] Spatial geometry data extraction unit: used to extract the spatial geometry features of the three-dimensional model, wherein the spatial geometry features include vertices, texture coordinates (tex_coords), normals and faces data.

[0048] It should be noted that spatial geometry data is implemented by defining a class. The class of spatial geometry data actually includes four parameters, namely the vertices (vertices), texture coordinates (tex_coords), normals (normals) and faces (faces) data of geometric features. The face data is composed of vertex indices.

[0049] In the process of extracting the spatial geometric features of the 3D model, four empty lists are first initialized: the vertex data list vertices, the normal data list normals, the texture coordinate data list tex_coords, and the face data list faces; then each line in the 3D model file is traversed.

[0050] First, determine whether the current line is a vertex, texture coordinate, normal, or face based on the data information of the current line; if it is a vertex, remove the line break (line.strip()) and split line (split()) at the end of the line, and convert each component of the vertex (except the first character) into a floating point number, and then add it to the vertices list; if it is a texture coordinate or normal, perform the same processing as the vertex, and add it to the tex_coords list or normals list accordingly; if it is face data, create a list derivation, convert each vertex index of the face to an integer, adjust it to a Python index (for example, if it is an OBJ file, subtract 1 from the integer because the OBJ index starts at 1 and the Python index starts at 0), and then add it to the faces list.

[0051] Since the present invention is a compatible processing device capable of processing files in various formats, the above description of the present invention mainly focuses on the correct processing methods for files in various formats and Python. In fact, the specific processing of this unit can be implemented using the existing geometric data extraction method, and the present invention will not go into details about the specific geometric data extraction method.

[0052] Material property extraction unit: used to extract material properties of 3D models.

[0053] It should be noted that material properties are implemented by defining classes. The material property class includes three parameters: color: object surface color (a list containing RGB components), reflection: reflection coefficient, and texture: texture map.

[0054] In the process of extracting material properties, the material property extraction unit first initializes an empty dictionary materials to store the properties of all materials. Then it traverses each line in the material property file.

[0055] First, determine the data of the material definition content according to the data information of the current row, get the material name, use the material name as the key, and add its corresponding attribute dictionary (initially empty) as the value to the materials dictionary; get the RGB components of the material's surface color, convert them into floating-point numbers, and store them under the 'color' key of the current material in the materials dictionary, and use the surface color representation of the object listed under the 'color' key as the surface color map L0, and store the reflection coefficient under the 'specular' key of the current material in the materials dictionary; get the material's texture map and store it under the 'texture' key of the current material in the materials dictionary, and use the texture map representation of the object listed under the 'texture' key as the texture map image L1.

[0056] The above description of the present invention mainly explains that the process of material attribute extraction requires obtaining texture map information. In fact, the specific processing of this unit can be implemented using the existing extraction method, and the present invention will not go into details about the more specific extraction method.

[0057] Lighting calculation module: calculates the angle relationship between the light intensity and the surface of the three-dimensional model according to the three-dimensional model data loaded by the three-dimensional model loading module, and then determines the light contribution; including the following steps:

[0058] First, determine all vertices based on the face data, traverse the vertices and normals of the 3D model, and use the zip function to combine the two lists into a tuple list, each tuple contains a vertex and a normal; calculate the distance from the light source to the vertex, and calculate the light source direction vector based on the distance from the light source to the vertex;

[0059] Calculate the dot product dot_product of the light source direction vector and the vertex normal, denoted as d p , judge d p Is it greater than 0? If the dot product is greater than 0, it means that the angle between the light source direction and the vertex normal is less than 90 degrees, that is, the light source is in front of the vertex and the vertex is affected by the light source; if the dot product is not greater than 0, it means that the light source is behind or directly below the vertex and the vertex is not affected by the light source;

[0060] Use light.intensity to represent the intensity of the light source, denoted as l i ; Use light_distance to represent the light source distance, denoted as l d , light_contribution is used to represent the lighting contribution, denoted as lc ; When a vertex is affected by a light source, calculate the lighting contribution l c =d p *l i / l d 2 ; Vertices are not affected by light sources to calculate lighting contribution l c =0; add the lighting contribution to the light_effect list, and represent the lighting contribution of all points in the list as the lighting contribution map L2.

[0061] Reflection vector calculation module: obtains diffuse reflection color based on the object surface color map L0, texture map image L1 and illumination contribution map L2;

[0062] First, the texture map image L1 is processed as follows to obtain the texture map enhanced image L1′:

[0063]

[0064] in, Represents the value of the nth channel of L1, n∈{r,g,b}; Texture map image channel contribution rate, is the intermediate variable, Indicates r, g, b The minimum value of

[0065] Then, based on the object surface color map L0 and the texture map enhanced image L1′, the fusion calculation is performed according to the following formula:

[0066] L c =L0+L1′

[0067] Among them, L c represents the fused image;

[0068] Based on the Lambert lighting model, the diffuse color is obtained:

[0069] Diffuse=L2×L c ×Reflection

[0070] In fact, the present invention is mainly improved on the basis of the Lambert lighting model, that is, the surface color map of the object is first fused through the texture map to highlight the influence of the texture map on the surface color map of the object, and then the lighting influence is added through the Lambert lighting model formula to obtain the diffuse reflection color.

[0071] It should be noted that diffuse color is implemented by defining a class. The diffuse color is represented by a list or tuple containing RGB components. It initializes an empty dictionary diffuse for diffuse color, and then traverses each line in the material property file. The calculated diffuse is stored in diffuse.

[0072] Reflection effect simulation module: Based on the diffuse color, the reflection is calculated in the screen space, the depth buffer and the normal buffer are used to trace the path of the light in the screen space, obtain the reflection information, and generate the reflection effect.

[0073] This module can be implemented using an existing simulation model, so the present invention will not go into details.

[0074] Rendering module: Based on the reflection effect generated by the reflection effect simulation module, modern graphics API (such as OpenGL or DirectX) is used for rendering, and shaders (Vertex Shader and Fragment Shader) are combined to calculate the final color output.

[0075] This unit can be implemented by using the existing rendering method, and the present invention will not go into details.

[0076] The processing effect of this embodiment is as follows Figures 1 to 3 As shown, Figure 1 This is a visual rendering generated using the traditional Lambert lighting model. Figure 2 A rendering of the visual effect of the reflective effect simulation visual enhancement of the present invention, Figure 3 for Figure 1 and Figure 2 From the detail comparison diagram, it can be seen that the present invention first merges the object surface color map through the texture map, highlighting the influence of the texture map on the object surface color map, which can increase the texture and effect of the detail display under the same light source conditions.

[0077] It should also be noted that the present invention only mainly describes the main component units / modules of the system of the present invention. The present invention includes but is not limited to these units / modules, and may also include other units, modules, or processing methods in the prior art. For example, LOD (level of detail) technology may be used to optimize performance, thereby selecting different three-dimensional model details according to the viewing distance to reduce the rendering burden, and, for example, using multi-threaded computing, using multi-threaded processing on the CPU side for lighting and reflection calculations to improve efficiency. Specific implementation method 2:

[0079] This embodiment is a computer storage medium, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to execute the system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model.

[0080] It should be understood that the instructions include computer program products, software or computerized methods corresponding to any method described in the present invention; the instructions can be used to program a computer system, or other electronic device. Computer storage media may include readable media on which instructions are stored, which may include but are not limited to magnetic storage media, optical storage media; magneto-optical storage media include read-only memory ROM, random access memory RAM, erasable programmable memory (e.g., EPROM and EEPROM) and flash memory layers, or other types of media suitable for storing electronic instructions. Specific implementation method three:

[0082] This embodiment is a device for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model, the device includes a processor and a memory. It should be understood that the device includes any device including a processor and a memory described in the present invention, and the device may also include other units and modules that perform display, interaction, processing, control, and other functions through signals or instructions;

[0083] The memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to execute the system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model.

[0084] Those skilled in the art will appreciate that at least one instruction stored is a computer program product corresponding to the method or system. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The scheme in the embodiment of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0085] The present application is described with reference to the flowcharts and / or block diagrams of the methods, systems, and computer program products according to the embodiments of the present application, and may also be used for corresponding devices. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0088] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0089] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0090] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A system for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model, characterized in that: It at least includes an illumination calculation module, a reflection vector calculation module and a reflection effect simulation module; wherein, Lighting calculation module: According to the loaded 3D model data, the angle relationship between the light intensity and the 3D model surface is calculated to determine the light contribution; the specific process includes the following steps: First, determine all vertices based on the face data, traverse the vertices and normals of the 3D model, and use the zip function to combine the two lists into a tuple list, each tuple contains a vertex and a normal; calculate the distance from the light source to the vertex, and calculate the light source direction vector based on the distance from the light source to the vertex; Calculate the dot product dot_product of the light source direction vector and the vertex normal, denoted as d p , judge d p Is it greater than 0? If the dot product is greater than 0, it means that the angle between the light source direction and the vertex normal is less than 90 degrees, that is, the light source is in front of the vertex and the vertex is affected by the light source; if the dot product is not greater than 0, it means that the light source is behind or directly below the vertex and the vertex is not affected by the light source; Use light.intensity to represent the intensity of the light source, denoted as l i ; Use light_distance to represent the light source distance, denoted as l d , light_contribution is used to represent the lighting contribution, denoted as l c ; When a vertex is affected by a light source, calculate the lighting contribution l c =d p *l i / l d 2 ; Vertices are not affected by light sources to calculate lighting contribution l c =0; add the lighting contribution to the light_effect list, and represent the lighting contribution of all points in the list as the lighting contribution map L2; Reflection vector calculation module: obtains diffuse reflection color based on the object surface color map L0, texture map image L1 and illumination contribution map L2; the specific process includes the following steps: First, the texture map image L1 is processed as follows to obtain the texture map enhanced image L1′: in, Represents the value of the nth channel of L1, n∈{r,g,b}; Texture map image channel contribution rate, is the intermediate variable, Indicates r, g, b The minimum value of Then, based on the object surface color map L0 and the texture map enhanced image L1′, the fusion calculation is performed according to the following formula: L c =L0+L1′ Among them, L c represents the fused image; Based on the Lambert lighting model, the diffuse color is obtained: Diffuse=L2×L c ×Reflection Reflection effect simulation module: Based on the diffuse color, the reflection is calculated in the screen space, the depth buffer and normal buffer are used to trace the path of the light in the screen space, obtain the reflection information, and generate the reflection effect.

2. A system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model according to claim 1, characterized in that: It also includes a rendering module; the rendering module performs rendering based on the reflective effect generated by the reflective effect simulation module, and calculates the final color output in combination with a shader.

3. A system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model according to claim 1 or 2, characterized in that: It also includes a three-dimensional model loading module for loading three-dimensional model data.

4. The system for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model according to claim 3, characterized in that: The 3D model loading module includes: 3D model reading unit: loads different types of 3D model files according to the provided file path; in the process of recording the 3D model, the file format is judged and determined through the conditional function, and the corresponding function is called to load the 3D model; Spatial geometry data extraction unit: used to extract spatial geometry features of a three-dimensional model, wherein the spatial geometry features include vertices, texture coordinates, normals and surface data; Material property extraction unit: used to extract material properties of 3D models.

5. The system for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model according to claim 4, characterized in that: In the 3D model loading unit, file_path is used to represent the path of the 3D model file; By checking whether the file_path string ends with .obj, if it does, it means that this is a 3D model file in OBJ format. The function will call the load_obj function and pass in the file_path, and then return the result of the load_obj function; here, it is assumed that load_obj is a pre-defined function used to load 3D models in OBJ format; Then check if the file path ends with .fbx. If so, it means this is a 3D model file in FBX format. The function will call the load_fbx function and pass in the file_path, and then return the result of the load_fbx function. Here, it is assumed that load_fbx is a pre-defined function used to load 3D models in FBX format. Then check whether the file path ends with .gltf. If so, it means that this is a 3D model file in GLTF format. The function will call the load_gltf function and pass in the file_path, and then return the result of the load_gltf function. It is assumed here that load_gltf is a defined function used to load 3D models in GLTF format.

6. The system for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model according to claim 4, characterized in that: In the process of extracting the spatial geometric features of the three-dimensional model by the spatial geometric data extraction unit, four empty lists are first initialized: the vertex data list vertices, the normal data list normals, the texture coordinate data list tex_coords and the face data list faces; Then, each line in the 3D model file is traversed, and first, the current line is determined to be a vertex, texture coordinate, normal, or face according to the data information of the current line; If it is a vertex, remove the line break and line splitter at the end of the line, convert each component of the vertex into a floating point number, and then add it to the vertices list; If it is a texture coordinate or normal, perform the same processing as the vertex and add it to the tex_coords list or normals list accordingly; If it is face data, create a list comprehension, convert each vertex index of the face to an integer, adjust it to a Python index, and add it to the faces list.

7. The system for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model according to claim 4, characterized in that: In the process of extracting the material properties of the three-dimensional model by the material property extraction unit, an empty dictionary materials is first initialized to store the properties of all materials; then each line in the material property file is traversed, and the data of the material definition content is first determined according to the data information of the current line, and the material name is obtained, and the material name is used as the key and its corresponding attribute dictionary is used as the value to add it to the materials dictionary; the RGB components of the material's object surface color are obtained, converted into floating point numbers, and stored under the 'color' key of the current material in the materials dictionary, and the object surface color representation listed under the 'color' key is used as the object surface color map L0, and the reflection coefficient is stored under the 'specular' key of the current material in the materials dictionary; the texture map of the material is obtained and stored under the 'texture' key of the current material in the materials dictionary, and the texture map representation listed under the 'texture' key is used as the texture map image L1.

8. A computer storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model as described in any one of claims 1 to 7.

9. A device for simulating visual enhancement of the reflective effect on the surface of a digital three-dimensional model, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to execute a system for simulating visual enhancement of reflective effects on the surface of a digital three-dimensional model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Three-dimensional model and material merging method and device, terminal, storage medium and rendering method

    CN111028361A

  • Method for quickly estimating three-dimensional illumination of indoor scene and related equipment

    CN118314272A