Map control rendering method and device, electronic equipment and storage medium

By acquiring the location, color, height, and distance information of the game scene to calculate the shadow coefficient, the problem of high performance consumption of map control lighting rendering is solved, achieving efficient lighting rendering and rich map display effects.

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

Patent Information

Application Number
CN202310523937.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-08
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In existing technologies, the lighting rendering of map controls consumes a lot of game performance, mainly because the calculation of shadow coefficients is complex and time-consuming, resulting in a simple and unenriched display effect for map controls.

Method used

By acquiring the position information of the controlled virtual character in the game scene, the color information, height information and distance field information of the target game scene are obtained using the first and second textures, the shadow coefficient is calculated, and a map control with lighting effects is rendered based on this information.

Benefits of technology

It improves the calculation efficiency of shadow coefficients in lighting rendering, reduces the consumption of game performance by lighting rendering, realizes efficient lighting rendering of map controls, and enhances the display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118903808A_ABST
    Figure CN118903808A_ABST
Patent Text Reader

Abstract

The invention provides a rendering method and device of a map control, electronic equipment and a storage medium. The method comprises the steps of obtaining position information of a controlled virtual character in a game scene; based on the position information, determining a target game scene, used for thumbnail display, of the map control from the game scene, the target game scene being at least a part of the game scene; obtaining target color information, target height information and target distance field information corresponding to the target game scene based on the first map and the second map; calculating a shadow coefficient corresponding to the target game scene based on the target distance field information; the map control which is used for thumbnail display of the target game scene and has an illumination effect is generated through rendering based on the target color information, the target height information and the shadow coefficient, and the shadow coefficient corresponding to the target game scene is calculated through the distance field information, so that the shadow coefficient calculation efficiency in illumination rendering is improved; and the consumption of illumination rendering on game performance is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image rendering technology, and in particular to a rendering method, device, electronic device and storage medium for a map control. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] At present, the development of game maps mainly focuses on some functional development, such as the position of the player character in the game scene, the mission target point, the position of the teammate character, the fog of war, etc. The display form of the map control is relatively simple, and the display content is not rich enough. Summary of the invention

[0004] In view of this, the purpose of the present application is to propose a rendering method, device, electronic device and storage medium for a map control.

[0005] Based on the above purpose, the present application provides a rendering method of a map control, which provides a graphical user interface of a target game through a terminal device, wherein the target game includes a game scene and a controlled virtual character, and the terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store color information corresponding to the game scene, and the second map is used to store height information and distance field information corresponding to the game scene, and the method includes:

[0006] Obtaining position information of the controlled virtual character in the game scene;

[0007] Determining a target game scene for thumbnail display by the map control from the game scene based on the position information, wherein the target game scene is at least a portion of the game scene;

[0008] Based on the first map and the second map, obtaining target color information, target height information, and target distance field information corresponding to the target game scene;

[0009] Calculate the shadow coefficient corresponding to the target game scene based on the target distance field information;

[0010] The map control for thumbnail display of the target game scene with lighting effects is generated based on the target color information, the target height information and the shadow coefficient rendering.

[0011] Based on the same inventive concept, the exemplary embodiment of the present application further provides a rendering device for a map control, which provides a graphical user interface of a target game through a terminal device, wherein the target game includes a game scene and a controlled virtual character, and the terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store color information corresponding to the game scene, and the second map is used to store height information and distance field information corresponding to the game scene, and the device includes:

[0012] A first acquisition module, acquiring position information of the controlled virtual character in the game scene;

[0013] A determination module, which determines a target game scene for thumbnail display by the map control from the game scene based on the position information, wherein the target game scene is at least a part of the game scene;

[0014] A second acquisition module, based on the first map and the second map, acquires target color information, target height information and target distance field information corresponding to the target game scene;

[0015] A calculation module, which calculates a shadow coefficient corresponding to the target game scene based on the target distance field information;

[0016] A rendering module is used to render and generate the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient.

[0017] Based on the same inventive concept, an exemplary embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the rendering method of the map control as described above when executing the program.

[0018] Based on the same inventive concept, an exemplary embodiment of the present application further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the rendering method of the map control as described above.

