Virtual model filter effect rendering method and device, and storage medium

By generating masks and textures by acquiring material maps and optical viewpoint parameters, the problem of rendering filter effects for virtual models is solved, achieving convenient and dynamic rendering effects.

CN115439594BActive Publication Date: 2025-10-24NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211145810.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2025-10-24
Estimated Expiration
2042-09-20

AI Technical Summary

Technical Problem

In existing technologies, the rendering methods for filter effects in virtual models suffer from the problem of difficult parameter adjustment and poor results, especially in the inability to achieve dynamic changes in filter effects when controlling material parameters and global illumination.

Method used

By obtaining the material texture and optical viewpoint parameters of the virtual model, a mask and texture are generated, and the edge and non-edge areas of the virtual model are rendered respectively. A common rendering engine is used to render the filter effect.

Benefits of technology

It improves the rendering convenience and scalability of virtual model filter effects, realizes dynamic changes in filter effects, and enhances rendering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115439594B_ABST
    Figure CN115439594B_ABST
Patent Text Reader

Abstract

The application discloses a virtual model filter effect rendering method and device and a storage medium. The method comprises the following steps: acquiring a first map and optical view angle parameters, wherein the optical view angle parameters are used to determine the optical performance of the filter effect of the virtual model; generating a first mask based on the first map and the optical view angle parameters; performing optical performance processing on the first map according to the optical view angle parameters to obtain a second map; and rendering the filter effect of the virtual model based on the first mask and the second map. The application solves the technical problem of the related art that the method of controlling material parameters or adjusting global light in an overall manner has great difficulty in filter effect rendering and poor effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a virtual model filter lens effect rendering method and device and a storage medium. BACKGROUND

[0002] In the rendering production of a virtual scene, the light effect (such as the reflection light effect or the light transmission effect) of a virtual model of metal or glass material is often processed. One of the technical ideas of the light effect processing is to simulate the use of a circular polarizing lens (or filter lens, Circular-Polarizing Lens, CPL) in a real photography scene to filter the reflected light and thus improve the picture clarity and color concentration. For this purpose, the technicians in the field try various material processing methods or picture rendering methods to realize the filter lens effect rendering of the virtual model.

[0003] In the related art, one filter lens effect rendering method is to control the corresponding variables or expressions respectively for the multiple parameters of the physically based rendering (PBR) material of the virtual model, so as to render the filter lens effect of the virtual model. However, the defect of this method is that the multiple parameters are independent of each other, the adjustment is difficult, and the filter lens effect that changes with the rotation of the camera angle cannot be realized.

[0004] In the related art, another filter lens effect rendering method is to adjust the global light of the virtual scene as a whole in the rendering process to control the light effect (such as the reflection light effect of the bright and dark parts) of the virtual model of metal or glass material. However, the defect of this method is that only the overall light adjustment of the virtual model in the virtual scene is realized, and the effect of improving the picture level that the filter lens can achieve cannot be simulated.

[0005] In view of the above problems, no effective solution has been proposed so far.

[0006] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present application, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0007] The present application provides a virtual model filter lens effect rendering method, device and storage medium to at least solve the technical problem that the method of controlling the material parameters or adjusting the global light in the related art has a large filter lens effect rendering difficulty and poor effect.

[0008] According to one of the embodiments of the present application, a virtual model filter lens effect rendering method is provided, comprising: obtaining a first map and an optical view parameter, wherein the first map is a material map of the virtual model, the first map is determined by a material type of the virtual model, and the optical view parameter is used to determine an optical performance of a filter lens effect of the virtual model; generating a first mask based on the first map and the optical view parameter, wherein the first mask is used to render the filter lens effect of a first area, and the first area is an edge area of the virtual model; performing optical performance processing on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render the filter lens effect of a second area, and the second area is a display area other than the edge area of the virtual model; and rendering the filter lens effect of the virtual model based on the first mask and the second map.

[0009] According to one of the embodiments of the present application, a virtual model filter lens effect rendering device is also provided, comprising: an obtaining module, configured to obtain a first map and an optical view parameter, wherein the first map is a material map of the virtual model, the first map is determined by a material type of the virtual model, and the optical view parameter is used to determine an optical performance of a filter lens effect of the virtual model; a generating module, configured to generate a first mask based on the first map and the optical view parameter, wherein the first mask is used to render the filter lens effect of a first area, and the first area is an edge area of the virtual model; a processing module, configured to perform optical performance processing on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render the filter lens effect of a second area, and the second area is a display area other than the edge area of the virtual model; and a rendering module, configured to render the filter lens effect of the virtual model based on the first mask and the second map.

[0010] According to one of the embodiments of the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program, wherein the computer program is set to execute the virtual model filter lens effect rendering method in any of the above embodiments when running.

[0011] According to one of the embodiments of the present application, an electronic device is also provided, comprising: a memory and a processor, the memory stores a computer program, and the processor is set to run the computer program to execute the virtual model filter lens effect rendering method in any of the above embodiments.

[0012] In at least some embodiments of the present application, first, a first map and an optical perspective parameter are acquired, wherein the first map is a material map of a virtual model, the first map is determined by a material type of the virtual model, and the optical perspective parameter is used to determine an optical performance of a filter effect of the virtual model. Then, a first mask is generated based on the first map and the optical perspective parameter, wherein the first mask is used to render the filter effect of a first area, and the first area is an edge area of the virtual model. Further, an optical performance processing is performed on the first map according to the optical perspective parameter to obtain a second map, wherein the second map is used to render the filter effect of a second area, and the second area is a display area other than the edge area of the virtual model. Thus, the filter effect of the virtual model is rendered based on the first mask and the second map, so as to achieve the purpose of rendering the filter effect of the virtual model based on the material type, the material map and the optical perspective parameter of the virtual model, thereby realizing the technical effects of improving the convenience and scalability of the filter effect rendering of the virtual model, and further solving the technical problem of large difficulty and poor effect of the filter effect rendering in the method of controlling material parameters or adjusting global illumination in the related art. BRIEF DESCRIPTION OF DRAWINGS

[0013] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0014] Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a virtual model filter effect rendering method according to an embodiment of the present application;

[0015] Figure 2 FIG. 2 is a flowchart of a virtual model filter effect rendering method according to an embodiment of the present application;

[0016] Figure 3 FIG. 3 is a schematic diagram of a virtual model filter effect rendering process according to an embodiment of the present application;

[0017] Figure 4 FIG. 4 is a schematic diagram of a rotation effect of a second map rendering result according to an embodiment of the present application;

[0018] Figure 5 FIG. 5 is a comparison diagram of a virtual metal model filter effect rendering according to an embodiment of the present application;

[0019] Figure 6 FIG. 6 is a comparison diagram of a virtual glass model filter effect rendering according to an embodiment of the present application;

[0020] Figure 7is a structural block diagram of a virtual model filter effect rendering device according to an embodiment of the present application;

[0021] Figure 8 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to enable persons skilled in the art to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.

