Virtual model processing method and device, electronic equipment and storage medium

When rendering the transition area of ​​the virtual model, the target saturation parameters and diffuse reflection information are determined based on the alveolar information and saturation parameters of the target pixel point, and the color gradient effect of the light in the transition area is solved in the prior art. Problem, achieving more natural shadow effects and higher rendering efficiency.

CN119516083APending Publication Date: 2025-02-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411802947.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When rendering the transition area of ​​a virtual model, the prior art cannot truly express the tone gradient effect of the light in the transition area, resulting in unnatural shadow effect and low rendering efficiency.

Method used

When rendering the shadow effect of the transition area, the target saturation parameters and diffuse reflection information are determined based on the target alveolar information and saturation parameters of the target pixel point, thereby determining the pixel point value, taking into account the influence of saturation factors to produce strong colors Saturation change.

Benefits of technology

It realizes a more realistic shadow effect on the surface of the virtual model, improves the rendering effect and rendering efficiency, and makes the shadow effect have a more natural color transition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516083A_ABST
    Figure CN119516083A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual model processing method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a transition region of a target virtual model in an illumination scene, the transition region being a region between a bright region and a shadow region on the target virtual model; obtaining target reflection information of each target pixel point in the transition area; determining a target saturation parameter of each target pixel point based on target reflection information and a preset mapping relation of saturation parameters; determining target diffuse reflection information of the target pixel point based on the target saturation parameter; and determining a pixel point value of each target pixel point based on the illumination information and the target diffuse reflection information corresponding to each pixel point. According to the method, the rendered shadow effect has more natural color transition, the color expressive force of the shadow effect is enhanced, the more real shadow effect is realized on the surface of the virtual model, the rendering effect is effectively improved, and the rendering efficiency of the virtual model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for processing a virtual model. Background Art

[0002] In order to provide users with a better visual experience, many virtual scenes are often constructed based on real scenes and objects in real scenes. In actual design projects, the production staff usually completes the production of virtual resources. Through the design of virtual resources, various scenes, animals, plants and other objects that simulate real life can be realized. Specifically, various virtual models such as virtual buildings, virtual animals and virtual plants can be produced.

[0003] In the prior art, in order to show users the different states of different parts of a virtual model under lighting scenes, production personnel usually use shadow rendering technology to render the virtual model, so as to render a realistic shadow effect and enhance the user's visual experience. However, the existing shadow rendering technology usually uses shadow maps to generate shadow effects during the real-time rendering process of the virtual model. The method of rendering shadow effects through shadow maps cannot truly show the hue gradient effect of light in the transition area. The color of the transition area is single, which makes the rendered shadow effect unnatural and the rendering effect poor, resulting in low rendering efficiency of the virtual model. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for processing a virtual model. The target saturation parameter of each target pixel is determined based on the target reflection information of each target pixel in the transition area, and the pixel value of each target pixel is determined according to the target saturation parameter. By considering the influence of the saturation factor when rendering the shadow effect in the transition area, a strong color saturation change can be generated in the transition area, thereby truly showing the hue gradient effect of light in the transition area, so that the rendered shadow effect has a more natural color transition, the color expression of the shadow effect is enhanced, and a more realistic shadow effect is achieved on the surface of the virtual model, which effectively improves the rendering effect and the rendering efficiency of the virtual model.

[0005] In a first aspect, an embodiment of the present application provides a method for processing a virtual model, comprising:

[0006] Determine a transition area of ​​the target virtual model in the lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model;

[0007] Acquire target reflection information of each target pixel point in the transition area;

[0008] Determining a target saturation parameter of each target pixel based on the target albedo information and a preset mapping relationship of saturation parameters;

[0009] Determining target diffuse reflection information of the target pixel based on the target saturation parameter;

[0010] Based on the illumination information corresponding to each pixel point and the target diffuse reflection information, the pixel value of each target pixel point is determined.

[0011] In a second aspect, an embodiment of the present application provides a virtual model processing device, including:

[0012] A first determining unit is used to determine a transition area of ​​the target virtual model in a lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model;

[0013] An acquisition unit, used for acquiring target albedo information of each target pixel point in the transition area;

[0014] A second determining unit, configured to determine a target saturation parameter of each of the target pixels based on the target albedo information and a preset mapping relationship of the saturation parameters;

[0015] A third determining unit, configured to determine target diffuse reflection information of the target pixel point based on the target saturation parameter;

[0016] The fourth determining unit is used to determine the pixel value of each of the target pixels based on the illumination information and the target diffuse reflection information corresponding to each of the pixel points.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any virtual model processing method provided in the embodiment of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any virtual model processing method provided in the embodiment of the present application.

[0019] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps in any virtual model processing method provided in the embodiment of the present application.

[0020] By adopting the scheme of the embodiment of the present application, the target saturation parameter of each target pixel is determined based on the target reflection information of each target pixel in the transition area, and the pixel value of each target pixel is determined according to the target saturation parameter; by considering the influence of the saturation factor when rendering the shadow effect of the transition area, a strong color saturation change can be generated in the transition area, thereby truly showing the hue gradient effect of light in the transition area, making the rendered shadow effect have a more natural color transition, enhancing the color expression of the shadow effect, and realizing a more realistic shadow effect on the surface of the virtual model, effectively improving the rendering effect, and improving the rendering efficiency of the virtual model. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 It is a scene schematic diagram of a processing system of a virtual model provided in an embodiment of the present application;

[0023] Figure 2 It is a schematic diagram of an embodiment of a method for processing a virtual model provided in an embodiment of the present application;

[0024] Figure 3 It is a schematic diagram of an application scenario of the virtual model processing method provided in the embodiment of the present application;

[0025] Figure 4 This is another application scenario schematic diagram of the virtual model processing method provided in the embodiment of the present application;

[0026] Figure 5 is a structural schematic diagram of a virtual model processing device provided in an embodiment of the present application;