[0019] From the above, it can be seen that the rendering method, device, electronic device and storage medium of the map control provided by the present application obtain the position information of the controlled virtual character in the game scene; determine the target game scene for thumbnail display of the map control from the game scene based on the position information, wherein the target game scene is at least part of the game scene; based on the first map and the second map, obtain the target color information, target height information and target distance field information corresponding to the target game scene; calculate the shadow coefficient corresponding to the target game scene based on the target distance field information; based on the target color information, the target height information and the shadow coefficient rendering, generate the map control for thumbnail display of the target game scene with lighting effects, calculate the shadow coefficient corresponding to the target game scene through the distance field information, improve the efficiency of shadow coefficient calculation in lighting rendering, reduce the consumption of lighting rendering on game performance, and provide a feasible implementation scheme for lighting rendering of map controls. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A schematic diagram of an application scenario of an embodiment of the present application;

[0022] Figure 2 A flowchart of a method for rendering a map control according to an embodiment of the present application;

[0023] Figure 3 A flowchart of another method for rendering a map control according to an embodiment of the present application;

[0024] Figure 4 A schematic diagram of the structure of a rendering device for a map control according to an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the structure of a specific electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present application, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0027] According to an implementation of the present application, a rendering method, system, electronic device and storage medium of a map control are proposed.

[0028] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0029] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application. SUMMARY OF THE INVENTION

[0031] At present, the rendering method of the map control in the related art consumes a lot of game performance. This is because the shadow coefficient corresponding to the game scene needs to be accurately calculated in the lighting rendering, and the calculation of the shadow coefficient needs to accurately determine whether each pixel in the game scene is in the shadow under the current lighting, that is, blocked, or completely illuminated. Therefore, the related art does not perform lighting rendering on the game map control, that is, directly renders and generates the map control based on the color information and height information of the game scene.

[0032] In order to solve the above problems, the present application provides a rendering method of a map control, which specifically includes:

[0033] The method comprises the steps of: obtaining position information of the controlled virtual character in the game scene; determining a target game scene for thumbnail display of the map control from the game scene based on the position information, wherein the target game scene is at least a portion of the game scene; obtaining target color information, target height information and target distance field information corresponding to the target game scene based on the first map and the second map; calculating a shadow coefficient corresponding to the target game scene based on the target distance field information; rendering and generating the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient, calculating the shadow coefficient corresponding to the target game scene through the distance field information, thereby improving the efficiency of shadow coefficient calculation in lighting rendering, reducing the consumption of game performance by lighting rendering, and providing a feasible implementation scheme for lighting rendering of maps.

[0034] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.

[0035] Application Scenario Overview

[0036] In some specific application scenarios, the rendering method of the map control of the present application can be applied to various platforms or systems involving lighting rendering. Optionally, the system or platform can be a game system or platform. Figure 1 , the application scenario includes at least one server 102 and at least one terminal 101. Terminal devices include but are not limited to desktop computers, mobile phones, mobile computers, tablet computers, media players, smart wearable devices, personal digital assistants (PDA) or other electronic devices that can realize the above functions. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (content distribution network), and big data and artificial intelligence platforms. The server and the terminal can communicate through the network to realize data transmission. Among them, the network can be a wired network or a wireless network, which is not specifically limited in this application.

[0037] The server can be a server that provides various services. Specifically, the server can be used to provide background services for applications running on the terminal. Optionally, in some implementations, the rendering method of the map control provided in the embodiment of the present application can be executed by a terminal device. The server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. The embodiment of the present application does not specifically limit this.

[0038] Optionally, the wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, the data exchanged through the network is represented by technologies and / or formats including hypertext mark-up language (HTML), extensible markup language (XML), etc. In addition, conventional encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), and Internet protocol security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0039] The following describes the rendering method of the map control according to the exemplary implementation of the present application in conjunction with a specific application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this regard. On the contrary, the implementation of the present application can be applied to any applicable scenario.

[0040] Exemplary Methods

[0041] refer to Figure 2 The embodiment of the present application provides a method for rendering a map control, and the execution subject of the method for rendering a map control can be but is not limited to a server or a terminal device. A graphical user interface of a target game is provided through a terminal device, and the target game includes a game scene and a controlled virtual character. The terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store color information corresponding to the game scene, and the second map is used to store height information and distance field information corresponding to the game scene. The method includes the following steps:

[0042] S101, obtaining position information of the controlled virtual character in the game scene.

