Image rendering method and device, equipment and storage medium

By obtaining and fusing the texture of the target virtual object, and using physical rendering for indirect light highlight processing, the problem of high computing power consumption and terminal lag during the image rendering process is solved, and efficient image rendering and improved rendering texture are achieved.

CN119359888APending Publication Date: 2025-01-24HANGZHOU BULLET FINGER UNIVERSE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411159871.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The computing power consumes a lot during image rendering, resulting in terminal lag.

Method used

By obtaining the target direction of the target virtual object and the target fusion texture, indirect light and highlighting are performed based on physical rendering, and the target image is directly rendered to avoid real -time calculation of the performance expenses brought by the multi -light source shadow.

Benefits of technology

Reduce computing power consumption, avoid the terminal stuttering, and enhance the rendering texture of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359888A_ABST
    Figure CN119359888A_ABST
Patent Text Reader

Abstract

The invention relates to an image rendering method and device, equipment and a storage medium, and the method comprises the steps: obtaining a target direction map and a target fusion map corresponding to a target virtual object in response to an image rendering instruction; the target fusion map is obtained by performing fusion processing on a target color map and a target shadow map corresponding to the target virtual object; obtaining target attribute information of the target virtual object, and determining color information of indirect light based on the target fusion map; performing indirect light highlight processing on the target direction map, the target attribute information and the color information of the indirect light based on physical rendering to obtain an indirect light highlight result corresponding to the target virtual object; and rendering based on the indirect light highlight result to obtain a target image corresponding to the target virtual object. According to the invention, highlight rendering of the image of the virtual object is realized, and the rendering texture of the image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an image rendering method, apparatus, device and storage medium. Background Art

[0002] In the related technologies, with the continuous growth of the number of mobile terminal game users, the requirements for picture quality and rendering efficiency in the field of mobile terminal game rendering are also increasing. In achieving high-quality rendering, the support of multi-light source technology is very important for achieving exquisite and beautiful scene effects. On devices with higher computing power such as PC host terminals, it is feasible to directly perform multi-light source calculations; at this time, the lighting is directly calculated according to the cost of the product of the number of lights and the number of objects; if the deferred rendering pipeline is used, it will bring great additional performance overhead, development complexity and compatibility issues; similarly, if the platform has sufficient computing power, directly calculating the shadows of multiple light sources in real time is also a way, but the performance overhead is large, and it will cause problems such as freezing and overheating of the mobile terminal. Summary of the invention

[0003] The present disclosure provides an image rendering method, device, equipment and storage medium to at least solve the problems of high computing power consumption and terminal lag in the image rendering process in the related art. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image rendering method, comprising:

[0005] In response to the image rendering instruction, a target direction map and a target fusion map corresponding to the target virtual object are obtained; the target fusion map is obtained by fusing the target color map and the target shadow map corresponding to the target virtual object;

[0006] Acquire target attribute information of the target virtual object, and determine color information of indirect light based on the target fusion map;

[0007] Based on physical rendering, indirect light highlight processing is performed on the target direction map, the target attribute information and the color information of the indirect light to obtain an indirect light highlight result corresponding to the target virtual object;

[0008] A target image corresponding to the target virtual object is obtained by rendering based on the indirect light highlight result.

[0009] In an exemplary embodiment, the physically based rendering performs indirect light highlight processing on the target direction map, the target attribute information, and the color information of the indirect light to obtain an indirect light highlight result corresponding to the target virtual object, including:

[0010] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain a distribution item, a geometric item, and a Fresnel item;

[0011] The product of the distribution term, the geometric term and the Fresnel term is calculated to obtain the indirect light highlight result corresponding to the target virtual object.

[0012] In an exemplary embodiment, the physically based rendering processes the target direction map, the target attribute information, and the color information of the indirect light to obtain a distribution term, a geometric term, and a Fresnel term, including:

[0013] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain the roughness, half-angle vector, normal vector, and cosine value of a first angle between the normal vector and the half-angle vector of the surface of the target virtual object;

[0014] Input the roughness, half-angle vector, normal vector and cosine value of the angle into the microsurface normal distribution function to obtain the distribution term;

[0015] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain a cosine value of a second angle between a normal line corresponding to the target virtual object and the line of sight, and a cosine value of a third angle between the normal line and the light;

[0016] Input the roughness, the cosine value of the second angle and the cosine value of the third angle into a geometric shielding-shadow function to obtain the geometric term;

[0017] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain the highlight color corresponding to the target virtual object and the cosine value of the fourth angle between the line of sight and the half-angle vector;

[0018] The highlight color and the cosine value of the fourth angle are input into the FSchlick function to obtain the Fresnel term.

[0019] In an exemplary embodiment, obtaining a target direction map and a target fusion map corresponding to the target virtual object includes:

[0020] Obtain a target object identifier of the target virtual object;

[0021] A preset direction map matching the target object identifier is searched in a first map library to obtain the target direction map; the first map library is used to store the correspondence between the preset object identifiers and the preset direction maps of a plurality of preset virtual objects; the plurality of preset virtual objects include the target virtual object;

[0022] A preset fused texture matching the target object identifier is searched in a second texture library to obtain the target fused texture; the second texture library is used to store the correspondence between the preset object identifiers of the plurality of preset virtual objects and the preset fused textures.

[0023] In an exemplary embodiment, the method for constructing the first sticker library includes:

[0024] Constructing preset direction maps corresponding to each of the plurality of preset virtual objects;

[0025] Obtaining a preset object identifier for each preset virtual object;

[0026] The first map library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the preset direction map of each preset virtual object.

[0027] In an exemplary embodiment, constructing a preset direction map corresponding to each of the plurality of preset virtual objects includes:

[0028] Filtering out a preset main light source from a plurality of preset light sources of a preset virtual scene where each preset virtual object is located;

[0029] According to the preset main light source corresponding to each preset virtual object, a preset direction map of each preset virtual object is generated for the illumination result of each preset virtual object.

[0030] In an exemplary embodiment, the method for constructing the second sticker library includes:

[0031] Constructing a preset color map and a preset shadow map corresponding to each of the plurality of preset virtual objects;

[0032] Fusing the preset color map and the preset shadow map corresponding to each preset virtual object to generate a preset fused map corresponding to each preset virtual object;

[0033] The second texture library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the preset fused texture of each preset virtual object.

[0034] In an exemplary embodiment, the method for constructing the second sticker library includes:

[0035] Constructing a preset color map and a preset shadow map corresponding to each preset virtual object under multiple preset light sources;

[0036] For any filtered light source among the plurality of preset light sources, a preset color map and a preset shadow map of each preset virtual object under the filtered light source are fused to obtain a preset fused map of each preset virtual object under the filtered light source;

[0037] Determine, according to the preset fused map of each preset virtual object under the screened light source, the preset fused map corresponding to each preset virtual object under the plurality of preset light sources;

[0038] According to the correspondence between a plurality of preset light source identifiers of any preset virtual object and a plurality of the preset fusion maps, a first association relationship of any preset virtual object is constructed;

[0039] The second texture library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the first association relationship.

[0040] In an exemplary embodiment, searching the second map library for a preset fused map that matches the target object identifier to obtain the target fused map includes:

[0041] Searching the second sticker library for a first association relationship that matches the target object identifier to obtain a first target association relationship;

[0042] Based on the target light source identifier in the target virtual scene where the target virtual object is located, a preset fusion map matching the target light source identifier is searched in the first target association relationship to obtain the target fusion map.