[0027] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0029] The embodiments of the present application provide a method, device, electronic device, and computer-readable storage medium for processing a virtual model. Specifically, the present embodiment will be described from the perspective of a processing device for a virtual model, and the processing device for a virtual model can be specifically integrated in an electronic device, that is, the processing method for a virtual model in the embodiments of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and the like.

[0030] The virtual model processing method provided in the embodiment of the present application can be applied to a virtual model processing system. The virtual model processing system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.

[0031] Optionally, the server may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0032] The processing method of the virtual model in one embodiment of the present disclosure can be run on a local terminal device or a server. When the processing method of the virtual model is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0033] For example, when the processing method of the virtual model is run on the terminal, the terminal device stores a game application and is used to present a virtual scene in the game screen. The terminal device is used to interact with the user through a graphical user interface, for example, the game application is downloaded and installed by the terminal device and run. The terminal device may provide the graphical user interface to the user in a variety of ways, for example, it may be rendered and displayed on the display screen of the terminal device, or the graphical user interface may be presented through holographic projection. For example, the terminal device may include a touch display screen and a processor, the touch display screen is used to present the graphical user interface and receive the operation instructions generated by the user acting on the graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, respond to the operation instructions, and control the display of the graphical user interface on the touch display screen.

[0034] For example, when the processing method of the virtual model runs on the server, it can be a cloud game. Cloud gaming refers to a gaming method based on cloud computing. In the operation mode of cloud gaming, the operating body of the game application and the game screen presentation body are separated, and the storage and operation of the processing method of the virtual model are completed on the cloud gaming server. The game screen presentation is completed on the client of the cloud gaming. The cloud gaming client is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud gaming client can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, a personal digital assistant, etc., but the terminal device for processing game data is a cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send an operation instruction to the cloud gaming server. The cloud gaming server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the cloud gaming client through the network. Finally, the cloud gaming client decodes and outputs the game screen.

[0035] See also Figure 1 , Figure 1A scene diagram of a processing system of a virtual model provided by an embodiment of the present application. The system may include at least one terminal, at least one server, at least one database, and a network. The terminal held by the user can be connected to the server of different games through the network. The terminal is any device with computing hardware that can support and execute software products corresponding to the game. In addition, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can be connected to each other through different networks and different servers. The network can be a wireless network or a wired network, such as a wireless network such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different terminals can also use their own Bluetooth network or hotspot network to connect to other terminals or to servers, etc. For example, multiple users can be online through different terminals and connected and synchronized with each other through appropriate networks to support multi-player games. In addition, the system may include multiple databases, multiple databases are coupled to different servers, and information related to the game environment can be continuously stored in the database when different users are online for multi-player games.

[0036] The embodiment of the present application provides a method for processing a virtual model, which can be executed by a terminal or a server. The embodiment of the present application takes the method for processing a virtual model executed by a terminal as an example for explanation. Among them, the terminal may include a touch display screen and a processor (of course, the terminal may also use peripherals such as a mouse and a keyboard as input devices, and only the touch display screen is used as an example for explanation here), and the touch display screen is used to present a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. When the user operates the graphical user interface through the touch display screen, the graphical user interface can control the local content of the terminal by responding to the received operation instructions, and can also control the content of the opposite server by responding to the received operation instructions. For example, the operation instructions generated by the user acting on the graphical user interface include instructions for starting a game application, and the processor is configured to start the game application after receiving the instructions for starting the game application provided by the user. In addition, the processor is configured to render and draw a graphical user interface associated with the game on the touch display screen. The touch display screen is a multi-touch sensitive screen that can sense touch or sliding operations performed simultaneously by multiple points on the screen. The user uses a finger to perform a touch operation on the graphical user interface, and when the graphical user interface detects the touch operation, different virtual objects in the graphical user interface of the game are controlled to perform actions corresponding to the touch operation.

[0037] It should be noted that Figure 1The scenario diagram of the virtual model processing system shown is merely an example. The virtual model processing system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0038] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0039] Please also read Figure 2 , Figure 2 A flowchart of a method for processing a virtual model provided in an embodiment of the present application is shown in FIG. The specific flow of the method for processing a virtual model may include steps 101 to 105 as follows:

[0040] Step 101: determine a transition area of ​​a target virtual model in a lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model.

[0041] In the embodiment of the present application, the bright area refers to the area on the virtual model that is completely illuminated by the light source or light, and the shadow area, also known as the full shadow area, refers to the area on the virtual model that completely blocks the light source or light. Since the light source or light cannot reach this area at all, the shadow part formed by the shadow area is the darkest. The transition area, also known as the penumbra area, refers to the area on the virtual model where the light source or light is partially blocked. At this time, part of the light can reach it, but the light intensity is weakened. Therefore, the penumbra area is usually located between the full shadow area and the bright area that is completely illuminated, showing a gradual transition effect.

[0042] Among them, the definition of penumbra area in optics or imaging refers to the transitional shadow area formed when the light source is partially blocked, which is between the full shadow area and the fully illuminated area. In the penumbra area, since part of the light can reach it, the light intensity is weaker than the bright area, but stronger than the fully blocked full shadow area. Specifically, when an opaque object is in front of a non-point light source (such as the sun or a light bulb), some parts of the light source are blocked, but other parts can still illuminate the surrounding area of ​​the opaque object. Since the light source has a certain expansibility, the shadow will not be completely hard-edged, so in the transition area of ​​the shadow, the light gradually decreases to form a penumbra. The appearance of the penumbra is due to the expansibility of the light source and the partial occlusion of the light. The characteristics of the penumbra include edge gradient and partial occlusion. Edge gradient refers to the transition from full illumination to full shadow, the light gradually weakens, and a soft shadow edge is formed; partial occlusion means that some parts of the light source still illuminate the penumbra area, so the brightness of the penumbra area is higher than that of the full shadow area, but lower than the bright area of ​​full illumination.

