Game scene rendering method, device, equipment and storage medium

By obtaining two material rendering parameters of the object to be rendered in the game scene, and rendering the areas illuminated by direct light and the areas not illuminated by direct light respectively, it solves the problems of high dark processing performance and difficult contrast balance in the existing technology, and improves the rendering effect. Authenticity and layering.

CN112190936BActive Publication Date: 2024-10-29NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202011075527.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-09
Publication Date
2024-10-29
Estimated Expiration
2040-10-09

AI Technical Summary

Technical Problem

The existing technology increases performance consumption when processing dark details in game scenes, and it is difficult to balance the contrast between bright and dark areas, resulting in a "dead black" effect in dark areas.

Method used

By obtaining the first material rendering parameters and the second material rendering parameters of the object to be rendered, a physically based rendering method is used to perform material rendering on the areas illuminated by direct light and the areas not illuminated by direct light respectively, so as to avoid rendering the areas not illuminated by direct light. Additional lighting processing to adjust the contrast between the two areas.

Benefits of technology

It is possible to balance the contrast between the areas illuminated by direct light and the areas not illuminated by direct light in the game scene without increasing performance consumption, avoid the "dead black" effect, and improve the authenticity and layering of the rendering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112190936B_ABST
    Figure CN112190936B_ABST
Patent Text Reader

Abstract

The present application provides a game scene rendering method, device, equipment and storage medium, and relates to the field of scene configuration technology. The method includes: obtaining a first material rendering parameter and a second material rendering parameter of the object to be rendered through the material shader of the object to be rendered in the game scene; according to the first material rendering parameter, using a physically based rendering method to perform material rendering on the directly illuminated area on the object to be rendered; according to the second material rendering parameter, using a physically based rendering method to perform material rendering on the area on the object to be rendered that is not directly illuminated. Compared with the prior art, the effects of the directly illuminated area and the area not directly illuminated in the game scene can be adjusted in a simple way, thereby balancing the contrast between the directly illuminated area and the area not directly illuminated, while avoiding the problem of increasing performance consumption by processing dark details.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of scene configuration, and in particular to a game scene rendering method, device, equipment and storage medium. Background Art

[0002] In the process of making game scenes, the bright and dark areas of the scene are often distinguished by whether they can receive direct light. The bright areas can receive direct light, while the dark areas are blocked and cannot be affected by direct light. Often the entire dark area will present an almost identical deep gray effect, so additional lighting processing is often required for the dark areas.

[0003] In order to highlight the details of dark areas in the prior art, the light generated by direct light and indirect light is generally used to interact with the surface of an object, so as to obtain and display the result of the coloring of the surface of the object after the interaction.

[0004] However, this method of using light sources to process dark details will increase performance consumption and make it difficult to balance the contrast between bright and dark areas. Summary of the invention

[0005] The purpose of this application is to provide a game scene rendering method, device, equipment and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem that processing dark details in the prior art will increase performance consumption and it is difficult to balance the contrast between bright and dark parts.