[0043] In an exemplary embodiment, the method further comprises:

[0044] Based on physical rendering, indirect light highlight processing is performed on the target direction map, the target attribute information and the color information of the indirect light to obtain an indirect light highlight result corresponding to the target virtual object;

[0045] The step of rendering a target image corresponding to the target virtual object based on the indirect light highlight result includes:

[0046] Based on the indirect light diffuse reflection result and the indirect light highlight result, a target image corresponding to the target virtual object is rendered.

[0047] In an exemplary embodiment, acquiring target attribute information of the target virtual object and determining color information of indirect light based on the target fusion map includes:

[0048] Obtaining the normal, highlight point, roughness and highlight color corresponding to the material surface of the target virtual object;

[0049] Determine the normal, highlight point, roughness and highlight color as target attribute information of the target virtual object;

[0050] Parsing the target fused map to obtain the shadow information and the color information of the indirect light;

[0051] The rendering to obtain a target image corresponding to the target virtual object based on the indirect light diffuse reflection result and the indirect light highlight result includes:

[0052] Calculate and obtain a direct light processing result based on the shadow information;

[0053] Based on the indirect light diffuse reflection result, the indirect light highlight result and the direct light processing result, a target image corresponding to the target virtual object is rendered.

[0054] According to a second aspect of an embodiment of the present disclosure, there is provided an image rendering device, including:

[0055] A texture acquisition module is configured to execute in response to an image rendering instruction, and acquire a target direction texture and a target fusion texture corresponding to a target virtual object; the target fusion texture is obtained by fusing a target color texture and a target shadow texture corresponding to the target virtual object;

[0056] A target attribute determination module is configured to obtain target attribute information of the target virtual object and determine color information of indirect light based on the target fusion map;

[0057] A highlight result determination module is configured to perform physically-based rendering to perform indirect light highlight processing on the target direction map, the target attribute information, and the color information of the indirect light, to obtain an indirect light highlight result corresponding to the target virtual object;

[0058] The target image rendering module is configured to perform rendering based on the indirect light highlight result to obtain a target image corresponding to the target virtual object.

[0059] In an exemplary embodiment, the highlight result determination module includes:

[0060] An information processing unit is configured to perform physically based rendering to process the target direction map, the target attribute information, and the color information of the indirect light to obtain a distribution item, a geometric item, and a Fresnel item;

[0061] The highlight result determination unit is configured to calculate the product of the distribution term, the geometric term and the Fresnel term to obtain the indirect light highlight result corresponding to the target virtual object.

[0062] In an exemplary embodiment, the highlight result determination unit includes:

[0063] A first cosine value determination subunit is configured to perform physically-based rendering to process the target direction map, the target attribute information, and the color information of the indirect light, to obtain the roughness, half-angle vector, normal vector, and a first angle cosine value between the normal vector and the half-angle vector of the surface of the target virtual object;

[0064] A distribution term determination subunit is configured to input the roughness, half-angle vector, normal vector and cosine value of the angle into a microsurface normal distribution function to obtain the distribution term;

[0065] A second cosine value determination subunit is configured to perform physically-based rendering to process the target direction map, the target attribute information, and the color information of the indirect light, to obtain a second cosine value of an angle between a normal corresponding to the target virtual object and the line of sight, and a third cosine value of an angle between the normal and the light;

[0066] A geometric item determination subunit is configured to input the roughness, the second angle cosine value and the third angle cosine value into a geometric shielding-shadow function to obtain the geometric item;

[0067] a fourth cosine value determination subunit, configured to perform physically based rendering to process the target direction map, the target attribute information, and the color information of the indirect light, to obtain a highlight color corresponding to the target virtual object, and a fourth angle cosine value between the sight line and the half-angle vector;

[0068] The Fresnel term determination subunit is configured to input the highlight color and the cosine value of the fourth angle into the FSchlick function to obtain the Fresnel term.

[0069] In an exemplary embodiment, the map acquisition module includes:

[0070] A target object identification obtaining unit, configured to obtain a target object identification of the target virtual object;

[0071] a target direction map determining unit, configured to perform a query in a first map library for a preset direction map matching the target object identifier, to obtain the target direction map; the first map library is used to store a correspondence between preset object identifiers and preset direction maps of a plurality of preset virtual objects; the plurality of preset virtual objects includes the target virtual object;

[0072] The target fused map determining unit is configured to execute a query in a second map library for a preset fused map matching the target object identifier to obtain the target fused map; the second map library is used to store the correspondence between the preset object identifiers of the multiple preset virtual objects and the preset fused maps.

[0073] In an exemplary embodiment, the device further comprises:

[0074] A preset direction map construction module is configured to execute construction of preset direction maps corresponding to each of the plurality of preset virtual objects;

[0075] A preset object identification acquisition module is configured to execute acquisition of a preset object identification of each preset virtual object;

[0076] The first texture library construction module is configured to construct the first texture library according to the correspondence between the preset object identifier of each preset virtual object and the preset direction texture of each preset virtual object.

[0077] In an exemplary embodiment, the preset direction map construction module includes:

[0078] A light source screening unit is configured to screen out a preset main light source from a plurality of preset light sources of a preset virtual scene where each preset virtual object is located;

[0079] The preset map generating unit is configured to generate a preset direction map for each preset virtual object based on the illumination result of each preset virtual object according to the preset main light source corresponding to each preset virtual object.

[0080] In an exemplary embodiment, the device further comprises:

[0081] A preset map construction module is configured to execute construction of preset color maps and preset shadow maps corresponding to each of the plurality of preset virtual objects;

[0082] A preset fused map generation module is configured to perform fusion processing on a preset color map and a preset shadow map corresponding to each preset virtual object to generate a preset fused map corresponding to each preset virtual object;

[0083] The second texture library construction module is configured to construct the second texture library according to the correspondence between the preset object identifier of each preset virtual object and the preset fused texture of each preset virtual object.

[0084] In an exemplary embodiment, the device further comprises:

[0085] A preset map construction module is configured to execute construction of a preset color map and a preset shadow map corresponding to each preset virtual object under multiple preset light sources;

[0086] A texture fusion module is configured to perform fusion processing on a preset color map and a preset shadow map of each preset virtual object under any filtered light source among the plurality of preset light sources, so as to obtain a preset fused texture of each preset virtual object under the filtered light source;

[0087] A preset fusion map determining module is configured to determine the preset fusion map corresponding to each preset virtual object under the plurality of preset light sources according to the preset fusion map of each preset virtual object under the screening light source;

[0088] A first relationship building module is configured to execute a correspondence between a plurality of preset light source identifiers and a plurality of the preset fusion maps for any preset virtual object, and build a first association relationship for any preset virtual object;

[0089] The second texture library construction module is configured to construct the second texture library according to the correspondence between the preset object identifier of each preset virtual object and the first association relationship.

[0090] In an exemplary embodiment, the target fusion map determining unit includes:

[0091] A first target relationship determination subunit is configured to perform a query in the second sticker library for a first association relationship that matches the target object identifier to obtain a first target association relationship;

[0092] The target map fusion subunit is configured to perform a search for a preset fusion map matching the target light source identifier in the target virtual scene where the target virtual object is located in the first target association relationship to obtain the target fusion map.

[0093] In an exemplary embodiment, the device further comprises:

[0094] A diffuse reflection processing module is configured to perform indirect light diffuse reflection processing on the target direction map, the target attribute information and the color information of the indirect light by performing physical-based rendering to obtain an indirect light diffuse reflection result corresponding to the target virtual object;

