Lighting processing method, device, equipment and storage medium in games

By obtaining and processing the material shader of dark objects in the scene in the game, deleting the lighting calculation, and only calculating the direct light information of other objects, the problem of increased running consumption caused by dark objects in the game is solved, and the effect of reducing consumption is achieved.

CN112190937BActive Publication Date: 2024-08-23NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011081638.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-10
Publication Date
2024-08-23
Estimated Expiration
2040-10-10

AI Technical Summary

Technical Problem

In the existing technology, in a game scene where a large area is in a dark indoor area, the entire object is in the shadow of direct light, resulting in increased game running costs.

Method used

By obtaining the target object in the dark part of the game scene, obtain the target shader corresponding to its material, and delete the lighting calculation during the rendering process, and only calculate the direct light information of other objects in the scene except the target object.

Benefits of technology

Without affecting the artistic effect or increasing the work cost, it reduces the running consumption of the game and reduces the direct light information calculation of objects in the dark part.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112190937B
    Figure CN112190937B
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for lighting processing in a game, and relates to the field of scene configuration technology. The method includes: in response to a game running operation, obtaining a target object in a dark part of a game scene; obtaining a target shader corresponding to the material of the target object, wherein the target shader does not include lighting calculations; and rendering the target object through the target shader. Compared with the prior art, it avoids the problem that the entire dark scene is in the shadow of direct light. If direct light is also determined for these scenes, the problem of increasing the running consumption of the game will be avoided.
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 method, device, equipment and storage medium for lighting processing in a game. Background Art

[0002] In open world games, or indoor scenes with outdoor natural light, a directional light is usually used to simulate the sun, and the directional light is also used as the main light source for the entire scene. Since most of the baking in the scene is not to bake the main light projection, but to bake indirect light, then the shadowmask is used to achieve real-time projection calculations with different precisions at different distances.

[0003] The existing lighting scheme is that the game scene is globally illuminated by directional light, and then the bright and dark parts are determined by calculation. The lightmap only collects indirect light, and the direct light is determined by real-time directional light calculation. For smaller objects in the game scene, lightmaps are generally not generated, and they are directly affected by light probes, so that they can obtain the same indirect light information as the surrounding environment, and then determine the direct light.

[0004] However, in actual game production, there are often large areas of dark indoor scenes, and the objects in this part of the scene are all in the shadow of direct light. If direct light is also determined according to the existing technology, the running cost of the game will increase. Summary of the invention

[0005] The purpose of the present application is to provide a lighting processing method, device, equipment and storage medium in a game to address the deficiencies in the above-mentioned prior art, so as to solve the problem that the dark scenes in the prior art are generally in the shadow of direct light. If direct light is also determined for these scenes, the running consumption of the game will increase.