[0043] In specific implementation, in order to determine the target game scene, the position information of the controlled virtual character in the game scene can be obtained first. It should be noted that the game scenes in this application are all virtual game scenes.

[0044] It should be noted that the entire virtual game scene can be photographed by a virtual bird's-eye view camera in the virtual game scene, and then the inherent color of the virtual game scene can be recorded in the RGB channel of the first map. When obtaining the color map of the target game scene, it can be directly obtained through the first map. At the same time, the entire virtual game scene photographed by the virtual bird's-eye view camera can record the height information and distance field information of the virtual game scene in the second map.

[0045] S102: Determine a target game scene for thumbnail display by the map control from the game scene based on the position information, wherein the target game scene is at least a portion of the game scene.

[0046] In specific implementation, when performing lighting rendering, it is necessary to first determine the target game scene corresponding to the map control to be rendered, that is, to provide the map control with raw data support for lighting rendering through the target game scene. Optionally, the target game scene can be the entire game scene, that is, the content of the map to be rendered includes the entire virtual game scene, or it can be part of the virtual game scene. Optionally, the center point can be determined based on the position information of the controlled virtual character in the game scene, and a certain distance (set distance) can be extended outward to determine the coverage range of the target game scene for thumbnail display of the map control. For example, the 80th to 120th pixels in the horizontal direction and the 215th to 255th pixels in the vertical direction can be determined as the coverage range of the target game scene.

[0047] S103: Based on the first map and the second map, obtain target color information, target height information, and target distance field information corresponding to the target game scene.

[0048] In a specific implementation, since the terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store the color information corresponding to the game scene, and the second map is used to store the height information and the distance field information corresponding to the game scene, the target color information, the target height information, and the target distance field information corresponding to the target game scene can be directly obtained through the first map and the second map. It should be noted that the second map can be multiple or one, and when the second map is multiple, the height information and the distance field information can be stored in different second maps respectively.

[0049] In some embodiments, the target distance field information and the height information of the target game scene are respectively stored in two channels of the same second map.

[0050] In the specific implementation, considering that when calculating the shadow coefficient, each step needs to obtain the height information and the distance field information at the same time, therefore, the target distance field information and the height information of the target game scene can be saved in the same map at the same time, specifically, they can be saved in two channels of the same second map. Optionally, in some implementations, the height information can be recorded in the G channel of a dual-channel 16-bit map, and the distance field information can be recorded in the R channel of the dual-channel 16-bit map. The dual-channel 16-bit map is used because the accuracy of the ordinary 8-bit map cannot meet the needs of these two types of data. The data of the 8-bit map can be considered to only cover 0 to 255, while the data of the 16-bit map can cover 0 to 65535. For example, for a 1024*1024 pixel map, if the height of the second pixel to the left of pixel P is greater than the height of pixel P, using an 8-bit map can only record 1 unit, which is actually equivalent to 1*1024 / 255, about 4 pixels. Similarly, for some more complex terrains, such as a 500-meter-high mountain, each pixel in the 8-bit map represents a height of 500 / 255, which is about 2 meters. Obviously, this level of accuracy is difficult to meet usage requirements.

[0051] S104: Calculate a shadow coefficient corresponding to the target game scene based on the target distance field information.

[0052] In specific implementation, after the target distance field information is obtained, the shadow coefficient corresponding to the target game scene can be calculated according to the target distance field information, that is, the shadow coefficient of each pixel in the target game scene can be calculated.

[0053] In some embodiments, calculating the shadow coefficient corresponding to the target game scene based on the target distance field information specifically includes:

[0054] Acquire the target distance field information; wherein the target distance field information includes the target distance corresponding to each pixel point in the target game scene, the target distance is the distance between the current pixel point and the target pixel point; the target pixel point is the pixel point whose height is greater than the current pixel point and is closest to the current pixel point among multiple pixel points;

[0055] A shadow coefficient of each pixel in the target game scene is calculated based on the target distance field information.