[0095] The target image rendering module is further configured to render a target image corresponding to the target virtual object based on the indirect light diffuse reflection result and the indirect light highlight result.

[0096] In an exemplary embodiment, the target attribute determination module includes:

[0097] A target attribute acquisition unit is configured to acquire a normal, a highlight point, a roughness, and a highlight color corresponding to a material surface of the target virtual object;

[0098] A target attribute determination unit is configured to determine the normal, highlight point, roughness and highlight color as target attribute information of the target virtual object;

[0099] A parsing unit, configured to parse the target fused map to obtain the shadow information and the color information of the indirect light;

[0100] The target image rendering module is further configured to perform calculations based on the shadow information to obtain a direct light processing result; and render a target image corresponding to the target virtual object based on the indirect light diffuse reflection result, the indirect light highlight result and the direct light processing result.

[0101] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0102] processor;

[0103] a memory for storing instructions executable by the processor;

[0104] The processor is configured to execute the instructions to implement the image rendering method as described above.

[0105] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image rendering method as described above.

[0106] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the image rendering method as described above is implemented.

[0107] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0108] The present disclosure responds to an image rendering instruction, obtains a target direction map and a target fusion map corresponding to a target virtual object; the target fusion map is obtained by fusing a target color map and a target shadow map corresponding to the target virtual object; thus, the target fusion map obtained after the fusion of the target color map and the target shadow map can be directly obtained, avoiding the computing power consumption caused by real-time fusion of maps during image rendering, thereby reducing computing power consumption and avoiding the freezing of the terminal; obtaining the target attribute information of the target virtual object, and determining the color information of the indirect light based on the target fusion map; performing indirect light highlight processing on the target direction map, the target attribute information and the color information of the indirect light based on physical rendering, and obtaining the indirect light highlight result corresponding to the target virtual object; rendering based on the indirect light highlight result to obtain the target image corresponding to the target virtual object. The present disclosure performs physical rendering according to the target direction map and the target attribute information to obtain the indirect light highlight result, realizes the highlight rendering of the image of the virtual object, and improves the rendering texture of the image.

[0109] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0110] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0111] Figure 1 The figure is an application environment diagram of an image rendering method according to an exemplary embodiment.

[0112] Figure 2 The figure is a flowchart of an image rendering method according to an exemplary embodiment.

[0113] Figure 3 The present invention is a flowchart of a method for obtaining a target direction map and a target fusion map corresponding to a target virtual object according to an exemplary embodiment.

[0114] Figure 4 The figure is a flowchart of a method for constructing a first texture library according to an exemplary embodiment.

[0115] Figure 5 The figure is a flow chart of a method for constructing a second texture library according to an exemplary embodiment.

[0116] Figure 6 The figure is a flowchart of another image rendering method according to an exemplary embodiment.

[0117] Figure 7 The invention is a block diagram of an image rendering device according to an exemplary embodiment.

[0118] Figure 8 It is a block diagram of a server according to an exemplary embodiment.

[0119] Fig. 9 The invention is a block diagram of an electronic device for image rendering according to an exemplary embodiment. DETAILED DESCRIPTION

[0120] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0121] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0122] In order to reduce computing power consumption during image rendering, avoid terminal freezes, and improve image rendering efficiency, the present disclosure provides an image rendering method, apparatus, device, and storage medium.

[0123] See also Figure 1 , which is a diagram of an application environment of an image rendering method according to an exemplary embodiment. The application environment may include a server 01 and a client 02.

[0124] Specifically, in the embodiments of this specification, the server 01 may include an independently operated server, or a distributed server, or a server cluster composed of multiple servers, and may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, a memory, and the like. Specifically, the server 01 can be used to store the target direction map and the target fusion map corresponding to the target virtual object, and send the target direction map and the target fusion map corresponding to the target virtual object to the client 02.

[0125] Specifically, in the embodiments of the present specification, the client 02 may include physical devices such as smart phones, desktop computers, tablet computers, laptop computers, digital assistants, smart wearable devices, and vehicle-mounted terminals, and may also include software running in physical devices, such as web pages provided by some service providers to users, or applications provided by these service providers to users. Specifically, the client 02 may be used to respond to image rendering instructions to obtain a target direction map and a target fusion map corresponding to a target virtual object; the target fusion map is obtained by fusion processing of a target color map and a target shadow map corresponding to the target virtual object; the target attribute information of the target virtual object is obtained, and the color information of the indirect light is determined based on the target fusion map; the target direction map, the target attribute information, and the color information of the indirect light are processed based on physical rendering to perform indirect light highlight processing to obtain an indirect light highlight result corresponding to the target virtual object; and the target image corresponding to the target virtual object is rendered based on the indirect light highlight result.

[0126] Figure 2 is a flowchart of an image rendering method according to an exemplary embodiment. Figure 2 As shown, this method can be applied to Figure 1 The client 02 shown includes the following steps.

[0127] In step S201, in response to an image rendering instruction, a target direction map and a target fusion map corresponding to a target virtual object are obtained; the target fusion map is obtained by fusion processing of a target color map and a target shadow map corresponding to the target virtual object.

[0128] In the disclosed embodiment, the client user can trigger the image rendering instruction by clicking, dragging, sliding and other operations. Based on the instruction, the client can obtain the target direction map and target fusion map of the target virtual object in the image to be rendered; exemplarily, the client can respond to the image rendering instruction and send a map acquisition request to the server; and receive the target direction map and target fusion map corresponding to the target virtual object sent by the server; wherein the target virtual object can be a static object in the target virtual scene, that is, in the application scene, the target virtual object is always in a static state, exemplarily, the target virtual object can include but is not limited to windows, sofas, tables and chairs, etc.; the application scene of this embodiment can include but is not limited to game scenes, video production scenes, etc.; the target direction map and the target fusion map can both be pre-built maps, and the target fusion map can be generated in advance according to the target color map and the target shadow map corresponding to the target virtual object. In the image rendering process, the target direction map and the target fusion map corresponding to the target virtual object can be obtained in real time, thereby avoiding the real-time calculation and generation of the target direction map and the target fusion map, reducing the computing power consumption.

[0129] In step S203, target attribute information of the target virtual object is obtained, and color information of indirect light is determined based on the target fusion map.

[0130] In the disclosed embodiment, target attribute information of the target virtual object can be extracted; the target attribute information can include but is not limited to normals, highlights, roughness, and highlight colors corresponding to the material surface of the target virtual object; and the color information of the indirect light can be determined based on the target fusion map.

[0131] In step S205, indirect light highlight processing is performed on the target direction map, the target attribute information and the color information of the indirect light based on physical rendering to obtain an indirect light highlight result corresponding to the target virtual object.

[0132] In the disclosed embodiment, physically-based rendering (PBR) is a shading method in computer graphics, which aims to simulate the physical behavior of light and its interaction with materials, so as to achieve realistic visual effects. The calculation of PBR lighting is divided into two parts: direct lighting and indirect lighting. Direct lighting is divided into direct light diffuse reflection and direct light specular reflection. Among them, indirect light = indirect light diffuse reflection + indirect light specular reflection (IBL); the PBR lighting model needs to meet the following conditions: based on the microplane model, energy conservation and the use of a physically based bidirectional reflectance distribution function (BRDF). PBR can be used to perform indirect light diffuse reflection calculation processing on the target direction map and the target attribute information to obtain the indirect light diffuse reflection result corresponding to the target virtual object. Diffuse reflection can include information such as color, pattern, texture, etc. of the target virtual object; the indirect light diffuse reflection result represents the image data of the target virtual object under indirect light diffuse reflection, and the diffuse reflection image of the target virtual object under indirect light can be rendered based on the indirect light diffuse reflection result.

