Geographic information-based shadow generation method and related device

By calculating key shadow maps based on the geographic information system in the game scene and generating target visibility maps according to user operation instructions, the problem of large computing overhead of terminal equipment during shadow generation in the prior art is solved, and more efficient shadow rendering and a more realistic gaming experience are achieved.

CN120037649AActive Publication Date: 2025-05-27HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311531628.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2025-05-27
Estimated Expiration
2043-11-15

AI Technical Summary

Technical Problem

In the prior art, when shadow generation is generated in game scenes, shadow maps need to be frequently updated and coordinate system conversion is performed, resulting in large computing overhead of terminal equipment and affecting performance.

Method used

By calculating the key shadow maps of key game scenes based on the geographical information system, determining the viewport information based on the user's operation instructions, determining whether the time node is a key time node, generating a target visibility map, and then shadow drawing.

Benefits of technology

It reduces the calculation overhead of terminal devices during shadow rendering, reduces the number of renderings and coordinate system conversions, and improves the authenticity and user experience of game scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120037649A_ABST
    Figure CN120037649A_ABST
Patent Text Reader

Abstract

The invention provides a shadow generation method based on geographic information and a related device, and by implementing the shadow generation method based on geographic information provided by the embodiment of the invention, a corresponding key shadow map can be generated only for a game scene at a key time point; and the game scene can be rendered based on the time node and the key shadow map corresponding to the user operation instruction, so that the operation burden of the terminal equipment is reduced, the game scene is ensured to have a real and three-dimensional reality effect, and the game experience of the user is also ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of the Internet, and in particular, to a method for generating shadows based on geographic information and related devices. Background Art

[0002] Shadows are an indispensable part of a game scene. They can make characters or scenes have a more realistic and three-dimensional effect, helping to enhance the user's immersion in the game and improve the user's gaming experience. Currently, in a game scene, one of the most common ways to generate shadows is shadow generation based on a shadow map. This method renders the entire game scene at the light source position, saves the depth values of the parts that can be illuminated by the light source in the shadow map in the form of a z-buffer, and then compares each point in the normal game scene with the shadow map to determine whether each point in the game scene can be seen by the light, so as to perform the rendering of the normal scene. However, during the rendering process, each frame of the image needs to maintain or generate a shadow map, which requires an additional number of rendering times, and each frame of the image needs to perform calculations for coordinate system conversion, increasing the computational overhead of the terminal device and being disadvantageous for the terminal device to maintain good performance. Summary of the Invention

[0003] In a first aspect, this application provides a method for generating shadows based on geographic information and related devices. The method includes:

[0004] Calculating a key shadow map corresponding to a key game scene based on geographic information in a geographic information system, where the key shadow map is a shadow map corresponding to a game model at a key time node, the key time node is a preset time node, and the number of key time nodes is greater than or equal to 2;

[0005] Responding to a user's operation instruction to determine viewport information, where the viewport information includes a first time node, and the first time node is the time node at which the game scene corresponding to the viewport information is located;

[0006] Judging whether the first time node is a key time node, and generating a target visibility map based on the judgment result and the key shadow map;

[0007] Based on the target visibility map, performing shadow drawing on the game scene corresponding to the viewport information to generate a target game image frame.

[0008] When implementing the method provided in the first aspect, the terminal device does not need to update the shadow map in real time based on the user's operation instruction. It can only generate corresponding key shadow maps for the game scenes at key time points, and can render the game scene based on the time node corresponding to the user's operation instruction and the key shadow map, which helps to reduce the operating burden of the terminal device while ensuring that the game scene has a real and three-dimensional realistic effect, and also helps to guarantee the user's gaming experience.

[0009] Implementing the method provided in the first aspect, in some embodiments, determining whether the first time node is a critical time node, and generating a target visibility map based on the determination result and the critical shadow map, includes:

[0010] If the determination result is yes, then perform blurring processing on the critical shadow map corresponding to the first time node, and generate a target visibility map;

[0011] If the determination result is no, then generate a target visibility map based on the target shadow map corresponding to the target time node, where the target time node is the two critical time nodes closest to the first time node before and after, and the target shadow map is the critical shadow map corresponding to each of the target time nodes.

[0012] Implementing the method provided in the above embodiments, the terminal device will adopt different shadow rendering steps according to the time node corresponding to the user's operation instruction. Specifically, when the time node corresponding to the user's operation instruction (i.e., the first time node) is the same as the preset critical time node, then the critical shadow map corresponding to the critical time node can be blurred, and then a target visibility map matching the viewport information can be obtained; when the time node corresponding to the user's operation instruction (i.e., the first time node) is between two preset critical time nodes (which can be regarded as target time nodes), the terminal device can approximate the critical shadow map corresponding to the target time node, so as to obtain the target visibility map corresponding to the first time node. This helps to simplify the shadow rendering work of the terminal device for the game scene, and further achieves the purpose of reducing the operating burden of the terminal device. And approximating the target shadow map can ensure that the terminal device can ensure the shadow rendering effect and quality of the game scene while simplifying the shadow rendering work.

[0013] Implementing the method provided in the first aspect, in some embodiments, after calculating the critical shadow map corresponding to the critical game scene based on the geographical information in the geographical information system, the method further includes:

[0014] Generating a corresponding first visibility map based on the critical shadow map.

[0015] Implementing the method provided in the above embodiments, the terminal device only samples the critical shadow corresponding to the critical time node to generate a corresponding first visibility map, reducing the number of times of game scene coordinate system conversion of the terminal device, and also reducing the frequency of updating the game shadow map of the terminal device, which can achieve the purpose of reducing the computing overhead of the terminal device.

[0016] Implementing the method provided in the first aspect, in some embodiments, if the determination result is no, then generating a target visibility map based on the target shadow map corresponding to the target time node, includes:

[0017] Perform approximation processing on the first visibility map corresponding to the target shadow map to generate a target visibility map.

[0018] By implementing the method provided in the above embodiment, the terminal device can perform approximation processing on the first visibility map corresponding to the target shadow map to generate a target visibility map corresponding to the first time node, and achieve the purpose of shadow rendering for the game scene (or game model) corresponding to the non-critical time node without performing shadow map sampling. This helps to improve the rendering efficiency of the terminal device for the game scene (or game model) on the premise of ensuring the shadow rendering effect of the game scene (or game model).

[0019] In some embodiments of implementing the method provided in the first aspect, performing approximation processing on the first visibility map to generate a target visibility map includes:

[0020] Determine the shadow bounding box and control points in the first visibility map, where the control points are the vertices of the shadow bounding box;