[0023] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0024] In a possible implementation, in the application scenario of the virtual model filter effect rendering involved in the rendering production process of the virtual scene in the field of computer technology, the method of respectively controlling the PBR material parameters or overall adjusting the global illumination is usually adopted, and the inventors still have the technical problems of great rendering difficulty and poor rendering effect after practice and careful research. Based on this, the embodiments of the present application propose a method of virtual model filter effect rendering applied to the above-mentioned virtual scene rendering production scenario, which adopts the technical concept of performing filter effect rendering of the virtual model based on the material type, material map, and optical view angle parameters of the virtual model, realizes the technical effect of improving the convenience and scalability of the filter effect rendering of the virtual model, and solves the technical problems of great filter effect rendering difficulty and poor effect of the method of respectively controlling the material parameters or overall adjusting the global illumination in the related art.

[0025] The above method embodiments related by the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the case of running on a mobile terminal, the mobile terminal can be a smart phone, a tablet computer, a palm computer, a mobile Internet device, a PAD, a game console and other terminal devices. Figure 1 is a hardware structure block diagram of a mobile terminal of a virtual model filter lens effect rendering method according to an embodiment of the present application. As shown in Figure 1 , the mobile terminal can include one or more (only one is shown in Figure 1 ) processors 102 (the processor 102 can include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc. Processing device) and memory 104 for storing data, in an embodiment of the present application, it can also include: input and output device 108 and display device 110.

[0026] In some optional embodiments mainly in game scenarios, the above-mentioned device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction function can include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital video, playing digital music and / or web browsing, etc. Executable instructions for performing the above human-computer interaction functions are configured / stored in one or more processor executable computer program products or readable storage media.

[0027] Those skilled in the art can understand that Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal can include more or fewer components than those shown in Figure 1 , or have a different configuration from Figure 1 .

[0028] According to an embodiment of the present application, an embodiment of a virtual model filter lens effect rendering method is provided. It should be noted that the steps shown in the flowchart of the drawing can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.

[0029] In a possible implementation, the embodiment of the present application provides a virtual model filter lens effect rendering method running on the above-mentioned mobile terminal.Figure 2 is a flowchart of a method for rendering a virtual model with a filter effect according to an embodiment of the present application, as shown in Figure 2 The method comprises the following steps:

[0030] In step S21, a first map and an optical perspective parameter are obtained, wherein the first map is a material map of the virtual model, and the first map is determined by a material type of the virtual model, and the optical perspective parameter is used to determine an optical performance of the filter effect of the virtual model.

[0031] The virtual model can be a virtual model (such as a virtual character, a virtual item, etc.) to be rendered with a filter effect in a virtual game scene. The game type corresponding to the virtual game scene can be: action (for example: first-person or third-person shooting game, two-dimensional or three-dimensional fighting game, war action game, and sports action game, etc.), adventure (for example: exploration game, collection game, puzzle game, etc.), simulation (for example: sand table simulation game, simulation raising game, strategy simulation game, city construction simulation game, business simulation game, etc.), role-playing, and leisure (for example: chess table game, leisure competition game, music rhythm game, dressing-up raising game, etc.) and the like.

[0032] The material type of the virtual model can be a virtual material related to the filter effect. For example, the material type can be a glass material or a metal material. The virtual model can be a virtual glass lens, a virtual glass prop, a virtual metal ball, a virtual metal prop, etc.

[0033] The first map can be a material map of the virtual model. The material map can be determined by the material type of the virtual model. The specific implementation process of determining the material map by the material type of the virtual model can be, but is not limited to: determining the material type of the virtual model to be rendered, then selecting the corresponding material map from the material map database pre-set by the technical personnel according to the material type, or requiring the technical personnel to select or input the material map in real time according to the material type.

[0034] The optical perspective parameter can be a pre-created integrated parameter. The optical perspective parameter can be used to determine the optical performance of the filter effect of the virtual model, wherein the optical performance can include: reflected light intensity, reflected light range (virtual and real visual performance of reflected light), refraction light effect, etc. By integrating multiple parameters related to the filter effect of the virtual model into one optical perspective parameter, the rendering or modification process can be controlled by controlling the one optical perspective parameter, thereby completing the rendering of the filter effect of the virtual model, improving the rendering convenience, and reducing the rendering difficulty.

[0035] Specifically, the obtaining the first map can further include other method steps, which can be referred to the further introduction of the embodiments of the present application below, and details are not described herein.

[0036] In step S22, a first mask is generated based on the first map and the optical perspective parameter, wherein the first mask is used to render a filter effect of a first region, and the first region is an edge region of the virtual model.

[0037] The first region can be an edge region of the virtual model. The edge region of the virtual model can be a region near an edge of a projection (i.e., a two-dimensional display picture) of the virtual model on the graphical user interface. The size of the region can be specified by a technician in advance.

[0038] The first mask can be used to render a filter effect in the first region. Since the material of the virtual model can be a material related to a filter effect such as metal or glass, when a light source of a virtual scene is incident on the virtual model, a more obvious edge reflection light can be generated in the edge region of the virtual model. In the edge region of the virtual model (equivalent to the first region), the first mask can be used to render a filter effect (for example, an edge reflection light effect).

[0039] Based on the material map of the virtual model and the optical perspective parameter, the first mask corresponding to the virtual model can be generated. The material map can be a map variable, and the optical perspective parameter can be a pre-created integrated parameter. Thus, the filter effect rendering method of the virtual model can be flexibly reused by replacing the material map and / or adjusting the optical perspective parameter.

[0040] Specifically, the generating the first mask based on the first map and the optical perspective parameter can further include other method steps, which can be referred to the further introduction of the embodiments of the present application below, and details are not described herein.

[0041] In step S23, the first map is optically rendered based on the optical perspective parameter to obtain a second map, wherein the second map is used to render a filter effect of a second region, and the second region is a to-be-displayed region except the edge region of the virtual model.

[0042] The second region is a to-be-displayed region except the edge region of the virtual model. For example, when the virtual model is a virtual glass ball, the first region is an edge annular region when the virtual glass ball is displayed in the graphical user interface, and the second region is a central circular region surrounded by the edge annular region.

[0043] The second map can be a map for rendering the filter effect in the second area of the virtual model. The second map can be obtained by performing the optical performance processing on the material map of the virtual model. The optical performance processing can be performed according to the optical view parameter. For example, the optical performance processing can be a saturation adjustment processing, a brightness adjustment processing, a layer mixing processing, a color interpolation processing, and the like performed on the material map of the virtual model.

[0044] Specifically, the optical performance processing on the first map to obtain the second map according to the optical view parameter can further include other method steps, which can be referred to the further introduction of the embodiments of the present application below, and will not be described here.

[0045] In step S24, the filter effect of the virtual model is rendered based on the first mask and the second map.

[0046] The rendering engine for performing the rendering step can be a commonly used engine such as Unreal 4 (UE4) game engine, Unreal 5 (UE5) game engine, Unity3D game engine, Redshift renderer, V-Ray image rendering engine, and Arnold image rendering engine.

[0047] With the rendering engine, the filter effect of the virtual model can be rendered based on the first mask and the second map. Specifically, based on the first mask, the filter effect of the edge area of the virtual model can be rendered; based on the second map, the filter effect of the other display area of the virtual model except the edge area can be rendered.