[0133] In the embodiment of the present disclosure, the physically based rendering performs indirect light highlight processing on the target direction map, the target attribute information, and the color information of the indirect light to obtain an indirect light highlight result corresponding to the target virtual object, including:

[0134] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain a distribution item, a geometric item, and a Fresnel item;

[0135] The product of the distribution term, the geometric term and the Fresnel term is calculated to obtain the indirect light highlight result corresponding to the target virtual object.

[0136] In the disclosed embodiment, during the highlight processing, the distribution term, geometric term and Fresnel term may be calculated first; then the product of the distribution term, geometric term and Fresnel term may be calculated to accurately obtain the indirect light highlight result corresponding to the target virtual object.

[0137] The physically based rendering processes the target direction map, the target attribute information, and the color information of the indirect light to obtain a distribution term, a geometric term, and a Fresnel term, including:

[0138] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain the roughness, half-angle vector, normal vector, and cosine value of a first angle between the normal vector and the half-angle vector of the surface of the target virtual object;

[0139] Input the roughness, half-angle vector, normal vector and cosine value of the angle into the microsurface normal distribution function to obtain the distribution term;

[0140] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain a cosine value of a second angle between a normal line corresponding to the target virtual object and the line of sight, and a cosine value of a third angle between the normal line and the light;

[0141] Input the roughness, the cosine value of the second angle and the cosine value of the third angle into a geometric shielding-shadow function to obtain the geometric term;

[0142] Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain the highlight color corresponding to the target virtual object and the cosine value of the fourth angle between the line of sight and the half-angle vector;

[0143] The highlight color and the cosine value of the fourth angle are input into the FSchlick function to obtain the Fresnel term.

[0144] Exemplarily, the calculation formula corresponding to the indirect light highlight result is as follows:

[0145] Highlight = D*G*F

[0146] In PBR (Physical Base Rendering) highlight calculation, D, G, and F represent different parts, which work together to calculate the final highlight reflection. The following is an explanation of the above parameters and their roles in a given function:

[0147] 1. D (Distribution)-Distribution term

[0148] The D term stands for the Normal Distribution Function (NDF). It describes how the microfacet normals are distributed at a specific roughness. In this function, D = DGGX_Mobile(Roughness, NoH, H, N); the GGX distribution model is used to calculate the distribution term, taking into account the roughness and some geometric relationships (such as NoH, H, N).

[0149] The DGGX_Mobile function computes the distribution term (D term) based on the model proposed by Walter et al. in 2007.

[0150] Roughness: Roughness determines the roughness of the surface.

[0151] NoH: The cosine of the angle between the normal and the half-angle vector.

[0152] H: half-angle vector.

[0153] N : Normal vector.

[0154] This function uses the Lagrange identity to calculate 1.0-NoH^2, avoiding floating point precision issues. It then uses the roughness to calculate a and n, and finally calculates the distribution term d.

[0155] 2.G (Geometry)-Geometry

[0156] The G term represents the geometry occlusion-shadow function, which describes the occlusion and shadow effects of light between microsurfaces. In this function, G = GSchlick (Roughness, NoV, NoL); the Schlick-G model is used to calculate the geometry term, taking into account the roughness and view-related parameters (such as NoV, NoL).

[0157] The GSchlick function computes the geometric term (G term) based on the approximate model of Schlick (1994).

[0158] Roughness: Roughness determines the roughness of the surface.

[0159] NoV: The cosine of the angle between the normal and the line of sight.

[0160] NoL: The cosine of the angle between the normal and the light.

[0161] The function calculates a k value based on the roughness, then uses this k value to calculate Vis_SchlickV and Vis_SchlickL, and finally calculates the geometric term G through these two values.

[0162] 3.F (Fresnel) - Fresnel term

[0163] The F term represents the Fresnel Effect, which describes the change in reflectivity of light at different incident angles. In this function, F = FSchlick (SpecularColor, VoH); the Schlick approximation is used to calculate the Fresnel term, taking into account the viewing angle and glossy color (SpecularColor).

[0164] The FSchlick function computes the Fresnel term (F term) based on the approximate model proposed by Schlick in 1994.

[0165] SpecularColor: Specular color.

[0166] VoH: The cosine of the angle between the line of sight and the half-angle vector.

[0167] This function calculates the Fresnel reflectivity using the Schlick approximation and returns the Fresnel term adjusted for viewing angle and specular color.

[0168] The above functions work together to realize the calculation of highlight reflection in PBR; combined with the above explanation, the working principle of the function PbrBRDF_SPEC is as follows:

[0169] Input parameters:

[0170] NoV: The cosine of the angle between the normal and the line of sight.

[0171] NoL: The cosine of the angle between the normal and the light.

[0172] VoH: The cosine of the angle between the line of sight and the half-angle vector.

[0173] NoH: The cosine of the angle between the normal and the half-angle vector.

[0174] N : Normal vector.

[0175] H: half-angle vector.

[0176] SpecularColor: Specular color.

[0177] Roughness: Roughness.

[0178] In an exemplary embodiment, the calculation steps are as follows:

[0179] 1. Use the DGGX_Mobile function to calculate the distribution term D, taking into account the roughness and geometric relationship.

[0180] 2. Use the GSchlick function to calculate the geometric term G, taking into account roughness and view-dependent parameters.

[0181] 3. Calculate the Fresnel term F using the FSchlick function, taking into account viewing angle and specular color.

[0182] 4. The final return value is the product of the three items (D*G)*F, which is the final value of the specular reflection.

[0183] This function integrates the key part of the BRDF (bidirectional reflectance distribution function) in PBR, which is used to calculate the reflection intensity of surface highlights.

[0184] In the disclosed embodiment, the target direction map and the target attribute information can be processed to obtain the surface roughness, half-angle vector, normal vector, and the first angle cosine value between the normal vector and the half-angle vector, the second angle cosine value between the normal and the line of sight, the third angle cosine value between the normal and the light, the highlight color, and the fourth angle cosine value between the line of sight and the half-angle vector of the target virtual object; then the roughness, half-angle vector, normal vector, and the angle cosine value are input into the microsurface normal distribution function to accurately obtain the distribution term; the roughness, the second angle cosine value, and the third angle cosine value are input into the geometric occlusion-shadow function to accurately obtain the geometric term; the highlight color and the fourth angle cosine value are input into the FSchlick function to accurately obtain the Fresnel term, so that the distribution term, geometric term, and Fresnel term can be accurately calculated, so as to accurately calculate the indirect light highlight result corresponding to the target virtual object.

[0185] In step S207, a target image corresponding to the target virtual object is obtained by rendering based on the indirect light highlight result.

[0186] In the disclosed embodiment, rendering processing can be performed based on the indirect light highlight result to obtain a target image corresponding to the target virtual object, thereby achieving highlight rendering of the image of the virtual object and improving the rendering texture of the image.