[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, an embodiment of the present application provides a game scene rendering method, the method comprising:

[0008] Obtaining a first material rendering parameter and a second material rendering parameter of the object to be rendered through a material shader of the object to be rendered in the game scene;

[0009] According to the first material rendering parameter, using a physically based rendering method, material rendering is performed on a directly illuminated area of ​​the object to be rendered;

[0010] According to the second material rendering parameter, a physically based rendering method is used to perform material rendering on the area of ​​the object to be rendered that is not illuminated by direct light.

[0011] Optionally, obtaining a first material rendering parameter and a second material rendering parameter of the object to be rendered by using a material shader of the object to be rendered in the game scene includes:

[0012] Obtaining the first material rendering parameter through a first configuration area on a configuration interface of the material shader;

[0013] The second material rendering parameters are obtained through a second configuration area on the configuration interface of the material shader.

[0014] Optionally, obtaining the first material rendering parameter through a first configuration area on a configuration interface of the material shader includes:

[0015] Receiving a material map input through the first configuration area;

[0016] The first material rendering parameter is read from a preset channel in the material map; the preset channel in the material map records the material rendering parameter of the corresponding type.

[0017] Optionally, reading the first material rendering parameter from a preset channel in the material map includes:

[0018] A first metalness value is read from the R channel of the texture map, and a first roughness value is read from the G channel of the texture map.

[0019] Optionally, obtaining the second material rendering parameter through a second configuration area on a configuration interface of the material shader includes:

[0020] A material rendering parameter of a preset type input through the second configuration area is received, where the second material rendering parameter includes: a material rendering parameter of the preset type.

[0021] Optionally, the second configuration area has: an input box for at least one preset type of material rendering parameter;

[0022] The receiving of the preset type of material rendering parameters input through the second configuration area includes:

[0023] Receiving the material rendering parameters of each preset type input through the input box of the material rendering parameters of each preset type: the second material rendering parameters include: the material rendering parameters of the at least one preset type.

[0024] Optionally, the at least one preset type of material rendering parameter includes: a second metalness value, and / or a second roughness value.

[0025] Optionally, performing material rendering on an area of ​​the object to be rendered that is not directly illuminated by light by using a physically based rendering method according to the second material rendering parameter includes:

[0026] According to the second material rendering parameter, a highlight item of indirect light of a rendering pipeline of the physically based rendering method is configured;

[0027] Based on the configured rendering pipeline, material rendering is performed on the area of ​​the object to be rendered that is not illuminated by direct light.

[0028] In a second aspect, another embodiment of the present application provides a game scene rendering device, the device comprising: an acquisition module and a rendering module, wherein:

[0029] The acquisition module is used to acquire the first material rendering parameter and the second material rendering parameter of the object to be rendered through the material shader of the object to be rendered in the game scene;

[0030] The rendering module is used to perform material rendering on the area on the object to be rendered that is directly illuminated by light, using a physically based rendering method according to the first material rendering parameters; and to perform material rendering on the area on the object to be rendered that is not directly illuminated by light, using a physically based rendering method according to the second material rendering parameters.

[0031] Optionally, the acquisition module is specifically used to acquire the first material rendering parameter through a first configuration area on the configuration interface of the material shader; and acquire the second material rendering parameter through a second configuration area on the configuration interface of the material shader.

[0032] Optionally, the device further comprises: a receiving module and a reading module, wherein:

[0033] The receiving module is used to receive the material map input through the first configuration area;

[0034] The reading module is used to read the first material rendering parameter from a preset channel in the material map; the preset channel in the material map records the material rendering parameters of the corresponding type.

[0035] Optionally, the reading module is specifically configured to read a first metalness value from an R channel of the material map, and read a first roughness value from a G channel of the material map.

[0036] Optionally, the receiving module is specifically used to receive material rendering parameters of a preset type input through the second configuration area, and the second material rendering parameters include: material rendering parameters of the preset type.

[0037] Optionally, the receiving module is specifically used to receive the material rendering parameters of each preset type input through the input box of the material rendering parameters of each preset type: the second material rendering parameters include: the material rendering parameters of the at least one preset type.

[0038] Optionally, the apparatus further comprises: a configuration module, configured to configure a highlight item of indirect light of a rendering pipeline of the physically based rendering method according to the second material rendering parameter;

[0039] The rendering module is specifically used to perform material rendering on the area of ​​the object to be rendered that is not illuminated by direct light based on the configured rendering pipeline.

[0040] In the third aspect, another embodiment of the present application provides a game scene rendering device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, when the game scene rendering device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect above.

[0041] In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any method described in the first aspect are executed.

[0042] The beneficial effect of the present application is that by adopting the game scene rendering method provided by the present application, since the rendering is performed by directly obtaining the first material rendering parameter and the second material rendering parameter of the material shader of the object to be rendered, and material rendering is performed on the directly illuminated area and the area not directly illuminated according to the first material rendering parameter and the second material rendering parameter, respectively, there is no need to perform additional lighting processing on the area not directly illuminated, and the effects of the directly illuminated area and the area not directly illuminated in the game scene can be adjusted in a simple way, thereby balancing the contrast between the directly illuminated area and the area not directly illuminated, thereby avoiding the "dead black" effect of the area not directly illuminated, improving the rendering effect of the game scene, and ensuring the layering effect between the directly illuminated area and the area not directly illuminated in the game scene after rendering, and the rendering effect is more realistic. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 A flowchart of a game scene rendering method provided in one embodiment of the present application;

[0045] Figure 2 A flowchart of a game scene rendering method provided by another embodiment of the present application;

[0046] Figure 3 A flowchart of a game scene rendering method provided by another embodiment of the present application;

[0047] Figure 4 A flowchart of a game scene rendering method provided by another embodiment of the present application;

[0048] Figure 5 A flowchart of a game scene rendering method provided by another embodiment of the present application;

[0049] Figure 6 A schematic diagram of a configuration interface provided in an embodiment of the present application;

[0050] Figure 7 A schematic diagram of the structure of a game scene rendering device provided in one embodiment of the present application;

[0051] Figure 8 A schematic diagram of the structure of a game scene rendering device provided in another embodiment of the present application;

[0052] Fig. 9 A schematic diagram of the structure of a game scene rendering device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0054] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0055] In addition, the flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of this application, and can also remove one or more operations from the flowchart.