[0048] In at least some embodiments of the present application, first, a first map and an optical perspective parameter are acquired, wherein the first map is a material map of a virtual model, the first map is determined by a material type of the virtual model, and the optical perspective parameter is used to determine an optical performance of a filter effect of the virtual model. Then, a first mask is generated based on the first map and the optical perspective parameter, wherein the first mask is used to render the filter effect of a first area, and the first area is an edge area of the virtual model. Then, the first map is processed according to the optical perspective parameter to obtain a second map, wherein the second map is used to render the filter effect of a second area, and the second area is a display area other than the edge area of the virtual model. Thus, the filter effect of the virtual model is rendered based on the first mask and the second map, so as to achieve the purpose of rendering the filter effect of the virtual model based on the material type, the material map and the optical perspective parameter of the virtual model, thereby realizing the technical effect of improving the convenience and scalability of the filter effect rendering of the virtual model, and further solving the technical problem of difficulty in filter effect rendering and poor effect of the method of controlling material parameters or adjusting global lighting in related technologies.

[0049] The above method of the embodiments of the present application is further described below.

[0050] Optionally, in step S21, acquiring the first map can include the following execution steps:

[0051] In step S211, a material type of the virtual model is acquired, wherein the material type is a metal material or a glass material.

[0052] In step S212, the first map is determined according to the material type.

[0053] The material type of the virtual model described above can be a virtual material related to the filter effect. For example, the material type can be a glass material or a metal material. The virtual model can be a virtual glass lens, a virtual glass prop, a virtual metal ball, a virtual metal prop, etc.

[0054] The specific implementation of acquiring the material type of the virtual model described above can be determined by parameters (such as a preset material type identifier) corresponding to the virtual model, or determined by using a preset material type identification tool (such as a Metallic node in a preset game engine).

[0055] According to the material type described above, the material map of the virtual model is determined as the first map. The material map can be used to determine the characteristics (such as color, brightness, self-luminosity, opacity, etc.) of the PBR material corresponding to the virtual model when shading.

[0056] The specific implementation process of determining the first map according to the material type can be, but is not limited to, the following: determining the material type of the virtual model to be rendered, and then selecting the corresponding material map from the material map database preset by the technical personnel according to the material type, or requiring the technical personnel to select or input the material map in real time according to the material type.

[0057] Optionally, in step S22, generating the first mask based on the first map and the optical perspective parameter can include the following execution steps:

[0058] In step S221, in response to the material type corresponding to the first map being a metal material, a first parameter of the virtual model is calculated based on the optical perspective parameter, wherein the first parameter is used to determine the reflection light intensity corresponding to the first region;

[0059] In step S222, in response to the material type corresponding to the first map being a glass material, a first parameter is calculated based on the optical perspective parameter and a second parameter, wherein the second parameter is an index of refraction parameter corresponding to the glass material;

[0060] In step S223, the first mask is generated using the first map and the first parameter.

[0061] It is easy to understand that, in order to simulate a real photography scene, the metal material is a non-transparent material, so the reflection characteristics of the above metal material are considered, and the glass material is a transparent material, so the reflection characteristics and refraction characteristics of the above glass material are considered.

[0062] When the material type corresponding to the material map of the virtual model is a metal material, the optical performance calculation can be performed based on the optical perspective parameter to obtain a first parameter of the virtual model. The first parameter can be used to determine the reflection light intensity corresponding to the edge region of the virtual model. The reflection light intensity can be used as a basis for rendering the filter effect of the edge region of the virtual model.

[0063] When the material type corresponding to the material map of the virtual model is a glass material, the optical performance calculation can be performed based on the optical perspective parameter and the second parameter to obtain the reflection light intensity (equivalent to the first parameter) corresponding to the edge region of the virtual model. The second parameter can be an index of refraction (IOR) parameter corresponding to the glass material.

[0064] It should be noted that the optical perspective parameter can be a pre-created integrated angle parameter. The second parameter can be a preset constant value determined by the technical personnel according to the index of refraction parameter of the common glass material in the real scene.

[0065] It should be noted that the optical performance calculation can be a calculation according to the law of optical nature (for example: Fresnel equation), which can be used to calculate the reflection light intensity of the metal material according to the integrated angle parameter, and can also be used to calculate the reflection light intensity of the glass material according to the integrated angle parameter and the second parameter.

[0066] Optionally, in step S223, generating the first mask using the first map and the first parameter can include the following execution steps:

[0067] Step S224, obtaining a third parameter of the virtual model, wherein the third parameter is used to determine a reflection light range corresponding to the first region;

[0068] Step S225, adjusting the orientation of the first map to obtain an adjustment result;

[0069] Step S226, generating the first mask based on the first parameter, the third parameter and the adjustment result.

[0070] The third parameter of the virtual model can be used to determine the display range of the edge reflection light corresponding to the edge region of the virtual model. The specific implementation process of obtaining the third parameter of the virtual model can be: obtaining the range parameter specified by the technician in advance as the third parameter, or determining the display range of the edge reflection light according to the rendering rule related to the virtual model to determine the third parameter.

[0071] The first map can be a material map of the virtual model. Adjusting the orientation of the first map can obtain the adjustment result. It is easy to understand that by adjusting the orientation of the first map, the orientation of the first map can be limited according to the requirements of the application scene, and the filter effect rendered based on the first map is further controlled.

[0072] The first parameter can be the reflection light intensity corresponding to the edge region of the virtual model. Based on the first parameter, the third parameter and the adjustment result, the first mask can be generated. The first mask can be used to render the filter effect corresponding to the edge region of the virtual model.

[0073] Optionally, in step S225, adjusting the orientation of the first map to obtain an adjustment result can include the following execution steps:

[0074] Step S2251, obtaining a virtual camera position corresponding to the virtual model;

[0075] Step S2252, adjusting the map orientation of the first map based on the virtual camera position to obtain an adjustment result.

[0076] The virtual camera position corresponding to the virtual model can be an observation position of a virtual camera in a virtual scene where the virtual model is located. The virtual camera position can be given in a position coordinate in a world space coordinate system. The virtual camera position can be used to determine an observation direction of the virtual camera.

[0077] The specific implementation process of obtaining the virtual camera position corresponding to the virtual model can be directly output by a preset game engine or pre-calculated by a technician.

[0078] Based on the virtual camera position, the mapping orientation of the first map can be adjusted to obtain the adjustment result. Specifically, the specific implementation process of adjusting the mapping orientation of the first map based on the virtual camera position can be: using a Camera Vector node in the preset game engine to process, so that the mapping orientation of the first map can always be consistent with the observation direction of the virtual camera.

[0079] It should be noted that the Camera Vector node can calculate the relationship between the RGB value of the first map and the distance from the first map to the virtual camera, and then determine the RGB value of the virtual model edge reflection light corresponding to the first map based on the coordinates of the first map in the world space according to the relationship, so as to ensure that the orientation of the first mask obtained from the first map is always consistent with the observation direction of the virtual camera.