[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 method for lighting processing in a game, the method comprising:

[0008] In response to the game running operation, obtaining a target object in a dark part of the game scene;

[0009] Obtaining a target shader corresponding to the material of the target object, wherein the target shader does not include lighting calculation;

[0010] The target object is rendered using the target shader.

[0011] Optionally, the target object in the dark part is a child object of a preset empty object in the game scene, and the preset empty object is located at the origin of the space coordinate system of the game scene.

[0012] Optionally, before obtaining the target shader corresponding to the material of the target object, the method further includes:

[0013] Obtain and copy the material of the target object;

[0014] The rendering of the target object by using the target shader includes:

[0015] The copied material of the target object is rendered by the target shader.

[0016] Optionally, in response to the game running operation, obtaining a target object in a dark part of the game scene includes:

[0017] In response to a game running operation, obtaining all objects in the scene;

[0018] The target object among the preset empty objects is searched.

[0019] In a second aspect, another embodiment of the present application provides a method for lighting processing in a game, the method comprising:

[0020] Get the target object in the dark part of the game scene;

[0021] Obtain a target shader corresponding to the material of the target object;

[0022] Removes the lighting calculations in the target shader.

[0023] Optionally, the method further comprises:

[0024] A preset empty object is constructed in the game scene, and the target object is used as a child object of the empty object.

[0025] Optionally, obtaining a target shader corresponding to the material of the target object includes:

[0026] Get the target shader corresponding to the material of all child objects under the empty object.

[0027] Deleting the lighting calculation in the target shader includes:

[0028] The lighting calculation in the target shader corresponding to the material of all sub-objects under the obtained empty object is deleted.

[0029] Optionally, after constructing a preset empty object in the game scene and using the target object as a child object of the empty object, the method further includes:

[0030] The position information of the preset empty object is reset to zero.

[0031] In a third aspect, another embodiment of the present application provides a lighting processing device in a game, the device comprising: an acquisition module and a rendering module, wherein:

[0032] The acquisition module is used to acquire a target object in a dark part of a game scene in response to a game running operation; and acquire a target shader corresponding to a material of the target object, wherein the target shader does not include illumination calculation;

[0033] The rendering module is used to render the target object through the target shader.

[0034] Optionally, the acquisition module is specifically used to acquire and copy the material of the target object;

[0035] The rendering module is specifically used to render the copied material of the target object through the target shader.

[0036] Optionally, the device further comprises: a search module, wherein:

[0037] The acquisition module is specifically used to acquire all objects in the scene in response to the game running operation;

[0038] The searching module is used to search for the target object among the preset empty objects.

[0039] In a fourth aspect, another embodiment of the present application provides a lighting processing device in a game, the device comprising: an acquisition module and a deletion module, wherein:

[0040] The acquisition module is used to acquire a target object in a dark part of a game scene; and acquire a target shader corresponding to a material of the target object;

[0041] The deleting module is used to delete the lighting calculation in the target shader.

[0042] Optionally, the device further comprises: a construction module, configured to construct a preset empty object in the game scene, and use the target object as a child object of the empty object.

[0043] Optionally, the acquisition module is specifically used to acquire the target shader corresponding to the material of all sub-objects under the empty object;

[0044] The deleting module is specifically used to delete the lighting calculation in the target shader corresponding to the materials of all sub-objects under the acquired empty object.

[0045] In the fifth aspect, another embodiment of the present application provides a lighting processing device in a game, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the lighting processing device in the game is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the method described in any of the first or second aspects above.

[0046] In a sixth 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 the method described in any one of the first aspect or the second aspect are executed.

[0047] The beneficial effect of the present application is: by adopting the lighting processing method in the game provided by the present application, since before rendering the target object, it is necessary to first obtain the target objects in the dark part of the scene, and since these target objects are completely in the dark part, when the shader is used to render the objects in the scene, the target shader of the target object does not contain lighting calculations. During the rendering process, only the direct light information of objects other than the target object in the scene needs to be calculated, and the other objects are rendered according to the shaders corresponding to the other objects. This calculation method reduces the operation consumption without affecting the artistic effect and increasing the work cost because it reduces the calculation of direct light information of objects in the dark part. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] 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.

[0049] Figure 1 A schematic diagram of a flow chart of a lighting processing method in a game provided by an embodiment of the present application;

[0050] Figure 2 A schematic diagram of a flow chart of a lighting processing method in a game provided by another embodiment of the present application;

[0051] Figure 3 A schematic diagram of a flow chart of a lighting processing method in a game provided by another embodiment of the present application;

[0052] Figure 4A schematic diagram of a flow chart of a lighting processing method in a game provided by another embodiment of the present application;

[0053] Figure 5 A schematic diagram of a flow chart of a lighting processing method in a game provided by another embodiment of the present application;

[0054] Figure 6 A schematic diagram of a flow chart of a lighting processing method in a game provided by another embodiment of the present application;

[0055] Figure 7 A schematic diagram of the structure of a lighting processing device in a game provided by an embodiment of the present application;

[0056] Figure 8 A schematic diagram of the structure of a lighting processing device in a game provided by another embodiment of the present application;

[0057] Fig. 9 A schematic diagram of the structure of a lighting processing device in a game provided by another embodiment of the present application;

[0058] Fig.10 A schematic diagram of the structure of a lighting processing device in a game provided by another embodiment of the present application;

[0059] Fig.11 A schematic diagram of the structure of a lighting processing device in a game provided by one embodiment of the present application. DETAILED DESCRIPTION

[0060] 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.

[0061] 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.

[0062] 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.

