Game resource making method and device

By rendering the scene depth map and mixing materials in the game scene, the problem of unnatural rain and snow covering effects in the existing technology is solved, low energy consumption and natural shading effects are achieved, and the user experience of the game scene is improved.

CN119280826APending Publication Date: 2025-01-10PERFECT WORLD INTERACTIVE ENTERTAINMENT (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311559254.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing game resource production methods are difficult to achieve natural rain and snow coverage in large-scale game worlds, resulting in unnatural changes in scene materials and affecting user experience.

Method used

By obtaining the scene model in the game scene, rendering the first and second scene depth maps, and mixing the scene element materials and weather element materials in the shading area, using blur and noise mixing technology to determine and draw the shading area to achieve natural shading effect.

Benefits of technology

It reduces the system processing pressure, improves the visual nature and user experience of the game scene, and realizes low-energy consumption game resource production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119280826A_ABST
    Figure CN119280826A_ABST
Patent Text Reader

Abstract

The invention discloses a game resource production method and device, relates to the technical field of game development, and mainly aims to solve the problems of low production efficiency and high system processing pressure of existing game resources. Comprising the steps that a scene model in a game scene is obtained, a first scene depth map and a second scene depth map of the scene model are rendered, and the second scene depth map is obtained through coding based on the color channel digit of the first scene depth map after fuzzy processing; determining a shielding area based on depth information in the first scene depth map and the second scene depth map; the scene element material and the weather element material of the scene model are mixed in the shielding area, and game resources of the game scene are manufactured and obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of game development, and in particular to a method and device for producing game resources. Background Art

[0002] In the process of developing large-scale game worlds, in order to display realistic world effects, it is necessary to realistically process the weather effects in the game world. For example, in rainy and snowy weather, the scene materials in the game world scenes will change with the rain and snow, such as the ground becoming wet or covered with snow.

[0003] At present, the existing method of achieving rain and snow coverage effects in game scenes is to calculate the occluded area by baking the scene height map, or directly bake the occluded area into a static map to bake the rain and snow coverage effect. However, since the scene objects in the game world are usually buildings, a large amount of memory will be occupied when baking the static occlusion map, and the boundary line of the occluded area calculated using the height map is too clear at the intersection, and the visual effect is very unnatural, which greatly affects the user experience of the game scene. Therefore, a method for producing game resources is urgently needed to solve the above problems. Summary of the invention

[0004] In view of this, the present invention provides a method and device for producing game resources, the main purpose of which is to solve the problems of low production efficiency and high system processing pressure of existing game resources.

[0005] According to one aspect of the present invention, a method for producing game resources is provided, comprising:

[0006] Acquire a scene model in the game scene, and render a first scene depth map and a second scene depth map of the scene model, where the second scene depth map is obtained by encoding the number of color channel bits of the first scene depth map after blurring;

[0007] Determine an occluded area based on the first scene depth map and the depth information in the second scene depth map;

[0008] Game resources of the game scene are produced by mixing the scene element material and the weather element material of the scene model in the shielded area.

[0009] Further, the rendering of the first scene depth map and the second scene depth map of the scene model includes:

[0010] Determine the first color channel bit number of the first scene depth map after blur processing, and a first color value channel corresponding to the first color channel bit number;

[0011] The first color channel bit number is encoded to obtain the second color channel bit number, and the second color channel bit number is configured in the second color value channel corresponding to the first color value channel, and the second scene depth map corresponding to the second color channel bit number and the second color value channel is rendered.

[0012] Further, the determining the masked area based on the depth information in the first scene depth map and the second scene depth map includes:

[0013] Sampling and decoding the second scene depth map according to the world position in the scene material component, determining at least one coordinate pixel point of the world position, and calculating depth information corresponding to the first scene depth map and the second scene depth map based on the coordinate pixel point;

[0014] Obtain blur range parameters and height difference values ​​that affect the occlusion area, and perform logarithmic operation based on the blur range parameters, the height difference value and the depth information to determine the occlusion area, wherein the height difference value is the difference between the game camera height based on the game scene and the game scene height.

[0015] Further, performing a logarithmic operation based on the blur range parameter, the height difference value and the depth information to determine the occluded area includes:

[0016] The occlusion function is used to calculate the occlusion result corresponding to the coordinate pixel point, and the occlusion function is e k*(z-d) , where k is the blur range parameter, z is the depth information, and d is the height difference;

[0017] Under the condition that the occlusion result is 1, determining that the coordinate pixel point is not occluded;

[0018] Under the condition that the occlusion result is 0, determining that the coordinate pixel point is occluded;

[0019] The occluded area is obtained by drawing according to the coordinate pixel points determined to be unoccluded and the coordinate pixel points determined to be occluded.

[0020] Furthermore, before producing the game resources of the game scene by mixing the scene element material and the weather element material of the scene model in the shielded area, the method further includes:

[0021] A noise map of the game scene is obtained, and noise mixing processing is performed on the shielded area based on the noise map to obtain the shielded area to be mixed with the scene material and the weather element material.

[0022] Furthermore, the method further comprises:

[0023] Under the condition that any one of the transition edge shape, transition edge color, and transition edge range of the masked area does not match the preset scene transition condition, the noise map is updated, and noise mixing processing is performed based on the updated noise map.

[0024] Further, the acquiring a scene model in the game scene and rendering a first scene depth map and a second scene depth map of the scene model includes:

[0025] Loading the scene model of the game scene, wherein the scene model includes a scene object model and a terrain model;

[0026] The scene object model and the terrain model are depth rendered from top to bottom through a game camera to obtain the first scene depth map.

[0027] According to another aspect of the present invention, there is provided a device for producing game resources, comprising:

[0028] An acquisition module, used to acquire a scene model in a game scene, and render a first scene depth map and a second scene depth map of the scene model, wherein the second scene depth map is obtained by encoding the number of color channel bits of the first scene depth map after blurring;

[0029] A determination module, configured to determine a masked area based on the depth information in the first scene depth map and the second scene depth map;

[0030] The production module is used to produce game resources of the game scene by mixing the scene element material and the weather element material of the scene model in the shielded area.

[0031] Furthermore, the acquisition module includes:

[0032] A first determining unit, configured to determine the first color channel bit number of the first scene depth map after blur processing, and a first color value channel corresponding to the first color channel bit number;

[0033] A rendering unit is used to perform an encoding operation on the first color channel bit number to obtain the second color channel bit number, and configure the second color channel bit number to the second color value channel corresponding to the first color value channel, and render to obtain the second color channel bit number and the second scene depth map corresponding to the second color value channel.

[0034] Furthermore, the determining module includes:

[0035] a second determining unit, configured to sample and decode the second scene depth map according to a world position in a scene material component, determine at least one coordinate pixel point of the world position, and calculate depth information corresponding to the first scene depth map and the second scene depth map based on the coordinate pixel point;

[0036] The third determination unit is used to obtain the blur range parameters and height difference values ​​that affect the occlusion area, and perform logarithmic operation based on the blur range parameters, the height difference value and the depth information to determine the occlusion area, wherein the height difference value is the difference between the game camera height based on the game scene and the game scene height.

[0037] Furthermore, the third determining unit is specifically configured to calculate the occlusion result corresponding to the coordinate pixel point using an occlusion function, wherein the occlusion function is e k*(z-d) , wherein k is the blur range parameter, z is the depth information, and d is the height difference; when the occlusion result is 1, the coordinate pixel point is determined to be unoccluded; when the occlusion result is 0, the coordinate pixel point is determined to be occluded; the occlusion area is obtained by drawing according to the coordinate pixel point determined to be unoccluded and the coordinate pixel point determined to be occluded.

[0038] Furthermore, the device also includes:

[0039] A processing module is used to obtain a noise map of the game scene, and perform noise mixing processing on the shielded area based on the noise map to obtain the shielded area to be mixed with the scene material and the weather element material.

[0040] Furthermore, the device also includes:

[0041] An updating module is used to update the noise map when any of the transition edge shape, transition edge color and transition edge range of the masked area does not match the preset scene transition condition, and perform noise mixing processing based on the updated noise map.

[0042] Further,

[0043] The acquisition module is specifically used to load the scene model of the game scene, wherein the scene model includes a scene object model and a terrain model; and perform depth rendering of the scene object model and the terrain model from top to bottom through a game camera to obtain the first scene depth map.

[0044] According to another aspect of the present invention, there is provided a storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned method for producing game resources.

[0045] According to another aspect of the present invention, there is provided a terminal, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0046] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned method for making game resources.