[0021] Perform inverse bilinear interpolation processing based on the first time node, the target time node, and the coordinate positions of the control points to obtain the target visibility map.

[0022] By implementing the method provided in the above embodiment, the terminal device can approximately generate a target visibility map based on the first visibility map corresponding to the target shadow map when "the first time node is not a critical time node". Specifically, the terminal device can first determine the shadow bounding box corresponding to each first visibility map, and based on the inverse bilinear interpolation processing method, combine the first time node, the target time node, and the vertices of the shadow bounding box to calculate the target visibility map corresponding to the first time node. The terminal device calculates the target visibility map by combining multiple parameters (such as the first time node, the target time node, and the coordinate positions of the control points), which helps to ensure the accuracy of the shadow rendering of the game scene (or game model), making it more conform to the projection law of the first time node, so that the game scene is more realistic, enabling users to experience game details more immersively and improving the user's game experience.

[0023] In some embodiments of implementing the method provided in the first aspect, the geographical information includes spatial data and time data;

[0024] Calculating a key shadow map corresponding to a key game scene based on the geographical information in a geographical information system includes:

[0025] Based on the key time node and the time data, determine the key game scene corresponding to the key time node;

[0026] Calculate the key shadow map corresponding to the key game scene based on the spatial data.

[0027] Implementing the method provided in the above embodiments, the terminal device can determine the key game scene corresponding to the key time node according to the preset key time nodes, and calculate the corresponding key shadow map based on the spatial data corresponding to the key game scene, which helps to reduce the operating burden of the terminal device while ensuring the accuracy of shadow rendering of the game scene, and also helps to improve the speed of shadow rendering of the game scene.

[0028] Implementing the method provided in the first aspect, in some embodiments, the geographic information further includes attribute data, and the spatial data includes elevation information;

[0029] If the judgment is yes, perform blurring processing on the key shadow map corresponding to the first time node, and generate a target visibility map, including:

[0030] Based on the elevation information and a preset formula, determine the sampling width for the key shadow map;

[0031] Generate a sampled shadow based on the sampling width.

[0032] Implementing the method provided in the above embodiments, the terminal device can determine the sampling width for the key shadow map based on the height information of each segment or object in the game scene, so as to generate the corresponding sampled shadow. It can be seen that the method provided in this embodiment takes into account the influence of height information on shadow generation, which helps to improve the accuracy and authenticity of the shadow, thereby improving the user's gaming experience.

[0033] Implementing the method provided in the first aspect, in some embodiments, based on the elevation information and a preset formula, determining the sampling width for the key shadow map includes:

[0034] Based on the elevation information, the light source width, and the scaling factor, determine the sampling width. The light source width is related to the key time node, and the scaling factor is used to adjust the blurring degree of the sampled shadow.

[0035] Implementing the method provided in the above embodiments, technicians will debug an appropriate scaling factor based on the generation effect of the shadow. The terminal device can calculate the corresponding sampling width based on the light source width, elevation information, and scaling factor, taking into account the influence of different factors on the shadow generation effect, which helps to determine the width of shadow sampling, and thus helps to generate a shadow that more conforms to the shadow generation law in the real scene, improving the authenticity of the game scene.

[0036] Implementing the method provided in the first aspect, in some embodiments, after generating the sampled shadow based on the sampling width, it further includes:

[0037] Determine whether the shadow projection surface in the game scene corresponding to the viewport information contains attribute data;

[0038] If the judgment is yes, a target visibility map is generated based on the attribute data and the sampled shadow;

[0039] If the judgment is no, the sampled shadow is determined as the target visibility map.

[0040] Implementing the method provided in the above embodiments can solve the problem that "shadows are imaged on surfaces of different materials with different degrees of blurriness". The terminal device can perform different blurring processes on the sampled shadow based on the attribute data of different surfaces, which helps to make the shadow further conform to the shadow generation law in the real scene, thereby improving the authenticity of the game scene and the user's gaming experience.

[0041] Implementing the method provided in the first aspect, in some embodiments, generating a target visibility map based on the attribute data and the sampled shadow includes:

[0042] Determining a blur radius based on the attribute data;

[0043] Performing a blurring process on the sampled shadow based on the blur radius and the standard deviation of the normal distribution to generate a target visibility map.

[0044] In a second aspect, an embodiment of the present application provides a terminal device, which may include: a calculation module, an input module, and a judgment module;

[0045] The calculation module is configured to calculate a key shadow map corresponding to a key game scene based on the geographical information in the geographical information system, where the key shadow map is a shadow map corresponding to a game model at a key time node, the key time node is a preset time node, and the number of key time nodes is greater than or equal to 2;

[0046] The input module is configured to receive an operation instruction from the user;

[0047] The calculation module is further configured to determine viewport information based on the operation instruction, where the viewport information includes a first time node, and the first time node is the time node at which the game scene corresponding to the viewport information is located;

[0048] The judgment module is configured to judge whether the first time node is a key time node;

[0049] The calculation module is further configured to generate a target visibility map based on the judgment result and the key shadow map;

[0050] The calculation module is further configured to perform shadow rendering on the game scene corresponding to the viewport information based on the target visibility map to generate a target game image frame.

[0051] Implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0052] The calculation module is further configured to, when the judgment result is yes, blur the key shadow map corresponding to the first time node and generate a target visibility map;

[0053] The calculation module is further configured to, when the judgment result is no, generate a target visibility map based on the target shadow map corresponding to the target time node, where the target time node is the two key time nodes closest to the first time node before and after, and the target shadow map is the key shadow map corresponding to each of the target time nodes.

[0054] When implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0055] The calculation module is further configured to generate a corresponding first visibility map based on the key shadow map.

[0056] When implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0057] The calculation module is further configured to approximate the first visibility map corresponding to the target shadow map to generate a target visibility map.

[0058] When implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0059] The calculation module is further configured to determine the shadow bounding box and control points in the first visibility map, where the control points are the vertices of the shadow bounding box;

[0060] The calculation module is further configured to perform inverse bilinear interpolation processing based on the coordinates of the first time node, the target time node, and the control points to obtain a target visibility map.

[0061] When implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0062] The calculation module is further configured to determine the key game scene corresponding to the key time node based on the key time node and time data;

[0063] The calculation module is further configured to calculate the key shadow map corresponding to the key game scene based on spatial data.

[0064] When implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0065] The calculation module is further configured to determine the sampling width for the key shadow map based on the elevation information and a preset formula;

[0066] The calculation module is further configured to generate a sampled shadow based on the sampling width.