[0080] It is easy to understand that by adjusting the mapping orientation of the first map, the mapping orientation of the first map is always consistent with the observation direction of the virtual camera in the virtual scene, which can further make the filter effect of the virtual model generated based on the first map more consistent with the performance of the real scene. Specifically, when the observation direction of the virtual camera in the virtual scene changes (for example, when the player controls the rotation of the virtual model), the filter effect corresponding to the current observation direction can be rendered in real time, thereby improving the experience of the player.

[0081] Optionally, in step S226, generating the first mask based on the first parameter, the third parameter and the adjustment result can include the following execution steps:

[0082] Step S2261, generating a second mask based on the first parameter, the third parameter and the adjustment result;

[0083] Step S2262, performing interpolation level processing on the second mask to obtain the first mask.

[0084] The first parameter can be used to determine the reflected light intensity corresponding to the edge region of the virtual model, the third parameter can be used to determine the reflected light range corresponding to the edge region of the virtual model, and the adjustment result is a map obtained after the first map is azimuthally adjusted. Based on the first parameter, the third parameter and the adjustment result, the second mask can be generated. The second mask can be an edge mask to be optimized for generating the first mask.

[0085] The specific implementation process of performing interpolation level processing on the second mask to obtain the first mask can be: generating an optimized mask corresponding to the second mask again using the optical natural law (for example, the Fresnel equation after approximation processing), and performing interpolation mixing (for example, average interpolation mixing) on the second mask and the optimized mask using the interpolation tool (for example, the Lerp node) provided by the preset game engine, and then obtaining the first mask.

[0086] It is easy to understand that by using the Fresnel equation after approximation to optimize the edge mask to be optimized (equivalent to the second mask), the level of the corresponding edge reflected light in the finally obtained first mask can be made more rich, and the intensity of the edge reflected light can change with the change of the observation direction of the virtual camera.

[0087] Optionally, in step S2261, generating the second mask based on the first parameter, the third parameter and the adjustment result can include the following execution steps:

[0088] Step S2263, obtaining the geometric shape of the first region;

[0089] Step S2264, generating a third mask according to the geometric shape based on the third parameter and the adjustment result;

[0090] Step S2265, generating a fourth mask according to the geometric shape based on the first parameter, the third parameter and the adjustment result;

[0091] Step S2266, performing division calculation on the third mask and the fourth mask to obtain the second mask.

[0092] The first region can be an edge region of the virtual model. The edge region of the virtual model can be a nearby region of the edge of the projection (i.e., a two-dimensional display picture) of the virtual model on the graphical user interface. The size of the nearby region can be specified by a technician in advance. The specific implementation process of obtaining the geometric shape of the first region can be: using a graphical recognition tool to recognize the edge region of the virtual model to obtain the geometric shape. For example, when the virtual model is a virtual metal sphere, the geometric shape is a circle corresponding to the size of the virtual metal sphere.

[0093] The third parameter can be used to determine the reflected light range of the edge region of the virtual model, and the adjustment result can be the first map after the orientation adjustment of the first map. Based on the third parameter and the adjustment result, the third mask can be generated according to the geometric shape. The third mask can be used to generate the second mask. For example, when the geometric shape is a circle corresponding to the size of the virtual metal sphere, the third mask can be

[0094] The first parameter can be used to determine the reflected light intensity of the edge region of the virtual model. Based on the first parameter, the third parameter and the adjustment result, the fourth mask can be generated according to the geometric shape. The fourth mask can be used to generate the second mask.

[0095] It is easy to understand that the third mask and the fourth mask can be two masks with the same geometric shape but different sizes. For example, the third mask is a circular mask with a smaller radius, which is used to determine the inner boundary of the edge region; the fourth mask is a circular mask with a larger radius, which is used to determine the outer boundary of the edge region; the centers of the third mask and the fourth mask can coincide or not coincide (determined by the technical personnel according to the application scene requirements).

[0096] The third mask and the fourth mask are divided to obtain the second mask. Specifically, the specific implementation process of dividing the third mask and the fourth mask can be: using the Subtract node provided by the preset game engine to divide the third mask and the fourth mask to obtain the second mask.

[0097] It is easy to understand that the process of dividing the third mask and the fourth mask can be visually represented as: subtracting the area corresponding to the third mask with a smaller radius from the area corresponding to the fourth mask with a larger radius. In particular, when the centers of the fourth mask and the third mask coincide, the shape of the second mask obtained by dividing the third mask and the fourth mask is annular, and the center of the annular ring coincides with the center.

[0098] Optionally, in step S23, the second map can be obtained by performing the following steps according to the optical perspective parameter:

[0099] In step S231, the saturation of the first map is adjusted to obtain a third map, wherein the saturation of the third map is lower than that of the first map.

[0100] In step S232, the third map is adjusted according to the optical perspective parameter to obtain the second map.

[0101] The first map can be a material map of the virtual model. The material map can be used to determine the characteristics (such as color, brightness, self-luminosity, opacity, etc.) of the PBR material corresponding to the virtual model when shading.

[0102] The third map can be obtained by performing saturation adjustment on the first map. Specifically, the specific implementation of performing saturation adjustment on the first map can be: performing mapping processing on the saturation data corresponding to the first map, so that the range of the saturation data is between 0 and 1, to obtain a mapping result; and then using a desaturation tool (such as a DeSaturation node) provided by a preset game engine to process the mapping result of the first map, to obtain the third map. That is, the saturation of the third map is lower than that of the first map.

[0103] The optical perspective parameter can be a pre-created integrated angle parameter. The optical perspective parameter can be used to determine the optical performance of the filter effect of the virtual model. Using the optical perspective parameter, the third map can be adjusted for dark reflection, and the second map can be obtained. The second map can be used to render a map of the filter effect in the second region of the virtual model, and the second region is a to-be-displayed region excluding the edge region of the virtual model.

[0104] Optionally, in step S232, adjusting the third map for dark reflection using the optical perspective parameter to obtain the second map can include the following execution steps:

[0105] In step S2321, based on the fourth map, the fifth map, a preset constant parameter, and the optical perspective parameter, the third map is adjusted for dark reflection using a shape mask tool to obtain the second map, wherein the fourth map is a dark texture map corresponding to the virtual model, and the fifth map is a preset noise map.

[0106] The fourth map can be a dark texture map corresponding to the virtual model. The dark texture performance corresponding to the fourth map corresponds to the change of the dark region of the virtual model. The fifth map can be a noise map pre-set by a technician.

[0107] The preset constant parameter can be a constant parameter pre-set by a technician. The optical perspective parameter can be a pre-created integrated angle parameter. The optical perspective parameter can be used to determine the optical performance of the filter effect of the virtual model.

[0108] Based on the fourth map, the fifth map, the preset constant parameter and the optical perspective parameter, the dark reflection adjustment is performed on the third map by using the shape mask tool (for example, a spherical mask tool Sphere Mask provided by a preset game engine), and the second map is obtained.

[0109] Specifically, the dark reflection adjustment on the third map includes: performing coordinate transformation on the third map by using a coordinate transformation node (for example, a TransformVector node) of the shape mask tool, so that the coordinate information of the third map is changed to the world space; and performing orientation adjustment on the third map by using an orientation adjustment node (for example, a CameraVector node) of the shape mask tool, so that the map orientation of the third map is always consistent with the observation direction of the virtual camera.