[0047] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0048] The present invention provides a method and device for producing game resources. Compared with the prior art, an embodiment of the present invention obtains a scene model in a game scene, and renders a first scene depth map and a second scene depth map of the scene model, wherein the second scene depth map is encoded based on the number of color channel bits of the first scene depth map after blurring; an occluded area is determined based on depth information in the first scene depth map and the second scene depth map; game resources of the game scene are produced by mixing scene element materials and weather element materials of the scene model in the occluded area, thereby realizing low-energy production for game scenes and meeting the requirements for natural and smooth transition display of occluded areas of different weather scenes. The production visual effect of game resources is more natural, thereby greatly improving the user experience of the game scene.

[0049] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0051] Figure 1 A flow chart of a method for producing game resources provided by an embodiment of the present invention is shown;

[0052] Figure 2 A schematic diagram of the effect of shielding rain and snow under a bridge provided by an embodiment of the present invention is shown;

[0053] Figure 3 A block diagram showing a composition of a device for making game resources provided by an embodiment of the present invention is shown;

[0054] Figure 4 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0055] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0056] The embodiment of the present invention provides a method for producing game resources, such as Figure 1 As shown, the method includes:

[0057] 101. Obtain a scene model in a game scene, and render a first scene depth map and a second scene depth map of the scene model.