[0067] Implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0068] A calculation module, further configured to determine, based on elevation information, light source width, and a scaling factor, that for a sampling width, the light source width is related to a key time node, and the scaling factor is used to adjust the blur degree of the sampling shadow.

[0069] Implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0070] A judgment module, further configured to judge whether the shadow casting surface in the game scene corresponding to the viewport information contains attribute data;

[0071] A calculation module, further configured to, when the shadow casting surface in the game scene corresponding to the viewport information contains attribute data, generate a target visibility map based on the attribute data and the sampling shadow;

[0072] A calculation module, further configured to, when the shadow casting surface in the game scene corresponding to the viewport information does not contain attribute data, determine the sampling shadow as the target visibility map.

[0073] Implementing the method provided in the second aspect, in some embodiments, the terminal device further includes:

[0074] A calculation module, further configured to determine a blur radius based on the attribute data;

[0075] A calculation module, further configured to blur the sampling shadow based on the blur radius and the standard deviation of the normal distribution to generate a target visibility map.

[0076] In a third aspect, the present application provides a terminal device, which includes one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the method described in the first aspect and any possible implementation manner in the first aspect is performed.

[0077] In a fourth aspect, the present application provides a computer-readable storage medium, including instructions, which when running on a target terminal, cause the method described in the first aspect and any possible implementation manner in the first aspect to be performed.

[0078] In a fifth aspect, the present application provides a computer program product containing instructions, which when running on a terminal device, cause the terminal device to perform the method described in the first aspect and any possible implementation manner in the first aspect.

[0079] Understandably, the terminal device provided by the second aspect and the third aspect above, the computer-readable storage medium provided by the fourth aspect, and the computer program product provided by the fifth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be elaborated here. Description of the Drawings

[0080] Figure 1 is a schematic diagram of a shadow generation process based on a shadow map in the prior art;

[0081] Figure 2 is a schematic diagram of the process of a method for generating shadows based on geographic information provided by this application;

[0082] Figure 3 is a schematic diagram of the data structure of a game data packet type provided by an embodiment of this application;

[0083] Figure 4 is a schematic diagram of a scene for determining a key game scene provided by an embodiment of this application;

[0084] Figure 5 is a schematic diagram of the process of a method for generating a target visibility map provided by an embodiment of this application;

[0085] Figure 6 is a schematic diagram of a scene for generating a target visibility map provided by an embodiment of this application;

[0086] Figure 7 is a schematic diagram of the process of a method for blurring a visibility map provided by an embodiment of this application;

[0087] Figure 8 is a schematic diagram of the composition of a terminal device provided by an embodiment of this application;

[0088] Figure 9 is a schematic diagram of the hardware structure of another terminal device provided by an embodiment of this application;

[0089] Figure 10 is a software structure block diagram of a terminal device provided by an embodiment of this application. Detailed Embodiments

[0090] The technical solutions in the embodiments of the present application will be clearly and elaborately described below with reference to the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; "and / or" in the text is only an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.

[0091] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more than two.

[0092] The term "user interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is source code written in a specific computer language such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device and finally presented as content recognizable by the user. The common manifestation form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical manner. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and Widgets displayed on the display screen of the terminal device.

[0093] For the sake of clear and concise description of the following embodiments, a brief introduction to the related technologies is given first:

[0094] A Geographic Information System (GIS), sometimes also known as "Geoscience Information System", is a specific and very important spatial information system. It is a technical system that, under the support of computer hardware and software systems, collects, stores, manages, calculates, analyzes, displays, and describes geographical distribution data in the space of the entire or part of the Earth's surface (including the atmosphere). The geographical information in a Geographic Information System can include spatial data, temporal data, and attribute data. For this application and the related embodiments of this application, the spatial data can be the position information (such as coordinate information) of each segment or object in the game scene, the temporal data can be the time node of the current game scene corresponding to the user operation instruction, and the attribute data can be the material information of each segment or object in the game scene, etc.

[0095] Shadow mapping is the process of adding shadows in 3D computer graphics, also known as Light Mapping, and can also be considered a method to achieve realistic lighting and shadow effects without reducing the frame rate. The basic process of the shadow mapping algorithm is as follows: Treat the light source as a camera, render the entire scene, and save the depth information of the depth buffer into a texture, which is called the shadow map texture or depth map texture; Render the entire scene using a conventional camera. For each visible pixel point, assume its viewing point coordinates are (x, y, z), and transform the coordinates (x 1 , y 1 , z 1 ) (i.e., the situation of rendering the scene with the light source as the camera); Compare z 1 and the z value on the depth map texture (x 1 , y 1 ). If z 1 < z, then this pixel point is not in the shadow; otherwise, this pixel point is in the shadow. By judging whether each pixel point in the scene is in the shadow, a visibility map corresponding to this scene can be obtained, and then the shadow rendering of this scene can be completed.

[0096] Please refer to Figure 1 , Figure 1 which is a schematic diagram of a shadow generation process based on shadow mapping in the prior art.

[0097] As Figure 1 shown, the prior art method can include the following steps:

[0098] S101: The terminal device generates a shadow map of the game scene in the light source coordinate system.

[0099] S102: The terminal device converts the viewport coordinates of each game model in the current viewport scene to world coordinates.

[0100] Specifically, the coordinates of the pixel points of each game model in the current viewport scene can be converted from the viewport coordinate system to the world coordinate system to obtain the first coordinates of the pixel points in the current viewport scene.

[0101] S103: The terminal device converts the world coordinates of each game model in the current viewport scene to light source coordinates.

[0102] Exemplarily, the first coordinates are converted from the world coordinate system to the light source coordinate system to obtain the corresponding second coordinates of the pixel points in the current viewport scene in the light source coordinate system.

[0103] S104: The terminal device compares the depth values of each game model in the current viewport scene in the light source coordinate system with the shadow map.

[0104] S105: The terminal device generates a visibility map corresponding to the current viewport scene.

[0105] Specifically, the terminal device 10 can compare the coordinate values representing "depth" in the second coordinates with the corresponding depth values in the shadow map and generate a visibility map corresponding to the current viewport scene. Furthermore, the terminal device can draw the shadows in the current viewport scene based on the visibility map.

[0106] S106: The terminal device draws shadows based on the visibility map.

[0107] It can be seen that in the case of rendering corresponding shadows based on the current viewport scene (or viewport coordinate information) in the prior art, it is necessary to maintain or generate shadow maps multiple times, increasing the additional rendering times. Furthermore, for each frame of the game scene rendered, multiple coordinate system conversions are required, further increasing the computational overhead of the terminal device. The prior art also does not consider the influence of the material of the imaging surface on the shadow imaging effect, which easily leads to the phenomenon of shadow homogenization. In addition, for each frame of the game scene, a visibility map needs to be sampled from the shadow map. Since there are limitations in the data itself accuracy and the size of the shadow map when the light source or the user's perspective moves, it cannot be guaranteed that the shadow sampling of each frame of the game scene is consistent. Therefore, shadow jitter may occur during the real-time rendering of the game scene, which is not conducive to ensuring the user's gaming experience.