[0056] In order to enable those skilled in the art to use the content of this application, the following implementation is given in conjunction with a specific application scenario: the rendering of a game scene as an example. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the rendering of a game scene, it should be understood that this is only an exemplary embodiment.

[0057] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0058] To facilitate understanding of this application, some terms involved in this application are explained as follows:

[0059] Shader: Shader stores the GPU's execution code, which is used to tell the GPU how to draw the color of the target pixel. It is widely used in the field of 3D graphics. Various 3D graphics effects can be obtained through shader code.

[0060] Direct light: The light that directly shines from the light source to the object is called direct light.

[0061] Indirect light: In the real world, objects can be illuminated by indirect light. Indirect light means that light usually reflects between multiple objects and finally enters the camera, which means that before the light enters the camera, it is reflected by more than one object.

[0062] Physical Based Rendering (PBR): It is a real-time rendering method widely used in recent years. The corresponding material system is called PBR material system, which includes multiple parameters such as base color, metallic, roughness, etc.

[0063] Image Based Lighting (IBL): In the PBR system, specular reflection is achieved through IBL technology. The effect of ambient light in real-time rendering is achieved by using environment maps (which can be taken by a camera in the real world or rendered in real time by a camera in the game).

[0064] Rendering pipeline: The rendering pipeline is the core component of real-time rendering. The function of the rendering pipeline is to render a two-dimensional image by giving a virtual camera, three-dimensional scene objects, light sources and other scene elements.

[0065] It is worth noting that before the present application was filed, in order to illuminate the scene, the prior art usually used direct light and indirect light in the game engine. In order to prevent the part not illuminated by direct light from appearing "dead black", that is, to highlight the details of the dark area, the light source or the environmental reflection would be used to interact with the object, that is, the light generated by the direct light and the indirect light needs to interact with the surface of the object, so as to obtain the rendering and shading results and display them. However, this method will not only increase the performance consumption, but also in some game scenes, such as water, ice and smooth snow, it will be difficult to balance the contrast between the bright and dark parts, resulting in the problem that the artist has adjusted the bright parts but the dark parts are overexposed or the dark parts are adjusted but the details of the bright parts are not obvious.

[0066] The game scene rendering method provided in the present application can directly obtain the first material rendering parameter and the second material rendering parameter of the material shader of the object to be rendered, and perform material rendering on the directly lighted area and the area not directly lighted according to the first material rendering parameter and the second material rendering parameter, respectively. There is no need to perform additional lighting processing on the area not directly lighted. The effects of the directly lighted area and the area not directly lighted in the game scene can be adjusted in a simple manner, thereby balancing the contrast between the directly lighted area and the area not directly lighted, avoiding the "dead black" effect of the area not directly lighted, and improving the rendering effect of the game scene. It can also solve the problem in the prior art that the light generated by direct light and indirect light interacts with the surface of an object to obtain the final rendering and shading effect and display it, resulting in high performance consumption, thereby simplifying the rendering process of the game scene.

[0067] The following is an explanation of a game scene rendering method provided in an embodiment of the present application in combination with multiple specific application examples. Figure 1 A flowchart of a game scene rendering method provided in one embodiment of the present application is shown as follows: Figure 1 As shown, the method includes:

[0068] S101: Obtaining a first material rendering parameter and a second material rendering parameter of an object to be rendered through a material shader of the object to be rendered in a game scene.

[0069] In the method provided in the present application, since the material shader includes a first material rendering parameter and a second material rendering parameter, the material shader provided in the present application can obtain two parts of material rendering parameters for the object to be rendered, and according to the two parts of material rendering parameters, render the materials corresponding to the bright and dark areas respectively.

[0070] S102: Performing material rendering on a directly illuminated area of ​​the object to be rendered using a physically based rendering method according to the first material rendering parameter.

[0071] Optionally, material rendering can be performed on objects corresponding to all direct light illumination areas in the game scene according to the first material rendering parameters; or, according to the first material rendering parameters and in combination with a user's selection operation, material rendering can be performed only on a few selected objects in the direct light illumination area in the game scene; or, according to the first material rendering parameters and in combination with a user's selection operation, material rendering can be performed only on multiple objects of a selected target type among multiple types of objects in the direct light illumination area in the game scene; the method for determining the specific material rendering object can be flexibly adjusted according to user needs, and is not limited to the above-mentioned embodiments.

[0072] The directly illuminated area in the game scene is the bright area of ​​the current scene. Material rendering is performed on the directly illuminated area based on the first material rendering parameter, which ensures the rendering effect of the bright area. In this way, the rendering effect of the bright area can be controlled by configuring or changing the first material rendering parameter.

[0073] S103: performing material rendering on the area of ​​the object to be rendered that is not illuminated by direct light, using a physically based rendering method according to the second material rendering parameter.

[0074] Optionally, in some possible embodiments, the method of performing material rendering on areas not illuminated by direct light may be, for example: performing material rendering on objects corresponding to all areas not illuminated by direct light in the game scene; or performing material rendering on only a few selected objects in areas not illuminated by direct light in the game scene based on user selection; or performing material rendering on only multiple objects of a selected target type among multiple types of objects in areas not illuminated by direct light in the game scene based on user selection; the determination of specific material rendering objects may be flexibly adjusted based on user needs and is not limited to the above embodiments.

[0075] Among them, the area in the game scene that is not directly illuminated by light due to occlusion and other reasons is the dark area of ​​the current scene. For example, some areas blocked by high-rise buildings or plants, or areas in caves or indoors with no light source at all are the dark areas in the current game scene. The second material rendering parameter is used to control the rendering effect of the dark area.

[0076] By adopting the game scene rendering method provided by the present application, since the rendering is performed by directly obtaining the first material rendering parameter and the second material rendering parameter of the material shader of the object to be rendered, and material rendering is performed on the directly illuminated area and the not directly illuminated area in the game scene according to the first material rendering parameter and the second material rendering parameter, there is no need to perform additional lighting processing on the not directly illuminated area in the game scene. The effects of the directly illuminated area and the not directly illuminated area in the game scene can be adjusted in a simple manner, thereby balancing the contrast between the directly illuminated area and the not directly illuminated area in the game scene, thereby avoiding the "dead black" effect of the not directly illuminated area, improving the rendering effect of the game scene, and ensuring the layering effect between the directly illuminated area and the not directly illuminated area in the game scene after rendering, and the rendering effect is more realistic.

[0077] Optionally, based on the above embodiment, the embodiment of the present application may also provide a game scene rendering method. The following is an example of the implementation process of obtaining material rendering parameters in the above method in combination with the accompanying drawings. Figure 2 A flowchart of a game scene rendering method provided by another embodiment of the present application is shown as follows: Figure 2 As shown, S101 may include:

[0078] S104: Obtaining a first material rendering parameter through a first configuration area on a configuration interface of a material shader.

[0079] Among them, the first configuration area is used to receive the first material rendering parameters. For example, the first configuration area can be displayed at a corresponding position pre-set in the setting interface in the form of a setting interface. The user can determine that the user-input parameters obtained are the first material rendering parameters by entering parameters in the first configuration area.

[0080] S105: Obtain second material rendering parameters through a second configuration area on a configuration interface of the material shader.