[0043] In an embodiment of the present application, the transition area may be a colored (saturated) penumbra area. The colored (saturated) penumbra refers to the situation where, under strong direct light, when light hits a rough and highly color-saturated material surface or passes through these materials, a large amount of scattering will occur, resulting in a significant saturated penumbra effect. For example, materials such as sand, skin, or granular substances, due to the roughness or anisotropic properties of the surface of the above materials, cause the light to diffuse in a manner that approximates diffuse reflection. At the same time, the reflectivity of the surface of the above materials affects the performance of scattered light. Brighter surfaces will enhance the multiple scattering process of light and produce a saturated visual effect, while darker surfaces will reduce the visibility of this effect. Therefore, the saturated penumbra effect usually appears under very strong direct light (such as direct sunlight) and is often used in rendering outdoor environments.

[0044] In one embodiment, the step of “determining the transition area of ​​the target virtual model under the lighting scene” includes:

[0045] Get the lighting identification parameters;

[0046] Based on the illumination identification parameter, obtaining position information of a transition area of ​​the target virtual model in the illumination scene corresponding to the illumination identification parameter;

[0047] Based on the position information, a transition area of ​​the target virtual model in the lighting scene is determined.

[0048] Specifically, a lighting identification parameter can be obtained, and the lighting identification parameter is used to indicate the position information of the transition area on the target virtual model under the lighting scene; the computer device can obtain the position information of the transition area of ​​the target virtual model in the lighting scene corresponding to the lighting identification parameter based on the lighting identification parameter, and then determine the transition area of ​​the target virtual model in the lighting scene based on the position information.

[0049] Step 102: Obtain target reflection information of each target pixel in the transition area.

[0050] The target reflectance information may be albedo, which is a physical quantity describing the surface reflectance of a virtual model. It is equal to the ratio of the radiance reflected from the surface of the virtual model to the incident radiance, and its value is usually between 0 and 1. Specifically, the higher the albedo of a virtual model (or object) surface, the stronger its reflectance. For example, the albedo value of snow is close to 1, while the albedo value of charcoal is only about 0.04.

[0051] In an embodiment of the present application, the albedo information can be obtained from the albedo map of the virtual model. In actual applications, the albedo of an object may vary with different areas of the surface, which can be specifically represented by the albedo map.

[0052] Step 103: Determine the target saturation parameter of each target pixel based on the target albedo information and a preset mapping relationship of saturation parameters.

[0053] In the embodiment of the present application, the preset mapping relationship is used to achieve nonlinear transformation between target albedo information and saturation parameters.

[0054] In one embodiment, the step of “determining the target saturation parameter of each target pixel based on the target albedo information and the preset mapping relationship of the saturation parameter” may include:

[0055] Determine an albedo attenuation coefficient of each of the target pixel points based on the target albedo information of each of the target pixel points, wherein the relationship between the target albedo information and the albedo attenuation coefficient is that the smaller the target albedo information, the larger the albedo attenuation coefficient;

[0056] Based on the albedo attenuation coefficient corresponding to each of the target pixels and the target albedo information, a target saturation parameter of each of the target pixels is determined.

[0057] Specifically, the step of “determining the albedo attenuation coefficient of each target pixel point based on the target albedo information of each target pixel point” includes:

[0058] Obtaining a difference between a preset first value and a second value corresponding to the target albedo information as the albedo attenuation coefficient;

[0059] The determining of the target saturation parameter of each target pixel point based on the albedo attenuation coefficient corresponding to each target pixel point and the target albedo information includes:

[0060] A first ratio of a second value corresponding to the target albedo information to the difference is obtained as a target saturation parameter of the target pixel.

[0061] For example, the target saturation parameter can be calculated as follows:

[0062]

[0063] Here, ρ refers to the surface albedo of the virtual model.

[0064] Step 104: Determine the target diffuse reflection information of the target pixel based on the target saturation parameter.

[0065] In a specific embodiment, the step of “determining the target diffuse reflection information of the target pixel point based on the target saturation parameter” may include:

[0066] A first ratio corresponding to the target pixel and a second ratio of a preset second value are obtained as target diffuse reflection information of the target pixel.

[0067] For example, the calculation formula for the target diffuse reflection information can be as follows:

[0068]

[0069] Here, ρ refers to the surface albedo of the virtual model.

[0070] Step 105: Determine the pixel value of each target pixel based on the illumination information corresponding to each pixel and the target diffuse reflection information.

[0071] In one embodiment, the step of “determining the pixel value of each target pixel based on the illumination information corresponding to each pixel and the target diffuse reflection information” may include:

[0072] Determining a lighting effect rendering parameter for each target pixel point based on the lighting information corresponding to each target pixel point and the target diffuse reflection information;

[0073] Based on the lighting effect rendering parameters corresponding to each of the target pixels and the preset pixel information, the pixel value of each of the target pixels is determined.

[0074] Specifically, the step of “determining the lighting effect rendering parameters of each target pixel point based on the lighting information corresponding to each target pixel point and the target diffuse reflection information” includes:

[0075] Based on the lighting information, model information and target diffuse reflection information corresponding to each of the target pixels, the lighting effect rendering parameters of each of the target pixels are determined, wherein the lighting information includes incident radiation parameters, and the model information includes model normal information and shadow information.

[0076] In a specific embodiment, the preset pixel point information includes color information and brightness information; the step of "determining the pixel point value of each target pixel point based on the lighting effect rendering parameters corresponding to each target pixel point and the preset pixel point information" includes:

[0077] Based on the lighting effect rendering parameters corresponding to each of the target pixel points, the corresponding color information and / or brightness information is adjusted to obtain adjusted color information and / or adjusted brightness information;

[0078] Based on the adjusted color information and / or the adjusted brightness information, a pixel value of each of the target pixels is determined.

