A game scene material upgrading method, device, electronic device and storage medium

By batch generating normal map data and replacing material parameters, the time-consuming problem of upgrading old model resources is solved, and game development efficiency and picture quality are improved.

CN114307155BActive Publication Date: 2024-10-11BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111643510.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-10-11
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

During the development process of the game remake, the material upgrade of old model resources requires a lot of manpower and time, which affects the game development cycle.

Method used

By obtaining the material data of multiple models in the game scene, generating normal map data in batches, and replacing the material parameters with target parameters, the material upgrade of the game scene is realized.

Benefits of technology

It greatly improves the visual effects of old games, reduces the workload of artists, and shortens the game development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114307155B_ABST
    Figure CN114307155B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, electronic device and storage medium for upgrading game scene materials, the method comprising: obtaining material data of multiple models in the game scene; batch replacing material parameters in the material data with target material parameters; obtaining diffuse reflection map data in the material data of each model; batch generating normal map data corresponding to each model according to each diffuse reflection map data; rendering the model according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene. This technical solution can batch modify the material parameters of each model in the game scene, and automatically batch generate normal maps corresponding to each model, thereby realizing the upgrade of the game scene material, greatly improving the picture effect of the old game, reducing the workload of the art staff, and shortening the game development cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for upgrading game scene materials. Background Art

[0002] In the process of developing the remastered version of the game, there is a large demand for upgrading old model resources. The existing old model resource upgrade mainly relies on the production of artists. Artists are required to make normal maps, replace materials for old models one by one in the scene editor, specify normal map paths, adjust material parameters, and other operations.

[0003] The existing technology requires artists to upgrade the materials of old model resources one by one, which requires a lot of manpower and time and will affect the game development cycle. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a game scene material upgrading method, device, electronic device and storage medium.

[0005] According to one aspect of an embodiment of the present application, a method for upgrading game scene materials is provided, comprising:

[0006] Get the material data of multiple models in the game scene;

[0007] Obtaining diffuse reflection map data from the material data of each of the models;

[0008] Batch generate normal map data corresponding to each of the models according to each of the diffuse reflection map data;

[0009] Batch replace the material parameters in the material data with target material parameters;

[0010] The model is rendered according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene.

[0011] Optionally, batch-generating normal map data corresponding to each of the models according to each of the diffuse reflection map data includes:

[0012] Converting the diffuse reflection map data into grayscale data;

[0013] Generate normal map data corresponding to the model according to the grayscale data.

[0014] Optionally, batch-generating normal map data corresponding to each of the models according to each of the diffuse reflection map data includes:

[0015] Obtain the path of each of the diffuse reflection map data and the array length of the array stored in the path;

[0016] Generate a configuration file corresponding to each of the models according to the path and the array length, wherein the configuration file includes a file for generating the normal map data according to the diffuse reflection map data;

[0017] The configuration files corresponding to the models are respectively executed, and the normal map data corresponding to the models are generated according to the diffuse reflection map data corresponding to the models.

[0018] Optionally, the respectively executing the configuration files corresponding to the models includes:

[0019] Creating a process, and setting a command line parameter of the process to the storage path of the configuration file;

[0020] Executing the process, calling the configuration file according to the storage path, and performing an operation of generating the normal map data according to the diffuse map data;

[0021] After the process is executed, the normal map data of all models in the game scene are obtained.

[0022] Optionally, the configuration file includes node files of four nodes for generating the normal map data according to the diffuse map data:

[0023] Reading node files, used to read diffuse reflection map data corresponding to each of the models;

[0024] A grayscale conversion node file, used to convert the diffuse reflection map data into grayscale data;

[0025] A normal conversion node file, used to generate normal map data corresponding to the model according to the grayscale data;

[0026] A storage node file is used to store the normal map data to disk.

[0027] Optionally, obtaining material data of multiple models in the game scene includes:

[0028] When the material type of the model is a preset type, determining whether the material data is the material data of the model itself;

[0029] When the material data is the material data of the model itself, the game scene is instantiated to obtain a scene material instance;