[0063] In order to make the present application easier to understand, some of the terms involved in the present application are explained as follows:

[0064] Directional Light: A parallel light source used in game engines to simulate the sun.

[0065] Real-time projection: The projection calculated in real time in the game engine. Compared with baked projection, real-time projection has higher accuracy, but consumes more resources. Generally, shadowmask is used for real-time projection calculation, and real-time projection is used in different levels according to the specific distance.

[0066] Light probe: Unity uses an interpolation algorithm to collect lighting information from multiple points to generate a lighting information matrix. All dynamic objects in this matrix will use the nearest interpolation operation around them to obtain an average lighting value, thereby affecting the brightness and color of the dynamic object so that it can blend into the lighting environment.

[0067] Shadowmask: A projection processing solution in Unity. Since real-time projection consumes a lot of resources, if you use baked projection, you need a very high-precision light map to achieve the same quality, which puts a lot of pressure on memory. Therefore, Unity provides a shadowmask solution, which bakes a mask range with relatively low precision. Then, use the distance of the light to subdivide, starting with the nearest high-precision real-time projection, and gradually reduce the precision as the distance increases, until the low-precision shadowmask mask is used to display the projection effect. This can better optimize the projection efficiency.

[0068] Layer: The object classification function in Unity can define a layer for an object, manage resources through layering, and implement program identification through layering.

[0069] Shader: Shader defines the graphics rendering algorithm of the graphics card in graphics rendering. It stores the GPU's execution code and 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.

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

[0071] 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.

[0072] In order to enable those skilled in the art to use the content of this application, it can be applied to the lighting processing in various game scenes, that is, first collect the current game scene image, and then combine the processing method provided by this application to perform lighting processing on each object in the scene. Optionally, the following implementation method is given in combination with a specific application scenario: the lighting processing scene in the game is taken as an example. The games involved in this application can be: first-person shooting game (First-person shooting game, FPS), third-person design game (Third-Personal Shooting, TPS), life simulation game (SimulationGame, SIM) or role-playing game (Role-playing Game, RPG), or other types of games. It should be noted that the term "including" will be used in the embodiments of this application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0073] It is worth noting that before the present application was filed, the lighting processing method in the existing game generally used a directional light to simulate the sun. The directional light also served as the main light source for the entire scene. All objects in the scene were illuminated by the directional light. Then, according to the influence of the light probe on each object and the directional light, the direct light corresponding to each object was calculated through the shadowmask, thereby realizing real-time projection calculations with different accuracies at different distances. However, such processing method is not suitable because there are often large areas of dark indoor scenes in the game scenes. For the objects in this part of the scene, they are in the shadow of the directional light as a whole, that is, they are not illuminated by the directional light. Therefore, if the calculation method of the prior art is used, for such objects in the dark indoor part, the direct light corresponding to the object is still determined based on the influence of the directional light and the light probe, which will increase the running consumption of the game.

[0074] To solve the above problems, the existing technology also attempts to use layers to distinguish and eliminate the effects of lighting on objects. However, in actual operation, since many program functions rely on layers for judgment, the setting of layers is unique and cannot satisfy multiple functions at the same time. Therefore, this setting method will have the problem of overlapping multiple functions.

[0075] In order to solve the problems existing in the prior art, the present application provides a lighting processing method in a game, which can obtain the target objects in the scene that are completely in the dark after the game is running, and then when calculating the direct light information, only the shader is used to calculate the direct light information of objects other than the target objects in the scene, thereby reducing the calculation of direct light information of objects in the dark, thereby reducing running consumption.

[0076] The following is an explanation of a lighting processing method in a game provided by an embodiment of the present application in combination with a plurality of specific application examples. Figure 1 This is a flow chart of a method for processing lighting in a game provided by an embodiment of the present application. The method is applied to a terminal device, such as a mobile phone, a tablet computer, a PDA or a wearable smart device, and any other terminal device that can run a game application. The following method is applied during the running of the game, such as Figure 1 As shown, the method includes:

[0077] S101: In response to a game running operation, a target object in a dark part of a scene is acquired.