[0108] Embodiments of the present application can provide a method for generating shadows based on geographic information, which can generate corresponding key shadow maps only for game scenes at key time points, and can render the game scene based on the time node corresponding to the user operation instruction and the key shadow map, which helps to reduce the operation burden of the terminal device while ensuring that the game scene has a real and three-dimensional realistic effect, and also helps to guarantee the user's game experience.

[0109] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for generating shadows based on geographic information provided by an embodiment of the present application.

[0110] As Figure 2 shown, the method may include the following steps:

[0111] S201: The terminal device calculates a key shadow map corresponding to the key game scene based on the geographic information in the geographic information system.

[0112] Among them, the key shadow map may be a shadow map corresponding to a game model at a key time point, the key time point is a preset time point, and the number of key time points is greater than or equal to 2.

[0113] In some possible implementation manners, a person skilled in the art can set and select appropriate time points as key time points according to the shadow imaging law. Specifically, the person skilled in the art can select the time points at the whole hour as key time points; optionally, the person skilled in the art can also select the time points that can form shadows with obvious prominent object shape features as key time points; optionally, the person skilled in the art can also use the area of the formed shadow as the basis for setting the key time point, and the present application does not limit this here.

[0114] Specifically, taking "one day" in the game as an example, the person skilled in the art can pre-set the time points at the whole hour of one day as key time points (such as 00:00, 1:00, 2:00... 23:00). When the user starts the game application on the terminal device 10, the terminal device 10 can generate a corresponding shadow map based on the game model (or game scene) at the key time point. It can be understood that the more key time points (or key shadow maps) there are, the more beneficial it is to ensure that the shadow rendering results of the game scenes corresponding to non-key time points are more realistic and three-dimensional. However, too many key time points cannot achieve the purpose of reducing the operation burden of the terminal device 10. Therefore, the person skilled in the art can set an appropriate number of key time points according to the actual situation, and the present application does not limit this here.

[0115] It should be noted that the terminal device 10 for executing the method of the embodiment of the present application is a terminal device with rendering capabilities. The terminal device 10 can be of various types, and the specific type is not limited in the embodiment of the present application. For example, the terminal device 10 can be a mobile phone, and can also include a tablet computer, a desktop computer, a desktop computer with a touch-sensitive surface or touch panel, a laptop, a handheld computer, a notebook computer, a smart screen, a wearable device (such as a smart watch, a smart bracelet, etc.), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a car machine, a smart headset, a game console, and can also be an Internet of Things (IOT) device or a smart home device such as a smart water heater, a smart lamp, a smart air conditioner, and so on.

[0116] In some possible implementation manners, calculating a key shadow map corresponding to a key game scene based on geographical information in a geographical information system may include:

[0117] The terminal device 10 obtains a game data packet from the server;

[0118] The terminal device 10 receives an operation instruction from the user;

[0119] The terminal device 10, in response to the operation instruction of the user, calculates a key shadow map corresponding to the key game scene based on the geographical information in the geographical information system.

[0120] Wherein, as Figure 3 shown, Figure 3 FIG. is a schematic diagram of the data structure of a type of game data packet provided by an embodiment of the present application. The game data packet may include position information, normal information, color information, texture coordinates, spatial data, time data, and attribute data of each game model in the game scene.

[0121] In some other possible implementation manners, the geographical information may include spatial data and time data;

[0122] Calculating a key shadow map corresponding to a key game scene based on geographical information in a geographical information system may include:

[0123] The terminal device 10 determines a key game scene corresponding to the key time node based on the key time node and the time data;

[0124] The terminal device 10 calculates a key shadow map corresponding to the key game scene based on the spatial data.

[0125] Among them, the spatial data in the geographic information can be the location information (or relative location information) corresponding to each game model in different game scenes, and the time data can be the time nodes corresponding to different game scenes.

[0126] Exemplarily, please refer to Figure 4 , Figure 4 which is a schematic diagram of a scene for determining a key game scene provided by an embodiment of the present application.

[0127] As Figure 4 shown, the terminal device 10 can respond to a user's installation instruction (such as Figure 4 the user clicks the button 41 in Figure 3 ) and obtain the data packet corresponding to the game application 42 from the server 20. After receiving the user's start instruction, the terminal device 10 can start calculating the key shadow map of the key game scene in the game application 42 based on the data packet corresponding to the game application 42 (the content included in the data packet can refer to Figure 4 the content of the relevant embodiments). Further, in the process of calculating the key shadow map corresponding to the key game scene based on the geographic information in the geographic information system, the terminal device 10 can filter out the key time nodes based on the game timeline and the time data, and determine the key game scene corresponding to the key time node based on the mapping relationship between time and game scenes (such as

[0128] the first mapping table 43 in Figure 1 ).

[0129] In some other possible implementation manners, after calculating the key shadow map corresponding to the key game scene based on the geographic information in the geographic information system, the terminal device 10 can perform blurring processing on the key shadow map, and then generate a corresponding first visibility map.

[0130] S202: The terminal device determines viewport information in response to a user's operation instruction.

[0131] Among them, the viewport information may include a first time node, and the first time node is the time node at which the game scene corresponding to the viewport information is located. Specifically, the viewport information may represent the game scene (or game screen) that the user can currently see through the interface of the terminal device 10. However, before presenting the game scene (or game screen) to the user, it is necessary to perform rendering processing on the game scene (or game screen). The terminal device 10 may determine the game scene corresponding to the user operation instruction based on the first time node, and thus perform the corresponding rendering operation.

[0132] S203: The terminal device determines whether the first time node is the key time node.

[0133] S204: Generate a target visibility map based on the judgment result and the key shadow map.

[0134] In some possible implementation manners, generating a first shadow map based on the judgment result and the key shadow map may include:

[0135] If the judgment result is yes, the terminal device 10 blurs the key shadow map corresponding to the first time node and generates a target visibility map;

[0136] If the judgment result is no, the terminal device 10 generates a target visibility map based on the target shadow map corresponding to the target time node. The target time node is the two key time nodes closest to the front and back of the first time node, and the target shadow map is the key shadow map corresponding to each of the target time nodes.