[0030] When the material data is scene material data, obtaining a scene material instance;

[0031] The material data corresponding to the scene material instance is obtained as the material data of the model.

[0032] According to another aspect of an embodiment of the present application, a game scene material upgrading device is provided, comprising:

[0033] The material acquisition module is used to obtain the material data of multiple models in the game scene;

[0034] A texture acquisition module, used to acquire diffuse reflection texture data from the material data of each model;

[0035] A batch generation module, used for batch generating normal map data corresponding to each of the models according to each of the diffuse reflection map data;

[0036] A batch replacement module, used for batch replacing material parameters in the material data with target material parameters;

[0037] A rendering module is used to render the model according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene.

[0038] Optionally, the batch generation module includes:

[0039] An acquisition submodule, used for acquiring the path of each of the diffuse reflection map data and the array length of the array stored in the path;

[0040] A generating submodule, used for generating a configuration file corresponding to each of the models according to the path and the array length, wherein the configuration file includes a file for generating the normal map data according to the diffuse map data;

[0041] The execution submodule is used to respectively execute the configuration files corresponding to the models, and generate the normal map data corresponding to the models according to the diffuse reflection map data corresponding to the models.

[0042] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.

[0043] According to another aspect of the embodiment of the present application, there is provided an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0044] The memory is used to store computer programs;

[0045] The processor is used to implement the above method steps when executing a computer program.

[0046] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method steps are implemented.

[0047] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0048] The game scene material upgrade technology provided in this application can batch modify the material parameters of each model in the game scene, and automatically batch generate normal maps corresponding to each model, thereby realizing the upgrade of the game scene material, greatly improving the picture effects of old games, reducing the workload of artists, and shortening the game development cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 A flowchart of a game scene material upgrade method provided in an embodiment of the present application;

[0052] Figure 2 A flowchart of a game scene material upgrade method provided by another embodiment of the present application;

[0053] Figure 3 A flowchart of a game scene material upgrade method provided by another embodiment of the present application;

[0054] Figure 4 A flowchart of a game scene material upgrade method provided by another embodiment of the present application;

[0055] Figure 5 A schematic diagram of four nodes for generating normal map data according to diffuse map data in an embodiment of the present application;

[0056] Figure 6 A flowchart of a game scene material upgrade method provided by another embodiment of the present application;

[0057] Figure 7 A block diagram of a game scene material upgrading device provided in an embodiment of the present application;

[0058] Figure 8A block diagram of a batch generation module provided in an embodiment of the present application;

[0059] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0061] Normal mapping is a technique for simulating the lighting effect of bumps and depressions. It is an implementation of bump mapping. Normal mapping can add details to a model without adding polygons. A common use case is to improve the appearance and add details to a low-polygon model.

[0062] In the prior art, according to the traditional normal map production process, artists create high polygon models (abbreviated as high poly) and low polygon models (abbreviated as low poly) in model making software (such as 3Ds Max, Maya, etc.), unfold UV for each low poly (i.e., create UV map), and bake normal maps for high poly and low poly. Therefore, for upgrading old model resources, the high poly and low poly of the original model are needed, but because the resources are too old, it is difficult to find all the original models.

[0063] The game scene material upgrade technology provided in this application can batch modify the material parameters of each model in the game scene, and automatically batch generate normal maps corresponding to each model, thereby realizing the upgrade of the game scene material, greatly improving the picture effects of old games, reducing the workload of artists, and shortening the game development cycle.

[0064] The following first introduces a game scene material upgrading method provided by an embodiment of the present invention.

[0065] Figure 1 This is a flow chart of a method for upgrading game scene materials provided in an embodiment of the present application. Figure 1 As shown, the method can be applied to a scene editor, comprising the following steps S11-S14:

[0066] Step S11, obtaining material data of multiple models in the game scene.

[0067] By selecting the corresponding files of each model in the corresponding folder of the game, the material data of the model can be obtained. The material data of all models can be selected in batches for subsequent batch modification of materials.