[0081] Among them, the first configuration area is used to receive the first material rendering parameters. In some possible embodiments, for example, the second configuration area can be displayed at a corresponding position pre-set in the setting interface in the form of a setting interface (wherein the first configuration area and the second configuration area are different areas on the setting interface). The user can determine that the user-input parameters obtained are the second material rendering parameters by entering parameters in the second configuration area.

[0082] Optionally, the first material rendering parameter and the second material rendering parameter can be manually configured by an artist, or can be determined by the artist through selection operations in preset configuration options. The specific method of determining the material rendering parameters can be flexibly adjusted according to user needs, and this application does not impose any restrictions here.

[0083] Optionally, based on the above embodiment, the embodiment of the present application may also provide a game scene rendering method. The following is an example of the implementation process of obtaining the first material rendering parameter in the above method in combination with the accompanying drawings. Figure 3 A flowchart of a game scene rendering method provided by another embodiment of the present application is shown as follows: Figure 3 As shown, S104 may include:

[0084] S106: Receive a material map input through the first configuration area.

[0085] In some possible embodiments, the material map can be a material map selected from multiple material maps in a preset material map library, or a material map drawn by an artist, or a material map crawled from the Internet. The specific method of obtaining the material map can be flexibly adjusted according to user needs and is not limited to the above embodiments.

[0086] S107: Reading a first material rendering parameter from a preset channel in a material map.

[0087] Among them, the preset channel in the material map records the corresponding type of material rendering parameters, which are used to render the material of the directly illuminated area according to the corresponding type of material rendering parameters in the material map, so that if the material of the directly illuminated area needs to be changed, it is only necessary to change the corresponding material map.

[0088] In one embodiment of the present application, the first metalness value can be read from the R channel of the material map, and the first roughness value can be read from the G channel of the material map, that is, the metalness of the directly illuminated area is material rendered according to the read first metalness value, and the roughness of the directly illuminated area is material rendered according to the read first roughness.

[0089] Optionally, based on the above embodiment, the embodiment of the present application may also provide a game scene rendering method. The following is an example of the implementation process of obtaining the first material rendering parameter in the above method in combination with the accompanying drawings. Figure 4 A flowchart of a game scene rendering method provided by another embodiment of the present application is shown as follows: Figure 4 As shown, S105 may include:

[0090] S108: Receive a preset type of material rendering parameter input through the second configuration area.

[0091] The second material rendering parameters include: material rendering parameters of a preset type.

[0092] Optionally, in one embodiment of the present application, the second configuration area has: an input box for at least one preset type of material rendering parameter; S108 is to receive each preset type of material rendering parameter input through the input box for each preset type of material rendering parameter: the second material rendering parameters include: at least one preset type of material rendering parameter.

[0093] For example, at least one preset type of material rendering parameter may include: a second metallic value, and / or a second roughness value. In one embodiment of the present application, at least one preset type of material rendering parameter includes: a second metallic value and a second roughness value; its value may be, for example, any value in the range of 0-1, wherein when the second metallic value is 0, it indicates that the effect corresponding to the current material is not metallic at all, and the closer the second metallic value is to 1, the stronger the metallic texture of the effect corresponding to the current material; the closer the second roughness value is to 0, the lower the roughness of the effect corresponding to the current material, that is, the smoother the effect corresponding to the current material, and the closer the second roughness value is to 1, the higher the roughness of the effect corresponding to the current material, that is, the less smooth the effect corresponding to the current material; however, it should be understood that for materials of the preset type, the specific contents included in the rendering parameters can be flexibly adjusted according to user needs, and are not limited to the above embodiments.

[0094] By adopting the method provided by the present application, compared with the method of only reading the first material rendering parameters in the prior art, the present application additionally adds a second material rendering parameter to replace the original method of only reading a set of parameters. Thus, the configuration of the bright and dark effects in the scene can be achieved through simple settings, without the need for complex processes such as interactive calculations based on direct light and indirect light. If the effects of the bright and dark parts need to be modified later, only simple modifications are required to achieve the modification of the bright and dark effects in the scene, thereby improving the work efficiency of artists.