[0137] It can be seen that in the embodiment of the present application, the terminal device 10 can determine which shadow rendering method needs to be adopted for the game scene corresponding to the user operation instruction by judging whether the first time node corresponding to the user operation instruction is a critical time node. Exemplarily, it is assumed that the time nodes 10:00, 14:00, and 16:00 are critical time nodes. If the first time node corresponding to the user operation instruction is 10:00, it can be determined that the first time node is a critical time node. In a possible implementation manner, if the terminal device 10 does not generate the first visibility map based on the critical shadow map after obtaining the game data packet and before receiving the user operation instruction, the critical shadow map corresponding to the 10:00 time node can be blurred, and then the target visibility map is generated; in another possible implementation manner, if the terminal device 10 has generated the first visibility maps corresponding to all critical shadow maps after obtaining the game data packet and before receiving the user operation instruction, the first visibility map corresponding to the 10:00 time node can be used as the target visibility map, and there is no need to blur the critical shadow map again; if the first time node corresponding to the user operation instruction is 15:00, the 14:00 and 16:00 can be used as the target time nodes, and the critical shadow map corresponding to the 14:00 time node and the critical shadow map corresponding to the 16:00 time node are used as the target shadow maps, and the target visibility map corresponding to the 15:00 time node is generated based on the target shadow maps.

[0138] Furthermore, the terminal device 10 can approximate the first visibility map corresponding to the target shadow map to obtain the target visibility map. The specific approximation process can refer to Figure 5 the relevant embodiment content.

[0139] S205: The terminal device performs shadow drawing on the game scene corresponding to the viewport information based on the target visibility map to generate a target game image frame.

[0140] Among them, the viewport information may further include the viewport scene and the viewport coordinate information. The terminal device 10 can determine the specific game scene area that needs to be shadow-rendered based on the viewport scene. The terminal device can also perform coordinate transformation on the viewport coordinate information (which can be understood as the coordinate information of each game model in the game scene corresponding to the viewport in the viewport coordinate system), and finally generate the initial visibility map corresponding to the viewport information with the first shadow map corresponding to the viewport information. It should be noted that the initial visibility map can be understood as the initial shadow distribution map in the game scene corresponding to the viewport information, and can simply reflect the shadow generation direction, position, and size of each game model in the game scene corresponding to the viewport information.

[0141] Understandably, the target visibility map can reflect the shadow distribution of the game scene corresponding to the viewport information (e.g., whether each pixel is in the shadow state, or the pixel value of each pixel). Therefore, based on the target visibility map, the target game image frame corresponding to the viewport information can be drawn.

[0142] Furthermore, the geographical information can also include attribute data and elevation information. The attribute data can represent the surface materials of each game model in the game scene, and different surface materials will have different effects on the generation of shadows; the elevation information can represent the height difference between different pixels of each game model in the game scene and the game horizontal plane, and different elevation information will have different effects on the generation of shadows. Fuzzy processing of the initial visibility map based on the attribute data and elevation information can generate a target visibility map with more authenticity and three-dimensionality. Exemplarily, when the surface material of the game model is smoother, the shadow presented on the surface of the game model is clearer; when the surface material of the game model is rougher, the shadow presented on the surface of the game model is more blurred; when the pixel on the game model is farther from the game horizontal plane, the shadow corresponding to the pixel is more blurred; when the pixel on the game model is closer to the game horizontal plane, the shadow corresponding to the pixel is clearer. It should be noted that the attribute data and elevation information can be pre-entered by technicians into the data packet corresponding to the game application program, and the present application does not limit this here.

[0143] It can be seen that by implementing the method of the embodiments of the present application, the terminal device 10 can adopt different shadow rendering means for the game scenes corresponding to different time nodes, so as to achieve the purpose of reducing the rendering overhead and reducing the operation burden of the terminal device 10. Specifically, the terminal device 10 can generate a shadow map corresponding to the key game scene at the key event node. When the game scene time node corresponding to the user operation instruction does not belong to the key time node, approximate processing is performed on the shadow maps corresponding to the two key time nodes before and after this time node, and then the shadow map corresponding to this time node is obtained, so that the terminal device 10 does not need to maintain or update the shadow map frame by frame, reducing the rendering times of the terminal device 10, and can achieve the purpose of reducing the calculation overhead of the terminal device 10 while ensuring the shadow rendering quality of the game scene.

[0144] Please refer to Figure 5 , Figure 5 which is a schematic flowchart of a method for generating a target visibility map provided by an embodiment of the present application.

[0145] As Figure 5 shown, the method may include the following steps:

[0146] S501: The terminal device determines the shadow bounding box and control points in the first visibility map.

[0147] Among them, the control points are the vertices of the shaded bounding box.

[0148] S502: The terminal device performs inverse bilinear interpolation processing based on the first time node, the target time node, and the coordinate positions of the control points to obtain the target visibility map.

[0149] Exemplarily, please refer to Figure 6 , Figure 6 which is a schematic diagram of a scenario for generating a target visibility map provided by an embodiment of the present application.

[0150] As Figure 6 shown, assume that the first time node corresponding to the user's operation instruction is not a critical time node. Then, the terminal device 10 can generate a target visibility map based on the first visibility maps of the target time nodes (such as the first target time node 61 and the second target time node 62 in Figure 6 ) corresponding to the first time node. Specifically, the terminal device 10 can determine the shaded bounding boxes (such as the first shaded bounding box 63 and the second shaded bounding box 64 in Figure 6 ) in each first visibility map, and determine the control points of each shaded bounding box (for example, the control points corresponding to the first shaded bounding box 63 are the first control point P 11 , the second control point P 12 , the third control point P 21 , and the fourth control point P 22 , and the control points corresponding to the second shaded bounding box 64 are the first control point P 11 , the second control point P 12 , the fifth control point P 31 , and the sixth control point P 32 ). Referring to the inverse bilinear interpolation processing, the third control point P 21 , the fourth control point P 22 , the fifth control point P 31 , and the sixth control point P 32 can be used as the interpolation quadrilateral.

[0151] Furthermore, the terminal device 10 can interpolate the coordinate values of the seventh control point P 21 based on the coordinate values of the third control point P 31 and the fifth control point P 41 :

[0152] f(P 41 ) = f(P 21 ) + f(P 31 ) - f(P 21 ) · u

[0153] where u is the interpolation coefficient, which can be obtained based on the proportional relationship between the first time node and the target time node, and is not limited herein.

[0154] Then, the coordinate value of the eighth control point P 22 is interpolated from the coordinate values of the fourth control point P 32 and the sixth control point P 42 :

[0155] f(P 42 ) = f(P 22 ) + f(P 32 ) - f(P 22 ) · u