[0058] In an embodiment of the present invention, the current execution end as the execution end of game development can be a cloud server or a terminal server, so as to produce game resources. Among them, the game scene can be a virtual scene developed for different large-scale online interactive games, and the scene model is used to characterize the 3D model, two-dimensional map and other terrain and building models developed for the game scene, such as a house model or a bridge model in a snowy game scene, which is not specifically limited in the embodiment of the present invention. At this time, the scene model can be developed and created based on a game development engine, such as UE, Unity and other development engines for different game scenes, which is not specifically limited in the embodiment of the present invention. Among them, the first scene depth map is obtained by rendering this scene model, and after blurring the first scene depth map, it is encoded according to the number of color channel bits to obtain the second scene depth map. Among them, the color channel is the R (red) G (green) B (blue) channel in game development, so when rendering the second scene depth map, it is encoded according to the number of channel bits.

[0059] 102. Determine an occluded area based on depth information in the first scene depth map and the second scene depth map.

[0060] In an embodiment of the present invention, depth information is used to characterize the visual depth displayed by the scene model in the game scene. For example, the scene model is a bridge. The first scene depth map of the bridge and the second scene depth map can be used to characterize the visual area under the bridge or the visual area on the bridge through depth information, so as to determine the shielded area for the scene in the game scene based on this depth information. At this time, the shielded area is used to characterize the area where the scene model is shielded from the weather elements in the game scene. For example, if the weather is snowing and the scene model is a house, the shielded area is the area under the house that blocks the falling snow. The embodiment of the present invention does not make specific limitations. Among them, when determining the depth information, the coordinate pixel point of the world position of the first scene depth map is obtained by decoding the second scene depth map, so as to calculate the depth information based on this coordinate pixel point.

[0061] 103. Game resources of the game scene are produced by mixing scene element materials and weather element materials of the scene model in the shielded area.