[0078] Among them, all objects in the current scene that are completely in the dark, that is, objects that will not be affected by the global directional light at all, for example, in life simulation games, objects that are completely in the dark may be: movie theaters, or indoors without windows, etc.; in role-playing games, objects that are completely in the dark may be: dark caves, the bottom of a well, caves, or completely closed secret rooms, etc.; different games have different corresponding preset empty objects. In one embodiment of the present application, the preset empty objects may include: identification of objects that are completely in the dark.

[0079] Optionally, in one embodiment of the present application, the target objects in the dark part of the current game scene can be obtained through the identification of each object. For example, the coordinate information of each object in the game scene can be selected as the identification corresponding to each object, or the unique number of each object in the game development process can be selected as the identification corresponding to each object. The method for determining the identification of a specific object and the specific content included can be flexibly adjusted according to user needs, and the present application does not impose any restrictions on this.

[0080] S102: Obtain a target shader corresponding to the material of the target object.

[0081] Among them, the target shader does not include lighting calculations; among them, lighting calculations may include, for example, real-time lighting and shadow calculations of directional lights, etc. Since the target object is an object that is completely in the dark, it will not be illuminated by the global directional light, and the performance in the game scene after calculating the direct light information is basically the same as the effect of not calculating the direct light information. Therefore, there is no need to calculate the direct light information for such objects, and only the direct light information of other objects needs to be calculated, thereby achieving the effect of reducing consumption and improving cost performance.

[0082] For example, in one embodiment of the present application, the target shader corresponding to the material of the target object can be obtained through a preset script, which is a script pre-configured by the R&D personnel and added under the preset empty object, and is used to remove the directional light real-time light and shadow calculation of the target object in the shader after detecting the game running operation. That is, by running the preset script, the material parameters of the shader file corresponding to the material of the target object can be modified, thereby removing the directional light real-time light and shadow calculation, and the shader after removing the lighting calculation is used as the target shader corresponding to the material of the target object.

[0083] The preset script may be, for example, InShadowObject, which is used to remove the directional light real-time light and shadow calculation of the objects in the preset empty object in the scene. In one embodiment of the present application, the preset script is also used to copy the material of the objects in the preset empty object.

[0084] For example, in one embodiment of the present application, during the process of running the preset script, the material file of the object in the preset empty object can be copied first, and then the copied material file portion corresponding to each target object can be removed for real-time light and shadow calculation. Such an implementation method can make the removal operation only modify the copied material information, avoiding the problem that after the material of the target object is modified, it affects the objects in other scenes, causing the lighting of other objects in the current game scene to be affected, and ensures the directionality of the modification.

[0085] In this way, before calculating the lighting of each object in the game scene, the real-time lighting and shadow calculations of the target object's directional light in the target object shader are eliminated by running a preset script. In the subsequent lighting calculation process, only the lighting of other objects outside the target object in the scene is calculated, avoiding the lighting calculation of the target object and thus avoiding the consumption of game operation.

[0086] S103: Rendering the target object through the target shader.

[0087] Rendering the target object through a target shader that does not include lighting calculations reduces operating costs without affecting the artistic effect or increasing work costs.

[0088] By using the lighting processing method in the game provided by the present application, before rendering the target object, it is necessary to first obtain the target objects in the dark part of the scene. Since these target objects are completely in the dark part, when the shader is used to render the objects in the scene, the target shader of the target object does not include lighting calculations. During the rendering process, only the direct light information of objects other than the target object in the scene needs to be calculated, and the other objects are rendered according to the shaders corresponding to the other objects. This calculation method reduces the operation consumption without affecting the artistic effect and increasing the work cost because it reduces the calculation of direct light information of objects in the dark part.

[0089] Optionally, in one embodiment of the present application, the target object in the dark portion is a child object of a preset empty object in the game scene, and the preset empty object is located at the origin of the game scene space coordinate system.

[0090] Optionally, based on the above embodiment, the embodiment of the present application may also provide a method for lighting processing in a game, and the above method is illustrated below with reference to the accompanying drawings. Figure 2 A flowchart of a lighting processing method in a game provided by another embodiment of the present application is shown as follows: Figure 2 As shown, before S102, the method may include:

[0091] S104: Acquire and copy the material of the target object.