[0187] The present disclosure responds to an image rendering instruction, obtains a target direction map and a target fusion map corresponding to a target virtual object; the target fusion map is obtained by fusing a target color map and a target shadow map corresponding to the target virtual object; thus, the target fusion map obtained after the fusion of the target color map and the target shadow map can be directly obtained, avoiding the computing power consumption caused by real-time fusion of maps during image rendering, thereby reducing computing power consumption and avoiding the freezing of the terminal; obtaining the target attribute information of the target virtual object, and determining the color information of the indirect light based on the target fusion map; performing indirect light highlight processing on the target direction map, the target attribute information and the color information of the indirect light based on physical rendering, and obtaining the indirect light highlight result corresponding to the target virtual object; rendering based on the indirect light highlight result obtains the target image corresponding to the target virtual object. The present disclosure performs physical rendering according to the target direction map and the target attribute information to obtain the indirect light highlight result, realizes the highlight rendering of the image of the virtual object, and improves the rendering quality of the image.

[0188] In the present disclosure, Figure 3 As shown, the step of obtaining a target direction map and a target fusion map corresponding to the target virtual object includes:

[0189] S20101: Acquire a target object identifier of the target virtual object;

[0190] S20103: searching a preset direction map matching the target object identifier in a first map library to obtain the target direction map; the first map library is used to store a correspondence between preset object identifiers and preset direction maps of a plurality of preset virtual objects; the plurality of preset virtual objects includes the target virtual object;

[0191] S20105: Searching for a preset fused texture matching the target object identifier in a second texture library to obtain the target fused texture; the second texture library is used to store the correspondence between the preset object identifiers of the plurality of preset virtual objects and the preset fused textures.

[0192] In the disclosed embodiment, a first texture library may be pre-constructed, in which a correspondence between preset object identifiers of a plurality of preset virtual objects and preset direction textures is stored; and the plurality of preset virtual objects include the target virtual object; thereby, a matching preset direction texture may be queried according to the target object identifier of the target virtual object to obtain the target direction texture; a second texture library may be pre-constructed, in which a correspondence between preset object identifiers of a plurality of preset virtual objects and preset fusion textures is stored; thereby, a matching target fusion texture may be queried according to the target object identifier in the second texture library.

[0193] In the disclosed embodiment, the target direction map and the target fusion map that match the target object identifier can be quickly obtained through the pre-built first map library and the second map library, thereby avoiding real-time rendering of the target direction map and the target fusion map and reducing the computing power in the map baking process.

[0194] In the present disclosure, Figure 4 As shown, the method for constructing the first texture library includes:

[0195] S401: constructing preset direction maps corresponding to each of the plurality of preset virtual objects;

[0196] S403: Obtaining a preset object identifier of each preset virtual object;

[0197] S405: constructing the first map library according to the correspondence between the preset object identifier of each preset virtual object and the preset direction map of each preset virtual object.

[0198] In the disclosed embodiments, multiple preset virtual objects in multiple preset virtual scenes can be acquired in advance, and the preset virtual objects are objects in a stationary state; each preset virtual scene can include one or more preset virtual objects, and a preset directional map of each preset virtual object in the corresponding preset virtual scene can be pre-built; exemplarily, in the Unity engine, Directional Mode can be turned on to bake each preset virtual object to obtain a preset directional map of each preset virtual object in the corresponding preset virtual scene. Directional Mode baking mode is a baking option of Unity. If it is turned on, an additional map of the source direction of the main light on the surface of the current object will be generated during baking, which is called a directional map. Then, the correspondence between the preset object identifier of each preset virtual object and the preset directional map of each preset virtual object can be stored in the first map library.

[0199] In the disclosed embodiment, a preset direction map corresponding to each preset virtual object can be pre-constructed and a first map library can be generated, thereby facilitating rapid search for the target direction map of the target virtual object according to the first map library during the image rendering process, thereby reducing the computing power consumption of the client during real-time rendering and improving image rendering efficiency.

[0200] In the embodiment of the present disclosure, the step of constructing the preset direction maps corresponding to the plurality of preset virtual objects includes:

[0201] Filtering out a preset main light source from a plurality of preset light sources of a preset virtual scene where each preset virtual object is located;

[0202] According to the preset main light source corresponding to each preset virtual object, a preset direction map of each preset virtual object is generated for the illumination result of each preset virtual object.

[0203] In the embodiment of the present disclosure, the preset virtual scene may include multiple preset light sources, and the multiple preset light sources may include light sources formed by reflections from lights and similar backgrounds such as walls; the main light source of the preset virtual object can be screened out from the multiple preset light sources to obtain the preset main light source; and then, based on the illumination result of each preset virtual object by the preset main light source corresponding to each preset virtual object, a preset direction map for each preset virtual object is generated.

[0204] In the disclosed embodiment, a preset main light source can be screened out from a preset virtual scene corresponding to a preset virtual object, and a preset direction map corresponding to the preset main light source can be generated, so that a target image can be rendered according to the preset direction map, thereby improving the quality of the target image.

[0205] In the present disclosure, Figure 5As shown, the method for constructing the second texture library includes:

[0206] S501: Constructing a preset color map and a preset shadow map corresponding to each of the plurality of preset virtual objects;

[0207] S503: performing fusion processing on the preset color map and the preset shadow map corresponding to each preset virtual object to generate a preset fused map corresponding to each preset virtual object;

[0208] S505: constructing the second texture library according to the correspondence between the preset object identifier of each preset virtual object and the preset fused texture of each preset virtual object.

[0209] In the disclosed embodiment, a preset color map and a preset shadow map corresponding to each preset virtual object can be pre-generated; the preset color map can be constructed by setting the values ​​of the three color channels of red (R), green (G), and blue (B). Exemplarily, the Unity baking mode can be set to ShadowMask (shadow map mode) or Indirect (direct lighting mode), wherein, in the shadow map mode, the transparency information in the A channel can be set to quickly generate a preset shadow map for the preset virtual object, and then the preset color map and the preset shadow map corresponding to each preset virtual object are fused to generate a preset fused map corresponding to each preset virtual object. Then, according to the correspondence between the preset object identifier of each preset virtual object and the preset fused map of each preset virtual object, the second map library is constructed; that is, the correspondence between the preset object identifier of each preset virtual object and the preset fused map of each preset virtual object is stored in the second map library.

[0210] In the disclosed embodiment, a preset fused map corresponding to each preset virtual object can be generated in advance based on the fusion processing of the preset color map and the preset shadow map corresponding to each preset virtual object; and a second map library is constructed based on the correspondence between the preset object identifier of each preset virtual object and the preset fused map of each preset virtual object; thereby facilitating the rapid query of the target fused map corresponding to the target virtual object according to the second map library, reducing the number of map sampling times; avoiding the real-time acquisition of the preset color map and the preset shadow map and then performing real-time fusion processing to obtain the preset fused map, that is, avoiding the computing power consumption caused by the real-time generation of the preset fused map during the image rendering process, thereby improving the image rendering efficiency.

[0211] In the disclosed embodiment, the method for constructing the second texture library includes:

[0212] Constructing a preset color map and a preset shadow map corresponding to each preset virtual object under multiple preset light sources;

[0213] For any filtered light source among the plurality of preset light sources, a preset color map and a preset shadow map of each preset virtual object under the filtered light source are fused to obtain a preset fused map of each preset virtual object under the filtered light source;

[0214] Determine, according to the preset fused map of each preset virtual object under the screened light source, the preset fused map corresponding to each preset virtual object under the plurality of preset light sources;

[0215] According to the correspondence between a plurality of preset light source identifiers of any preset virtual object and a plurality of the preset fusion maps, a first association relationship of any preset virtual object is constructed;