[0095] Optionally, based on the above embodiment, the embodiment of the present application may also provide a game scene rendering method. The following is an example of the implementation process of material rendering for areas not illuminated by direct light in the above method in combination with the accompanying drawings. Figure 5 A flowchart of a game scene rendering method provided by another embodiment of the present application is shown as follows: Figure 5 As shown, S103 may include:

[0096] S109: According to the second material rendering parameter, a highlight item of indirect light of a rendering pipeline based on a physically based rendering method is configured.

[0097] By adopting the method provided in the present application, since the PBR part in the rendering pipeline is improved, by processing the part of the IBL read in the PBR, the material shader of the object to be rendered can receive separate first material rendering parameters and second material rendering parameters, that is, in the method provided in the present application, the PBR needs to receive two different material rendering parameters, and then perform material rendering on different areas in the game scene according to the received different material rendering parameters, and the two different material rendering parameters are used to render the material effects of the bright area and the dark area in the current game scene, respectively; wherein, the highlight item of the IBL part of the indirect light of the PBR rendering pipeline can be configured according to the second material rendering parameter, for use in the subsequent highlight calculation in the IBL.

[0098] S110: Based on the configured rendering pipeline, material rendering is performed on the area of ​​the object to be rendered that is not illuminated by direct light.

[0099] In an embodiment of the present application, the material rendering of the directly illuminated area (bright part) and the area not directly illuminated by light (bright part) are performed separately. Specifically, the target bright area is rendered according to the first material rendering parameter, and the target dark area is rendered according to the second material rendering parameter. The final shading effect in the scene includes the result of material rendering of the area illuminated by direct light and the result of material rendering of the area not directly illuminated by light.

[0100] The following is an example of rendering a virtual snow layer in a game scene. Figure 6 A schematic diagram of a configuration interface provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, for example, the current game scene rendering method is taken as an example for rendering the snow layer in the game scene: the object material shader configuration interface can, for example, be a terrain mosaic material shader configuration interface, and the configuration interface can include parameter configuration areas such as terrain standard parameters and snow basic color parameters. In addition, a second configuration area 130 can be additionally set in the object material shader configuration interface for receiving second material rendering parameters; at this time, in addition to the standard parameter and basic parameter configuration areas, the snow layer Snow Layer also has two layered configuration areas: a first configuration area 120 and a second configuration area 130, which are respectively used to read different metallicities and roughnesses corresponding to bright areas and dark areas, and perform subsequent material rendering on the objects to be rendered in the current game scene according to the read parameters.

[0101] Among them: the first layer is to read the first material rendering parameter through the first configuration area 120, that is, the snow layer mixing parameter SnowLayer Mix interface. The interface reads a material map, wherein the R channel in the material map stores the metalness value, and the G channel stores the roughness value. The first material rendering parameter is determined according to the two parameters read, and then the material rendering is performed on the bright area illuminated by direct light according to the first material rendering parameter. If the artist needs to modify the material effects of the two areas in the current game scene, the first material rendering parameter corresponding to the above interface can be modified directly by modifying the material map, thereby adjusting the material effect corresponding to the bright area in the current game scene.

[0102] The second layering is to read the second material rendering parameters through the second configuration area 130, namely the snow layer metallicity specification parameter SnowLayerSpecCubeMetallic interface and the snow layer roughness specification parameter SnowLayerSpecCube Roughness interface, and then perform material rendering on the dark area not directly illuminated by light according to the second material rendering parameters; the two interfaces in the above-mentioned second configuration area 130 are used to read the corresponding material rendering parameters, which respectively allow receiving a value ranging from 0 to 1, and different values ​​correspond to different roughness or metallicity, which is used to subsequently process the metallicity and roughness of the dark area according to the values ​​of the two interfaces read; in the process of configuring the game scene, if the artist needs to modify the material effect of the dark area in the current game scene, he can directly adjust the material effect corresponding to the dark area in the current game scene by modifying the material rendering parameters corresponding to these two interfaces in the first configuration area 120 and the second configuration area 130 corresponding to the parameter configuration interface.