[0056] In the specific implementation, it is considered that when calculating the shadow coefficient, it is necessary to detect step by step from the current pixel point along the illumination direction according to the preset step length. For example, each time X pixels (preset step length) are moved, the height of the pixel point at the position is detected. If it is higher than the height of the original pixel point and high enough to block the light irradiated by the light, the current pixel point is determined to be in the shadow. This cycle is repeated until the light exceeds the mapping range or the set maximum distance, and the current pixel point is considered to be completely illuminated. It can be imagined that a very high number of steps and a very small step length are required in a large scene to have a relatively complete result. In particular, the illuminated pixel needs the light to travel the entire distance to confirm that it is illuminated, so repeated sampling causes huge performance consumption. Moreover, unless the preset step length of each movement is set to one pixel, that is, no pixel point is skipped, it is difficult to ensure that there is no undetected point that can block the current pixel point in the area skipped by the preset step length each time, and a smaller step length means a higher consumption of performance. Therefore, most of the related technologies have abandoned the lighting rendering of the game map. Therefore, the target distance field information in this embodiment includes the target distance corresponding to each pixel in the target game scene, and the target distance is the distance between the current pixel and the target pixel; the target pixel is the pixel whose height is greater than the current pixel and is closest to the current pixel among multiple pixels. Since the target distance field information includes the target distance corresponding to each pixel, the efficiency of shadow calculation can be improved according to the target distance, that is, multiple undetected pixels can be skipped by the target distance, and there is no need to worry about the existence of undetected pixels that can block the current pixel among these undetected pixels. At the same time, the shadow coefficient of each pixel in the target game scene is calculated by the distance field information, and the step size can be determined each time according to the target distance corresponding to each pixel, so that the efficiency of shadow coefficient calculation in lighting rendering can be improved while ensuring the accuracy of the shadow coefficient, reducing the consumption of lighting rendering on game performance, and providing a feasible implementation plan for lighting rendering of maps.

[0057] In some embodiments, calculating the shadow coefficient of each pixel in the target game scene based on the target distance field information specifically includes:

[0058] For each pixel point in the target game scene, determine whether there is an occluded pixel point in the target game scene that can block the pixel point based on the target distance field information along the lighting direction; if so, determine the shadow coefficient of the pixel point based on the distance between the occluded pixel point and the pixel point; if not, determine the shadow coefficient of the pixel point as a preset shadow coefficient.

[0059] In specific implementation, when calculating the shadow coefficient of each pixel, it is necessary to determine whether each pixel is blocked along the illumination direction according to the target distance field information. If blocked, the shadow coefficient of the current pixel is determined according to the distance between the blocked pixel and each pixel. Generally, the farther the distance between the blocked pixel and each pixel, the smaller the corresponding occlusion coefficient. If there is no blocked pixel, it means that the current pixel can be fully illuminated at this time. At this time, the shadow coefficient of the current pixel is the minimum value, that is, the shadow coefficient of the pixel can be determined as the preset shadow coefficient. Optionally, the preset shadow coefficient can be set as needed, and there is no limitation on this.

[0060] In some embodiments, determining whether there is an occluding pixel point in the target game scene that can block the illumination of the pixel point along the illumination direction based on the target distance field information specifically includes:

[0061] For each pixel point in the target game scene, determine a plurality of candidate pixel points corresponding to the pixel point along the illumination direction based on the target distance field information, and determine whether the occluded pixel point exists among the plurality of candidate pixel points;

[0062] The process of determining each candidate pixel point includes:

[0063] The current candidate pixel point is determined in the target game scene along the lighting direction and based on the target distance corresponding to the previous candidate pixel point, wherein the first candidate pixel point corresponding to each pixel point in the target game scene is determined in the target game scene by the target distance corresponding to each pixel point.

[0064] In specific implementation, for each pixel, when determining whether there is a corresponding occluded pixel, multiple candidate pixels may be determined in sequence from the current pixel along the illumination direction and according to the target distance field information, and then it is determined whether there is the occluded pixel among the multiple candidate pixels. When determining the candidate pixels for the first time, the first candidate pixel is first determined along the illumination direction according to the target distance corresponding to the current pixel, and then it can be further determined whether the first candidate pixel is an occluded pixel. If so, it is possible to stop determining the subsequent candidate pixels. If not, the second candidate pixel is determined along the illumination direction according to the target distance corresponding to the first candidate pixel, and so on, until the occluded pixel is determined or the current pixel is determined to be completely illuminated.