[0079] In the embodiment of the present application, the diffuse reflection illumination intensity (i.e., the illumination effect rendering parameter) of the object surface under specific illumination conditions can be obtained according to the improved diffuse reflection illumination equation. This intensity is the result of the combined effect of the incident light intensity, the diffuse reflection albedo of the object surface, and the geometric function. Its value will directly affect the color and brightness of the object surface in the rendering result, thereby improving the color saturation of each target pixel in the penumbra area. For example, see Figure 3 , Figure 3 The left figure is the target virtual model of the first rendering effect. At this time, the first rendering effect is calculated by the standard diffuse reflection lighting equation that only considers the diffuse reflection term. Further, after calculating by the standard diffuse reflection lighting equation that comprehensively considers the diffuse reflection term and the saturation term, the target virtual model of the second rendering effect that produces a strong color saturation change in the transition area (that is, Figure 3 shown on the right).

[0080] Among them, the diffuse reflection term in the standard lighting equation in physically based rendering calculates the scattering of light on a rough surface. In the physically based lighting model, diffuse reflection refers to the scattering of light on the surface of an object. This scattering does not depend on the viewing angle, that is, the intensity of diffuse reflection is roughly the same regardless of the direction from which it is observed. The result calculated by the diffuse reflection term in the standard lighting equation is the color value and brightness value of a certain pixel point when the position corresponding to the virtual object is rendered when it is illuminated by light. Specifically, the diffuse reflection term calculates the scattering of light on a rough surface, which reflects the color and brightness changes of the surface of the object under different lighting conditions. In physically based rendering, the diffuse reflection term is usually related to the incident light intensity, the diffuse reflection coefficient of the surface, and the dot product of the surface normal and the light direction. This calculation result is independent of the viewing angle, which means that the brightness of the diffuse reflection part is roughly the same regardless of the angle from which it is observed.

[0081] It should be noted that in physically based rendering, the diffuse reflection term usually refers to the diffuse reflection of light on the surface of an object. Diffuse reflection refers to the phenomenon that light is scattered evenly in all directions after hitting the surface of an object. This is a concept opposite to specular reflection. Among them, the result of the diffuse reflection term calculation is usually related to the color or albedo of the object. Albedo refers to the ability of the surface of an object to reflect light. It is a value from 0 to 1, indicating the brightness of the object's color. During the rendering process, the value calculated by the diffuse reflection term will directly affect the color value of the corresponding pixel when the virtual object is rendered. Specifically, the result of the diffuse reflection term calculation will be combined with factors such as the intensity of the incident light, the color of the object's surface, and the viewing angle to determine the final pixel color. This calculation process usually involves the following steps:

[0082] (1) Ambient lighting: The effect of ambient lighting on objects can be calculated, which usually involves the environment map and the albedo of the object.

[0083] (2) Illumination model. The illumination model can be used to calculate diffuse illumination. The model assumes that the surface of the object is completely rough, so the light will be scattered evenly.

[0084] (3) Albedo map. In practical applications, the albedo of an object may vary in different areas of the surface, which can be represented by an albedo map.

[0085] (4) Lighting calculation: Multiply the albedo by the light intensity to get the intensity of diffuse light.

[0086] (5) Color mixing. The intensity of diffuse light can be mixed with specular light (if any) and other possible effects (such as self-illumination) to obtain the final pixel color value corresponding to the pixel.

[0087] Therefore, based on the above, the result obtained by calculating the diffuse reflection term is a part of the color value of the corresponding pixel when the virtual object is rendered, which is closely related to factors such as the object's albedo, lighting conditions, and observation angle.

[0088] In summary, an embodiment of the present application provides a method for processing a virtual model, which can determine a transition area of ​​a target virtual model in a lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model; then, the target reflection information of each target pixel in the transition area is obtained; then, based on the target reflection information and a preset mapping relationship of a saturation parameter, the target saturation parameter of each target pixel is determined; thereafter, based on the target saturation parameter, the target diffuse reflection information of the target pixel is determined; finally, based on the lighting information and the target diffuse reflection information corresponding to each pixel, the pixel value of each target pixel is determined. In an embodiment of the present application, a target saturation parameter of each target pixel is determined based on the target reflection information of each target pixel in the transition area, and a pixel value of each target pixel is determined according to the target saturation parameter; by considering the influence of the saturation factor when rendering the shadow effect of the transition area, a strong color saturation change can be generated in the transition area, thereby truly showing the hue gradient effect of light in the transition area, so that the rendered shadow effect has a more natural color transition, enhances the color expression of the shadow effect, and achieves a more realistic shadow effect on the surface of the virtual model, effectively improving the rendering effect, and improving the rendering efficiency of the virtual model.

[0089] Based on the above introduction, the following example will be used to further illustrate the processing method of the virtual model of the present application. The formulas involved in the processing method of the virtual model are specifically described as follows:

[0090] (1) The diffuse reflection term of the standard bidirectional reflectance distribution function is:

[0091]

[0092] Among them, the bidirectional reflectance distribution function is a core concept in computer graphics used to describe how light affects the reflection of an object surface. It defines how the radiant illumination in a given incident direction affects the radiance in a given outgoing direction. More specifically, the bidirectional reflectance distribution function describes how the incident light is distributed in each outgoing direction after being reflected by a surface. This can include various reflections from ideal mirror reflection to diffuse reflection, isotropic or anisotropic.

[0093] According to the standard lighting equation for physical rendering, the surface albedo ρ∈[0,1] and the incident radiance L i , then the reflected radiation rate L o and the incident radiance Li The relationship is:

[0094] L o ∝ρL i

[0095] According to the relationship between reflected radiance and incident radiance, under ideal reflection conditions, the simplified geometric series of multiple reflections can be obtained:

[0096]

[0097] For details, please refer to Figure 4 , Figure 4 The formula corresponding to the first curve in is:

[0098]

[0099] Depend on Figure 4 From the first curve, we can see that when ρ>0.5, L o Greater than L i The principle of energy conservation is violated because the assumed ideal reflection condition does not take into account the energy attenuation during multiple reflections. In order to satisfy the requirement that the reflected radiance is less than the incident radiance, the formula is simply modified to meet the energy conservation requirement. This is the saturation term that will be included in the diffuse term of the standard bidirectional reflectance distribution function:

[0100]