[0062] In the embodiment of the present invention, after determining the shielded area, the current execution end mixes the scene element material and the weather element material of the scene model in the shielded area in order to reduce the processing pressure of the system and improve the display effect of the weather scene in the game scene, thereby producing the game resources of the game scene. Among them, the scene element material is the material data of the scene model. For example, if the scene model is a house, the material data is the house material, and the weather element material is the material data of the weather element. At this time, the weather element includes but is not limited to snow elements, rain materials, etc., which are not specifically limited in the embodiment of the present invention.

[0063] In another embodiment of the present invention, for further definition and explanation, the step of rendering the first scene depth map and the second scene depth map of the scene model includes:

[0064] Determine the first color channel bit number of the first scene depth map after blur processing, and a first color value channel corresponding to the first color channel bit number;

[0065] The first color channel bit number is encoded to obtain the second color channel bit number, and the second color channel bit number is configured in the second color value channel corresponding to the first color value channel, and the second scene depth map corresponding to the second color channel bit number and the second color value channel is rendered.

[0066] In order to avoid taking up a large amount of memory when baking static occlusion maps and to improve the efficiency of game resource production, when rendering the first scene depth map and the second scene depth map, the current execution end first uses the orthogonal camera in the game engine to perform depth rendering on the scene model in the game scene from top to bottom to obtain a depth map, which is the first scene depth map, and then encodes the first scene depth map. When encoding to obtain the second scene depth map, first determine the first color channel bit number and the corresponding first color value channel of the first scene depth map. At this time, after rendering the first scene depth map, you can directly get the channel of the rendering map based on the game engine. For example, the first scene depth map is a 16-bit color channel, which corresponds to the RG channel for color display. When encoding, perform encoding operations based on the first color channel bit number, convert it into the second color channel bit number of the second scene depth map to be rendered, and configure the second color channel bit number in the second color value channel corresponding to the first color value channel. For example, a 16-bit single-channel image is encoded as an 8-bit RGBA map. At this time, the median of the original 16-bit single-channel image is configured in the 8-bit RGBA color channel, R is the red color channel, G is the green color channel, B is the blue color channel, and A is the transparency color channel to obtain a rendered second scene depth map. At the same time, the B channel and the A channel in the second scene depth map store other information as needed to avoid waste of maps, which is not specifically limited in the embodiment of the present invention. In addition, before encoding the first scene depth map, the first scene depth map is blurred to make the scene rendering effect more realistic.

[0067] It should be noted that the encoding method in the embodiment of the present invention can be to divide the depth information by 256, store the decimal part in the R channel of the second scene depth map, and divide the integer part by 256 again, and store the obtained value in the G channel. For example, if the depth value to be stored is 10000, then the R channel stores 0.0625 and the G channel stores 0.1523. The embodiment of the present invention does not make specific limitations. In addition, in the development of different game scenes, the color data stored in the RG color channel can also be stored in the channel according to the RGBA order, which is not specifically limited in the embodiment of the present invention.

[0068] The reason why it is stored in the RG channel is because of the usage habits of textures. Generally, the channels are used in the order of RGBA. If there is no other information at present, the information will be stored in the R channel and the G channel first. It does not have to be stored in the RG channel.

[0069] In another embodiment of the present invention, for further definition and explanation, the step of determining the masked area based on the depth information in the first scene depth map and the second scene depth map includes:

[0070] Sampling and decoding the second scene depth map according to the world position in the scene material component, determining at least one coordinate pixel point of the world position, and calculating depth information corresponding to the first scene depth map and the second scene depth map based on the coordinate pixel point;

[0071] Obtain a blur range parameter and a height difference value that affect the occluded area, and perform a logarithmic operation based on the blur range parameter, the height difference value, and the depth information to determine the occluded area.