[0065] It should be noted that since the first candidate pixel point is determined based on the target distance corresponding to the current pixel point, that is, along the illumination direction and within the range less than the target distance, there cannot be an undetected pixel point with a height greater than the current pixel point. As for the second candidate pixel point, it is determined based on the target distance corresponding to the first candidate pixel point. Therefore, when the first candidate pixel point cannot cover the current pixel point, it means that there cannot be an undetected pixel point with a height greater than the current pixel point between the second candidate pixel point and the first candidate pixel point. Therefore, by analogy, multiple candidate pixel points are determined based on the target distance field information, which can improve efficiency and avoid the existence of an undetected pixel point with a height greater than the current pixel point between two candidate pixel points.

[0066] In some embodiments, determining whether the occluded pixel point exists in the plurality of candidate pixel points specifically includes:

[0067] Determine whether the current candidate pixel point is the blocked pixel point;

[0068] In response to determining that the current candidate pixel point is the occluded pixel point, stopping determining the candidate pixel point again.

[0069] In some embodiments, determining whether the current candidate pixel point is the blocked pixel point specifically includes:

[0070] Determine whether the first height of the current candidate pixel point is greater than the second height of the pixel point corresponding to the current candidate pixel point;

[0071] In response to determining that the height of the current candidate pixel point is greater than the height of the pixel point corresponding to the current candidate pixel point, determine whether the current candidate pixel point is the occluded pixel point based on the first height, the second height and the illumination direction.

[0072] The specific implementation is that when judging whether the candidate pixel is an occluded pixel, it can be determined whether the first height of the current candidate pixel is greater than the second height of the pixel (each initial pixel) corresponding to the current candidate pixel; if not, it means that the current candidate pixel is not the occluded pixel, and the subsequent judgment can be omitted. If it is greater, it is necessary to further determine whether the current candidate pixel is the occluded pixel based on the first height, the second height and the illumination direction. That is, it is determined whether the first height is sufficient to block the place where the illumination direction irradiates to the second height.

[0073] In some embodiments, the step of determining the distance between each pixel and the corresponding occluded pixel comprises:

[0074] The distance between each pixel point and the corresponding occluded pixel point is determined based on the target distance corresponding to each pixel point and the target distances corresponding to a plurality of candidate pixel points.

[0075] In specific implementation, in order to improve efficiency, when determining the distance between the occluded pixel and the pixel, it is not necessary to calculate through the respective positions of the occluded pixel and the pixel, but the distance between the occluded pixel and the pixel can be determined directly according to the target distance corresponding to each pixel and the target distances corresponding to multiple candidate pixels. Optionally, the distance between the occluded pixel and each pixel can be directly obtained by summing the target distance corresponding to each pixel and the target distances corresponding to all candidate pixels except the occluded pixel.

[0076] In some embodiments, the target distance is a plane distance between two pixel points in the target game scene.

[0077] In the specific implementation, in order to save space occupation, compared with the mainstream 3D directed distance field (SDF) map used in the current related technology, this implementation uses a 2D distance field map with a smaller space, that is, the target distance included in the target distance field information is the plane distance between two pixel points in the target game scene, thereby reducing the space occupation, and at the same time, all the information that can be provided by SDF (and required by this solution) is provided through the height information additionally stored in the height channel.

[0078] S105, generating the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient rendering.

[0079] In specific implementation, the map control for thumbnail display of the target game scene can be generated by rendering in the graphical user interface based on the target color information and the target height information, and a lighting effect determined based on the shadow coefficient can be added to the map control. Alternatively, the map control can be directly generated by rendering based on the target color information, the target height information and the shadow coefficient, which is not limited.

[0080] In some embodiments, the map control for thumbnail display of the target game scene with lighting effects is generated based on the target color information, the target height information and the shadow coefficient rendering, specifically including:

[0081] Obtain the lighting color and lighting intensity corresponding to the target game scene;

[0082] The map control for thumbnail display of the target game scene with lighting effects is generated based on the shadow coefficient, the target color information, the target height information, the lighting color and the lighting intensity.

[0083] In specific implementation, the shadow coefficient corresponding to each pixel, the color in the target color information, the height in the target height information, the lighting color and the lighting intensity can be directly multiplied to obtain the lighting rendering result of the pixel, that is, the color value of the pixel after adding lighting.

[0084] It should be noted that, since the shadow coefficient with high performance consumption has been obtained through the method of this application, when performing lighting calculations, the map control can be rendered by a more complex lighting calculation method in the relevant technology, and there is no limitation on this.