[0092] Among them, since the material information of the target object may include shared material information, directly modifying the material information of each target object may cause the shared material information to be modified as well, resulting in other objects in the current game scene that are not in the dark part but also use the shared material information being affected. Therefore, the preset script needs to first copy the material information of each target object in the preset empty object, and then modify the material parameters of the shader file corresponding to the copied material, and use the modified material information as the material information of each corresponding target object. This modification method ensures that the modification is only for the target object and will not affect other objects in the scene.

[0093] For example, in some possible embodiments, the preset script can also check the material information of each object in the preset empty object to check whether the material information of each target object includes shared material information. If shared material information is included, only the shared material information part is copied, and then the material parameters of the shader file corresponding to the copied shared material are modified, and the modified material information is used as the material information of each corresponding target object; for material information that does not belong to the shared material information part, the material parameters of the corresponding shader file can be directly modified. Such a modification method can also ensure that the modification is only for the target object and does not affect other objects in the scene. Whether the specific copy operation is only for the shared material information part or the material information corresponding to the entire target object is copied can be flexibly adjusted according to user needs, and this application does not impose any restrictions on this.

[0094] After obtaining the material information corresponding to each target object and copying it, the copied material information is modified, which avoids the problem that after the material of the target object is modified, it affects the objects in other scenes and causes the lighting of other objects in the current game scene to be affected, thereby ensuring the directionality of the modification.

[0095] Correspondingly, S103 may include:

[0096] S105: Rendering the material of the copied target object through the target shader.

[0097] Optionally, based on the above embodiment, the embodiment of the present application may also provide a method for lighting processing in a game. The following is an example of how to obtain a target object belonging to a preset empty object in the scene in the above method in combination with the accompanying drawings. Figure 3 A flowchart of a lighting processing method in a game provided by another embodiment of the present application is shown as follows: Figure 3 As shown, S101 may include:

[0098] S106: In response to the game running operation, all objects in the scene are obtained.

[0099] Among them, the running operation of the game can be a running operation triggered when the user opens the game application, or a running operation triggered after the user opens the game application and logs in successfully. The specific method for determining the running operation can be flexibly adjusted as needed and is not limited to the above embodiments.

[0100] S107: Searching for a target object among the preset empty objects.

[0101] For example, in one embodiment of the present application, in response to a game running operation, a preset script can be triggered to run, a preset empty object can be searched, and each target object in the preset empty object can be collected.

[0102] By adopting the lighting processing method in the game provided by the present application, after responding to the running operation of the game, before calculating the direct light information of each object in the game scene, the material information of each target object in the current game scene is first obtained and copied by running a preset script, and then the lighting calculation of the copied material information of each target object is deleted. This not only ensures that the deletion operation is only for the target object and will not affect other objects in the game scene, but also makes it so that in the subsequent lighting calculation process, only the direct light information of other objects other than the target object in the game scene is calculated, thereby avoiding the calculation of the direct light information of the target object, thereby reducing the consumption of game operation without affecting the artistic effect and without increasing the work cost.

[0103] Figure 4 This is a flow chart of a method for lighting processing in a game provided by an embodiment of the present application. The execution subject of the method is a server or a terminal device, which is applied in the game development process. In the following embodiments, the execution subject is described as a server. Figure 4 As shown, the method may include:

[0104] S201: Acquire a target object in a dark area in a game scene.

[0105] Optionally, in one embodiment of the present application, target objects in the dark part of the game scene can be obtained based on the identification of each object. For example, the coordinate information of each object in the game scene can be selected as the identification corresponding to each object, or the unique number of each object in the game development process can be selected as the identification corresponding to each object. The method and content of determining the identification of specific objects can be flexibly adjusted according to user needs, and the present application does not impose any restrictions on this.

[0106] S202: Obtain a target shader corresponding to the material of the target object.

[0107] S203: Delete the lighting calculation in the target shader.

[0108] Optionally, based on the above embodiment, the embodiment of the present application can also provide a lighting processing method in a game, and the above method is further described below in conjunction with the accompanying drawings. Figure 5 A flowchart of a lighting processing method in a game provided by an embodiment of the present application is shown in FIG. Figure 5 As shown, after S203, the method further includes:

[0109] S204: Construct a preset empty object in the game scene, and use the target object as a child object of the empty object.