[0110] Specifically, the dark reflection adjustment on the third map includes: based on the fifth map, performing mixing control on the third map by using the shape mask tool according to the preset constant parameter and the optical perspective parameter, adjusting the texture of the third map according to the position and observation direction of the virtual camera, and further improving the dark texture level of the third map; and then superimposing the adjusted third map and the fourth map to obtain the second map.

[0111] In summary, the technical scheme of the present application uses the material type, the material map and the optical perspective parameter based on the virtual model to perform the filter effect rendering of the virtual model, improves the convenience and expandability of the filter effect rendering of the virtual model, and solves the technical problems of the method of controlling material parameters or adjusting global light in related technologies, which has great difficulty in filter effect rendering and poor effect. The above scheme can be applied to scenes involving filter effect rendering in a third person shooting (TPS for short) game (for example, a virtual character observing a distance through a scope, observing a distance through a spherical water droplet, rendering of a virtual glass prop in a scene, etc.). The key technologies of the embodiments of the present application are described in detail as follows:

[0112] Figure 3 is a schematic diagram of a filter effect rendering process of a virtual model according to an embodiment of the present application, as Figure 3 shown, a polar angle parameter (equivalent to the optical perspective parameter) is created in advance by a technician to control the optical performance (for example, edge reflection intensity, dark reflection intensity of material, etc.) of the filter effect of the virtual model, and the polar angle parameter is controlled by a polar angle parameter node.

[0113] Still as Figure 3As shown, by the material node, the first map (i.e. the material map of the virtual model) can be obtained, and the material type corresponding to the first map can also be determined, which can be a metal material or a glass material.

[0114] Still as Figure 3 As shown, based on the Polar Angle provided by the Polar Angle parameter node, the edge reflection light intensity of the virtual model can be calculated by the Fresnel formula using the Schlick Phase Function node, the reflectivity node and the refractive index node, and the edge reflection light intensity is transmitted to the intensity parameter node.

[0115] Specifically, in the process of calculating the edge reflection light intensity of the virtual model by the Fresnel formula, the Fresnel formula used can be as shown in the following formula (1) to formula (2):

[0116]

[0117]

[0118] In the above formula (1) and formula (2), R p is the reflection light intensity of P-polarized light, R s is the reflection light intensity of S-polarized light, θ i represents the angle between the incident light and the normal, θ t represents the angle between the refracted light and the normal, n1 represents the refractive index of the medium where the incident light is located, and n2 represents the refractive index of the virtual model.

[0119] Further, based on the above formula (1) and formula (2), combined with the reflection law as shown in the following formula (3), the angle relationship as shown in the following formula (4) can be derived:

[0120] n1sinθ i = n2sinθ t Formula (3)

[0121]

[0122] Based on the above formula (1) to formula (4), the edge reflection light intensity of the virtual model can be calculated based on the Polar Angle provided by the Polar Angle parameter node, using the Schlick Phase Function node, the reflectivity node and the refractive index node.

[0123] Further, the Fresnel formula can be approximated by using the above-mentioned phase function (Schlick Phase Function) node to obtain more accurate edge light reflection intensity. Assuming that the reflectivity when the angle between the incident light and the normal line is 0 is the base reflectivity R0, the Fresnel approximation formula shown in the following formula (5) can be obtained: i = 0 is the base reflectivity R0, the Fresnel approximation formula shown in the following formula (5) can be obtained:

[0124] R = R0 + (1 - R0) (1 - cosθ i ) 5 Formula (5)

[0125] In the above-mentioned formula (5), R represents the actual reflectivity of the edge light.

[0126] In the above-mentioned phase function (Schlick Phase Function) node, cosθ i can be represented as the dot product of the incident light direction and the normal line. Accordingly, by controlling the numerical value of the initial reflectivity R0, cosθ i can be controlled, and the actual reflectivity R of the edge light can be obtained.

[0127] It should be noted that the above-mentioned pre-created polar angle parameter can be used to replace the numerical value of cosθ i in the calculation.

[0128] It should be noted that when the technical personnel set the reflectivity parameter for the metal material or set the reflectivity parameter for the glass material, the reflectivity parameter used in the rendering filter effect can be determined according to the reflectivity of the common metal material or the common glass material in the real scene.

[0129] Table 1

[0130] Metal \ Wavelength 800 nm 650 nm 500 nm Aluminum 86.7% 90.5% 91.8% Silver 99.2% 98.8% 97.9% Gold 98.0% 95.5% 47.7% Copper 98.1% 96.6% 60.0%

[0131] For example, the reflectivity parameter value of the common metal shown in Table 1 can be selected by the technical personnel according to Table 1, and the reflectivity of the metal can be averaged to obtain the metal material reflectivity parameter to be used. When the selected target common metal is aluminum (Al), the average reflectivity calculated according to Table 1 is 0.89, and 0.89 can be used as a constant to be used as the metal material reflectivity parameter to be used. The reflectivity node is stored.

[0132] It should be noted that when the technical personnel set the refractive index parameter for the glass material, the refractive index parameter to be used can be determined according to the IOR parameter calibration value of the common material in the real scene. In this example, the refractive index parameter of the glass material to be used is calibrated to 1.5.

[0133] In addition, when rendering the filter effect for the virtual model of the glass material, the Opacity parameter of the glass material can also be set. In the real scene, the Opacity parameter of the common transparent colorless glass is usually 82% to 83%. In this example, the Opacity parameter is mapped and calculated so that the value of the Opacity parameter is between 0.1 and 0.2. The Opacity parameter can also be integrated into the Polar Angle parameter (equivalent to the above optical view angle parameter).

[0134] Still as Figure 3 shown, the specific implementation process of generating the edge light mask (equivalent to the above first mask) using the edge light reflection intensity provided by the intensity parameter node (hereinafter referred to as iris ratio, equivalent to the above first parameter) and the first map provided by the material node includes the following method steps:

[0135] Step E1, obtain the edge light display range (hereinafter referred to as pupil size, equivalent to the above third parameter) through the range parameter node;

[0136] Step E2, transform the map coordinates of the first map to the world space using the Transform Vector node, and adjust the orientation of the first map using the Camera Vector node so that the map orientation of the first map is always consistent with the observation direction of the virtual camera;

[0137] Step E3, generate the mask Mask1 based on the first map adjusted in the above step E2 and the pupil size using the mask node 1;

[0138] Step E4, multiply the above pupil size and the above iris ratio using the multiplication node 1;

[0139] Step E5, generate the mask Maks2 based on the first map adjusted in the above step E2 and the result obtained by the multiplication calculation in the above step E4 using the mask node 2;

[0140] Step E6, divide the mask Mask1 and the mask Maks2 to obtain the mask Mask3 using the division node;

[0141] Step E7, based on the Polar Angle parameter (equivalent to the above optical view angle parameter), generate the mask Y using the mapping node 1, the multiplication node 2, the preset parameter node 1, the preset parameter node 2 and the multiplication node 2, and use the Fresnel node (use the above approximate Fresnel formula) again;

[0142] Step E8, using an addition node, add the mask Y and the mask Mask3 obtained in the above step E6 (equivalent to the above interpolation level processing) to obtain a mask Mask4 (equivalent to the above first mask), which can be used to render the filter effect of the edge area of the virtual model.