[0072] In order to reduce the working pressure of the system for rendering, in an embodiment of the present invention, when determining the occluded area based on the depth information of the first scene depth map and the second scene depth map, specifically, the current execution end loads the second scene depth map in the scene material component in the game engine, and samples and decodes the second scene depth map in the scene material according to the world position of the game scene. Among them, sampling is first performed in the sampling and decoding process, and decoding is performed after the coordinates in the world position are determined to obtain multiple coordinate pixel points of this world position, so as to calculate the depth information corresponding to the first scene depth map and the second scene depth map with these coordinate pixel points, for example, the values ​​between the coordinate pixel points can be directly compared to determine the depth information, which is not specifically limited in the embodiment of the present invention. Furthermore, after determining the depth information, in order to avoid unclear boundaries of the occluded area, the current execution end performs logarithmic operations on the depth information based on the fuzzy range parameters and height difference values ​​that affect the occluded area, and obtains the occlusion results of the coordinate pixels of each world position, so as to determine the occluded area that can be divided in the scene according to the specific values ​​of this occlusion result. Among them, the fuzzy range parameter is a parameter for adjusting the visual weather effect for different game scenes, which can be configured based on different development requirements. The height difference value is the difference between the game camera height based on the game scene and the game scene height, which can be calculated in real time based on the game camera height and the game scene height in the game engine, and the embodiment of the present invention does not make specific limitations.

[0073] In another embodiment of the present invention, for further definition and explanation, the step of performing a logarithmic operation based on the blur range parameter, the height difference value and the depth information to determine the occluded area includes:

[0074] Calculate the occlusion result corresponding to the coordinate pixel point using an occlusion function;

[0075] Under the condition that the occlusion result is 1, determining that the coordinate pixel point is not occluded;

[0076] Under the condition that the occlusion result is 0, determining that the coordinate pixel point is occluded;

[0077] The occluded area is obtained by drawing according to the coordinate pixel points determined to be unoccluded and the coordinate pixel points determined to be occluded.

[0078] In order to accurately determine the occlusion area, thereby reducing the resource consumption of system rendering and improving the visual display effect of scene weather. In a specific implementation scenario, the current execution end uses the occlusion function to calculate the occlusion result corresponding to the coordinate pixel point. At this time, the occlusion function is ESM=e k*(z-d) , where k is the blur range parameter, z is the depth information, d is the height difference, and e is the base of the natural logarithm, and the value is preferably a constant of 2.718. When the occlusion result ESM calculated based on the above occlusion function is 1, the coordinate pixel point is determined to be unoccluded; if the occlusion result ESM is 0, the coordinate pixel point is determined to be occluded. Since the depth information is calculated corresponding to at least one coordinate pixel point of each world position, after determining the occlusion result corresponding to the coordinate pixel point corresponding to each world position, the occlusion area is obtained by drawing according to the coordinate pixel points determined to be unoccluded and the coordinate pixel points determined to be occluded. For example, the coordinate pixel points corresponding to the occlusion results that are all equal to 1 are connected to obtain the occlusion area, which is not specifically limited in the embodiment of the present invention.

[0079] In addition, in a specific implementation scenario, according to the numerical value calculated by the above-mentioned occlusion function, if the part corresponding to the numerical value 1 is the normal rain and snow area, then the part corresponding to the numerical value 0 is the shielded area, and correspondingly, the part of 0-1 is the transition area. Whether to divide this area into the occlusion area can be determined based on the game development requirements, and the embodiment of the present invention does not make specific limitations.

[0080] In another embodiment of the present invention, for further definition and explanation, before the step of mixing the scene element material and the weather element material of the scene model in the shielded area to produce the game resources of the game scene, the method further includes:

[0081] A noise map of the game scene is obtained, and noise mixing processing is performed on the shielded area based on the noise map to obtain the shielded area to be mixed with the scene material and the weather element material.