[0103] In the method provided in the present application, the PBR calculation needs to receive two different metallicity and roughness values ​​for processing the bright material effects and the dark material effects in the current game scene. In the IBL part, the required metallicity and roughness values ​​are used to add a second configuration area in the present application, wherein the second configuration area includes two interfaces (SnowLayerSpecCube Metallic and SnowLayerSpecCube Roughness). When the method provided in the present application is used to modify the material effects in the current game scene, the bright material effects and the dark material effects can be modified by simply modifying the parameters, which simplifies the operation of the artists and allows the artists to control the bright and dark material effects in the game scene more easily.

[0104] By adopting the game scene rendering method provided by the present application, the target bright area and the target dark area are rendered respectively by configuring the first material rendering parameters and the second material rendering parameters in the first configuration area and the second configuration area. Compared with the traditional technology of rendering the dark area according to the interaction of direct light and indirect light, the rendering method provided by the present application is simple, easy to operate and easy to modify, which makes it convenient for artists to control the bright and dark effects of objects of any material in the game scene by adjusting the first material rendering parameters and the second material rendering parameters.

[0105] The following is an explanation of the game scene rendering device provided by the present application in conjunction with the accompanying drawings. The game scene rendering device can perform the above Figure 1-Figure 6 For any game scene rendering method, its specific implementation and beneficial effects are as mentioned above and will not be repeated below.

[0106] Figure 7 A schematic diagram of the structure of a game scene rendering device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device includes: an acquisition module 201 and a rendering module 202, wherein:

[0107] The acquisition module 201 is used to acquire the first material rendering parameter and the second material rendering parameter of the object to be rendered through the material shader of the object to be rendered in the game scene.

[0108] The rendering module 202 is used to perform material rendering on the area of ​​the object to be rendered that is directly illuminated by light using a physically based rendering method according to the first material rendering parameter; and to perform material rendering on the area of ​​the object to be rendered that is not directly illuminated by light using a physically based rendering method according to the second material rendering parameter.

[0109] Optionally, the acquisition module 201 is specifically used to acquire a first material rendering parameter through a first configuration area on a configuration interface of a material shader; and acquire a second material rendering parameter through a second configuration area on the configuration interface of the material shader.

[0110] Figure 8 A schematic diagram of the structure of a game scene rendering device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device further includes: a receiving module 203 and a reading module 204, wherein:

[0111] The receiving module 203 is used to receive the material map input through the first configuration area;

[0112] The reading module 204 is used to read the first material rendering parameter from the preset channel in the material map; the preset channel in the material map records the material rendering parameter of the corresponding type.

[0113] Optionally, the reading module 204 is specifically configured to read the first metalness value from the R channel of the texture map, and read the first roughness value from the G channel of the texture map.

[0114] Optionally, the receiving module 203 is specifically configured to receive a preset type of material rendering parameter input through the second configuration area, and the second material rendering parameter includes: a preset type of material rendering parameter.

[0115] Optionally, the receiving module 203 is specifically configured to receive a material rendering parameter of each preset type input through an input box of the material rendering parameter of each preset type: the second material rendering parameter includes: at least one material rendering parameter of the preset type.

[0116] like Figure 8 As shown, the apparatus further includes: a configuration module 205, configured to configure a highlight item of indirect light of a rendering pipeline of a physical-based rendering method according to a second material rendering parameter;

[0117] The rendering module 202 is specifically configured to perform material rendering on the area of ​​the object to be rendered that is not illuminated by direct light based on the configured rendering pipeline.

[0118] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0119] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0120] Fig. 9 This is a structural schematic diagram of a game scene rendering device provided in one embodiment of the present application. The game scene rendering device can be integrated into a terminal device or a chip of a terminal device.

[0121] like Fig. 9As shown, the game scene rendering device includes: a processor 501, a storage medium 502 and a bus 503.

[0122] The processor 501 is used to store programs. The processor 501 calls the program stored in the storage medium 502 to execute the above Figure 1 - Figure 6 The corresponding method embodiment has similar specific implementation methods and technical effects, which will not be described here.

[0123] Optionally, the present application also provides a program product, such as a storage medium, on which a computer program is stored, including a program that, when executed by a processor, executes an embodiment corresponding to the above method.

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

[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0127] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

Claims