[0156] Finally, the shadow bounding box formed by the first control point P 11 , the second control point P 12 , the seventh control point P 41 and the eighth control point P 42 can be used as the shadow bounding box corresponding to the target visibility map, and then the target visibility map corresponding to the first time node can be determined.

[0157] Please refer to Figure 7 , Figure 7 , which is a schematic flowchart of a method for blurring a visibility map provided by an embodiment of the present application.

[0158] As Figure 7 shown, the method may include the following steps:

[0159] S701: The terminal device determines the sampling width for the key shadow map based on the elevation information and a preset formula.

[0160] In some possible implementation manners, the geographic information may further include attribute data, and the spatial data may include elevation information.

[0161] Furthermore, the preset formula may be w sample = w light ·s·h, where w sample is the sampling width, w light is the light source width, w light is related to the key time node, h is the elevation information, and s is a scaling factor for controlling the blurring degree.

[0162] S702: The terminal device generates a sampling shadow based on the sampling width.

[0163] S703: The terminal device determines whether the shadow projection surface in the game scene corresponding to the viewport information contains attribute data.

[0164] If the determination result is no, the terminal device 10 then executes step S704: The terminal device determines that the sampling shadow is the target visibility map.

[0165] If the judgment is yes, the terminal device 10 then executes step S705: The terminal device generates a target visibility map based on the attribute data and the sampled shadow.

[0166] In some other possible implementation manners, if the judgment is yes, generating a target visibility map based on the attribute data and the sampled shadow may include:

[0167] Based on Calculate the blurring degree of the sampled shadow, where K is a constant, r is the blurring radius, and σ is the standard deviation of the normal distribution, and r is related to the attribute data.

[0168] Please refer to Figure 8 , Figure 8 FIG. 15 is a schematic diagram of the composition of a terminal device provided by an embodiment of the present application. The terminal device 10 may include: a calculation module 810 and an input module 820;

[0169] The calculation module 810 is configured to calculate a key shadow map corresponding to a key game scene based on the geographic information in the geographic information system, where the key shadow map is a shadow map corresponding to a game model at a key time node, and the number of key time nodes is greater than or equal to 2;

[0170] The input module 820 is configured to receive a user operation instruction;

[0171] The calculation module 810 is further configured to determine viewport information based on the operation instruction, where the viewport information includes a first time node;

[0172] The calculation module 810 is further configured to generate a target visibility map based on the first time node and the key shadow map;

[0173] The calculation module 810 is further configured to perform shadow rendering on the game scene corresponding to the viewport information based on the target visibility map to generate a target game image frame.

[0174] In some possible implementation manners, the terminal device further includes: a judgment module 830;

[0175] The judgment module 830 is configured to judge whether the first time node is a key time node;

[0176] The calculation module 810 is further configured to, when the first time node is a key time node, perform blurring processing on the key shadow map corresponding to the first time node and generate a target visibility map;

[0177] The calculation module 810 is further configured to, when the first time node is not a critical time node, generate a target visibility map based on the target shadow map corresponding to the target time node, where the target time node is the two critical time nodes closest to the first time node before and after, and the target shadow map is the key shadow map corresponding to each of the target time nodes.

[0178] In some other possible implementation manners, the terminal device further includes:

[0179] The calculation module 810 is further configured to generate a corresponding first visibility map based on the key shadow map.

[0180] In some other possible implementation manners, the terminal device further includes:

[0181] The calculation module 810 is further configured to approximate the first visibility map corresponding to the target shadow map to generate a target visibility map.

[0182] In some other possible implementation manners, the terminal device further includes:

[0183] The calculation module 810 is further configured to determine the shadow bounding box and control points in the first visibility map, where the control points are the vertices of the shadow bounding box;

[0184] The calculation module 810 is further configured to perform inverse bilinear interpolation processing based on the first time node, the target time node, and the coordinate positions of the control points to obtain a target visibility map.

[0185] In some other possible implementation manners, the terminal device further includes:

[0186] The calculation module 810 is further configured to determine the key game scene corresponding to the critical time node based on the critical time node and time data;

[0187] The calculation module 810 is further configured to calculate the key shadow map corresponding to the key game scene based on spatial data.

[0188] In some other possible implementation manners, the terminal device further includes:

[0189] The calculation module 810 is further configured to determine the sampling width for the key shadow map based on the elevation information and a preset formula;

[0190] The calculation module 810 is further configured to generate a sampled shadow based on the sampling width.

[0191] In some other possible implementation manners, the terminal device further includes:

[0192] The calculation module 810 is further configured to determine, based on the elevation information, the light source width, and the scaling factor, that for the sampling width, the light source width is related to the key time node, and the scaling factor is used to adjust the blur degree of the sampling shadow.

[0193] In some other possible implementation manners, the terminal device further includes:

[0194] The determination module 830 is further configured to determine whether the shadow projection surface in the game scene corresponding to the viewport information includes attribute data;

[0195] The calculation module 810 is further configured to generate a target visibility map based on the attribute data and the sampling shadow when the shadow projection surface in the game scene corresponding to the viewport information includes attribute data;

[0196] The calculation module 810 is further configured to determine that the sampling shadow is the target visibility map when the shadow projection surface in the game scene corresponding to the viewport information does not include attribute data.

[0197] In some other possible implementation manners, the terminal device further includes:

[0198] The calculation module 810 is further configured to determine the blur radius based on the attribute data;

[0199] The calculation module 810 is further configured to blur the sampling shadow based on the blur radius and the standard deviation of the normal distribution to generate a target visibility map.

[0200] Please refer to Figure 9 , Figure 9 which is a schematic hardware structure diagram of another terminal device provided in an embodiment of the present application. The terminal device 10 is configured to execute the image recommendation method provided in the foregoing method embodiment.

[0201] The terminal device 10 may include a processor 101, a memory 102, a wireless communication module 103, a mobile communication module 104, antennas 103A and 104A, a power switch 105, a sensor module 106, a focus motor 107, a camera 108, a display screen 109, etc. Among them, the sensor module 106 may include a gyroscope sensor 106A, an acceleration sensor 106B, an ambient light sensor 106C, an image sensor 106D, a distance sensor 106E, etc. Among them, the wireless communication module 103 may include a WLAN communication module, a Bluetooth communication module, etc. The above-mentioned multiple parts may transmit data through a bus.

[0202] The processor 101 may include one or more processing units. For example, the processor 101 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0203] The memory 102 may be used to store computer-executable program code, and the executable program code may include instructions. The processor 101 executes various functional applications and data processing of the terminal device 10 by running the instructions stored in the memory 102. The memory 102 may include a program storage area and a data storage area. In a specific implementation, the memory 102 may include a high-speed random-access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.