[0143] Further, the first map is desaturated by using a DeSaturation node, and based on the desaturated first map, a dark texture map corresponding to the virtual model, and a preset noise map, a SphereMask is created by using a mask tool, and in combination with a polar angle parameter Polar Angle (equivalent to the above optical view angle parameter) and a preset constant parameter, a second map for rendering the filter effect in a second area (a to-be-displayed area other than the edge area) of the virtual model is obtained.

[0144] Figure 4 is a schematic diagram of a rotation effect of a second map rendering result according to an embodiment of the present application, as Figure 4 shown, based on the virtual model obtained by the above second map rendering, the intensity of the dark reflection of the virtual model can change with the rotation of the observation direction of the virtual camera. As Figure 4 shown before the rotation of the virtual camera, the intensity of the dark reflection of the virtual model is large, and the overall brightness of the virtual model is bright in visual performance. As Figure 4 shown after the rotation of the virtual camera, the intensity of the dark reflection of the virtual model is small, and the brightness of the dark part of the virtual model is small, and the brightness of other areas is large.

[0145] Figure 5 is a comparison diagram of a filter effect rendering of a virtual metal model according to an embodiment of the present application, as Figure 5 shown, the schematic diagrams before and after adjusting the filter effect of the virtual metal ball by the above filter effect rendering method of the virtual metal model are compared, it is easy to note that the saturation of the color of the rendering result after adjustment is higher than that of the rendering result before adjustment, and the picture level is stronger, and is closer to the filter effect in the real scene.

[0146] Figure 6 is a comparison diagram of a filter effect rendering of a virtual glass model according to an embodiment of the present application, as Figure 6 shown, the schematic diagrams before and after adjusting the filter effect of the virtual glass ball by the above filter effect rendering method of the virtual glass model are compared, it is easy to note that the effect of the edge light of the rendering result after adjustment is closer to the real scene than that of the rendering result before adjustment, and the picture level is stronger (as Figure 6The adjusted rendering result takes into account the light transmittance, the dark texture is more realistic, and is closer to the filter effect in the real scene.

[0147] Those skilled in the art can clearly understand the method according to the above-mentioned embodiments can be realized by means of software and necessary general hardware platform, of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a magnetic disk, an optical disk), and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, or a network device) execute the method described in each embodiment of the present application.

[0148] In the embodiment, a virtual model filter effect rendering device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.

[0149] Figure 7 is a structural block diagram of a virtual model filter effect rendering device according to one of the embodiments of the present application, as Figure 7 shown, the device comprises: an acquisition module 71, configured to acquire a first map and an optical view parameter, wherein the first map is a material map of a virtual model, the first map is determined by a material type of the virtual model, and the optical view parameter is used to determine an optical performance of a filter effect of the virtual model; a generation module 72, configured to generate a first mask based on the first map and the optical view parameter, wherein the first mask is used to render the filter effect of a first area, and the first area is an edge area of the virtual model; a processing module 73, configured to perform optical performance processing on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render the filter effect of a second area, and the second area is a display area other than the edge area of the virtual model; and a rendering module 74, configured to render the filter effect of the virtual model based on the first mask and the second map.

[0150] Optionally, the acquisition module 71 is further configured to acquire a material type of the virtual model, wherein the material type is a metal material or a glass material; and determine the first map according to the material type.

[0151] Optionally, the generation module 72 is further configured to: in response to the material type corresponding to the first map being a metal material, calculate a first parameter of the virtual model based on the optical perspective parameter, wherein the first parameter is used to determine the reflected light intensity corresponding to the first region; in response to the material type corresponding to the first map being a glass material, calculate the first parameter based on the optical perspective parameter and a second parameter, wherein the second parameter is a refractive index parameter corresponding to the glass material; and generate the first mask by using the first map and the first parameter.

[0152] Optionally, the generation module 72 is further configured to: obtain a third parameter of the virtual model, wherein the third parameter is used to determine a reflected light range corresponding to the first region; perform orientation adjustment on the first map to obtain an adjustment result; and generate the first mask based on the first parameter, the third parameter and the adjustment result.

[0153] Optionally, the generation module 72 is further configured to: obtain a virtual camera position corresponding to the virtual model; and adjust the mapping orientation of the first map based on the virtual camera position to obtain an adjustment result.

[0154] Optionally, the generation module 72 is further configured to: generate a second mask based on the first parameter, the third parameter and the adjustment result; and perform interpolation level processing on the second mask to obtain the first mask.

[0155] Optionally, the generation module 72 is further configured to: obtain a geometric shape of the first region; generate a third mask according to the geometric shape based on the third parameter and the adjustment result; generate a fourth mask according to the geometric shape based on the first parameter, the third parameter and the adjustment result; and perform division calculation on the third mask and the fourth mask to obtain the second mask.

[0156] Optionally, the processing module 73 is further configured to: perform saturation adjustment on the first map to obtain a third map, wherein the saturation of the third map is lower than that of the first map; and perform dark reflection adjustment on the third map based on the optical perspective parameter to obtain the second map.

[0157] Optionally, the processing module 73 is further configured to: perform dark reflection adjustment on the third map based on the fourth map, the fifth map, a preset constant parameter and the optical perspective parameter by using a shape mask tool to obtain the second map, wherein the fourth map is a dark texture map corresponding to the virtual model, and the fifth map is a preset noise map.

[0158] It should be noted that the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all the modules are located in the same processor; or the modules are located in different processors in any combination.

[0159] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any method embodiment described above when running.

[0160] Optionally, in the embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk and various storage media that can store computer programs.

[0161] Optionally, in the embodiment, the computer readable storage medium can be located in any computer terminal in a computer terminal group in a computer network or in any mobile terminal in a mobile terminal group.

[0162] Optionally, in the embodiment, the computer readable storage medium can be configured to store a computer program for executing the following steps:

[0163] S1, acquiring a first map and an optical perspective parameter, wherein the first map is a material map of a virtual model, the first map is determined according to a material type of the virtual model, and the optical perspective parameter is used to determine an optical performance of a filter effect of the virtual model;

[0164] S2, generating a first mask based on the first map and the optical perspective parameter, wherein the first mask is used to render the filter effect of the first area, and the first area is an edge area of the virtual model;

[0165] S3, performing optical performance processing on the first map according to the optical perspective parameter to obtain a second map, wherein the second map is used to render a filter effect of a second area, and the second area is a display area other than the edge area of the virtual model;

[0166] S4, rendering the filter effect of the virtual model based on the first mask and the second map.

[0167] Optionally, the computer readable storage medium is further configured to store program code for executing the following steps: acquiring a material type of the virtual model, wherein the material type is a metal material or a glass material; and determining the first map according to the material type.

[0168] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: in response to the material type corresponding to the first map being a metal material, calculating a first parameter of the virtual model based on the optical view parameter, wherein the first parameter is used to determine the reflected light intensity corresponding to the first region; in response to the material type corresponding to the first map being a glass material, calculating the first parameter based on the optical view parameter and a second parameter, wherein the second parameter is a refractive index parameter corresponding to the glass material; and generating the first mask by using the first map and the first parameter.