[0085] It should be noted that the lighting direction, lighting color and lighting intensity in the embodiments of the present application can all be changed according to time. In this way, the lighting rendering results corresponding to different moments can be calculated through the method of the present application.

[0086] refer to Figure 3 , is a flow chart of another method for rendering a map control of an embodiment of the present application, wherein the target game scene corresponding to the map to be rendered is first determined, and then the target game scene is sampled to obtain a color map, and the distance field and height map are sampled, that is, the distance field and height are saved in two channels of a map, and then the current candidate pixel corresponding to each initial pixel is determined according to the distance field and the height map, and it is further determined whether the current candidate pixel can block the light. If it can, it means that the current initial pixel is in the shadow. At this time, the shadow coefficient of the initial pixel can be calculated according to the distance between the current candidate pixel and the current initial pixel. After determining the shadow coefficient, the color information of the initial pixel can be obtained from the color map, and then lighting rendering is performed to obtain the map control for thumbnail display of the target game scene with lighting effects. If the current candidate pixel cannot block the light, it is determined whether the current candidate pixel has reached the maximum number of confirmations. If it has reached, it means that the initial pixel is not in the shadow, and the shadow coefficient of the initial pixel can be directly determined, and then subsequent lighting rendering is performed. If the maximum number of confirmations is not reached, the next current candidate pixel is re-determined.

[0087] The rendering method of the map control provided in the present application determines the target game scene corresponding to the map to be rendered; obtains the position information of the controlled virtual character in the game scene; determines the target game scene for thumbnail display of the map control from the game scene based on the position information, wherein the target game scene is at least a part of the game scene; obtains the target color information, target height information and target distance field information corresponding to the target game scene based on the first map and the second map; calculates the shadow coefficient corresponding to the target game scene based on the target distance field information; renders and generates the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient, calculates the shadow coefficient corresponding to the target game scene through the distance field information, improves the efficiency of shadow coefficient calculation in lighting rendering, reduces the consumption of game performance by lighting rendering, and provides a feasible implementation scheme for lighting rendering of map controls.

[0088] Exemplary Devices

[0089] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a rendering device for a map control, which provides a graphical user interface of a target game through a terminal device, wherein the target game includes a game scene and a controlled virtual character, and the terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store color information corresponding to the game scene, and the second map is used to store height information and distance field information corresponding to the game scene.

[0090] refer to Figure 4 , the rendering device of the map control comprises:

[0091] A first acquisition module 201, acquiring position information of the controlled virtual character in the game scene;

[0092] A determination module 202 is configured to determine a target game scene for thumbnail display by the map control from the game scene based on the location information, wherein the target game scene is at least a portion of the game scene;

[0093] A second acquisition module 203 acquires target color information, target height information, and target distance field information corresponding to the target game scene based on the first map and the second map;

[0094] A calculation module 204 calculates a shadow coefficient corresponding to the target game scene based on the target distance field information;

[0095] The rendering module 205 generates the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient rendering.

[0096] For the convenience of description, the above system is described by dividing the functions into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0097] The system of the above embodiment is used to implement the rendering method of the corresponding map control in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0098] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the rendering method of the map control described in any of the above embodiments is implemented.

[0099] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0100] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0101] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0102] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0103] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0104] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0105] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0106] The electronic device of the above embodiment is used to implement the rendering method of the corresponding map control in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0107] Exemplary Program Products

[0108] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the rendering method of the map control as described in any of the above embodiments.

[0109] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0110] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the rendering method of the map control as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0111] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure further provides a computer program product, which includes a computer program. In some embodiments, the computer program is executed by one or more processors so that the processors execute the rendering method of the map control described in the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0112] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; based on the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0113] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0114] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0115] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A rendering method for a map control, characterized in that: A graphical user interface of a target game is provided through a terminal device, the target game includes a game scene and a controlled virtual character, the terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store color information corresponding to the game scene, and the second map is used to store height information and distance field information corresponding to the game scene, and the method includes: Acquiring position information of the controlled virtual character in the game scene; Determining a target game scene for thumbnail display by the map control from the game scene based on the position information, wherein the target game scene is at least a portion of the game scene; Based on the first map and the second map, obtaining target color information, target height information, and target distance field information corresponding to the target game scene; Calculate the shadow coefficient corresponding to the target game scene based on the target distance field information; The map control for thumbnail display of the target game scene with lighting effects is generated based on the target color information, the target height information and the shadow coefficient rendering.