[0068] During the game development process, game developers usually put models of the same type in the same folder, such as car models in the first folder, animal models in the second folder, and character models in the third folder; and the first folder may be further divided into multiple subfolders such as sedans, sports cars, and off-road vehicles. Therefore, by selecting a folder, all models in the folder can be selected.

[0069] Step S12, obtaining diffuse reflection map data from the material data of each model.

[0070] The Diffuse Map shows the reflection and surface color of an object in the game, that is, it can show the color and intensity of the object when it is illuminated by light.

[0071] Diffuse maps are applied directly to materials through DiffuseMap data. Usually, the naming convention is to add "_d" to the end of the file name to mark the file as a diffuse map. Therefore, by identifying the file name, the Diffuse Map can be extracted from the material data of each model.

[0072] Step S13, batch-generating normal map data corresponding to each model according to each diffuse reflection map data.

[0073] When remaking games, a large number of old game models usually do not use normal maps, and the details of the game models are less realistic. Therefore, when upgrading the game model material, it is necessary to add the corresponding normal map for each model. Since the diffuse map contains the lighting information of the model surface, the normal map data can be generated in batches through the diffuse map data.

[0074] The naming convention for all normal map data is to add the suffix "_n", and the normal map data can be stored in the same directory as the diffuse map data.

[0075] Step S14, replacing the material parameters in the material data with the target material parameters in batches.

[0076] Among them, the modification of material parameters in material data is to modify and replace the material parameters of the shader file corresponding to the material data. The correspondence between each model and the target material parameter, or the correspondence between the model type and the target material parameter, or the correspondence between the material data and the target material parameter can be pre-set. After obtaining the material data of the model, the corresponding target material parameters can be queried based on the model or material data, thereby completing the batch replacement of materials.

[0077] Optionally, if you choose to modify the material parameters of a certain model type, you can replace the material parameters of all models belonging to this model type with the target material parameters.

[0078] Optionally, the target material parameters may include material parameters corresponding to physically based rendering (PBR), such as transparency (TRANSLUCENCY), metal (Metallic), albedo (RGB), smoothness (Smoothness), emission (Emission), etc.

[0079] Optionally, the material parameters include the following parts:

[0080] 1. Macro parameters, such as: whether it is a metal material (MetallicEnable), whether to include an environment map (EnvMapEnable), whether to enable ambient occlusion (AOEnable), etc.

[0081] 2. Texture parameters, store texture path.

[0082] 3. Numerical parameters, such as light intensity, shadow color, etc.

[0083] After obtaining the material data of multiple models in the game scene, the normal map data is generated in batches according to the diffuse map data. After the normal map data is generated and saved, the material data corresponding to all models is updated in batches.

[0084] Step S15, rendering the model according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene.

[0085] In this embodiment, batch material upgrades of old models in the game are achieved by batch modifying material parameters and batch generating normal map data, which greatly improves the graphics effects of old games, improves the efficiency of material upgrades, reduces the workload of artists, and shortens the game development cycle.

[0086] Figure 2 This is a flowchart of a method for upgrading game scene materials provided by another embodiment of the present application. Figure 2 As shown, the above step S13 includes steps S21-S22:

[0087] Step S21, converting the diffuse reflection map data into grayscale data.

[0088] Among them, the diffuse reflection map data is converted into grayscale data, that is, each pixel is converted from three channels (RGB) to one channel. There are many conversion methods:

[0089] (1) Average method

[0090] Average the RGB values ​​of the three channels at the same pixel position, I(x,y)=1 / 3*I_R(x,y)+1 / 3*I_G(x,y)+1 / 3*I_B(x,y).

[0091] (2) Maximum-minimum-average method

[0092] Take the average of the maximum and minimum brightness of RGB at the same pixel position.

[0093] (3) Weighted average method

[0094] I(x,y)=A*I_R(x,y)+B*I_G(x,y)+C*I_B(x,y). The weighting coefficients A, B, and C are parameters adjusted according to the human brightness perception system, and there can be multiple sets of actual parameters, such as 0.3, 0.59, 0.11, or 0.2126, 0.7152, and 0.0722.

[0095] Step S22, generating normal map data corresponding to the model according to the grayscale data.