[0101] Among them, the saturation term corresponds to Figure 4 The second curve in represents. When the restriction condition is ρ∈[0,1], Figure 4 In the provided coordinate system, the horizontal axis represents the albedo ρ, and the vertical axis is the value corresponding to the function.

[0102] (2) Furthermore, the diffuse reflection term of the standard bidirectional reflectance distribution function is:

[0103]

[0104] Where c is the surface diffuse color, k d is the diffuse reflection ratio. In a cosine radiator, the incident light is evenly distributed on the surface, and the intensity of the reflected light is proportional to the angle between the incident light and the surface normal. Normalization. Specifically, a cosine radiator is an ideal radiator whose spatial distribution of luminous intensity conforms to the cosine law. Regardless of whether the radiator is self-luminous or reflects light, its radiation intensity at different angles will change according to the cosine formula, that is, the larger the angle, the weaker the radiation intensity. The radiometric properties of this radiator make its radiance (power per unit solid angle per unit area) in all directions remain unchanged, so it has the same apparent brightness or brightness from any angle.

[0105] Specifically, in physically based rendering, the diffuse term ρ of the bidirectional reflectance distribution function d Describes how light is scattered on a surface. The diffuse reflection term is usually the ratio of the incident light energy to the incident light energy. d is related to the surface color c, where k d is the diffuse reflectance, which indicates the ratio of incident light energy to diffuse reflection. c represents the color of the surface, which can also be understood as the diffuse reflection surface texture. In the process of light transmission on the surface of an object, in addition to diffuse reflection, specular reflection must also be considered. Therefore, for opaque objects, in order to ensure energy conservation, it is also necessary to ensure that k d +k s ≤1, k s is the specular reflection coefficient, which represents the ratio of incident light energy that is reflected by the specular surface. This is a key condition to ensure that the material does not violate the laws of physics. d and c usually depend on the color and material of the surface. The result of the diffuse reflection term determines the intensity of reflected light at a point on the surface of the object in a specific viewing direction under specific incident light conditions.

[0106] (3) Specifically, after incorporating the saturation term into the diffuse reflection term, we obtain:

[0107]

[0108] (4) Substitute the above formula into the following standard diffuse reflection lighting equation:

[0109] L o =L i ρ d S(ω i ·n)

[0110] Among them, ω i is the incident light direction, n is the surface normal of the object, and S is the shadow term. Specifically, in real-time rendering, the shadow term S usually refers to the shadow factor calculated in the shadow mapping technology. Shadow mapping is a technology used in 3D graphics rendering to simulate the effect of illuminated objects being blocked by other objects. It renders the depth information of the scene at the light source position into a map, and then compares the depth value of the object surface with the depth value in the shadow map when rendering the object to determine whether the object is blocked by the shadow.

[0111] Specifically, the basic steps of shadow mapping can include the following steps:

[0112] (1) Rendering depth map: Render the scene from the perspective of the light source and generate a map (shadow map) containing the scene depth information.

[0113] (2) Shadow test: When rendering an object, for each pixel on the object's surface, determine whether the pixel is in the shadow by comparing its position on the object's surface with the depth value of the corresponding position in the shadow map.

[0114] (3) Calculate the shadow factor: Calculate the shadow factor of each pixel based on the result of the shadow test. If the pixel is completely illuminated by the light source, the shadow factor is 1; if it is completely in the shadow, the shadow factor is 0; if it is in the penumbra area, the shadow factor is between 0 and 1.

[0115] Furthermore, in the standard lighting equation, the shadow factor S is combined with the diffuse term ρ d Multiply to simulate the effect of light being blocked. Therefore, the value of the shadow factor S will affect the final reflected radiance L o For example, let's take a specific example to illustrate how to calculate the formula L o =L i ρ d S(ω i ·n), specifically assuming the following values: L i =100 (incident radiance, indicating the intensity of incident light); ρ d =0.5 (diffuse reflection ratio, indicating the ability of the surface to reflect light); S = 0.8 (shadow factor, indicating the degree of light obstruction); ω i = 0.7 (the dot product of the incident light direction and the surface normal, representing the angle between the incident light and the normal). Substituting the above values ​​into the formula L o =L i ρ d S(ω i ·n), we can get:

[0116] L o =100×0.5×0.8×0.7

[0117] Then calculate the above expression L o =100×0.5×0.8×0.7=28 to get the reflected radiation rate L o This value represents the intensity of light reflected from the surface of the object given the incident light intensity, diffuse reflection ratio, shadow factor, and the angle between the incident light and the normal.

[0118] Therefore, in the embodiment of the present application, a saturation enhancement term is introduced, and the diffuse reflection term is corrected, while ensuring that the reflected radiance does not exceed the incident radiance is mainly reflected in the following steps or formulas:

[0119] (1) Simplification of geometric series: Under ideal reflection conditions, the geometric series of multiple reflections can be simplified to the following formula:

[0120]

[0121] However, when the surface albedo ρ>0.5, this formula will cause the reflected radiance to be greater than the incident radiance, violating the principle of energy conservation.

[0122] (2) Introduction of saturation factor: In order to meet the requirement of energy conservation, the saturation term is introduced:

[0123]

[0124] This modified diffuse albedo ρ d This ensures that even at high albedo, the reflected radiance does not exceed the incident radiance.

[0125] (3) Correction of the diffuse reflection term of the standard BRDF: In the diffuse reflection term of the standard BRDF, the diffuse reflection ratio k d and the surface diffuse color k d Multiply and Normalize it and get Then, after incorporating the saturation term, the formula is modified to:

[0126]

[0127] This revised formula takes into account the energy attenuation during multiple reflections and ensures energy conservation.

[0128] (4) Application of diffuse reflection illumination equation: The corrected diffuse reflection albedo ρ d Substitute into the standard diffuse lighting equation L i ρ d S(ω i ·n), where S is the shadow factor, ω i is the incident light direction, and is the surface normal of the object. This equation is expressed by ρ d This correction ensures that the reflected radiance does not exceed the incident radiance in the penumbra region due to the additional consideration of the multi-scattered energy.