2. The method according to claim 1, characterized in that: Calculating a shadow coefficient corresponding to the target game scene based on the target distance field information specifically includes: Acquire the target distance field information; wherein the target distance field information includes the target distance corresponding to each pixel point in the target game scene, the target distance is the distance between the current pixel point and the target pixel point; the target pixel point is the pixel point whose height is greater than the current pixel point and is closest to the current pixel point among multiple pixel points; A shadow coefficient of each pixel in the target game scene is calculated based on the target distance field information.

3. The method according to claim 1, characterized in that Calculating the shadow coefficient of each pixel in the target game scene based on the target distance field information specifically includes: For each pixel point in the target game scene, determine whether there is an occluded pixel point in the target game scene that can block the pixel point based on the target distance field information along the lighting direction; if so, determine the shadow coefficient of the pixel point based on the distance between the occluded pixel point and the pixel point; if not, determine the shadow coefficient of the pixel point as a preset shadow coefficient.

4. The method according to claim 3, characterized in that Determining whether there is an occluded pixel point in the target game scene that can block the pixel point from being illuminated based on the target distance field information along the illumination direction specifically includes: For each pixel point in the target game scene, determine a plurality of candidate pixel points corresponding to the pixel point along the illumination direction based on the target distance field information, and determine whether the occluded pixel point exists among the plurality of candidate pixel points; The process of determining each candidate pixel point includes: The current candidate pixel point is determined in the target game scene along the lighting direction and based on the target distance corresponding to the previous candidate pixel point, wherein the first candidate pixel point corresponding to each pixel point in the target game scene is determined in the target game scene by the target distance corresponding to each pixel point.

5. The method according to claim 4, characterized in that Determining whether the occluded pixel point exists in the plurality of candidate pixel points specifically includes: Determine whether the current candidate pixel point is the blocked pixel point; In response to determining that the current candidate pixel point is the occluded pixel point, stopping determining the candidate pixel point again.

6. The method according to claim 5, characterized in that Determining whether the current candidate pixel point is the blocked pixel point specifically includes: Determine whether the first height of the current candidate pixel point is greater than the second height of the pixel point corresponding to the current candidate pixel point; In response to determining that the height of the current candidate pixel point is greater than the height of the pixel point corresponding to the current candidate pixel point, determine whether the current candidate pixel point is the occluded pixel point based on the first height, the second height and the illumination direction.

7. The method according to claim 4, characterized in that The step of determining the distance between each pixel point and the corresponding occluded pixel point comprises: The distance between each pixel point and the corresponding occluded pixel point is determined based on the target distance corresponding to each pixel point and the target distances corresponding to a plurality of candidate pixel points.

8. The method according to claim 1, characterized in that The target distance field information and the height information of the target game scene are respectively stored in two channels of the same second map.

9. The method according to claim 2, characterized in that: The target distance is the plane distance between two pixel points in the target game scene.

10. The method according to claim 1, characterized in that Generating the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient rendering specifically includes: Obtain the lighting color and lighting intensity corresponding to the target game scene; The map control for thumbnail display of the target game scene with lighting effects is generated based on the shadow coefficient, the target color information, the target height information, the lighting color and the lighting intensity.

11. A rendering device for a map control, characterized in that: A graphical user interface of a target game is provided through a terminal device, wherein the target game includes a game scene and a controlled virtual character, and the terminal device stores a first map and a second map corresponding to the game scene, wherein the first map is used to store color information corresponding to the game scene, and the second map is used to store height information and distance field information corresponding to the game scene, and the device includes: A first acquisition module, acquiring position information of the controlled virtual character in the game scene; A determination module, which determines a target game scene for thumbnail display by the map control from the game scene based on the position information, wherein the target game scene is at least a part of the game scene; A second acquisition module, based on the first map and the second map, acquires target color information, target height information and target distance field information corresponding to the target game scene; A calculation module, which calculates a shadow coefficient corresponding to the target game scene based on the target distance field information; A rendering module is used to render and generate the map control for thumbnail display of the target game scene with lighting effects based on the target color information, the target height information and the shadow coefficient.

12. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 10 when executing the program.

13. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the method according to any one of claims 1 to 10.