[0096] Among them, the normal refers to the direction of the model surface. In three-dimensional modeling, only the normal of the vertex can be recorded, or the normal of each pixel can be recorded. Normal map data is a mapping data that makes a normal at each point on the concave and convex surface of the original object and marks the direction of the normal through the RGB color channel. The vertices in the diffuse reflection map data correspond one-to-one to the vertices of the model. Therefore, the normals of each vertex of the model can be calculated based on the vertices in the grayscale data. The grayscale data is saved in the UV space. The two-dimensional coordinates of each vertex and the grayscale value corresponding to the vertex can be obtained according to the grayscale data. The grayscale value of the vertex can be used as the relative height of the vertex. The normal of the vertex can be calculated based on the two-dimensional coordinates and relative height of the vertex. The direction of the vertex normal is marked by the grayscale value of each vertex, and finally the normal map data corresponding to the model is obtained.

[0097] In an optional embodiment, the height map data or texture map data corresponding to the model can also be converted into a grayscale image to generate normal map data. The specific method is the same as generating normal map data using diffuse reflection map data, which will not be repeated here.

[0098] In an optional embodiment, in order to realize the function of automatically generating normal map data in batches, it is necessary to automatically generate a configuration file for each diffuse reflection map data. Figure 3 This is a flowchart of a method for upgrading game scene materials provided by another embodiment of the present application. Figure 3 As shown, the above step S13 includes steps S31-S33:

[0099] Step S31, obtaining the path of each diffuse reflection map data and the array length of the array stored in the path;

[0100] Step S32, generating a configuration file corresponding to each model according to the path and the array length, wherein the configuration file includes a file for generating normal map data according to the diffuse map data;

[0101] Step S33, executing the configuration files corresponding to the models respectively, and generating the normal map data corresponding to the models according to the diffuse reflection map data corresponding to the models.

[0102] In the scene editor, you can collect all the models that need to be upgraded in the game scene, store the path of each model's diffuse map data in an array, and automatically generate a configuration file for controlling the normal map generation software (such as ShaderMap) based on the path and array length of each diffuse map data. Each diffuse map data corresponds to a configuration file. By executing the configuration file, the normal map generation software generates normal map data corresponding to the model based on the diffuse map data.

[0103] Figure 4 This is a flowchart of a method for upgrading game scene materials provided by another embodiment of the present application. Figure 4 As shown, the above step S33 includes steps S41-S43:

[0104] Step S41, creating a process, and setting the command line parameters of the process to the storage path of the configuration file;

[0105] Step S42, executing a process, calling a configuration file according to a storage path, and performing an operation of generating normal map data according to diffuse map data;

[0106] Step S43, after the process is executed, the normal map data of all models in the game scene is obtained.

[0107] The scene editor creates a process, sets the command line parameter to the storage path of the configuration file, starts the normal map generation software, and after the process ends, the normal map data of all models in the current scene are generated.

[0108] In an alternative embodiment, the configuration file contains a node file of four nodes for generating normal map data from diffuse map data:

[0109] (1) Read the node file to read the diffuse reflection map data corresponding to each model;

[0110] (2) Grayscale conversion node file, used to convert diffuse reflection map data into grayscale data;

[0111] (3) Normal conversion node file, used to generate normal map data corresponding to the model based on grayscale data;

[0112] (4) Storage node file, used to store normal map data to disk.

[0113] Figure 5 Schematic diagram of four nodes for generating normal map data according to diffuse map data in an embodiment of the present application. Figure 5 As shown in the figure, the four nodes are described in detail as follows:

[0114] Node0, reads diffuse map data;

[0115] Node1, converts diffuse map data into grayscale data;

[0116] Node2, generates normal map data based on grayscale data;

[0117] Node3, automatically saves the normal map data.

[0118] Optionally, if the normal map data generation software is ShaderMap, a .smp file can be specified for each node to determine which operations are performed. The .smp file is a dynamic library generated by the ShaderMap SDK, which provides a specific implementation algorithm for map data conversion. Through Node0-Node2, the diffuse map data can be converted into normal map data.