[0129] In summary, through these steps and formulas, the physically based rendering equation ensures that under various lighting and surface conditions, the reflected radiance is always less than or equal to the incident radiance, thus satisfying the requirement of energy conservation.

[0130] Based on the above introduction, the following example will be given to further illustrate the virtual model processing method of the present application. The specific embodiment of the virtual model processing method is described as follows.

[0131] This application introduces a saturation factor, which actually turns the diffuse albedo into a nonlinear function, making the color saturation change of the simulated penumbra area more natural and realistic. The following is an actual example to illustrate:

[0132] For example, the target virtual model is a wall model, and the diffuse reflectance of the wall model is 0.8. At this time, the color of the wall model at different incident angles can be calculated. Specifically, the calculation under the standard bidirectional reflectance distribution function can be adopted. That is, in the standard bidirectional reflectance distribution function without introducing the saturation factor, the diffuse reflection term is usually linear, that is, as shown in the formula Therefore, for the wall model, according to its corresponding ρ d The calculation formula can be calculated as follows:

[0133] Furthermore, the calculation after the saturation factor is introduced in the embodiment of the present application is as follows:

[0134]

[0135] At this point, the diffuse albedo becomes nonlinear. Therefore, for the same wall model, the ρ calculated by the calculation formula with the introduction of the saturation factor is d will be:

[0136]

[0137] Furthermore, in order to simulate the color saturation change in the penumbra area, we can assume that the incident angle between the light and the wall model is 45 degrees. In this case, we can use the cosine radiator diffuse reflection model to calculate the light intensity:

[0138] L o =L i ·ρ d max(cos(θ), 0)

[0139] Where θ is the angle of incidence, so under the standard bidirectional reflectance distribution function, the reflected light intensity is calculated as:

[0140] L o =L i 0.275 max(cos(45°), 0)

[0141] L o =L i 0.275 0.707 ≈ L i 0.194

[0142] The reflected light intensity calculated after introducing the saturation factor is:

[0143] Lo =L i 0.214 max(cos(45°), 0)

[0144] L o =L i 0.214 0.707 ≈ L i 0.151

[0145] In the embodiment of the present application, due to the introduction of the saturation factor, d The value is lower, which means that in the penumbra area, the intensity of reflected light will be lower, making the color look more saturated. This is because the lower reflected light intensity makes the color purer, thereby improving the perception of color saturation. In summary, after the saturation term is introduced in the embodiment of the present application, the diffuse albedo ρ d It becomes a nonlinear function, which makes it possible to obtain more natural and realistic results when simulating the color saturation change in the penumbra area. This nonlinear processing method better conforms to the actual situation of light scattering and energy attenuation in the physical world, thereby improving the realism of the rendering.

[0146] Specifically, the limitations of the existing standard BRDF in terms of natural color transitions and realistic shadow effects are mainly because the standard model often does not fully consider the impact of multiple reflections and scattering on shadow effects, which results in unnatural color saturation changes when simulating the penumbra area. In the actual physical world, the color saturation in the penumbra area will increase due to multiple scattering and energy attenuation. In order to solve these problems, this proposal has been improved in the following ways, specifically by introducing a saturation factor:

[0147]

[0148] This application corrects the calculation of diffuse albedo by introducing a saturation factor, and obtains the corrected diffuse albedo calculation formula:

[0149]

[0150] This ensures that in the case of high albedo, the reflected radiance will not exceed the incident radiance, achieving the effect of satisfying energy conservation. This modified diffuse albedo takes into account the energy attenuation during multiple reflections, which helps to achieve a more natural color transition under different lighting conditions, especially in the penumbra area. Furthermore, the diffuse reflection lighting equation is modified according to the saturation factor. Specifically, the modified diffuse reflection albedo ρ d Substitute into the standard diffuse lighting equation L o =L i ρ d S(ω i·n), this equation is expressed by ρ d The correction ensures that in the penumbra area, due to the additional consideration of multiple scattered energy, the reflected radiance does not exceed the incident radiance, thereby more accurately simulating the color effect of the penumbra area in the rendering. In addition, although the embodiment of the present application introduces a saturation factor, the calculation of this correction is relatively simple, involving only basic arithmetic operations, and does not significantly increase the amount of calculation, which allows the rendering process to remain efficient while improving the naturalness and realism of the rendering effect. Therefore, through the above-mentioned improvements, the calculation formula provided in the embodiment of the present application can achieve a more natural color transition and a realistic shadow effect while maintaining efficient rendering, and will not significantly increase the amount of calculation, which can effectively save the computer's computing resources.

[0151] This embodiment also provides a virtual model processing device, which can be integrated into a terminal device. Figure 5 As shown, the processing device of the virtual model may include:

[0152] A first determining unit 201 is used to determine a transition area of ​​the target virtual model in a lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model;

[0153] An acquisition unit 202 is used to acquire target albedo information of each target pixel point in the transition area;

[0154] A second determining unit 203 is used to determine a target saturation parameter of each of the target pixels based on the target albedo information and a preset mapping relationship of saturation parameters;

[0155] A third determining unit 204 is used to determine the target diffuse reflection information of the target pixel point based on the target saturation parameter;

[0156] The fourth determining unit 205 is used to determine the pixel value of each of the target pixels based on the illumination information and the target diffuse reflection information corresponding to each of the pixel points.

[0157] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0158] Determine an albedo attenuation coefficient of each of the target pixel points based on the target albedo information of each of the target pixel points, wherein the relationship between the target albedo information and the albedo attenuation coefficient is that the smaller the target albedo information, the larger the albedo attenuation coefficient;

[0159] Based on the albedo attenuation coefficient corresponding to each of the target pixels and the target albedo information, a target saturation parameter of each of the target pixels is determined.

[0160] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0161] Obtaining a difference between a preset first value and a second value corresponding to the target albedo information as the albedo attenuation coefficient;