[0082] In order to show more realistic visualization effects of weather such as rain and snow, and reduce the resource pressure of system rendering, the current execution end first obtains the noise map of the game scene before making game resources. The occluded area is blurred by mixing this noise map with the occluded area. At this time, the noise mixing process can be to highly mix the noise map with the map of the occluded area. For example, the occlusion result ESM value calculated when determining the occluded area is multiplied by 2 and subtracted by 1, and then added to the sampled pixels in the noise map to obtain the occluded area of ​​the scene material and weather element material to be mixed, such as Figure 2 As shown, the embodiments of the present invention are not specifically limited.

[0083] In another embodiment of the present invention, for further definition and description, the steps further include:

[0084] Under the condition that any one of the transition edge shape, transition edge color, and transition edge range of the masked area does not match the preset scene transition condition, the noise map is updated, and noise mixing processing is performed based on the updated noise map.

[0085] In order to improve the realistic display effect of the game weather scene resources, the aforementioned numerical value calculated based on the occlusion function can be a numerical value between 0 and 1 to characterize the transition interval. Therefore, after the current execution end calculates the numerical value between 0 and 1, the transition interval can be determined in the same way as the shielding interval, and the embodiment of the present invention does not make specific limitations. Further, based on the determined transition interval, it is determined whether the transition edge shape, transition edge color, and transition edge range match the preset scene transition condition, wherein the transition edge shape can be determined according to the boundary shape of the transition area and the non-shielded area in the scene, the transition edge color can be determined based on the color channel corresponding to the coordinate pixel point based on the coordinate position, and the transition edge range can be determined based on the world coordinates displayed by the transition area in the game scene, and then judged according to the preset scene transition condition. Among them, the preset scene transition condition includes edge shape condition, edge range condition, and color condition, which can be configured based on the game effect of the specific game scene, so that the transition area is more in line with the realistic effect of rain and snow weather in the game scene, so that the rendering between the shielded area and the non-shielded area is more balanced.

[0086] It should be noted that if any of the transition edge shape, transition edge color, and transition edge range does not match the preset scene transition conditions, it means that the transition between the masked area and the non-masked area is not smooth enough, such as the edge is too regular and there is a gradient transition range with hard cut edges. Therefore, the noise map used for the mixing process is updated, and noise mixing processing is performed based on the updated noise map to achieve the purpose of natural transition.

[0087] In another embodiment of the present invention, for further definition and explanation, the step of obtaining a scene model in a game scene and rendering a first scene depth map and a second scene depth map of the scene model includes:

[0088] Loading the scene model of the game scene;

[0089] The scene object model and the terrain model are depth rendered from top to bottom through a game camera to obtain the first scene depth map.

[0090] In order to realize the production of realistic natural weather game resources for game scenes, when the current execution end renders the first scene depth map, it first loads the scene model to be displayed in the game scene. At this time, the scene model includes a scene object model and a terrain model, such as a ground model, a house model, a bridge model, etc., which are not specifically limited in the embodiment of the present invention. Furthermore, the current execution end uses a game camera in the game engine, such as an orthogonal camera, to perform depth rendering on the scene object model and the terrain model from top to bottom to obtain a first scene depth map, that is, a depth map.

[0091] An embodiment of the present invention provides a method for producing game resources. Compared with the prior art, the embodiment of the present invention obtains a scene model in a game scene, and renders a first scene depth map and a second scene depth map of the scene model, wherein the second scene depth map is encoded based on the number of color channel bits of the first scene depth map after blurring; an occluded area is determined based on the depth information in the first scene depth map and the second scene depth map; game resources of the game scene are produced by mixing scene element materials and weather element materials of the scene model in the occluded area, thereby achieving low-energy production for game scenes and meeting the requirements for natural and smooth transition display of occluded areas in different weather scenes. The production visual effect of game resources is more natural, thereby greatly improving the user experience of the game scene.

[0092] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a device for making game resources, such as Figure 3 As shown, the device comprises:

[0093] An acquisition module 31 is used to acquire a scene model in a game scene, and render a first scene depth map and a second scene depth map of the scene model, where the second scene depth map is obtained by encoding the number of color channel bits of the first scene depth map after blurring;