[0216] The second texture library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the first association relationship.

[0217] In the embodiment of the present disclosure, when there are multiple preset light sources in the preset virtual scene where the preset virtual object is located, the preset color map and the preset shadow map of the preset virtual object under each preset virtual light source can be obtained in advance, and the preset fusion map of the preset virtual object under each preset virtual light source can be generated; then, based on the correspondence between the multiple preset light source identifiers of any preset virtual object and the multiple preset fusion maps, a first association relationship of any preset virtual object is constructed; and based on the correspondence between the preset object identifier of each preset virtual object and the first association relationship, the second map library is constructed.

[0218] In the disclosed embodiment, the first association relationship of any preset virtual object and the correspondence between the preset object identifier of each preset virtual object and the first association relationship can be stored in the second map library; thereby facilitating rapid query of matching preset fusion maps according to the virtual light source and virtual object identifier in the application scene during the image rendering process.

[0219] In the embodiment of the present disclosure, the step of searching the second map library for a preset fused map that matches the target object identifier to obtain the target fused map includes:

[0220] Searching the second sticker library for a first association relationship that matches the target object identifier to obtain a first target association relationship;

[0221] Based on the target light source identifier in the target virtual scene where the target virtual object is located, a preset fusion map matching the target light source identifier is searched in the first target association relationship to obtain the target fusion map.

[0222] In the disclosed embodiment, the first target association relationship matching the target object identifier may be first searched in the second map library, and then the target fusion map matching the target light source identifier may be searched in the first target association relationship according to the target object identifier.

[0223] In the disclosed embodiment, a pre-constructed second map library can be used to first query the first target association relationship that matches the target object identifier, and then quickly query the target fusion map from the first target association relationship based on the target light source identifier, thereby quickly determining the target fusion map that matches both the target object identifier and the target light source identifier.

[0224] In the embodiment of the present disclosure, the method further includes:

[0225] Based on physical rendering, indirect light diffuse reflection processing is performed on the target direction map, the target attribute information and the color information of the indirect light to obtain an indirect light diffuse reflection result corresponding to the target virtual object;

[0226] The step of rendering a target image corresponding to the target virtual object based on the indirect light highlight result includes:

[0227] Based on the indirect light diffuse reflection result and the indirect light highlight result, a target image corresponding to the target virtual object is rendered.

[0228] In the disclosed embodiment, indirect light diffuse reflection processing can be performed on the target direction map, the target attribute information and the color information of the indirect light according to physical rendering to obtain an indirect light diffuse reflection result corresponding to the target virtual object; then, the indirect light diffuse reflection result and the indirect light highlight result are rendered to obtain a target image corresponding to the target virtual object.

[0229] In the embodiment of the present disclosure, in the image rendering process, the quality of the rendered image can be further improved by combining the indirect light diffuse reflection result and the indirect light highlight result for rendering.

[0230] In the embodiment of the present disclosure, the step of acquiring target attribute information of the target virtual object and determining color information of indirect light based on the target fusion map includes:

[0231] Obtaining the normal, highlight point, roughness and highlight color corresponding to the material surface of the target virtual object;

[0232] Determine the normal, highlight point, roughness and highlight color as target attribute information of the target virtual object;

[0233] Parsing the target fused map to obtain the shadow information and the color information of the indirect light;

[0234] The rendering to obtain a target image corresponding to the target virtual object based on the indirect light diffuse reflection result and the indirect light highlight result includes:

[0235] Calculate and obtain a direct light processing result based on the shadow information;

[0236] Based on the indirect light diffuse reflection result, the indirect light highlight result and the direct light processing result, a target image corresponding to the target virtual object is rendered.

[0237] In the disclosed embodiment, the normal, highlight point, roughness and highlight color corresponding to the material surface of the target virtual object can be extracted to obtain the target attribute information of the target virtual object; the target fusion map is parsed to obtain the shadow information and the color information of the indirect light; based on the indirect light highlight result, combined with the indirect light diffuse reflection result and the direct light processing result, the final target image based on physical rendering can be obtained. The shadow information extracted in this embodiment can be directly used for the calculation of direct light to obtain the direct light processing result, omitting the shadow calculation overhead and improving the calculation efficiency.

[0238] In an exemplary embodiment, Figure 6 As shown, Figure 6 A flowchart of another image rendering method, including:

[0239] Constructing preset direction maps corresponding to each of the plurality of preset virtual objects; obtaining a preset object identifier for each preset virtual object; constructing the first map library according to the corresponding relationship between the preset object identifier of each preset virtual object and the preset direction map of each preset virtual object; querying the preset direction map matching the target object identifier in the first map library to obtain the target direction map; constructing preset color maps and preset shadow maps corresponding to each of the plurality of preset virtual objects; fusing the preset color map and preset shadow map corresponding to each preset virtual object to generate a preset fused map corresponding to each preset virtual object; constructing the second map library according to the corresponding relationship between the preset object identifier of each preset virtual object and the preset fused map of each preset virtual object; querying the preset fused map matching the target object identifier in the second map library to obtain the target fused map. The target attribute information of the target virtual object is obtained, and the color information of the indirect light is determined based on the target fusion map; the indirect light highlight processing is performed on the target direction map and the target attribute information based on the PBR material to obtain the indirect light highlight result corresponding to the target virtual object; based on the indirect light diffuse reflection result and the indirect light highlight result, the target image corresponding to the target virtual object is rendered. Among them, PBR material, the full name of which is Physically Based Rendering, is a rendering technology that aims to more accurately describe how light interacts with the surface of an object by simulating the physical laws of nature to achieve realistic effects. This technology approaches and simulates the physical phenomena of nature by introducing various BRDF (bidirectional reflectance distribution function) theoretical models, making the rendering results closer to reality. The use of PBR materials not only improves the efficiency and effect of art production, but is also very popular in the art design of next-generation games, making the texture of 3D models more realistic. The core of PBR materials lies in their physically based rendering method, which can more accurately depict the interaction between light and surfaces, including simulating the actual behavior of light rather than just simulating the appearance of light. It calculates the interaction between light and materials by simulating the physical laws of nature, such as microplane theory, specular reflection, diffuse reflection and subsurface scattering, thereby achieving a more realistic lighting effect.

[0240] Figure 7 is a block diagram of an image rendering device according to an exemplary embodiment. Figure 7 , the device comprises:

[0241] The texture acquisition module 710 is configured to execute in response to the image rendering instruction, and acquire a target direction texture and a target fusion texture corresponding to the target virtual object; the target fusion texture is obtained by fusing the target color texture and the target shadow texture corresponding to the target virtual object;

[0242] The target attribute determination module 720 is configured to obtain target attribute information of the target virtual object and determine color information of the indirect light based on the target fusion map;

[0243] The highlight result determination module 730 is configured to perform physically-based rendering to perform indirect light highlight processing on the target direction map, the target attribute information, and the color information of the indirect light, to obtain an indirect light highlight result corresponding to the target virtual object;

[0244] The target image rendering module 740 is configured to perform rendering based on the indirect light highlight result to obtain a target image corresponding to the target virtual object.

[0245] In an exemplary embodiment, the highlight result determination module includes:

[0246] An information processing unit is configured to perform physically based rendering to process the target direction map, the target attribute information, and the color information of the indirect light to obtain a distribution item, a geometric item, and a Fresnel item;

[0247] The highlight result determination unit is configured to calculate the product of the distribution term, the geometric term and the Fresnel term to obtain the indirect light highlight result corresponding to the target virtual object.