[0169] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: obtaining a third parameter of the virtual model, wherein the third parameter is used to determine the reflected light range corresponding to the first region; performing orientation adjustment on the first map to obtain an adjustment result; and generating the first mask based on the first parameter, the third parameter and the adjustment result.

[0170] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: obtaining a virtual camera position corresponding to the virtual model; and adjusting the mapping orientation of the first map based on the virtual camera position to obtain an adjustment result.

[0171] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: generating a second mask based on the first parameter, the third parameter and the adjustment result; and performing interpolation level processing on the second mask to obtain the first mask.

[0172] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: obtaining a geometric shape of the first region; generating a third mask according to the geometric shape based on the third parameter and the adjustment result; generating a fourth mask according to the geometric shape based on the first parameter, the third parameter and the adjustment result; and performing division calculation on the third mask and the fourth mask to obtain the second mask.

[0173] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: performing saturation adjustment on the first map to obtain a third map, wherein the saturation of the third map is lower than that of the first map; and performing dark reflection adjustment on the third map by using the optical view parameter to obtain the second map.

[0174] Optionally, the computer readable storage medium is further configured to store program codes for performing the following steps: performing dark reflection adjustment on the third map by using a shape mask tool based on a fourth map, a fifth map, a preset constant parameter and the optical view parameter to obtain the second map, wherein the fourth map is a dark texture map corresponding to the virtual model, and the fifth map is a preset noise map.

[0175] In the computer readable storage medium of the embodiment, a technical solution of a virtual model filter effect rendering method is provided. First, a first map and an optical view parameter are acquired, wherein the first map is a material map of the virtual model, the first map is determined by a material type of the virtual model, and the optical view parameter is used to determine an optical performance of a filter effect of the virtual model. A first mask is generated based on the first map and the optical view parameter, wherein the first mask is used to render a filter effect of a first area, and the first area is an edge area of the virtual model. An optical performance processing is performed on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render a filter effect of a second area, and the second area is a display area except the edge area of the virtual model. Thus, the filter effect of the virtual model is rendered based on the first mask and the second map, so as to achieve the purpose of rendering the filter effect of the virtual model based on the material type, the material map and the optical view parameter of the virtual model, thereby realizing the technical effects of improving the convenience and scalability of the filter effect rendering of the virtual model, and further solving the technical problem of great difficulty and poor effect of the filter effect rendering in the related art method of respectively controlling material parameters or integrally adjusting global illumination.

[0176] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a computer readable storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present application.

[0177] In the example embodiments of the present application, a program product capable of implementing the above-mentioned method of the embodiment is stored on a computer readable storage medium. In some possible embodiments, various aspects of the embodiments of the present application can also be implemented in the form of a program product, which includes program code for causing a terminal device to execute the steps described in the “example method” section above according to various example embodiments of the present application when the program product runs on the terminal device.

[0178] A program product for implementing the above method according to the embodiments of the present application can adopt a portable compact disc read-only memory (CD-ROM) and include program codes, and can run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present application is not limited thereto, and in the embodiments of the present application, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used by or in conjunction with an instruction execution system, apparatus or device.

[0179] The above program product can adopt any combination of one or more computer readable media. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0180] It should be noted that the program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0181] The embodiments of the present application also provide an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0182] Optionally, the above electronic device can further include a transmission device connected to the processor and an input and output device connected to the processor.

[0183] Optionally, in the present embodiment, the processor can be configured to perform the following steps by the computer program:

[0184] S1, obtaining a first map and an optical perspective parameter, wherein the first map is a material map of a virtual model, the first map being determined by a material type of the virtual model, and the optical perspective parameter is used to determine an optical performance of a filter effect of the virtual model;

[0185] S2, generating a first mask based on the first map and the optical perspective parameter, wherein the first mask is used to render the filter effect of the first area, and the first area is an edge area of the virtual model;

[0186] S3, performing optical performance processing on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render the filter effect of the second area, and the second area is a to-be-displayed area except for the edge area of the virtual model;

[0187] S4, rendering the filter effect of the virtual model based on the first mask and the second map.

[0188] Optionally, the processor can also be configured to execute the following steps through the computer program: obtaining a material type of the virtual model, wherein the material type is a metal material or a glass material; and determining the first map according to the material type.

[0189] Optionally, the processor can also be configured to execute the following steps through the computer program: in response to the material type corresponding to the first map being the metal material, calculating a first parameter of the virtual model based on the optical view parameter, wherein the first parameter is used to determine the reflection light intensity corresponding to the first area; and in response to the material type corresponding to the first map being the glass material, calculating the first parameter based on the optical view parameter and a second parameter, wherein the second parameter is a refractive index parameter corresponding to the glass material; and generating the first mask by using the first map and the first parameter.

[0190] Optionally, the processor can also be configured to execute the following steps through the computer program: obtaining a third parameter of the virtual model, wherein the third parameter is used to determine a reflection light range corresponding to the first area; performing orientation adjustment on the first map to obtain an adjustment result; and generating the first mask based on the first parameter, the third parameter and the adjustment result.

[0191] Optionally, the processor can also be configured to execute the following steps through the computer program: obtaining a virtual camera position corresponding to the virtual model; and adjusting a map orientation of the first map based on the virtual camera position to obtain an adjustment result.

[0192] Optionally, the processor can also be configured to execute the following steps through the computer program: generating a second mask based on the first parameter, the third parameter and the adjustment result; and performing interpolation level processing on the second mask to obtain the first mask.

[0193] Optionally, the processor can also be configured to execute the following steps through the computer program: obtaining a geometric shape of the first area; generating a third mask according to the geometric shape based on the third parameter and the adjustment result; generating a fourth mask according to the geometric shape based on the first parameter, the third parameter and the adjustment result; and performing division calculation on the third mask and the fourth mask to obtain the second mask.

[0194] Optionally, the processor can be further configured to perform the following steps by using a computer program: performing saturation adjustment on the first map to obtain a third map, wherein the saturation of the third map is lower than that of the first map; and performing highlight adjustment on the third map by using the optical perspective parameter to obtain the second map.

[0195] Optionally, the processor can be further configured to perform the following steps by using a computer program: performing highlight adjustment on the third map by using a shape mask tool based on the fourth map, the fifth map, a preset constant parameter and the optical perspective parameter to obtain the second map, wherein the fourth map is a highlight texture map corresponding to the virtual model, and the fifth map is a preset noise map.

[0196] In the electronic device of the embodiment, a technical solution of a filter effect rendering method of a virtual model is provided. First, a first map and an optical perspective parameter are obtained, wherein the first map is a material map of the virtual model, the first map is determined by a material type of the virtual model, and the optical perspective parameter is used to determine an optical performance of a filter effect of the virtual model. A first mask is generated based on the first map and the optical perspective parameter, wherein the first mask is used to render a filter effect of a first region, and the first region is an edge region of the virtual model. The first map is processed according to the optical perspective parameter to obtain a second map, wherein the second map is used to render a filter effect of a second region, and the second region is a display region other than the edge region of the virtual model. Thus, the filter effect of the virtual model is rendered based on the first mask and the second map, so as to achieve the purpose of rendering the filter effect of the virtual model based on the material type, the material map and the optical perspective parameter of the virtual model, thereby realizing the technical effects of improving the convenience and expandability of the filter effect rendering of the virtual model, and further solving the technical problem of difficulty in filter effect rendering and poor effect of the method of controlling material parameters or adjusting global light in the related art.