[0162] The determining of the target saturation parameter of each target pixel point based on the albedo attenuation coefficient corresponding to each target pixel point and the target albedo information includes:

[0163] A first ratio of a second value corresponding to the target albedo information to the difference is obtained as a target saturation parameter of the target pixel.

[0164] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0165] A first ratio corresponding to the target pixel and a second ratio of a preset second value are obtained as target diffuse reflection information of the target pixel.

[0166] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0167] Determining a lighting effect rendering parameter for each target pixel point based on the lighting information corresponding to each target pixel point and the target diffuse reflection information;

[0168] Based on the lighting effect rendering parameters corresponding to each of the target pixels and the preset pixel information, the pixel value of each of the target pixels is determined.

[0169] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0170] Based on the lighting information, model information and target diffuse reflection information corresponding to each of the target pixels, the lighting effect rendering parameters of each of the target pixels are determined, wherein the lighting information includes incident radiation parameters, and the model information includes model normal information and shadow information.

[0171] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0172] Based on the lighting effect rendering parameters corresponding to each of the target pixel points, the corresponding color information and / or brightness information is adjusted to obtain adjusted color information and / or adjusted brightness information;

[0173] Based on the adjusted color information and / or the adjusted brightness information, a pixel value of each of the target pixels is determined.

[0174] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:

[0175] Get the lighting identification parameters;

[0176] Based on the illumination identification parameter, obtaining position information of a transition area of ​​the target virtual model in the illumination scene corresponding to the illumination identification parameter;

[0177] Based on the position information, a transition area of ​​the target virtual model in the lighting scene is determined.

[0178] An embodiment of the present application discloses a processing device for a virtual model, wherein a first determination unit 201 determines a transition area of ​​a target virtual model in a lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model; an acquisition unit 202 acquires target reflection information of each target pixel in the transition area; a second determination unit 203 determines a target saturation parameter of each target pixel based on the target reflection information and a preset mapping relationship of a saturation parameter; a third determination unit 204 determines target diffuse reflection information of the target pixel based on the target saturation parameter; and a fourth determination unit 205 determines a pixel value of each target pixel based on the lighting information and target diffuse reflection information corresponding to each pixel. In an embodiment of the present application, a target saturation parameter of each target pixel is determined based on the target reflection information of each target pixel in the transition area, and a pixel value of each target pixel is determined according to the target saturation parameter; by considering the influence of the saturation factor when rendering the shadow effect of the transition area, a strong color saturation change can be generated in the transition area, thereby truly showing the hue gradient effect of light in the transition area, so that the rendered shadow effect has a more natural color transition, enhances the color expression of the shadow effect, and achieves a more realistic shadow effect on the surface of the virtual model, effectively improving the rendering effect, and improving the rendering efficiency of the virtual model.

[0179] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0180] like Figure 6 As shown, Figure 6A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0181] The processor 301 is the control center of the electronic device 300. It uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the electronic device 300 by running or loading software programs and / or units stored in the memory 302, and calling data stored in the memory 302, so as to monitor the electronic device 300 as a whole. The processor 301 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0182] In the embodiment of the present application, the processor 301 in the electronic device 300 will load instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions, such as:

[0183] Determine a transition area of ​​the target virtual model in the lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model;

[0184] Acquire target reflection information of each target pixel point in the transition area;

[0185] Determining a target saturation parameter of each target pixel based on the target albedo information and a preset mapping relationship of saturation parameters;

[0186] Determining target diffuse reflection information of the target pixel based on the target saturation parameter;

[0187] Based on the illumination information corresponding to each pixel point and the target diffuse reflection information, the pixel value of each target pixel point is determined.

[0188] The electronic device provided in the embodiment of the present application can determine the transition area of ​​the target virtual model in the lighting scene, wherein the transition area is the area between the bright area and the shadow area on the target virtual model; then, the target reflection information of each target pixel in the transition area is obtained; then, based on the target reflection information and the preset mapping relationship of the saturation parameter, the target saturation parameter of each target pixel is determined; thereafter, based on the target saturation parameter, the target diffuse reflection information of the target pixel is determined; finally, based on the lighting information and the target diffuse reflection information corresponding to each pixel, the pixel value of each target pixel is determined. In an embodiment of the present application, a target saturation parameter of each target pixel is determined based on the target reflection information of each target pixel in the transition area, and a pixel value of each target pixel is determined according to the target saturation parameter; by considering the influence of the saturation factor when rendering the shadow effect of the transition area, a strong color saturation change can be generated in the transition area, thereby truly showing the hue gradient effect of light in the transition area, so that the rendered shadow effect has a more natural color transition, enhances the color expression of the shadow effect, and achieves a more realistic shadow effect on the surface of the virtual model, effectively improving the rendering effect, and improving the rendering efficiency of the virtual model.

[0189] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0190] Optional, such as Figure 6 As shown, the electronic device 300 further includes: a touch screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307, respectively. Those skilled in the art can understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0191] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 301, and can receive the command sent by the processor 301 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to realize the input function.

[0192] The radio frequency circuit 304 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0193] The audio circuit 305 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data, and then the audio data is output to the processor 301 for processing, and then sent to another electronic device through the radio frequency circuit 304, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earplug jack to provide communication between an external headset and the electronic device.

[0194] The input unit 306 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0195] The power supply 307 is used to supply power to various components of the electronic device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 307 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0196] although Figure 6 Not shown, the electronic device 300 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0197] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0198] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0199] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any virtual model processing method provided in the embodiment of the present application. The computer program can execute the following steps of the virtual model processing method:

[0200] Determine a transition area of ​​the target virtual model in the lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model;

[0201] Acquire target reflection information of each target pixel point in the transition area;

[0202] Determining a target saturation parameter of each target pixel based on the target albedo information and a preset mapping relationship of saturation parameters;

[0203] Determining target diffuse reflection information of the target pixel based on the target saturation parameter;

[0204] Based on the illumination information corresponding to each pixel point and the target diffuse reflection information, the pixel value of each target pixel point is determined.