[0110] Among them, one game scene can correspond to a preset empty object. For example, the current game A includes multiple game scenes, such as a main line scene and an adventure scene. The preset empty objects can be the preset main line empty objects corresponding to the main line scene, and the preset adventure empty objects corresponding to the adventure scene. It can also be that the entire game A scene corresponds to only one preset empty object, and the preset empty object includes all target objects in the main line scene and the adventure scene. The specific correspondence between the preset empty objects and the game scenes can be flexibly designed according to user needs, and is not limited to the above embodiments.

[0111] Optionally, in one embodiment of the present application, after constructing the preset empty object corresponding to the current game scene, the name of the preset empty object is changed. For example, the name of the preset empty object can be changed to inshadow. The specific name of the preset empty object can be flexibly adjusted. It is only necessary to uniquely identify the preset empty object in the current scene according to the name. The present application does not impose any restrictions here.

[0112] For example, in some possible embodiments, the method of moving objects that are completely in the dark in the current game scene to the same preset empty object can be: during the game development process, according to the developer's dragging action, all target objects that are completely in the dark in the current game scene can be dragged to the preset empty object; or a selection panel can be provided during the development process, and all objects in the current game scene are displayed on the selection panel. By obtaining the user's selection operation on the selection panel, all selected objects are determined to be target objects, and the selected target objects are added to the preset empty object. The specific method of moving the identifier of the object that is completely in the dark to the preset empty object can be flexibly adjusted according to user needs, and is not limited to the above-mentioned embodiments.

[0113] The preset empty object is used to indicate an object for which direct light information is not calculated. The identifiers of the objects that are completely in the dark in the current game scene are uniformly moved to the preset empty object, so that the preset empty object can be directly obtained later, and all the objects that are completely in the dark in the current scene can be obtained, without the need to screen and determine the objects that are completely in the dark one by one among all the objects in the game scene, thereby improving processing efficiency.

[0114] Optionally, based on the above embodiment, the embodiment of the present application can also provide a lighting processing method in a game, and the above method is further described below in conjunction with the accompanying drawings. Figure 6 A flowchart of a lighting processing method in a game provided by an embodiment of the present application is shown in FIG. Figure 6 As shown, after S203, the method further includes:

[0115] S205: Reset the position information of the preset empty object to zero.

[0116] Among them, after the position information of the preset empty object is reset to zero, it will not affect the coordinate information of each target object in the preset empty object. The developer can view and manage the position of each object in the preset empty object at any time; of course, the coordinates of the preset empty object can also not be reset to zero. The preset empty object that is not reset to zero will not affect the use, but will only affect the coordinates of each target object in the preset empty object, causing subsequent inconvenience in viewing. The specific setting method of the position information of the preset empty object can be designed according to user needs, and this application does not impose any restrictions here.

[0117] The beneficial effects of the above method are Figure 1-Figure 4 The beneficial effects of the provided methods are the same and will not be repeated here.

[0118] Figure 7 A schematic diagram of the structure of a lighting processing device in a game provided by an embodiment of the present application, such as Figure 7 As shown, the device includes: an acquisition module 301 and a rendering module 302, wherein:

[0119] The acquisition module 301 is used to respond to the game running operation, acquire the target object in the dark part of the game scene; and acquire the target shader corresponding to the material of the target object, wherein the target shader does not include lighting calculation.

[0120] The rendering module 302 is used to render the target object through a target shader.

[0121] Optionally, the acquisition module 301 is specifically configured to acquire and copy the material of the target object.

[0122] The rendering module 302 is specifically configured to render the material of the copied target object through a target shader.

[0123] Figure 8 A schematic diagram of the structure of a lighting processing device in a game provided by an embodiment of the present application, such as Figure 8 As shown, the device also includes: a search module 303, wherein:

[0124] The acquisition module 301 is specifically used to acquire all objects in the scene in response to the game running operation.

[0125] The searching module 303 is used to search for a target object among the preset empty objects.

[0126] Fig. 9 A structural diagram of a lighting processing device in a game provided by an embodiment of the present application is shown in FIG. Fig. 9 As shown, the device includes: an acquisition module 401 and a deletion module 402, wherein:

[0127] The acquisition module 401 is used to acquire a target object in a dark part of the game scene; and acquire a target shader corresponding to the material of the target object;

[0128] The deletion module 402 is used to delete the lighting calculation in the target shader.

[0129] Fig.10 A structural diagram of a lighting processing device in a game provided by an embodiment of the present application is shown in FIG. Fig.10 As shown, the device further includes: a construction module 403, which is used to construct a preset empty object in the game scene and use the target object as a child object of the empty object.

[0130] Optionally, the acquisition module 401 is specifically used to obtain the target shader corresponding to the material of all sub-objects under the empty object.

[0131] The deletion module 402 is specifically used to delete the lighting calculation in the target shader corresponding to the materials of all sub-objects under the acquired empty object.

[0132] 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.

[0133] 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).

[0134] Fig.11 This is a schematic diagram of the structure of a lighting processing device in a game provided by an embodiment of the present application. The lighting processing device in the game can be integrated into a terminal device or a chip of the terminal device.

[0135] The lighting processing device in the game includes: a processor 501 , a storage medium 502 and a bus 503 .

[0136] 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.

[0137] 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.

[0138] 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.

[0139] 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.

[0140] 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.

[0141] 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 method for lighting processing in a game, characterized in that: The method comprises: In response to the game running operation, a target object in a dark part of the game scene is obtained; the target object in the dark part is a child object of a preset empty object in the game scene, and the preset empty object is located at the origin of the spatial coordinate system of the game scene; Obtaining a target shader corresponding to the material of the target object, wherein the target shader does not include lighting calculation; Rendering the target object by using the target shader; Before obtaining the target shader corresponding to the material of the target object, the method further includes: Obtain and copy the material of the target object; The rendering of the target object by using the target shader includes: The copied material of the target object is rendered by the target shader.

2. The method according to claim 1, characterized in that The step of obtaining a target object in a dark part of a game scene in response to a game running operation includes: In response to a game running operation, obtaining all objects in the game scene; The target object belonging to the preset empty object is searched from all objects in the game scene.

3. A lighting processing method in a game, characterized in that: The method comprises: Get the target object in the dark part of the game scene; Obtain a target shader corresponding to the material of the target object; Deleting the lighting calculation in the target shader; The method further comprises: Constructing a preset empty object in the game scene, and using the target object as a child object of the preset empty object; The step of obtaining a target shader corresponding to the material of the target object includes: Get the target shader corresponding to the material of all sub-objects under the preset empty object; Deleting the lighting calculation in the target shader includes: The lighting calculation in the target shader corresponding to the materials of all sub-objects under the preset empty object is deleted.

4. The method according to claim 3, characterized in that After constructing a preset empty object in the game scene and using the target object as a child object of the preset empty object, the method further includes: The position information of the preset empty object is reset to zero.

5. A lighting processing device in a game, characterized in that: The device comprises an acquisition module and a rendering module, wherein: The acquisition module is used to acquire a target object in a dark part of a game scene in response to a game running operation; the target object in a dark part is a child object of a preset empty object in the game scene, and the preset empty object is located at the origin of the game scene space coordinate system; and acquire a target shader corresponding to a material of the target object, wherein the target shader does not include lighting calculation; The rendering module is used to render the target object through the target shader; The acquisition module is specifically used to acquire and copy the material of the target object; The rendering module is specifically used to render the copied material of the target object through the target shader.

6. A lighting processing device in a game, characterized in that: The device comprises: an acquisition module and a deletion module, wherein: The acquisition module is used to acquire a target object in a dark part of a game scene; and acquire a target shader corresponding to a material of the target object; The deleting module is used to delete the lighting calculation in the target shader; The device further comprises: a construction module, configured to construct a preset empty object in the game scene, and use the target object as a child object of the preset empty object; The acquisition module is specifically used to acquire the target shader corresponding to the material of all sub-objects under the preset empty object; The deleting module is specifically used to delete the lighting calculation in the target shader corresponding to the materials of all sub-objects under the preset empty object.

7. A lighting processing device in a game, 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, when the lighting processing device in the game 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-2 or 3-4 above.

8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method described in any one of claims 1 to 2 or 3 to 4 is executed.