[0248] In an exemplary embodiment, the highlight result determination unit includes:

[0249] A first cosine value determination subunit is configured to perform physically-based rendering to process the target direction map, the target attribute information, and the color information of the indirect light, to obtain the roughness, half-angle vector, normal vector, and a first angle cosine value between the normal vector and the half-angle vector of the surface of the target virtual object;

[0250] A distribution term determination subunit is configured to input the roughness, half-angle vector, normal vector and cosine value of the angle into a microsurface normal distribution function to obtain the distribution term;

[0251] A second cosine value determination subunit is configured to perform physically-based rendering to process the target direction map, the target attribute information, and the color information of the indirect light, to obtain a second cosine value of an angle between a normal corresponding to the target virtual object and the line of sight, and a third cosine value of an angle between the normal and the light;

[0252] A geometric item determination subunit is configured to input the roughness, the second angle cosine value and the third angle cosine value into a geometric shielding-shadow function to obtain the geometric item;

[0253] a fourth cosine value determination subunit, configured to perform physically based rendering to process the target direction map, the target attribute information, and the color information of the indirect light, to obtain a highlight color corresponding to the target virtual object, and a fourth angle cosine value between the sight line and the half-angle vector;

[0254] The Fresnel term determination subunit is configured to input the highlight color and the cosine value of the fourth angle into the FSchlick function to obtain the Fresnel term.

[0255] In an exemplary embodiment, the map acquisition module includes:

[0256] A target object identification obtaining unit, configured to obtain a target object identification of the target virtual object;

[0257] a target direction map determining unit, configured to perform a query in a first map library for a preset direction map matching the target object identifier, to obtain the target direction map; the first map library is used to store a correspondence between preset object identifiers and preset direction maps of a plurality of preset virtual objects; the plurality of preset virtual objects includes the target virtual object;

[0258] The target fused map determining unit is configured to execute a query in a second map library for a preset fused map matching the target object identifier to obtain the target fused map; the second map library is used to store the correspondence between the preset object identifiers of the multiple preset virtual objects and the preset fused maps.

[0259] In an exemplary embodiment, the device further comprises:

[0260] A preset direction map construction module is configured to execute construction of preset direction maps corresponding to each of the plurality of preset virtual objects;

[0261] A preset object identification acquisition module is configured to execute acquisition of a preset object identification of each preset virtual object;

[0262] The first texture library construction module is configured to construct the first texture library according to the correspondence between the preset object identifier of each preset virtual object and the preset direction texture of each preset virtual object.

[0263] In an exemplary embodiment, the preset direction map construction module includes:

[0264] A light source screening unit is configured to screen out a preset main light source from a plurality of preset light sources of a preset virtual scene where each preset virtual object is located;

[0265] The preset map generating unit is configured to generate a preset direction map for each preset virtual object based on the illumination result of each preset virtual object according to the preset main light source corresponding to each preset virtual object.

[0266] In an exemplary embodiment, the device further comprises:

[0267] A preset map construction module is configured to execute construction of preset color maps and preset shadow maps corresponding to each of the plurality of preset virtual objects;

[0268] A preset fused map generation module is configured to perform fusion processing on a preset color map and a preset shadow map corresponding to each preset virtual object to generate a preset fused map corresponding to each preset virtual object;

[0269] The second texture library construction module is configured to construct the second texture library according to the correspondence between the preset object identifier of each preset virtual object and the preset fused texture of each preset virtual object.

[0270] In an exemplary embodiment, the device further comprises:

[0271] A preset map construction module is configured to execute construction of a preset color map and a preset shadow map corresponding to each preset virtual object under multiple preset light sources;

[0272] A texture fusion module is configured to perform fusion processing on a preset color map and a preset shadow map of each preset virtual object under any filtered light source among the plurality of preset light sources, so as to obtain a preset fused texture of each preset virtual object under the filtered light source;

[0273] A preset fusion map determining module is configured to determine the preset fusion map corresponding to each preset virtual object under the plurality of preset light sources according to the preset fusion map of each preset virtual object under the screening light source;

[0274] A first relationship building module is configured to execute a correspondence between a plurality of preset light source identifiers and a plurality of the preset fusion maps for any preset virtual object, and build a first association relationship for any preset virtual object;

[0275] The second texture library construction module is configured to construct the second texture library according to the correspondence between the preset object identifier of each preset virtual object and the first association relationship.

[0276] In an exemplary embodiment, the target fusion map determining unit includes:

[0277] A first target relationship determination subunit is configured to perform a query in the second sticker library for a first association relationship that matches the target object identifier to obtain a first target association relationship;

[0278] The target map fusion subunit is configured to perform a search for a preset fusion map matching the target light source identifier in the target virtual scene where the target virtual object is located in the first target association relationship to obtain the target fusion map.

[0279] In an exemplary embodiment, the device further comprises:

[0280] A diffuse reflection processing module is configured to perform indirect light diffuse reflection processing on the target direction map, the target attribute information and the color information of the indirect light by performing physical-based rendering to obtain an indirect light diffuse reflection result corresponding to the target virtual object;

[0281] The target image rendering module is further configured to render a target image corresponding to the target virtual object based on the indirect light diffuse reflection result and the indirect light highlight result.

[0282] In an exemplary embodiment, the target attribute determination module includes:

[0283] A target attribute acquisition unit is configured to acquire a normal, a highlight point, a roughness, and a highlight color corresponding to a material surface of the target virtual object;

[0284] A target attribute determination unit is configured to determine the normal, highlight point, roughness and highlight color as target attribute information of the target virtual object;

[0285] A parsing unit, configured to parse the target fused map to obtain the shadow information and the color information of the indirect light;

[0286] The target image rendering module is further configured to perform calculations based on the shadow information to obtain a direct light processing result; and render a target image corresponding to the target virtual object based on the indirect light diffuse reflection result, the indirect light highlight result and the direct light processing result.

[0287] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0288] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, the image rendering method provided in any of the above embodiments is implemented.

[0289] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Figure 8 is a block diagram of an electronic device according to an exemplary embodiment. Figure 8 As shown, the server 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 810 (the processor 810 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 830 for storing data, and one or more storage media 820 (such as one or more mass storage devices) for storing application programs 823 or data 822. Among them, the memory 830 and the storage medium 820 can be short-term storage or permanent storage. The program stored in the storage medium 820 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 810 can be configured to communicate with the storage medium 820 and execute a series of instruction operations in the storage medium 820 on the server 800. The server 800 may also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input and output interfaces 840, and / or one or more operating systems 821, such as Windows ServerTM, Mac OSXTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0290] The input / output interface 840 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 800. In one example, the input / output interface 840 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 840 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0291] It can be understood by those skilled in the art that Figure 8 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 8More or fewer components as shown, or with Figure 8 Different configurations shown.

[0292] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 830 including instructions, and the instructions can be executed by the processor 810 of the device 800 to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0293] Fig. 9 is a block diagram of an electronic device for image rendering according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an image rendering method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0294] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0295] In an exemplary embodiment, there is also provided an electronic device, comprising:

[0296] A processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the above-mentioned image rendering method.

[0297] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the above image rendering method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0298] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned image rendering method is implemented.