1. A game scene rendering method, characterized in that: The method comprises: Obtaining, through a material shader of an object to be rendered in a game scene, a first material rendering parameter and a second material rendering parameter of the object to be rendered; wherein the first material rendering parameter includes a first metalness value and a first roughness value; and the second material rendering parameter includes a second metalness value and a second roughness value; According to the first material rendering parameter and the user's selection operation, using a physically based rendering method, material rendering is performed on a directly illuminated area of ​​an object or an object of a selected type in the object to be rendered based on the user's selection operation; Performing material rendering on an area of ​​the object to be rendered that is not directly illuminated by light and that is selected based on the user's selection operation or the type of object selected, in the object to be rendered, using a physically based rendering method according to the second material rendering parameter; The step of performing material rendering on an area of ​​the object to be rendered that is not directly illuminated by light and that is selected based on the user's selection operation or an object of a selected type in the object to be rendered using a physically based rendering method according to the second material rendering parameter includes: According to the second material rendering parameter, a highlight item of indirect light of the rendering pipeline of the physical based rendering method is configured; Based on the configured rendering pipeline, material rendering is performed on the area of ​​the object to be rendered that is not illuminated by direct light.

2. The method according to claim 1, characterized in that The method of obtaining the first material rendering parameter and the second material rendering parameter of the object to be rendered by using the material shader of the object to be rendered in the game scene includes: Obtaining the first material rendering parameter through a first configuration area on a configuration interface of the material shader; The second material rendering parameters are obtained through a second configuration area on the configuration interface of the material shader.

3. The method according to claim 2, characterized in that The obtaining the first material rendering parameter through a first configuration area on a configuration interface of the material shader includes: Receiving a material map input through the first configuration area; The first material rendering parameter is read from a preset channel in the material map; the preset channel in the material map records the material rendering parameter of the corresponding type.

4. The method according to claim 3, characterized in that The step of reading the first material rendering parameter from a preset channel in the material map includes: A first metalness value is read from the R channel of the texture map, and a first roughness value is read from the G channel of the texture map.

5. The method according to claim 2, characterized in that The obtaining the second material rendering parameter through the second configuration area on the configuration interface of the material shader includes: A material rendering parameter of a preset type input through the second configuration area is received, where the second material rendering parameter includes: a material rendering parameter of the preset type.

6. The method according to claim 5, characterized in that The second configuration area has: an input box for at least one preset type of material rendering parameter; The receiving of the preset type of material rendering parameters input through the second configuration area includes: Receiving the material rendering parameters of each preset type input through the input box of the material rendering parameters of each preset type: the second material rendering parameters include: the material rendering parameters of the at least one preset type.

7. The method according to claim 6, characterized in that The at least one preset type of material rendering parameter includes: a second metalness value, and / or a second roughness value.

8. A game scene rendering device, characterized in that: The device comprises: an acquisition module and a rendering module, wherein: The acquisition module is used to acquire a first material rendering parameter and a second material rendering parameter of the object to be rendered through a material shader of the object to be rendered in the game scene; wherein the first material rendering parameter includes a first metal value and a first roughness value; and the second material rendering parameter includes a second metal value and a second roughness value; The rendering module is used to perform material rendering on a directly illuminated area of ​​the object selected based on the user's selection operation or an object of a selected type in the object to be rendered by using a physically based rendering method according to the first material rendering parameter and the user's selection operation; and perform material rendering on a not directly illuminated area of ​​the object selected based on the user's selection operation or an object of a selected type in the object to be rendered by using a physically based rendering method according to the second material rendering parameter; The device also includes a configuration module, which is used to configure the highlight item of the indirect light of the rendering pipeline of the physical rendering method according to the second material rendering parameter; based on the configured rendering pipeline, material rendering is performed on the area on the object to be rendered that is not illuminated by direct light.

9. A game scene rendering device, characterized in that: The device includes: a processor, a storage medium and a bus, the storage medium stores machine-readable instructions executable by the processor, and when the game scene rendering device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the method described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Fast rendering method for virtual scene and model

    CN107103638A

  • Method and device for processing virtual resources in game scene

    CN108434742A

  • Game scene rendering method and device

    CN110193193A

  • Game picture rendering method and device, storage medium and electronic equipment

    CN111068312A

  • AR scene-based illumination rendering method and device

    CN111127624A