[0094] A determination module 32, configured to determine a masked area based on the depth information in the first scene depth map and the second scene depth map;

[0095] The production module 33 is used to produce game resources of the game scene by mixing the scene element material and the weather element material of the scene model in the shielded area.

[0096] Furthermore, the acquisition module includes:

[0097] A first determining unit, configured to determine the first color channel bit number of the first scene depth map after blur processing, and a first color value channel corresponding to the first color channel bit number;

[0098] A rendering unit is used to perform an encoding operation on the first color channel bit number to obtain the second color channel bit number, and configure the second color channel bit number to the second color value channel corresponding to the first color value channel, and render to obtain the second color channel bit number and the second scene depth map corresponding to the second color value channel.

[0099] Furthermore, the determining module includes:

[0100] a second determining unit, configured to sample and decode the second scene depth map according to a world position in a scene material component, determine at least one coordinate pixel point of the world position, and calculate depth information corresponding to the first scene depth map and the second scene depth map based on the coordinate pixel point;

[0101] The third determination unit is used to obtain the blur range parameters and height difference values ​​that affect the occlusion area, and perform logarithmic operation based on the blur range parameters, the height difference value and the depth information to determine the occlusion area, wherein the height difference value is the difference between the game camera height based on the game scene and the game scene height.

[0102] Furthermore, the third determining unit is specifically configured to calculate the occlusion result corresponding to the coordinate pixel point using an occlusion function, wherein the occlusion function is e k*(z-d) , wherein k is the blur range parameter, z is the depth information, and d is the height difference; when the occlusion result is 1, the coordinate pixel point is determined to be unoccluded; when the occlusion result is 0, the coordinate pixel point is determined to be occluded; the occlusion area is obtained by drawing according to the coordinate pixel point determined to be unoccluded and the coordinate pixel point determined to be occluded.

[0103] Furthermore, the device also includes:

[0104] A processing module is used to obtain a noise map of the game scene, and perform noise mixing processing on the shielded area based on the noise map to obtain the shielded area to be mixed with the scene material and the weather element material.

[0105] Furthermore, the device also includes:

[0106] An updating module is used to update the noise map when any of the transition edge shape, transition edge color and transition edge range of the masked area does not match the preset scene transition condition, and perform noise mixing processing based on the updated noise map.

[0107] Further,

[0108] The acquisition module is specifically used to load the scene model of the game scene, wherein the scene model includes a scene object model and a terrain model; and perform depth rendering of the scene object model and the terrain model from top to bottom through a game camera to obtain the first scene depth map.

[0109] An embodiment of the present invention provides a method for producing game resources. Compared with the prior art, the embodiment of the present invention obtains a scene model in a game scene, and renders a first scene depth map and a second scene depth map of the scene model, wherein the second scene depth map is encoded based on the number of color channel bits of the first scene depth map after blurring; an occluded area is determined based on the depth information in the first scene depth map and the second scene depth map; game resources of the game scene are produced by mixing scene element materials and weather element materials of the scene model in the occluded area, thereby achieving low-energy production for game scenes and meeting the requirements for natural and smooth transition display of occluded areas of different weather scenes. The production visual effect of game resources is more natural, thereby greatly improving the user experience of the game scene.

[0110] According to an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the method for producing game resources in any of the above method embodiments.

[0111] Figure 4 A schematic diagram of the structure of a terminal provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.

[0112] like Figure 4 As shown, the terminal may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0113] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .

[0114] The communication interface 404 is used to communicate with other devices such as clients or other servers.

[0115] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned embodiment of the method for producing game resources.

[0116] Specifically, the program 410 may include program codes, which include computer operation instructions.

[0117] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0118] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0119] The program 410 may be specifically configured to enable the processor 402 to perform the following operations:

[0120] Acquire a scene model in the game scene, and render a first scene depth map and a second scene depth map of the scene model, where the second scene depth map is obtained by encoding the number of color channel bits of the first scene depth map after blurring;