[0299] The present disclosure responds to an image rendering instruction, obtains a target direction map and a target fusion map corresponding to a target virtual object; the target fusion map is obtained by fusing a target color map and a target shadow map corresponding to the target virtual object; thus, the target fusion map obtained after the fusion of the target color map and the target shadow map can be directly obtained, avoiding the computing power consumption caused by real-time fusion of maps during image rendering, thereby reducing computing power consumption and avoiding the freezing of the terminal; obtaining the target attribute information of the target virtual object, and determining the color information of the indirect light based on the target fusion map; performing indirect light highlight processing on the target direction map, the target attribute information and the color information of the indirect light based on physical rendering, and obtaining the indirect light highlight result corresponding to the target virtual object; rendering based on the indirect light highlight result to obtain the target image corresponding to the target virtual object. The present disclosure performs physical rendering according to the target direction map and the target attribute information to obtain the indirect light highlight result, realizes the highlight rendering of the image of the virtual object, and improves the rendering texture of the image.

[0300] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0301] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0302] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image rendering method, characterized in that: include: In response to the image rendering instruction, obtaining a target direction map and a target fusion map corresponding to the target virtual object; The target fusion map is obtained by fusing a target color map and a target shadow map corresponding to the target virtual object; Acquire target attribute information of the target virtual object, and determine color information of indirect light based on the target fusion map; Based on physical rendering, indirect light highlight processing is performed on the target direction map, the target attribute information and the color information of the indirect light to obtain an indirect light highlight result corresponding to the target virtual object; A target image corresponding to the target virtual object is obtained by rendering based on the indirect light highlight result.

2. The method according to claim 1, characterized in that The physically based rendering performs indirect light highlight processing on the target direction map, the target attribute information, and the color information of the indirect light to obtain an indirect light highlight result corresponding to the target virtual object, including: Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain a distribution item, a geometric item, and a Fresnel item; The product of the distribution term, the geometric term and the Fresnel term is calculated to obtain the indirect light highlight result corresponding to the target virtual object.

3. The method according to claim 2, characterized in that The physically based rendering processes the target direction map, the target attribute information, and the color information of the indirect light to obtain a distribution term, a geometric term, and a Fresnel term, including: Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain the roughness, half-angle vector, normal vector, and cosine value of a first angle between the normal vector and the half-angle vector of the surface of the target virtual object; Input the roughness, half-angle vector, normal vector and cosine value of the angle into the microsurface normal distribution function to obtain the distribution term; Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain a cosine value of a second angle between a normal line corresponding to the target virtual object and the line of sight, and a cosine value of a third angle between the normal line and the light; Input the roughness, the cosine value of the second angle and the cosine value of the third angle into a geometric shielding-shadow function to obtain the geometric term; Processing the target direction map, the target attribute information, and the color information of the indirect light based on physical rendering to obtain the highlight color corresponding to the target virtual object and the cosine value of the fourth angle between the line of sight and the half-angle vector; The highlight color and the cosine value of the fourth angle are input into the FSchlick function to obtain the Fresnel term.

4. The method according to claim 1, characterized in that: The step of obtaining a target direction map and a target fusion map corresponding to the target virtual object includes: Obtain a target object identifier of the target virtual object; A preset direction map matching the target object identifier is searched in a first map library to obtain the target direction map; the first map library is used to store the correspondence between the preset object identifiers and the preset direction maps of a plurality of preset virtual objects; the plurality of preset virtual objects include the target virtual object; A preset fused texture matching the target object identifier is searched in a second texture library to obtain the target fused texture; the second texture library is used to store the correspondence between the preset object identifiers of the plurality of preset virtual objects and the preset fused textures.

5. The method according to claim 4, characterized in that The method for constructing the first texture library includes: Constructing preset direction maps corresponding to each of the plurality of preset virtual objects; Obtaining a preset object identifier for each preset virtual object; The first map library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the preset direction map of each preset virtual object.

6. The method according to claim 5, characterized in that The step of constructing the preset direction maps corresponding to the plurality of preset virtual objects comprises: Filtering out a preset main light source from a plurality of preset light sources of a preset virtual scene where each preset virtual object is located; According to the preset main light source corresponding to each preset virtual object, a preset direction map of each preset virtual object is generated for the illumination result of each preset virtual object.

7. The method according to claim 4, characterized in that The method for constructing the second texture library includes: Constructing a preset color map and a preset shadow map corresponding to each of the plurality of preset virtual objects; Fusing the preset color map and the preset shadow map corresponding to each preset virtual object to generate a preset fused map corresponding to each preset virtual object; The second texture library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the preset fused texture of each preset virtual object.

8. The method according to claim 4, characterized in that The method for constructing the second texture library includes: Constructing a preset color map and a preset shadow map corresponding to each preset virtual object under multiple preset light sources; For any filtered light source among the plurality of preset light sources, a preset color map and a preset shadow map of each preset virtual object under the filtered light source are fused to obtain a preset fused map of each preset virtual object under the filtered light source; Determine, according to the preset fused map of each preset virtual object under the screened light source, the preset fused map corresponding to each preset virtual object under the plurality of preset light sources; According to the correspondence between a plurality of preset light source identifiers of any preset virtual object and a plurality of the preset fusion maps, a first association relationship of any preset virtual object is constructed; The second texture library is constructed according to the correspondence between the preset object identifier of each preset virtual object and the first association relationship.

9. The method according to claim 8, characterized in that The step of searching the second map library for a preset fused map that matches the target object identifier to obtain the target fused map includes: Searching the second sticker library for a first association relationship that matches the target object identifier to obtain a first target association relationship; Based on the target light source identifier in the target virtual scene where the target virtual object is located, a preset fusion map matching the target light source identifier is searched in the first target association relationship to obtain the target fusion map.

10. The method according to claim 1, characterized in that The method further comprises: Based on physical rendering, indirect light diffuse reflection processing is performed on the target direction map, the target attribute information and the color information of the indirect light to obtain an indirect light diffuse reflection result corresponding to the target virtual object; The step of rendering a target image corresponding to the target virtual object based on the indirect light highlight result includes: Based on the indirect light diffuse reflection result and the indirect light highlight result, a target image corresponding to the target virtual object is rendered.

11. The method according to claim 10, characterized in that The acquiring target attribute information of the target virtual object and determining shadow information and color information of indirect light based on the target fusion map includes: Obtaining the normal, highlight point, roughness and highlight color corresponding to the material surface of the target virtual object; Determine the normal, highlight point, roughness and highlight color as target attribute information of the target virtual object; Parsing the target fused map to obtain the shadow information and the color information of the indirect light; The rendering to obtain a target image corresponding to the target virtual object based on the indirect light diffuse reflection result and the indirect light highlight result includes: Calculate and obtain a direct light processing result based on the shadow information; Based on the indirect light diffuse reflection result, the indirect light highlight result and the direct light processing result, a target image corresponding to the target virtual object is rendered.

12. An image rendering device, characterized in that: include: A texture acquisition module is configured to execute in response to the image rendering instruction, and acquire a target direction texture and a target fusion texture corresponding to the target virtual object; The target fusion map is obtained by fusing a target color map and a target shadow map corresponding to the target virtual object; A target attribute determination module is configured to obtain target attribute information of the target virtual object and determine color information of indirect light based on the target fusion map; A highlight result determination module is configured to perform physically-based rendering to perform indirect light highlight processing on the target direction map, the target attribute information, and the color information of the indirect light, to obtain an indirect light highlight result corresponding to the target virtual object; The target image rendering module is configured to perform rendering based on the indirect light highlight result to obtain a target image corresponding to the target virtual object.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image rendering method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the image rendering method according to any one of claims 1 to 11.