[0119] Existing normal map data generation software, such as ShaderMap, does not provide an automatic save interface, and the normal map data can only be saved by clicking "Save" on the ShaderMap tool panel. In this way, the function of batch generating normal map data cannot be realized, and it is not necessary to click "Save" to save each normal map data generated. Therefore, in this embodiment, Node3 can automatically store the normal map data to a specified disk location, such as saving the normal map data to the same directory as the diffuse map data.

[0120] In the above embodiment, by saving the settings of the four nodes into a configuration file and using the configuration file to start the normal map data generation software, it is possible to automatically convert the diffuse map data into normal map data and automatically store the normal map data to the disk. After each configuration file is executed, the diffuse map data corresponding to a model can be converted into normal map data and the normal map data can be automatically stored to the disk. By executing all configuration files in sequence, batch generation and storage of normal map data can be achieved. In this process, no manual operation is required, which improves the efficiency of normal map data generation and reduces the time required for material upgrades.

[0121] Figure 6 This is a flowchart of a method for upgrading game scene materials provided by another embodiment of the present application. Figure 6 As shown, in an optional embodiment, the operation of obtaining material data in the above step S11 includes S51-S54:

[0122] Step S51, when the material type of the model is a preset type, determining whether the material data is the material data of the model itself;

[0123] Step S52, when the material data is the material data of the model itself, instantiate the game scene to obtain a scene material instance;

[0124] Step S53, when the material data is scene material data, obtaining a scene material instance;

[0125] Step S54, obtaining material data corresponding to the scene material instance as material data of the model.

[0126] Among them, the scene material instance inherits from the material and has the shader logic of the material, but only exposes the adjustable material parameters and blocks the ability to edit the shader. When a model needs to modify the material parameters, it will not affect other models using the material; and when the material logic is updated, all material instances will be updated accordingly.

[0127] In this embodiment, since the same model may exist in the game scene and use the same material data, the same material data needs to be used by different models. In order to avoid modifying the material parameters of one model and causing the material parameters of other models using the same material data to be modified, a material instance is generated for each model. When one of the material instances changes the material parameters, the model parameters of other material instances will not change. Only when the material changes, all material instances will be updated accordingly. Therefore, in an optional solution, in order to batch modify the material parameters of all models, the material parameters of the material can be directly replaced instead of replacing the material parameters of each material instance one by one, so as to improve the efficiency of material upgrades and shorten the material modification time.

[0128] The process of batch modification of materials is to traverse all static models in the game scene, execute the above steps S51-S54 on these static models, and automatically obtain the material data of each static model in batches, so as to realize subsequent batch modification of material data, improve the modification efficiency of material data, and reduce the time of material upgrade.

[0129] In an optional embodiment, the same model may exist in the game scene, and the diffuse reflection map data and material parameters used by the same model are also the same. Therefore, for the same model, normal map data generation and material parameter modification can be performed only once, and the generated normal map data and modified target material parameters can be applied to the rendering of all the same models, which can further reduce the workload of game scene material upgrades, improve game development efficiency, and shorten the game development cycle.

[0130] The following are device embodiments of the present application, which can be used to execute method embodiments of the present application.

[0131] Figure 7 This is a block diagram of a game scene material upgrade device provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 7 As shown, the game scene material upgrading device includes:

[0132] The material acquisition module 61 is used to acquire the material data of multiple models in the game scene;

[0133] A texture acquisition module 62 is used to acquire diffuse reflection texture data from the material data of each model;

[0134] A batch generation module 63 is used to batch generate normal map data corresponding to each model according to each diffuse reflection map data;

[0135] A batch replacement module 64 is used to replace the material parameters in the material data with target material parameters in batches;

[0136] The rendering module 65 is used to render the model according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene.

[0137] Figure 8 A block diagram of a batch generation module provided in an embodiment of the present application, such as Figure 8 As shown, the batch generation module 63 includes:

[0138] The acquisition submodule 71 is used to obtain the path of each diffuse reflection map data and the array length of the array stored in the path.