[0121] Determine an occluded area based on the first scene depth map and the depth information in the second scene depth map;

[0122] Game resources of the game scene are produced by mixing the scene element material and the weather element material of the scene model in the shielded area.

[0123] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for producing game resources, characterized in that: include: Acquire a scene model in the game scene, and render a first scene depth map and a second scene depth map of the scene model, where the second scene depth map is obtained by encoding the number of color channel bits of the first scene depth map after blurring; Determine an occluded area based on the first scene depth map and the depth information in the second scene depth map; Game resources of the game scene are produced by mixing the scene element material and the weather element material of the scene model in the shielded area.

2. The method according to claim 1, characterized in that The rendering of the first scene depth map and the second scene depth map of the scene model comprises: Determine the first color channel bit number of the first scene depth map after blur processing, and a first color value channel corresponding to the first color channel bit number; The first color channel bit number is encoded to obtain the second color channel bit number, and the second color channel bit number is configured in the second color value channel corresponding to the first color value channel, and the second scene depth map corresponding to the second color channel bit number and the second color value channel is rendered.

3. The method according to claim 1, characterized in that The determining of the masked area based on the depth information in the first scene depth map and the second scene depth map comprises: Sampling and decoding the second scene depth map according to the world position in the scene material component, determining at least one coordinate pixel point of the world position, and calculating depth information corresponding to the first scene depth map and the second scene depth map based on the coordinate pixel point; Obtain blur range parameters and height difference values ​​that affect the occlusion area, and perform logarithmic operation based on the blur range parameters, the height difference value and the depth information to determine the occlusion area, wherein the height difference value is the difference between the game camera height based on the game scene and the game scene height.

4. The method according to claim 3, characterized in that The performing logarithmic operation based on the blur range parameter, the height difference value and the depth information to determine the occluded area comprises: The occlusion function is used to calculate the occlusion result corresponding to the coordinate pixel point, and the occlusion function is e k*(z-d) , where k is the blur range parameter, z is the depth information, and d is the height difference; Under the condition that the occlusion result is 1, determining that the coordinate pixel point is not occluded; Under the condition that the occlusion result is 0, determining that the coordinate pixel point is occluded; The occluded area is obtained by drawing according to the coordinate pixel points determined to be unoccluded and the coordinate pixel points determined to be occluded.

5. The method according to claim 1, characterized in that Before producing the game resources of the game scene by mixing the scene element material and the weather element material of the scene model in the shielded area, the method further includes: A noise map of the game scene is obtained, and noise mixing processing is performed on the shielded area based on the noise map to obtain the shielded area to be mixed with the scene material and the weather element material.

6. The method according to claim 5, characterized in that The method further comprises: Under the condition that any one of the transition edge shape, transition edge color, and transition edge range of the masked area does not match the preset scene transition condition, the noise map is updated, and noise mixing processing is performed based on the updated noise map.

7. The method according to any one of claims 1 to 6, characterized in that: The step of acquiring a scene model in a game scene and rendering a first scene depth map and a second scene depth map of the scene model comprises: Loading the scene model of the game scene, wherein the scene model includes a scene object model and a terrain model; The scene object model and the terrain model are depth rendered from top to bottom through a game camera to obtain the first scene depth map.

8. A device for producing game resources, characterized in that: include: An acquisition module, used to acquire a scene model in a game scene, and render a first scene depth map and a second scene depth map of the scene model, wherein the second scene depth map is obtained by encoding the number of color channel bits of the first scene depth map after blurring; A determination module, configured to determine a masked area based on the depth information in the first scene depth map and the second scene depth map; The production module is used to produce game resources of the game scene by mixing the scene element material and the weather element material of the scene model in the shielded area.

9. A storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute an operation corresponding to the method for producing game resources as described in any one of claims 1-7.

10. A terminal, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the method for producing game resources as described in any one of claims 1-7.