[0197] Figure 8 is a schematic diagram of an electronic device according to an embodiment of the present application. As shown in Figure 8 , the electronic device 800 is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0198] As shown in Figure 8 , the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 can include, but are not limited to, the at least one processor 810, the at least one memory 820, a bus 830 connecting different system components (including the memory 820 and the processor 810), and a display 840.

[0199] The memory 820 stores, among other things, program code that is executable by the processor 810 for implementing the steps described in the above method portions of the embodiments of the present application according to the various exemplary embodiments of the present application.

[0200] The memory 820 can include a readable medium in the form of volatile memory units, such as random access memory (RAM) 8201 and / or cache memory units 8202, and can further include a read-only memory (ROM) 8203, and can also include non-volatile memory, such as one or more magnetic data storage devices, flash memory, or other non-volatile solid-state memory.

[0201] In some examples, the memory 820 can also include program / utility 8204 having a set of programs / modules 8205, including, but not limited to: operating systems, one or more application programs, other programs / modules, and program data, each of which or a combination can include an implementation of a network environment. The memory 820 can further include memory that is remote from the processor 810, which can be connected to the electronic device 800 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0202] The bus 830 can be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor 810, or a local bus using any of a variety of bus architectures.

[0203] The display 840 can be, for example, a touch screen type liquid crystal display (LCD) that can enable a user to interact with a user interface of the electronic device 800.

[0204] Optionally, the electronic device 800 can also communicate with one or more external devices 900, such as a keyboard or a pointing device, a Bluetooth device, etc., and can also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or with any devices (such as a router, a modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication can occur via an input / output (I / O) interface 850. Still yet, the electronic device 800 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the public network, such as the Internet, via a network adapter 860. As Figure 8As shown, the network adapter 860 communicates with other modules of the electronic device 800 via the bus 830. Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID systems), tape drives, and data backup storage systems.

[0205] The electronic device 800 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.

[0206] It can be understood by those skilled in the art that Figure 8 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 8 More or fewer components than shown, or with Figure 8 The memory 820 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the method for rendering a virtual model with a filter effect in the embodiments of the present application. The processor 810 executes the computer program stored in the memory 820 to perform various functional applications and data processing, thereby implementing the aforementioned method for rendering a virtual model with a filter effect.

[0207] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0208] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0209] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0210] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0211] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0212] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various program code storage media.

[0213] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.

Claims

1. A method of rendering a virtual model's lens effect, characterized in that, The method comprises: obtaining a first map and an optical view parameter, wherein the first map is a material map of a virtual model, the first map is determined by a material type of the virtual model, and the optical view parameter is used to determine an optical performance of a filter effect of the virtual model; generating a first mask based on the first map and the optical view parameter, wherein the first mask is used to render the filter effect of a first area, and the first area is an edge area of the virtual model; performing optical performance processing on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render the filter effect of a second area, and the second area is a display area other than the edge area of the virtual model; rendering the filter effect of the virtual model based on the first mask and the second map.

2. The virtual model's lens effect rendering method of claim 1, wherein, The obtaining of the first map comprises: obtaining the material type of the virtual model, wherein the material type is a metal material or a glass material; determining the first map according to the material type.

3. The virtual model's lens effect rendering method of claim 2, wherein, The generating of the first mask based on the first map and the optical view parameter comprises: in response to the material type corresponding to the first map being the metal material, calculating a first parameter of the virtual model based on the optical view parameter, wherein the first parameter is used to determine the reflection light intensity corresponding to the first area; in response to the material type corresponding to the first map being the glass material, calculating the first parameter based on the optical view parameter and a second parameter, wherein the second parameter is a refractive index parameter corresponding to the glass material; generating the first mask by using the first map and the first parameter.

4. The virtual model's lens effect rendering method of claim 3, wherein, The generating of the first mask by using the first map and the first parameter comprises: obtaining a third parameter of the virtual model, wherein the third parameter is used to determine the reflection light range corresponding to the first area; performing orientation adjustment on the first map to obtain an adjustment result; generating the first mask based on the first parameter, the third parameter and the adjustment result.

5. The virtual model's lens effect rendering method of claim 4, wherein, The orientation adjustment on the first map to obtain the adjustment result comprises: obtaining a virtual camera position corresponding to the virtual model, adjusting the map orientation of the first map based on the virtual camera position to obtain the adjustment result.

6. The virtual model's lens effect rendering method of claim 4, wherein, The generating of the first mask based on the first parameter, the third parameter and the adjustment result comprises: generating a second mask based on the first parameter, the third parameter and the adjustment result; performing interpolation level processing on the second mask to obtain the first mask.

7. The virtual model's lens effect rendering method of claim 6, wherein, The generating of the second mask based on the first parameter, the third parameter and the adjustment result comprises: obtaining a geometric shape of the first area; generating a third mask according to the third parameter and the adjustment result and according to the geometric shape; generating a fourth mask according to the first parameter, the third parameter and the adjustment result and according to the geometric shape; performing division calculation on the third mask and the fourth mask to obtain the second mask.

8. The virtual model's lens effect rendering method of claim 1, wherein, The first map is subjected to optical performance processing according to the optical view parameter to obtain a second map, including: The first map is subjected to saturation adjustment to obtain a third map, wherein the saturation of the third map is lower than that of the first map; The third map is subjected to dark reflection adjustment using the optical view parameter to obtain the second map.

9. The virtual model's lens effect rendering method of claim 8, wherein, The third map is subjected to dark reflection adjustment using the optical view parameter to obtain the second map, including: The third map is subjected to dark reflection adjustment using a shape mask tool based on a fourth map, a fifth map, a preset constant parameter and the optical view parameter to obtain the second map, wherein the fourth map is a dark texture map corresponding to the virtual model, and the fifth map is a preset noise map.

10. A device for rendering filter effects of a virtual model, characterized in that: Including: The acquisition module is configured to acquire a first map and an optical view parameter, wherein the first map is a material map of a virtual model, the first map is determined by a material type of the virtual model, and the optical view parameter is used to determine optical performance of a filter effect of the virtual model. The generation module is configured to generate a first mask based on the first map and the optical view parameter, wherein the first mask is used to render the filter effect of a first area, and the first area is an edge area of the virtual model. The processing module is configured to perform optical performance processing on the first map according to the optical view parameter to obtain a second map, wherein the second map is used to render the filter effect of a second area, and the second area is a to-be-displayed area other than the edge area of the virtual model. The rendering module is configured to render the filter effect of the virtual model based on the first mask and the second map.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is configured to be run by the processor to execute the filter effect rendering method of the virtual model in any one of claims 1 to 9. 12.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to run the computer program to execute the filter effect rendering method of the virtual model in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Fast rendering method for virtual scene and model

    CN107103638A

  • 3D light effect animation production system

    CN109584344A