[0139] The generation submodule 72 is used to generate a configuration file corresponding to each model according to the path and the array length, and the configuration file includes a file for generating normal map data according to the diffuse map data.

[0140] The execution submodule 73 is used to execute the configuration files corresponding to each model respectively, and generate the normal map data corresponding to the model according to the diffuse reflection map data corresponding to each model.

[0141] The present application also provides an electronic device, such as Fig. 9 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .

[0142] Memory 1503, used for storing computer programs;

[0143] The processor 1501 is used to implement the steps of the above method embodiment when executing the computer program stored in the memory 1503.

[0144] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0145] The communication interface is used for communication between the above electronic device and other devices.

[0146] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0147] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0148] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method embodiment described below are implemented.

[0149] It should be noted that, for the above-mentioned device, electronic device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0150] It should be further noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0151] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for upgrading game scene materials, characterized in that: include: Get the material data of multiple models in the game scene; Obtaining diffuse reflection map data from the material data of each of the models; Batch generate normal map data corresponding to each of the models according to each of the diffuse reflection map data; Batch replace the material parameters in the material data with target material parameters; Rendering the model according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene; The step of batch-generating normal map data corresponding to each of the models according to each of the diffuse reflection map data comprises: Converting the diffuse reflection map data into grayscale data; Generate normal map data corresponding to the model according to the grayscale data.

2. The method according to claim 1, characterized in that The step of batch-generating normal map data corresponding to each of the models according to each of the diffuse reflection map data comprises: Obtain the path of each of the diffuse reflection map data and the array length of the array stored in the path; Generate a configuration file corresponding to each of the models according to the path and the array length, wherein the configuration file includes a file for generating the normal map data according to the diffuse reflection map data; The configuration files corresponding to the models are respectively executed, and the normal map data corresponding to the models are generated according to the diffuse reflection map data corresponding to the models.

3. The method according to claim 2, characterized in that The respectively executing the configuration files corresponding to the models comprises: Creating a process, and setting a command line parameter of the process to the storage path of the configuration file; Executing the process, calling the configuration file according to the storage path, and performing an operation of generating the normal map data according to the diffuse map data; After the process is executed, the normal map data of all models in the game scene are obtained.

4. The method according to claim 2, characterized in that: The configuration file includes node files of four nodes for generating the normal map data according to the diffuse map data: Reading node files, used to read diffuse reflection map data corresponding to each of the models; A grayscale conversion node file, used to convert the diffuse reflection map data into grayscale data; A normal conversion node file, used to generate normal map data corresponding to the model according to the grayscale data; A storage node file is used to store the normal map data to disk.

5. The method according to claim 1, characterized in that The obtaining of material data of multiple models in the game scene includes: When the material type of the model is a preset type, determining whether the material data is the material data of the model itself; When the material data is the material data of the model itself, the game scene is instantiated to obtain a scene material instance; When the material data is scene material data, obtaining a scene material instance; The material data corresponding to the scene material instance is obtained as the material data of the model.

6. A game scene material upgrading device, characterized in that: include: The material acquisition module is used to obtain the material data of multiple models in the game scene; A texture acquisition module, used to acquire diffuse reflection texture data from the material data of each model; A batch generation module, used for batch generating normal map data corresponding to each of the models according to each of the diffuse reflection map data; A batch replacement module, used for batch replacing material parameters in the material data with target material parameters; A rendering module, used to render the model according to the target material parameters and the normal map data, thereby completing the material upgrade of the game scene; The batch generation module is used to convert the diffuse reflection map data into grayscale data; and generate normal map data corresponding to the model according to the grayscale data.

7. The device according to claim 6, characterized in that The batch generation module comprises: An acquisition submodule, used for acquiring the path of each of the diffuse reflection map data and the array length of the array stored in the path; A generating submodule, used for generating a configuration file corresponding to each of the models according to the path and the array length, wherein the configuration file includes a file for generating the normal map data according to the diffuse map data; The execution submodule is used to respectively execute the configuration files corresponding to the models, and generate the normal map data corresponding to the models according to the diffuse reflection map data corresponding to the models.

8. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 5 when executing the computer program.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.