[0205] Due to the computer program stored in the storage medium, a transition area of ​​a target virtual model in a lighting scene can be determined, wherein the transition area is an area between a bright area and a shadow area on the target virtual model; then, target reflection information of each target pixel in the transition area is obtained; then, based on the target reflection information and a preset mapping relationship of a saturation parameter, a target saturation parameter of each target pixel is determined; thereafter, based on the target saturation parameter, target diffuse reflection information of the target pixel is determined; finally, based on the lighting information and target diffuse reflection information corresponding to each pixel, a pixel value of each target pixel is determined. In an embodiment of the present application, a target saturation parameter of each target pixel is determined based on the target reflection information of each target pixel in the transition area, and a pixel value of each target pixel is determined according to the target saturation parameter; by considering the influence of the saturation factor when rendering the shadow effect of the transition area, a strong color saturation change can be generated in the transition area, thereby truly showing the hue gradient effect of light in the transition area, so that the rendered shadow effect has a more natural color transition, enhances the color expression of the shadow effect, and achieves a more realistic shadow effect on the surface of the virtual model, effectively improving the rendering effect, and improving the rendering efficiency of the virtual model.

[0206] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0207] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0208] Since the computer program stored in the computer-readable storage medium can execute any virtual model processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any virtual model processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0209] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0210] In the above-mentioned virtual model processing device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-mentioned virtual model processing device, computer-readable storage medium, computer program product, electronic device and its corresponding units can refer to the description of the virtual model processing method in the above embodiment, and will not be repeated here.

[0211] The above is a detailed introduction to a virtual model processing method, device, electronic device, computer-readable storage medium and computer program product provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for processing a virtual model, characterized in that: include: Determine a transition area of ​​the target virtual model in the lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model; Acquire target reflection information of each target pixel point in the transition area; Determining a target saturation parameter of each of the target pixels based on the target albedo information and a preset mapping relationship of saturation parameters; Based on the target saturation parameter, determining the target diffuse reflection information of the target pixel point; Based on the illumination information corresponding to each pixel point and the target diffuse reflection information, a pixel point value of each target pixel point is determined.

2. The method according to claim 1, characterized in that The preset mapping relationship is used to achieve nonlinear transformation between target albedo information and saturation parameters.

3. The method according to claim 2, characterized in that The determining the target saturation parameter of each target pixel based on the target albedo information and the preset mapping relationship of the saturation parameter includes: Determine an albedo attenuation coefficient of each of the target pixel points based on the target albedo information of each of the target pixel points, wherein the relationship between the target albedo information and the albedo attenuation coefficient is that the smaller the target albedo information, the larger the albedo attenuation coefficient; Based on the albedo attenuation coefficient corresponding to each of the target pixels and the target albedo information, a target saturation parameter of each of the target pixels is determined.

4. The method according to claim 3, characterized in that The determining, based on the target albedo information of each target pixel point, an albedo attenuation coefficient of each target pixel point comprises: Obtaining a difference between a preset first value and a second value corresponding to the target albedo information as the albedo attenuation coefficient; The determining of the target saturation parameter of each target pixel point based on the albedo attenuation coefficient corresponding to each target pixel point and the target albedo information includes: A first ratio of a second value corresponding to the target albedo information to the difference is obtained as a target saturation parameter of the target pixel.

5. The method according to claim 4, characterized in that The determining the target diffuse reflection information of the target pixel point based on the target saturation parameter includes: A first ratio corresponding to the target pixel and a second ratio of a preset second value are obtained as target diffuse reflection information of the target pixel.

6. The method according to claim 5, characterized in that The step of determining the pixel value of each target pixel based on the illumination information corresponding to each pixel and the target diffuse reflection information includes: Determining a lighting effect rendering parameter for each target pixel point based on the lighting information corresponding to each target pixel point and the target diffuse reflection information; Based on the lighting effect rendering parameters corresponding to each of the target pixels and the preset pixel information, the pixel value of each of the target pixels is determined.

7. The method according to claim 6, characterized in that The step of determining the lighting effect rendering parameters of each target pixel point based on the lighting information and target diffuse reflection information corresponding to each target pixel point includes: Based on the lighting information, model information and target diffuse reflection information corresponding to each of the target pixels, the lighting effect rendering parameters of each of the target pixels are determined, wherein the lighting information includes incident radiation parameters, and the model information includes model normal information and shadow information.

8. The method according to claim 6, characterized in that The preset pixel point information includes color information and brightness information; The step of determining the pixel value of each target pixel based on the lighting effect rendering parameter corresponding to each target pixel and the preset pixel information includes: Based on the lighting effect rendering parameters corresponding to each of the target pixel points, the corresponding color information and / or brightness information is adjusted to obtain adjusted color information and / or adjusted brightness information; Based on the adjusted color information and / or the adjusted brightness information, a pixel value of each of the target pixels is determined.

9. The method according to claim 1, characterized in that: The step of determining a transition area of ​​the target virtual model under the lighting scene includes: Get the lighting identification parameters; Based on the illumination identification parameter, obtaining position information of a transition area of ​​the target virtual model in the illumination scene corresponding to the illumination identification parameter; Based on the position information, a transition area of ​​the target virtual model in the lighting scene is determined.

10. A virtual model processing device, characterized in that: include: A first determining unit is used to determine a transition area of ​​the target virtual model in a lighting scene, wherein the transition area is an area between a bright area and a shadow area on the target virtual model; An acquisition unit, used for acquiring target albedo information of each target pixel point in the transition area; A second determining unit, configured to determine a target saturation parameter of each of the target pixels based on the target albedo information and a preset mapping relationship of the saturation parameters; A third determining unit, configured to determine target diffuse reflection information of the target pixel point based on the target saturation parameter; The fourth determining unit is used to determine the pixel value of each of the target pixels based on the illumination information and the target diffuse reflection information corresponding to each of the pixel points.

11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the virtual model processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the virtual model processing method according to any one of claims 1 to 9.