[0204] The wireless communication function of the terminal device 10 may be implemented by the antenna 103A, the antenna 104A, the mobile communication module 104, the wireless communication module 103, the modem processor, and the baseband processor, etc.

[0205] The antennas 103A and 104A may be used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device 10 may be used to cover a single or multiple communication frequency bands. Different antennas may also be multiplexed to improve the utilization rate of the antennas.

[0206] The mobile communication module 104 may provide wireless communication solutions such as 2G / 3G / 4G / 5G applied to the terminal device 10. The mobile communication module 104 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 104 may receive electromagnetic waves by the antenna 104A, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 104 may also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 104A and radiate it out.

[0207] The modulation and demodulation processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through the display screen 109.

[0208] The wireless communication module 103 can provide wireless communication solutions applied to the terminal device 10, including wireless local area networks (WLAN), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 103 can be one or more devices integrating at least one communication processing module. The wireless communication module 103 receives electromagnetic waves via the antenna 103A, performs frequency modulation and filtering processing on the electromagnetic wave signal, and sends the processed signal to the processor 101. The wireless communication module 103 can also receive the signal to be transmitted from the processor 101, perform frequency modulation on it, amplify it, and convert it into electromagnetic waves through the antenna 103A and radiate it out.

[0209] The power switch 105 can be used to control the power supply to the terminal device 10.

[0210] The gyroscope sensor 106A can be used to determine the motion posture of the terminal device 10. In some embodiments, the angular velocity of the terminal device 10 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 106A. The gyroscope sensor 106A can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 106A detects the shaking angle of the terminal device 10, calculates the distance that the lens module needs to compensate according to the angle, and makes the lens offset the shaking of the terminal device 10 through reverse movement to achieve anti-shake. The gyroscope sensor 106A can also be used for navigation and somatosensory game scenarios.

[0211] The acceleration sensor 106B can detect the magnitude of the acceleration of the terminal device 10 in various directions (generally three axes). When the terminal device 10 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the user terminal. For example, the acceleration sensor 106B can be applied to applications such as horizontal and vertical screen switching and pedometers.

[0212] The ambient light sensor 106C is used to sense the ambient light brightness. The terminal device 10 can adaptively adjust the brightness of the display screen 109 according to the sensed ambient light brightness. The ambient light sensor 106C can also be used to automatically adjust the white balance during photographing.

[0213] The image sensor 106D, also known as the photosensitive element, can convert the optical image on the photosensitive surface into an electrical signal in proportion to the optical image by using the photoelectric conversion function of the optoelectronic device. The image sensor can be a charge coupled device (CCD) sensor or a complementary metal-oxide-semiconductor (CMOS) sensor.

[0214] The distance sensor 106E can be used to measure the distance. The terminal device 10 can measure the distance by infrared or laser. In some shooting scenarios, the terminal device 10 can use the distance sensor 106E to measure the distance to achieve rapid focusing.

[0215] The focusing motor 107 can be used for rapid focusing. The terminal device 10 can control the movement of the lens through the focusing motor 107 to achieve autofocus.

[0216] The terminal device 10 can achieve the shooting function through the ISP, camera 108, video codec, GPU, display screen 109, application processor, etc.

[0217] The ISP is used to process the data fed back by the camera 108. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 108.

[0218] The camera 108 can be used to capture static images or videos. The object generates an optical image through the lens and projects it onto the image sensor. The image sensor can convert the optical signal into an electrical signal, and then transmit the electrical signal to the ISP to convert it into a digital image signal. The ISP can output the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in standard RGB, YUV and other formats. In some embodiments, the terminal device 10 can include one or N cameras 108, where N is a positive integer greater than 1.

[0219] The video codec is used to compress or decompress digital images. The terminal device 10 may support one or more image codecs. In this way, the terminal device 10 can open or save pictures or videos in multiple encoding formats.

[0220] The terminal device 10 can realize the display function through a GPU, a display screen 109, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 109 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 101 may include one or more GPUs, which execute program instructions to generate or change display information.

[0221] The display screen 109 is used to display images, videos, etc. The display screen 109 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 10 may include 1 or N display screens 109, where N is a positive integer greater than 1.

[0222] It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 10. In other embodiments of the present application, the terminal device 10 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0223] The operations performed by each component in the terminal device 10 may be specifically referred to the relevant description of the above method embodiment, which will not be elaborated here.

[0224] The software system of the terminal device 10 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes a mobile operating system with a layered architecture as an example to exemplify the software structure of the terminal device 10.

[0225] See also Figure 10 , Figure 10 A software structure block diagram of a terminal device according to an embodiment of the present application.

[0226] The layered architecture divides software into several layers, and each layer has clear roles and divisions of labor. The layers communicate with each other through software interfaces. In some embodiments, the mobile operating system is divided into four layers, from top to bottom: the application layer, the application framework layer / core service layer, the system library and runtime, and the kernel layer.

[0227] The application layer may include a series of application packages.

[0228] As Figure 10 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0229] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0230] As Figure 10 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.

[0231] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0232] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include video, image, audio, dialed and answered calls, browsing history and bookmarks, phone book, etc.

[0233] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.

[0234] The telephone manager is used to provide the communication function of the user terminal. For example, the management of call status (including connection, disconnection, etc.).

[0235] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.

[0236] The notification manager enables an application to display notification information in the status bar. It can be used to convey messages of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that a download is completed, a message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or a scrolling text, such as a notification of a background-running application, or a notification that appears on the screen in the form of a dialogue window. For example, it can prompt text information in the status bar, emit a prompt tone, vibrate the user terminal, and blink the indicator light, etc.

[0237] Runtime can refer to all code libraries, frameworks, etc. required during program execution. For example, for the C language, the runtime includes a series of function libraries required for C program execution. For the Java language, in addition to the core libraries, the runtime also includes a virtual machine required for Java program execution, etc. The above core libraries can include functional functions that the Java language needs to call.

[0238] The system library can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

[0239] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0240] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0241] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0242] The 2D graphics engine is a drawing engine for 2D drawing.

[0243] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0244] It should be understood that each step in the above method embodiments can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor.

[0245] The present application further provides a user terminal, which may include: a memory and a processor. Among them, the memory can be used to store computer programs; the processor can be used to call the computer programs in the memory, so that the user terminal executes the method executed on the user terminal side in any of the above embodiments.

[0246] The present application further provides a user terminal, which may include: a memory and a processor. Among them, the memory can be used to store computer programs; the processor can be used to call the computer programs in the memory, so that the user terminal executes the method executed on the user terminal side in any of the above embodiments.

[0247] The present application further provides a chip system, which includes at least one processor for implementing the functions involved on the user terminal side in any of the above embodiments.

[0248] In a possible design, the chip system further includes a memory, and the memory is used to store program instructions and data. The memory is located inside or outside the processor.

[0249] The chip system may be composed of chips or may include chips and other discrete devices.

[0250] Optionally, the processor in the chip system may be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that implements by reading software code stored in the memory.

[0251] Optionally, the memory in the chip system may also be one or more. The memory can be integrated with the processor or can be separately arranged from the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be separately arranged on different chips. The embodiments of the present application do not specifically limit the type of the memory and the setting manner of the memory and the processor.

[0252] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0253] The present application also provides a computer program product, which includes a computer program (which can also be referred to as code or instruction). When the computer program is run, it causes the computer to execute the method performed on the user terminal side in any of the above embodiments.

[0254] The present application also provides a computer-readable storage medium, which stores a computer program (which can also be referred to as code or instruction). When the computer program is run, it causes the computer to execute the method performed on the user terminal side in any of the above embodiments.

[0255] The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0256] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.

[0257] Those of ordinary skill in the art can understand all or part of the processes in the above method embodiments. These processes can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The aforementioned storage medium includes: various media such as ROM or random access memory RAM, magnetic disks, or optical discs that can store program codes.

[0258] In summary, the above description is only for the embodiments of the technical solution of this application and is not intended to limit the protection scope of this application. Any modifications, equivalent replacements, improvements, etc. made according to the disclosure of this application should be included within the protection scope of this application.

Claims

1. A method for generating shadows based on geographic information, characterized in that, the method comprises the following steps: Calculating a key shadow map corresponding to a key game scene based on geographic information in a geographic information system, where the key shadow map is a shadow map corresponding to a game model at a key time node, the key time node is a preset time node, and the number of key time nodes is greater than or equal to 2; Responding to a user's operation instruction to determine viewport information, where the viewport information includes a first time node, and the first time node is the time node at which the game scene corresponding to the viewport information is located; Judging whether the first time node is the key time node, and generating a target visibility map based on the judgment result and the key shadow map; Based on the target visibility map, performing shadow rendering on the game scene corresponding to the viewport information to generate a target game image frame.

2. The method according to claim 1, characterized in that, the step of judging whether the first time node is the key time node and generating a target visibility map based on the judgment result and the key shadow map includes: If the judgment result is yes, performing blurring processing on the key shadow map corresponding to the first time node and generating the target visibility map; If the judgment result is no, generating the target visibility map based on the target shadow maps corresponding to the target time nodes, where the target time nodes are the two key time nodes closest to the first time node before and after, and the target shadow maps are the key shadow maps corresponding to the target time nodes respectively.

3. The method according to claim 2, characterized in that, after calculating the key shadow map corresponding to the key game scene based on the geographic information in the geographic information system, the method further includes: Generating a corresponding first visibility map based on the key shadow map.

4. The method according to claim 3, characterized in that, the step of if the judgment result is no, generating the target visibility map based on the target shadow maps corresponding to the target time nodes includes: Performing approximation processing on the first visibility map corresponding to the target shadow map to generate the target visibility map.

5. The method according to claim 4, characterized in that, the step of performing approximation processing on the first visibility map to generate the target visibility map includes: Determining a shadow bounding box and control points in the first visibility map, where the control points are the vertices of the shadow bounding box; Performing inverse bilinear interpolation processing based on the coordinates of the first time node, the target time nodes, and the control points to obtain the target visibility map.

6. The method according to claim 5, characterized in that, the geographic information includes spatial data and time data; the step of calculating the key shadow map corresponding to the key game scene based on the geographic information in the geographic information system includes: Based on the key time nodes and the time data, determining the key game scene corresponding to the key time nodes; Calculating the key shadow map corresponding to the key game scene based on the spatial data.

7. The method according to claim 6, wherein, the geographic information further includes attribute data, and the spatial data includes elevation information; the step of, if the determination is yes, performing blurring processing on the key shadow map corresponding to the first time node and generating the target visibility map, includes: determining a sampling width for the key shadow map based on the elevation information and a preset formula; generating a sampled shadow based on the sampling width.

8. The method according to claim 7, wherein, the step of determining a sampling width for the key shadow map based on the elevation information and a preset formula, includes: determining, based on the elevation information, the light source width, and a scaling factor, the sampling width, wherein the light source width is related to the key time node, and the scaling factor is used to adjust the blurring degree of the sampled shadow.

9. The method according to claim 7 or 8, wherein, after generating the sampled shadow based on the sampling width, further includes: judging whether the shadow casting surface in the game scene corresponding to the viewport information contains attribute data; if the determination is yes, generating the target visibility map based on the attribute data and the sampled shadow; if the determination is no, determining the sampled shadow as the target visibility map.

10. The method according to claim 9, wherein, the step of, if the determination is yes, generating the target visibility map based on the attribute data and the sampled shadow, includes: determining a blurring radius based on the attribute data; performing blurring processing on the sampled shadow based on the blurring radius and the standard deviation of the normal distribution to generate the target visibility map.

11. A terminal device, wherein, the terminal device includes: a calculation module, an input module, and a judgment module; the calculation module is configured to calculate a key shadow map corresponding to a key game scene based on geographic information in a geographic information system, the key shadow map being a shadow map corresponding to a game model at a key time node, the key time node being a preset time node, and the number of key time nodes being greater than or equal to 2; the input module is configured to receive an operation instruction of a user; the calculation module is further configured to determine viewport information based on the operation instruction, the viewport information including a first time node, the first time node being the time node at which the game scene corresponding to the viewport information is located; the judgment module is configured to judge whether the first time node is the key time node; the calculation module is further configured to generate a target visibility map based on the judgment result and the key shadow map; the calculation module is further configured to perform shadow rendering on the game scene corresponding to the viewport information based on the target visibility map to generate a target game image frame.

12. A terminal device, wherein, The terminal device includes one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the method described in any one of claims 1-10 is executed.

13. A computer-readable storage medium, comprising instructions, wherein, when the instructions run on a target terminal, the method described in any one of claims 1-10 is executed.

Citation Information

Patent Citations

  • Background updating method of depth map

    CN110889866A

  • Building shadow analysis method, device and equipment and storage medium

    CN114494384A

  • Picture rendering method and device, computer equipment and storage medium

    CN116843815A

  • Image capture apparatus and method

    US20090244317A1

  • Method of indirect time of flight depth map acquisition and corresponding sensor

    US20220137220A1