Target area processing method and device, equipment and storage medium
By updating the directed distance field information of the target area according to the region connection status in the game, the problem of high calculation and bandwidth overhead when updating the territory polygons and distance fields in the prior art is solved, and efficient multi-threaded parallel computing and movement are realized performance improvement on the end.
Patent Information
- Application Number
- CN202411261125.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-02-14
AI Technical Summary
When the prior art updates the city territory polygonal contour and directed distance field map in real time in the game, the calculation overhead and bandwidth overhead are large, resulting in the mobile terminal being prone to problems such as heating, frequency reduction and power failure.
When the first new area and the to-select area of the first account are in a connected state in the current period, the first target area is determined based on the to-select area and the first new area; and the processing area corresponding to the first target area is obtained. The texture coordinates of the pixels of the target area identification and processing area are determined based on the texture coordinates of the pixels in the target area identification and processing area.
It realizes that only updates the directed distance field information of the region according to the communication status between regions, reduces calculation and bandwidth overhead, and improves the performance and battery life of the mobile terminal.
Smart Images

Figure CN119425079A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a target area processing method, device, equipment and storage medium. Background Art
[0002] In a type of game that requires players to divide camps, form alliances, and occupy cities to achieve specific goals, after occupying the relevant city, the territory of the city will be merged with the surrounding territories belonging to the alliance, indicating that the polygonal area of the alliance's sphere of influence will expand to form a new polygon, and the color of the alliance will be displayed on the map to facilitate players to distinguish their respective forces.
[0003] However, the current common map coloring method is generally to dynamically reconstruct the territory polygon outline after the player occupies the city and the territory range changes. In addition, each location in each changed territory needs to calculate its distance to the territory outline and generate the corresponding directed distance field map in real time. This solution of calculating one by one and updating in real time has high computational overhead and will also cause large bandwidth overhead. It is easy to cause heat generation, frequency reduction, and rapid power loss on the mobile terminal. Summary of the invention
[0004] The present disclosure provides a target area processing method, device, equipment and storage medium to solve at least one problem in the related art. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a target area processing method is provided, comprising:
[0006] If the first newly added area and the to-be-selected area of the first account are in a connected state during the current period, a first target area is determined based on the to-be-selected area and the first newly added area; the to-be-selected area includes the first historical area or the second newly added area;
[0007] determining a target area identifier of a first target area based on a first historical area identifier of a first historical area;
[0008] Acquire texture coordinates of pixels in a processing area corresponding to the first target area; the processing area is a regular area surrounding the first target area;
[0009] Determine texture information of each target pixel in the first target area based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel;
[0010] Based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area, the signed distance field information of the first target area is determined; and the signed distance field information is used to render the boundary of the first target area.
[0011] In some embodiments, the first newly added area, the second newly added area, and the first historical area each include at least one basic sub-area; and the at least one basic sub-area respectively has a corresponding basic sub-area identifier;
[0012] If the first newly added area and the to-be-selected area of the first account are in a connected state during the current period, determining the first target area based on the to-be-selected area and the first newly added area includes:
[0013] If the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the first historical region indicate that the first newly added region and the first historical region are in a connected state, determining the first target region based on the first newly added region and the first historical region; or;
[0014] If the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the second newly added region indicate that the first newly added region and the second newly added region are in a connected state, a first target region is determined based on the first newly added region and the second newly added region.
[0015] In some implementations, when the processing area includes non-target pixels outside the first target area, obtaining texture coordinates of pixels in the processing area corresponding to the first target area includes:
[0016] Get the rendering texture of the virtual map;
[0017] Determine the texture coordinates of each target pixel in the first target area according to the rendering texture of the virtual map; the virtual map includes the first newly added area and the area to be selected;
[0018] Determining a processing region of the first target region based on the texture coordinates of each target pixel;
[0019] Determining texture coordinates of each non-target pixel in the processing area based on the rendered texture of the virtual map;
[0020] Based on the texture coordinates of each target pixel and the texture coordinates of each non-target pixel, texture coordinates of pixels in the processing area are determined.
[0021] In some embodiments, determining texture information of each target pixel in the first target region based on the target region identifier and the texture coordinates of the pixels in the processing region includes:
[0022] Determine the target region identifier as a texture identifier for each target pixel;
[0023] Determine the texture coordinates of the boundary pixels corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel and the texture coordinates of each non-target pixel;
[0024] The texture information of each target pixel is determined based on the texture coordinates and texture identifier of the boundary pixel corresponding to each target pixel.
[0025] In some implementations, determining the texture coordinates of the boundary pixel corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel, and the texture coordinates of each non-target pixel includes:
[0026] For each target pixel, perform:
[0027] The currently executed target pixel is regarded as the current pixel;
[0028] Acquire texture coordinates of pixels of a first position type corresponding to the current pixel; the pixels of the first position type are pixels of a preset number of first preset steps in a preset direction of the current pixel and located within the processing area;
[0029] Determine the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel;
[0030] Based on the texture coordinates of the boundary pixel corresponding to the current pixel, the texture coordinates of the boundary pixel corresponding to each target pixel are determined.
[0031] In some implementations, determining the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the pixel of the first position type, and the texture coordinates of the current pixel includes:
[0032] If the first preset step length is greater than the preset step length threshold, the texture coordinates of the second position type pixel corresponding to the current pixel are obtained, the texture coordinates of the second position type pixel are determined as the texture coordinates of the first position type pixel, and the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel; the second position type pixel is a pixel with a preset number of the second preset step length in the preset direction of the current pixel and is located in the processing area, and the first preset step length is twice the second preset step length; or;
[0033] If the first preset step length is less than or equal to the preset step length threshold, the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel.
[0034] In some implementations, determining the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the pixel of the first position type, and the texture coordinates of the current pixel includes:
[0035] Determining a first distance based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel;
[0036] Determine a first target distance in the first distance; the first distance includes the first target distance and the non-first target distance, and the first target distance is less than or equal to the non-first target distance;
[0037] The texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture coordinates of the pixel of the first position type corresponding to the first target distance.
[0038] In some implementations, determining the first distance based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel includes:
[0039] In the case where there is a target boundary pixel in the first position type pixel, determining a first distance based on the texture coordinates of the current pixel and the texture coordinates of the target boundary pixel;
[0040] The texture ID of the current pixel is different from the texture ID of the target boundary pixel.
[0041] In some embodiments, determining the signed distance field information of the first target region based on the texture coordinates of the pixels in the processing region and the texture information of the pixels in the first target region includes:
[0042] Determining a first target distance set based on the texture coordinates of each target pixel and the texture coordinates of the boundary pixel corresponding to each target pixel;
[0043] Determine a second target distance in the first target distance set; the first target distance set includes the second target distance and the non-second target distance, and the second target distance is greater than or equal to the non-second target distance;
[0044] Determine the directed distance field information of each target pixel based on the first target distance and the second target distance;
[0045] Based on the signed distance field information of each target pixel, the signed distance field information of the first target area is determined.
[0046] In some implementations, the first newly added area and the second newly added area are areas corresponding to the second account in the historical period.
[0047] In some implementations, when the second account in the historical period also includes a third newly added area, and the third newly added area belongs to the first account in the current period, the method further includes:
[0048] If the third newly added area and the to-be-selected area are in a disconnected state, determining the second target area based on the third newly added area;
[0049] The directed distance field information of the second target area is determined according to the directed distance field information of the virtual map.
[0050] In some implementations, before determining the directed distance field information of the second target area according to the directed distance field information of the virtual map, the method further includes:
[0051] Determine the directed distance field information of the virtual map; the virtual map includes a plurality of basic sub-areas;
[0052] Determine the signed distance field information of the virtual map, including:
[0053] For each base sub-region, execute:
[0054] Treat the currently executing base sub-region as the current sub-region;
[0055] Get the texture coordinates of the pixels in the processing area corresponding to the current sub-area;
[0056] Determine texture information of each pixel in the current sub-region based on a basic sub-region identifier of the current sub-region and texture coordinates of pixels in a processing region corresponding to the current sub-region;
[0057] Determine the signed distance field information of the current sub-region based on the texture coordinates of the pixels in the processing region corresponding to the current sub-region and the texture information of each pixel in the base sub-region;
[0058] Based on the signed distance field information of each current sub-region, the signed distance field information of the virtual map is determined.
[0059] In some embodiments, the method further comprises:
[0060] Rendering a boundary of the first target area based on the signed distance field information of the first target area;
[0061] The first newly added area and the to-be-selected area are presented at a first scale.
[0062] In some implementations, when the first account in the historical period also includes a second historical area, the second account in the historical period also includes a fourth newly added area, and the fourth newly added area belongs to the first account in the current period, the method further includes:
[0063] The current visual field information and the historical visual field information are obtained; the second historical area and the fourth newly added area are presented at a second scale; the scale of the second scale is greater than the scale of the first scale; the current visual field information and the historical visual field information are visual field information at different time periods under the main perspective;
[0064] If the current field of view information and the historical field of view information indicate that the field of view of the main perspective has changed, a third target area is determined based on the second historical area and the fourth newly added area;
[0065] Based on the third target area and the current field of view information, obtaining the rendering texture under the top perspective;
[0066] Based on the rendering texture under the top viewing angle, the boundary of the third target area under the main viewing angle is rendered.
[0067] In some implementations, after obtaining the current field of view information and the historical field of view information, the method further includes:
[0068] If the current field of view information and the historical field of view information indicate that the field of view of the main view is in a static state, obtaining a first projection matrix of the main view;
[0069] Add jitter information to the projection matrix to obtain a second projection matrix;
[0070] Pixels around a boundary of the third object region are rasterized based on the second projection matrix to obtain a boundary of the third object region.
[0071] In some implementations, obtaining a rendering texture at a top viewing angle based on the third target area and current field of view information includes:
[0072] Based on the current field of view information, determine the rendering range of the top perspective;
[0073] Based on the rendering range of the top viewing angle and the third target area, a rendering texture under the top viewing angle is obtained.
[0074] According to a second aspect of an embodiment of the present disclosure, there is provided a target region processing device, comprising:
[0075] A first determination module is configured to determine a first target area based on the to-be-selected area and the first newly added area if the first newly added area and the to-be-selected area of the first account are in a connected state during a current period; the to-be-selected area includes the first historical area or the second newly added area;
[0076] A second determination module is configured to determine a target area identifier of a first target area based on a first historical area identifier of a first historical area;
[0077] An acquisition module is configured to acquire texture coordinates of pixels in a processing area corresponding to the first target area; the processing area is a regular area surrounding the first target area;
[0078] A third determination module is configured to determine texture information of each target pixel in the first target area based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes texture coordinates of boundary pixels corresponding to each target pixel;
[0079] The fourth determination module is configured to determine the signed distance field information of the first target area based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area; the signed distance field information is used to render the boundary of the first target area.
[0080] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0081] processor;
[0082] a memory for storing instructions executable by the processor;
[0083] The processor is configured to execute the instructions to implement the target area processing method as described in any of the above embodiments.
[0084] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the target area processing method as described in any of the above embodiments.
[0085] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the target area processing method provided in any one of the above embodiments is implemented.
[0086] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0087] The embodiment of the present disclosure determines the first target area based on the selected area and the first new area when the first newly added area and the selected area of the first account are in a connected state during the current period; the selected area includes the first historical area or the second newly added area; the target area identifier of the first target area is determined based on the first historical area identifier of the first historical area; the texture coordinates of the pixels in the processing area corresponding to the first target area are obtained; the processing area is a regular area surrounding the first target area; the texture information of each target pixel in the first target area is determined based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel; the directed distance field information of the first target area is determined based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area; the directed distance field information is used to render the boundary of the first target area. The present disclosure only updates the directed distance field information of the area according to the connected state between the areas, and uses the area identifier to represent the belonging relationship between the area and the pixel, so as to facilitate the calculation of the texture information and the directed distance field information of the target pixel, and the calculation of each pixel is independent of each other, so as to realize efficient multi-threaded parallel calculation.
[0088] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] The drawings herein are incorporated into the specification and constitute a part of the present disclosure, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0090] Figure 1 It is a schematic diagram of an application environment of a target area processing method according to an exemplary embodiment.
[0091] Figure 2 is a flow chart of a target area processing method according to an exemplary embodiment (connected state).
[0092] Figure 3 The figure is a schematic diagram of area division of a virtual map according to an exemplary embodiment.
[0093] Figure 4 The invention is a flowchart showing a method for determining texture coordinates of pixels in a processing area according to an exemplary embodiment.
[0094] Figure 5 The diagram is a schematic diagram showing a method for determining texture coordinates of boundary pixels corresponding to each target pixel according to an exemplary embodiment.
[0095] Figure 6 The diagram is an updated signed distance field map according to an exemplary embodiment.
[0096] Figure 7 The figure is a flowchart of a method for processing a target area according to an exemplary embodiment (non-connected state).
[0097] Figure 8 A single-region directed distance field map is shown according to an exemplary embodiment.
[0098] Fig. 9 The present invention is a flowchart of a method for rendering a target area boundary according to an exemplary embodiment.
[0099] Fig.10 The figure is a schematic diagram showing an anti-aliasing effect according to an exemplary embodiment.
[0100] Fig.11 The figure is a block diagram of a target area boundary processing device according to an exemplary embodiment.
[0101] Fig.12 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0102] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0103] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0104] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0105] Before introducing the method embodiments provided in the present application, a brief introduction is first given to the relevant terms or nouns that may be involved in the method embodiments of the present application to facilitate understanding by technicians in the field of the present application.
[0106] SLG: Simulation and Strategy Game, is a type of video game that emphasizes strategic thinking and planning. Players usually need to manage resources, formulate strategies, and make long-term plans to achieve specific goals. This type of game covers multiple sub-genres, such as city building, war simulation, management simulation, etc.
[0107] SDF: Signed Distance Function (SDF), used to describe the position of geometric shapes in space. SDF
[0108] Returns the signed distance from a point to a geometric surface. A positive value indicates that the point is outside the shape, a negative value indicates that the point is inside the shape, and zero indicates that the point is on the surface of the shape. The absolute value of the distance value indicates the closest distance from the point to all geometric surfaces.
[0109] CPU: Central Processing Unit, also known as central processing unit in Chinese. It is the core component of a computer system, responsible for executing instructions in computer programs and performing basic arithmetic, logical operations, control and input / output (I / O) operations.
[0110] GPU: Graphics Processing Unit, also known as graphics processor in Chinese. It is a processor specially designed for processing graphics and image tasks. GPU was originally designed for computer graphics to handle graphics-intensive tasks such as 3D rendering, video playback, and games. As technology develops, GPU is also used for other types of data processing, including deep learning and artificial intelligence.
[0111] Jobs System: Jobs System is an efficient parallel processing framework provided by Unity (a game engine) for high-performance computing on multi-core processors. It allows developers to decompose tasks into independent work units (Jobs) and assign these work units to multiple threads for parallel execution, thereby making full use of the multi-core architecture of modern CPUs and improving the efficiency of program operation. Combined with the use of Native data types based on unmanaged memory, the performance overhead caused by garbage collection (GC) can be avoided. These Native data types are directly allocated in memory and do not rely on the managed heap. Through the combination of Jobs System and Native data types, developers can efficiently share data in a multi-threaded environment without introducing additional memory management complexity.
[0112] Render Texture: RenderTexture is a technique used in computer graphics to output rendering results to a texture instead of displaying them directly on the screen. The position, color or other data of each pixel can be calculated by an algorithm and written to the render texture.
[0113] Texture coordinates: UV coordinates are a method used in computer graphics to map a two-dimensional image (texture) to the surface of a three-dimensional model. UV coordinates match the pixels of the rendered texture to the surface points of the model one by one, so that the texture can accurately cover the surface of the model. The two components of the UV coordinates represent the coordinates of the rendered texture in the horizontal direction (U) and the vertical direction (V).
[0114] Texture information: including the three RGB channels of the rendered texture, the R channel (Red Channel), the G channel (Green Channel) and the B channel (Blue Channel) can store other forms of data information, such as lighting information, normal direction, depth, material properties, etc. In this way, more complex effects can be achieved based on these data in the post-processing stage. For example, in SDF calculation, the R, G, and B channels may be used to store information about the signed distance field instead of color information.
[0115] See also Figure 1 , Figure 1 is a schematic diagram showing an application environment of a target area processing method according to an exemplary embodiment. Figure 1 As shown, the application environment may include a server 011 , a first client 012 , and a second client 013 .
[0116] In some possible embodiments, the server 011 may include an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or 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 Delivery Network), and big data and artificial intelligence platforms. The operating system running on the server may include but is not limited to Android, IOS, Linux, Windows, Unix, etc.
[0117] In some possible embodiments, the first client 012 may include but is not limited to a smartphone, a desktop computer, a tablet computer, a laptop computer, a smart speaker, a digital assistant, an augmented reality (AR) / virtual reality (VR) device, a smart wearable device, and other image-type clients. It may also be software running on the above client, such as an application, a small program, etc. Optionally, the operating system running on the client may include but is not limited to Android system, IOS system, Linux, Windows, Unix, etc.
[0118] In some possible embodiments, the second client 013 may include but is not limited to a smartphone, a desktop computer, a tablet computer, a laptop computer, a smart speaker, a digital assistant, an augmented reality (AR) / virtual reality (VR) device, a smart wearable device, and other image-type clients. It may also be software running on the above client, such as an application, a small program, etc. Optionally, the operating system running on the client may include but is not limited to Android system, IOS system, Linux, Windows, Unix, etc.
[0119] In some possible embodiments, the first client 012 or the second client 013 displays the target area in the virtual map on a preset page. If the first newly added area and the selected area of the first account are in a connected state during the current period, the first target area is determined based on the selected area and the first newly added area; the selected area includes the first historical area or the second newly added area; the target area identifier of the first target area is determined based on the first historical area identifier of the first historical area; the texture coordinates of the pixels in the processing area corresponding to the first target area are obtained; the processing area is a regular area surrounding the first target area; the texture information of each target pixel in the first target area is determined based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel; the directed distance field information of the first target area is determined based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area; the directed distance field information is used to render the boundary of the first target area. The disclosed embodiment only updates the directed distance field information of the area according to the connected state between the areas, and uses the area identifier to represent the belonging relationship between the area and the pixel, so as to facilitate the calculation of the texture information and the directed distance field information of the target pixel, and the calculation of each pixel is independent of each other, so as to realize efficient multi-threaded parallel calculation.
[0120] In an exemplary embodiment, the databases corresponding to the client and the server can both be node devices in the blockchain system, and can share the acquired and generated information with other node devices in the blockchain system, thereby realizing information sharing among multiple node devices. Multiple node devices in the blockchain system can be configured with the same blockchain, which is composed of multiple blocks, and the adjacent blocks have an association relationship, so that when the data in any block is tampered, it can be detected by the next block, thereby preventing the data in the blockchain from being tampered with, and ensuring the security and reliability of the data in the blockchain.
[0121] Figure 2 It is a flow chart of a method for processing a target area according to an exemplary embodiment. It should be noted that this specification provides method operation steps as described in the embodiment or flow chart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the flow chart at least includes the following steps S101-S109:
[0122] In step S101, if the first newly added area and the to-be-selected area of the first account are in a connected state during the current period, a first target area is determined based on the to-be-selected area and the first newly added area; the to-be-selected area includes the first historical area or the second newly added area.
[0123] Optionally, the first newly added area and the second newly added area are areas corresponding to the second account in the historical period. The second account may belong to other game players or non-game players, that is, the newly added area may be occupied by other game players or unoccupied neutral areas in the historical period. In one embodiment, the first newly added area is the territory of other game players, and the second newly added area is an unoccupied neutral area.
[0124] The first account includes at least one game player, which can represent one game player, or a camp or alliance composed of multiple game players belonging to the same camp.
[0125] Optionally, in order to facilitate game players to distinguish territories of different camps, the territories of different camps correspond to different colors. In a possible embodiment, the territory area of the first account corresponds to green on the virtual map of the game, and the territory area of the second account corresponds to red on the virtual map of the game. The boundaries of the territory areas are shaded with corresponding colors, so that the territories of different camps can be distinguished.
[0126] When the camp affiliation of the first newly added area changes, it is necessary to dye the border of the first newly added area with the color corresponding to the current camp. In the embodiment of the present application, the current camps of the first newly added area and the selected area are both the first account, and the color of the border needs to be changed to green.
[0127] In the embodiment of the present application, the boundary shapes of the first newly added area and the area to be selected may be one or more of a complex shape and a simple shape. The complex shape includes but is not limited to an irregular polygon, a special shape, etc. The simple shape may include but is not limited to a rectangle, a hexagon, etc.
[0128] In some implementations, if in the current time period, the first newly added area and the to-be-selected area of the first account are in a connected state in step S101, determining the first target area based on the to-be-selected area and the first newly added area includes:
[0129] Obtaining the area identifiers of the first newly added area and the area to be selected;
[0130] Connectivity status is determined based on the region identifier.
[0131] Each area on the virtual map has a corresponding area identifier, which is used to identify the account and the location on the virtual map. By obtaining the area identifiers of the first newly added area and the area to be selected, it can be determined whether the first newly added area and the area to be selected are connected based on the location information carried by the area identifiers.
[0132] In a possible embodiment, the area to be selected includes the second newly added area and the first historical area, and the first newly added area, the second newly added area and the first historical area each include at least one basic sub-area; and the at least one basic sub-area respectively has a corresponding basic sub-area identifier.
[0133] Among them, Figure 3 As shown, before the game starts, the virtual map is divided into multiple basic sub-areas. After the game has been going on for a period of time, each player occupies some basic sub-areas to form his own historical area.
[0134] In a possible embodiment, the virtual map includes 20 basic sub-areas, each of which corresponds to 001, 002, 003...020, a total of 20 basic sub-area identifiers, and there is a pre-set adjacent relationship between the basic sub-areas, for example, the basic sub-area with area identifier 001 is adjacent to the basic sub-area with area identifier 002 and the basic sub-area with area identifier 003, and when they belong to the same account, the three basic sub-areas are connected. Whether the first newly added area and the to-be-selected area are connected is determined by the basic sub-areas contained in the first newly added area and the to-be-selected area, and the corresponding basic sub-area identifiers.
[0135] In a possible embodiment, step S101 specifically includes the following steps:
[0136] In step S1011, if the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the first historical region indicate that the first newly added region and the first historical region are in a connected state, a first target region is determined based on the first newly added region and the first historical region.
[0137] In a possible embodiment, the selected area includes the first historical area, the basic sub-area identifier of the first historical area and the basic sub-area identifier of the first newly added area indicate that the first newly added area and the first historical area are in a connected state, and the entire area composed of the first newly added area and the first historical area is the first target area for which the border coloring needs to be changed. In other words, the first newly added area occupied by the first account this time and the first historical area occupied previously are adjacent and connected.
[0138] In step S1013, if the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the second newly added region indicate that the first newly added region and the second newly added region are connected, a first target region is determined based on the first newly added region and the second newly added region.
[0139] In a possible embodiment, the selected area includes the second newly added area, the basic sub-area identifier of the second newly added area and the basic sub-area identifier of the first newly added area indicate that the first newly added area and the second newly added area are in a connected state, and the entire area composed of the first newly added area and the second newly added area is the first target area for which the border coloring needs to be changed. In other words, the first newly added area and the second newly added area occupied by the first account this time are adjacent and connected, but are not connected to the previously occupied area.
[0140] In step S103, a target area identifier of a first target area is determined based on a first historical area identifier of a first historical area.
[0141] In some implementations, the area identifier of the area occupied by the first account is 100, and the area identifier of the area occupied by the second account is 200. Based on the first historical area identifier 100, the target area identifier of the first target area is determined to be 100.
[0142] In step S105, texture coordinates of pixels in a processing area corresponding to the first target area are obtained; the processing area is a regular area surrounding the first target area.
[0143] Optionally, the processing area is determined based on the first target area, and the processing area is a regular area surrounding the first target area. The regular area may be a polygonal area such as a rectangle, a pentagon, or a hexagon.
[0144] In a possible embodiment, the processing area is specifically set to a rectangular area whose size is adapted to the first target area. Specifically, an AABB bounding box is created through the four vertices of the first target area, the top, bottom, left, and right, and the length and width of the AABB bounding box are respectively parallel to the two coordinate axes of the texture coordinates.
[0145] By creating an AABB bounding box and a processing area, it is convenient to exclude interfering pixels outside the processing area when calculating the target pixel later, which effectively reduces the amount of calculation and improves the calculation efficiency.
[0146] Optionally, when the first target area itself is a rectangular area, the processing area only includes target pixels inside the first target area, and when the first target area is not a rectangular area, the processing area also includes non-target pixels outside the first target area.
[0147] Figure 4is a flow chart showing a method for determining texture coordinates of pixels in a processing area according to an exemplary embodiment. Figure 4 As shown, in some embodiments, when the processing area includes target pixels and non-target pixels, step S105 of obtaining texture coordinates of pixels in the processing area corresponding to the first target area includes:
[0148] In step S1051, the rendering texture of the virtual map is obtained.
[0149] For a 160km*160km virtual map, one pixel is used to cover a range of 250m*250m, that is, 640*640 pixels, and each pixel has its own texture coordinates.
[0150] In step S1053 , the texture coordinates of each target pixel in the first target area are determined according to the rendering texture of the virtual map.
[0151] The virtual map includes a first newly added area and a selected area, that is, the current area of the first account is part of the virtual map, so the texture coordinates of each target pixel in the first target area can be determined by using the rendering texture of the virtual map.
[0152] In step S1055 , a processing area of the first target area is determined based on the texture coordinates of each target pixel.
[0153] Optionally, after obtaining the texture coordinates of each target pixel in the first target area, the u value and v value of each target pixel can be compared to obtain the upper, lower, left and right vertices of the first target area, and the AABB bounding box mentioned above is established based on the four vertices to determine the processing area of the first target area.
[0154] In step S1057 , the texture coordinates of each non-target pixel in the processing area are determined according to the rendering texture of the virtual map.
[0155] Optionally, the texture coordinates of each non-target pixel in the processing area and outside the first target area may be determined according to the rendering texture of the virtual map.
[0156] In step S1059 , based on the texture coordinates of each target pixel and the texture coordinates of each non-target pixel, the texture coordinates of the pixels in the processing area are determined.
[0157] The texture coordinates of each target pixel and the texture coordinates of each non-target pixel constitute the texture coordinates of the pixels in the processing area. By determining the texture coordinates of each pixel, the distance between pixels can be calculated, which facilitates the calculation of subsequent finite distance field information.
[0158] In step S107, texture information of each target pixel in the first target area is determined based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel.
[0159] The texture information of a pixel consists of two parts: the texture identifier of the pixel and the texture coordinates of the boundary pixel corresponding to the pixel. The boundary pixel corresponding to the pixel is the boundary pixel closest to the pixel, and the distance between the pixel and the boundary pixel is the distance from the pixel to the boundary, that is, the signed distance field information of the pixel.
[0160] The texture ID of the pixel is saved in the R channel of the rendering texture, and the texture coordinates of the boundary pixel closest to the pixel are saved in the GB channel of the rendering texture. In the subsequent SDF calculation process, the relevant data can be read directly from the three RGB channels of the pixel. No additional memory or calculation is required to obtain this information, which can speed up the distance calculation. Storing related data in a texture can reduce multiple accesses to the memory, thereby improving performance.
[0161] In some implementations, step S107 determines the texture information of each target pixel in the first target area based on the target area identifier and the texture coordinates of the pixels in the processing area, including:
[0162] Determine the target region identifier as a texture identifier for each target pixel;
[0163] Determine the texture coordinates of the boundary pixels corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel and the texture coordinates of each non-target pixel;
[0164] The texture information of each target pixel is determined based on the texture coordinates and texture identifier of the boundary pixel corresponding to each target pixel.
[0165] In a possible embodiment, the specific steps of determining the target area identifier as the texture identifier of each target pixel include: triangulating the first target area to obtain a triangular mesh of the first target area, rendering the territory mesh to a rendering texture, and the initial three channel values of each pixel on the rendering texture are (-1, -1, -1), and the value of the target pixel rendered to the triangular mesh is (target area identifier, -1, -1), which is specifically (100, -1, -1) in the embodiment of the present application.
[0166] Next, the values of the three channels of the non-target pixels are initialized to (-1, PixelX, PixelY), where (PixelX, PixelY) is the texture coordinate of the non-target pixel. For the target pixel, (target region identifier, -1, -1) remains unchanged.
[0167] Then, according to the texture identifier stored in the R channel, the texture coordinates of each target pixel and the texture coordinates of each non-target pixel, the boundary pixel corresponding to each target pixel is determined in the non-target pixel, and its texture coordinates are stored in the GB channel of the target pixel, and finally the texture information of each target pixel is determined. The distance from the target pixel to the first target boundary can be calculated according to the texture coordinates of the target pixel and the texture coordinates of the boundary pixel stored in the GB channel, thereby obtaining the directed distance field information.
[0168] The texture identifier saved in the R channel can be used to easily distinguish target pixels from non-target pixels: if the R channel of a pixel is -1, the pixel is a non-target pixel; if the R channel of a pixel is greater than 0, the pixel is a target pixel that needs to be calculated, and subsequent operations no longer need to determine the positional relationship between the pixel and the first target area, which saves a lot of calculation time and improves calculation efficiency.
[0169] Figure 5 is a schematic diagram showing a method for determining texture coordinates of boundary pixels corresponding to each target pixel according to an exemplary embodiment. Figure 5 As shown, in some embodiments, after determining the texture identifier of the target pixel, determining the texture coordinates of the boundary pixel corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel and the texture coordinates of each non-target pixel includes:
[0170] For each target pixel, perform:
[0171] In step S201, the target pixel currently being executed is regarded as the current pixel.
[0172] In step S203, the texture coordinates of the first position type pixel corresponding to the current pixel are obtained.
[0173] Optionally, the first position type pixel is a pixel having a preset number of first preset steps in a preset direction of the current pixel and located within the processing area.
[0174] In step S205, the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel.
[0175] In a possible embodiment, the step size is continuously reduced, and the texture coordinates of the boundary pixel corresponding to the current pixel are iteratively calculated based on the texture coordinates of the first position type pixel corresponding to the current pixel.
[0176] Optionally, if the first preset step size is greater than the preset step size threshold, the texture coordinates of the second position type pixel corresponding to the current pixel are obtained, the texture coordinates of the second position type pixel are determined as the texture coordinates of the first position type pixel, and based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel, the texture coordinates of the boundary pixel corresponding to the current pixel are determined.
[0177] Optionally, if the first preset step size is less than or equal to a preset step size threshold, the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel.
[0178] The second position type pixel is a pixel with a preset number of second preset steps in the preset direction of the current pixel and located in the processing area, and the first preset step is twice the second preset step. The preset step includes a preset width step and a preset height step, the preset width step is determined based on the width of the rendering texture, and the preset height step is determined based on the height of the rendering texture.
[0179] Optionally, the preset step length threshold is specifically 1.5, which is used to determine whether the step length iteration is completed.
[0180] Taking a 512*512 rendering texture as an example, during the first iterative calculation, the first preset step size is 256, the preset number is 8 surrounding pixels, and the preset directions are 8 directions of the current pixel, namely, up, down, left, right, upper left, lower left, upper right, and lower right; during the second iterative calculation, the second preset step size is 128, the preset number is still 8 surrounding pixels, and the preset directions are still 8 directions of the current pixel, namely, up, down, left, right, upper left, lower left, upper right, and lower right, and so on, until the preset step sizes of width and height are iterated to less than 1.5.
[0181] Next, the first position type pixels are determined among the 8 pixels around the current pixel, that is, the pixels of the 8 pixels in the processing area are the first position type pixels. For example, 2 of the 8 pixels around the current pixel are outside the rectangular processing area, and 6 are within the rectangular processing area, then the 6 pixels within the processing area are the first position type pixels. Among the 6 first position type pixels, the boundary pixel corresponding to the current pixel is determined according to the texture identifier and the texture coordinates of the current pixel, and then the directed distance field information is calculated.
[0182] Based on the texture coordinates of the boundary pixel corresponding to the current pixel, the texture coordinates of the boundary pixel corresponding to each target pixel are determined.
[0183] After the texture coordinates of the boundary pixels corresponding to each current pixel are determined and saved, the texture coordinates of the boundary pixels corresponding to each target pixel in the first target area can be obtained by aggregation.
[0184] In some implementations, step S205 determines the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel, including:
[0185] In step S2051, a first distance is determined based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel.
[0186] In a possible embodiment, when there is a target boundary pixel in the first position type pixel, the first distance is determined based on the texture coordinates of the current pixel and the texture coordinates of the target boundary pixel.
[0187] Optionally, the texture identifier of the current pixel is different from the texture identifier of the target boundary pixel.
[0188] In an embodiment of the present application, the target boundary pixel can be determined in the first position type pixel through the texture identifier saved on the R channel, and the distance between the target boundary pixel and the current pixel is used as the first distance.
[0189] For example, there are 2 target boundary pixels among 6 first position type pixels, specifically including: comparing the texture identifier saved on the R channel of the first position type pixel with the texture identifier 100 saved on the R channel of the current pixel, if the first position type pixel is located inside the first target area and is one of the target pixels, and the texture identifier saved on the R channel of the first position type pixel is also 100, then the texture identifier of the first position type pixel is the same as the texture identifier of the current pixel, and the first position type pixel is not a target boundary pixel; if the first position type pixel is located outside the first target area and is one of the non-target pixels, and the texture identifier saved on the R channel of the first position type pixel is -1, then the texture identifier of the first position type pixel is different from the texture identifier of the current pixel, and the first position type pixel is a target boundary pixel. Through the above method, 2 target boundary pixels can be determined among the 6 first position type pixels.
[0190] In a possible embodiment, for non-target boundary pixels in the first position type pixels, the first distance is calculated using the texture coordinates stored on the GB channel of the current pixel, that is, the target boundary pixels in the previous iteration maintain the result of this iteration.
[0191] In step S2053, a first target distance is determined in the first distance.
[0192] Optionally, the first distance includes a first target distance and a non-first target distance, and the first target distance is less than or equal to the non-first target distance. In other words, the first target distance is the shortest distance among the first distances.
[0193] In step S2055, based on the texture coordinates of the first position type pixels corresponding to the first target distance, determine the texture coordinates of the boundary pixels corresponding to the current pixel.
[0194] In a possible embodiment, save the texture coordinates of the first position type pixels corresponding to the shortest first target distance on the GB channels of the current pixel.
[0195] In the embodiment of the present application, in the first iterative calculation, the two target boundary pixels are the first target boundary pixel and the second target boundary pixel respectively. Calculate the distances between the first target boundary pixel and the second target boundary pixel and the current pixel, which are D1 and D2 respectively. Both D1 and D2 are the first distances. If D1 < D2 and D1 is the first target distance, then save the texture coordinates of the first target boundary pixel on the GB channels of the current pixel.
[0196] After multiple rounds of iterative calculations for each current pixel, the texture coordinates of the corresponding boundary pixels, that is, the texture coordinates of the boundary pixel closest to the current pixel, are saved on the GB channels of each current pixel.
[0197] Through the above skip calculation method, using texture identifiers, the interference of non-target area pixels and non-target boundary pixels is excluded, and the calculation amount of the texture information of each pixel is reduced.
[0198] In step S109, based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area, determine the signed distance field information of the first target area; the signed distance field information is used to render the boundary of the first target area.
[0199] In some embodiments, step S109 determining the signed distance field information of the first target area based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area includes:
[0200] In step S1091, based on the texture coordinates of each target pixel and the texture coordinates of the boundary pixels corresponding to each target pixel, determine the first target distance set.
[0201] In step S1093, determine the second target distance in the first target distance set.
[0202] Optionally, the first target distance set includes the second target distance and non-second target distances, and the second target distance is greater than or equal to the non-second target distances.
[0203] In step S1095, based on the first target distance and the second target distance, determine the signed distance field information of each target pixel.
[0204] In step S1097 , based on the signed distance field information of each target pixel, the signed distance field information of the first target area is determined.
[0205] Figure 6 is an updated directed distance field map according to an exemplary embodiment. Figure 6 As shown, in the embodiment of the present application, the largest second target distance in the first target distance set is first counted, the quotient obtained by dividing the first target distance by the second target distance is used as the directed distance field information of each target pixel, and a directed distance field map of the first target area is generated based on the directed distance field information of each target pixel. Through the above steps, the first target distance is normalized to ensure that the directed distance field information corresponding to each pixel is within the same range, which facilitates the generation of subsequent directed distance field maps.
[0206] In addition to the above-mentioned situation where the first account occupied the connected first newly added area and the to-be-selected area, there is another situation where the first account occupied a third newly added area independent of the to-be-selected area, and the third newly added area only contains one basic sub-area. At this time, the boundaries of the areas have not merged or changed, so the calculation can be skipped and the signed distance field information of the basic sub-area can be directly used to change the camp affiliation by changing the coloring.
[0207] Figure 7 is a flow chart of a target area processing method according to an exemplary embodiment (non-connected state), such as Figure 7 As shown, in some embodiments, when the second account in the historical period also includes a third newly added area, and the third newly added area belongs to the first account in the current period, the method further includes:
[0208] In step S301, if the third newly added area and the to-be-selected area are in a disconnected state, a second target area is determined based on the third newly added area.
[0209] Optionally, the third newly added area is used alone as the second target area.
[0210] In step S303, the directed distance field information of the second target area is determined according to the directed distance field information of the virtual map.
[0211] Specifically, the directed distance field information of the second target area is determined in the directed distance field information of the virtual map according to the basic sub-area identifier corresponding to the third newly added area.
[0212] In some implementations, before determining the directed distance field information of the second target area according to the directed distance field information of the virtual map, the method includes:
[0213] In step S302 , the directed distance field information of the virtual map is determined.
[0214] Optionally, the virtual map includes multiple basic sub-areas.
[0215] In some implementations, determining the directed distance field information of the virtual map includes:
[0216] For each base sub-region, execute:
[0217] In step S3021, the currently executed basic sub-region is regarded as the current sub-region.
[0218] In step S3023, the texture coordinates of the pixels in the processing area corresponding to the current sub-area are obtained.
[0219] In step S3025, texture information of each pixel in the current sub-region is determined based on the basic sub-region identifier of the current sub-region and the texture coordinates of the pixels in the processing region corresponding to the current sub-region.
[0220] In step S3027, based on the texture coordinates of the pixels in the processing area corresponding to the current sub-area and the texture information of each pixel in the base sub-area, the signed distance field information of the current sub-area is determined.
[0221] Based on the signed distance field information of each current sub-region, the signed distance field information of the virtual map is determined.
[0222] Figure 8 A single-region signed distance field map is shown according to an exemplary embodiment. Since the number and boundary shape of the basic sub-regions can be determined in the offline development stage of the game, a basic single-region signed distance field map can be generated for each basic sub-region in the offline development stage. Figure 8 As shown, unnecessary updated overhead of the signed distance field information can be avoided when the first account occupies a single independent basic sub-region during the game running stage, and the result of the single-region signed distance field is directly used, which greatly saves computing resources.
[0223] In a possible embodiment, the process of calculating the signed distance field information of each basic sub-region in the offline development stage is the same as the process of calculating the signed distance field information of the connected first target region in the game running stage, which will not be described in detail here.
[0224] Through the above-mentioned signed distance field calculation method, since the calculation of the signed distance field information of each target pixel disclosed in the present invention does not depend on the calculation results of other pixels, multiple target areas can be calculated in parallel. For example, the first account has captured two connected areas this time, or after each battle, the territory ranges of the first account and the second account will change accordingly. Therefore, by using parallel calculation to locally update the SDF of the two areas respectively, better calculation efficiency can be obtained.
[0225] Since many functions in the GPU's Computer Shader (compute shader) have compatibility issues on mobile devices, in order to avoid the mobile compatibility issues caused by the use of Computer Shader parallel computing, the present disclosure uses JobsSystem and Burst (a high-performance compilation technology of Unity) to perform parallel computing on the CPU side to obtain the best computing efficiency. By making full use of the characteristics of multi-threaded background computing, it avoids calling Job.Complete() (a method that forces one or more jobs to complete their execution) to force all jobs to complete, but polls all initiated jobs in each Update to see if they have been completed. When all area calculations in the virtual map are completed, the calculated directed distance field information results are updated to the GPU to avoid unnecessary waiting. The execution of jobs can be effectively managed and monitored without blocking the main thread, reducing performance loss.
[0226] Furthermore, since the present invention only uses three float16 (half-precision floating point) variables to record the texture coordinates of the target pixel, which are recorded respectively on the three RGB channels of the rendering texture, and only uses one rendering texture for in-situ calculation, compared with the prior art that uses the four RGBA channels of multiple rendering textures to store data and perform ping-pong calculations, it avoids the large bandwidth overhead caused by a large number of read and write accesses to multiple rendering textures, which is prone to problems such as overheating, frequency reduction, and rapid power loss on the mobile terminal.
[0227] In step S1010 , a boundary of the first target area is rendered based on the signed distance field information of the first target area.
[0228] In a possible embodiment, based on the signed distance field information of the first target area, the step of rendering the boundary of the first target area includes: assigning colors to target pixels based on the signed distance field information to render the boundary of the first target area.
[0229] Taking the first target area of the first account being dyed green as an example, the pixels closest to the boundary can be dyed dark green, and the pixels slightly farther from the boundary can be dyed light green, ultimately achieving a gradient effect from dark to light from the boundary to the middle of the area, so as to clearly distinguish the boundary of the first target area.
[0230] Optionally, the first newly added area and the to-be-selected area are presented at a first scale.
[0231] In SLG games, there are usually two perspectives: sandbox and big world. The sandbox perspective is a perspective from above, similar to the perspective of a toy sandbox or map, which can show the layout and structure of the entire virtual map. The big world perspective is a perspective that shows the virtual world from a more macro perspective, allowing gamers to move freely in a larger space, and can show the details of the world, including terrain changes, buildings, and ecosystems.
[0232] The sand table perspective is presented at a first scale, for example, the scale of the first scale is 1:2000.
[0233] Fig. 9 is a flowchart of a method for rendering a target area boundary according to an exemplary embodiment. Fig. 9 As shown, in some embodiments, when the first account in the historical period also includes the second historical area, the second account in the historical period also includes the fourth newly added area, and the fourth newly added area belongs to the first account in the current period, the target area processing method includes:
[0234] In step S401, current field of view information and historical field of view information are obtained.
[0235] Optionally, the second historical area and the fourth newly added area are presented at a second scale. The scale of the second scale is larger than the scale of the first scale, for example, the scale of the second scale is 1:20.
[0236] Optionally, the current field of view information and the historical field of view information are field of view information at different time periods under the main viewing angle, such as the current frame and the previous frame of the main camera.
[0237] In step S403, if the current field of view information and the historical field of view information indicate that the field of view of the main perspective has changed, a third target area is determined based on the second historical area and the fourth newly added area.
[0238] In a possible embodiment, the current field of view information and the historical field of view information of the main camera indicate that the field of view of the main perspective has changed, that is, when the main camera moves, it is necessary to clear the color buffer and restart rendering the boundary of the current territory. At this time, the sum of the second historical area and the fourth newly added area constitutes the third target area to be rendered.
[0239] In step S405, based on the third target area and the current field of view information, a rendering texture under the top viewing angle is obtained.
[0240] In some implementations, step S405 obtains a rendering texture at a top viewing angle based on the third target area and the current field of view information, including:
[0241] In step S4051, based on the current field of view information, the rendering range of the top perspective is determined.
[0242] In step S4053, based on the rendering range of the top viewing angle and the third target area, a rendering texture under the top viewing angle is acquired.
[0243] Based on the current field of view information of the main camera, the rendering range of the top camera is determined, so that the rendering range of the top camera needs to strictly fit the field of view of the main camera to fully utilize every pixel on the rendering texture under the top perspective, avoiding the phenomenon that the rendering texture under the top perspective occupies a large amount of bandwidth when the resolution is large or the resolution is too small and significant jagged edges appear.
[0244] Specifically, based on the rendering range of the top viewing angle and the third target area, the step of obtaining the rendering texture under the top viewing angle includes: obtaining the outer polygon boundary of the third target area, retracting the outer polygon boundary by a preset width to obtain an inner polygon, triangulating the area between the outer polygon and the inner polygon to obtain a triangular mesh with the polygon retracted, rendering the triangular mesh with the polygon retracted to the rendering texture of the top camera, and finally obtaining the rendering texture under the top viewing angle.
[0245] In step S407, based on the rendering texture at the top viewing angle, the boundary of the third target area at the main viewing angle is rendered.
[0246] Fig.10 is a schematic diagram showing an anti-aliasing effect according to an exemplary embodiment, referring to Fig.10 When rendering the undulating terrain such as mountains and stones in the big world, the boundary line in the box samples the rendering texture under the top perspective and renders the boundary of the third target area under the main perspective to make the boundary line fit the terrain and avoid the boundary of the dyed area being blocked by the undulating terrain.
[0247] In some implementations, after step S401 obtains the current field of view information and the historical field of view information, the process further includes:
[0248] In step S402, if the current field of view information and the historical field of view information indicate that the field of view of the main view is in a static state, a first projection matrix of the main view is obtained.
[0249] In step S404, jitter information is added to the projection matrix to obtain a second projection matrix.
[0250] In step S406 , pixels around the boundary of the third target region are rasterized based on the second projection matrix to obtain the boundary of the third target region.
[0251] Reference Fig.10For the boundary line in the box, when the main camera is stationary, a slight jitter is added to the projection matrix of the main camera in the subsequent frames, and the pixels around the boundary of the third target area are rasterized, so that the pixels next to the jagged boundary pixels are also filled with color, presenting a smooth boundary of the third target area as a whole.
[0252] The method of the disclosed embodiment no longer samples the rendering result of the previous frame, but uses AlphaAdd (a synthesis mode) to directly superimpose it on the current rendering texture. Therefore, PrevColorBuffer (the color buffer of the previous frame) is no longer required, and because anti-aliasing calculation is only started when the main camera is stationary, this solution does not require MotionVectorBuffer (motion vector buffer), which greatly reduces the bandwidth overhead, and due to the amount of rendering calculation per frame and the non-use of anti-aliasing, almost no additional performance overhead is introduced.
[0253] In the disclosed embodiment, if the first newly added area and the to-be-selected area of the first account are in a connected state in the current period, the first target area is determined based on the to-be-selected area and the first newly added area; the to-be-selected area includes the first historical area or the second newly added area; the target area identifier of the first target area is determined based on the first historical area identifier of the first historical area; the texture coordinates of the pixels in the processing area corresponding to the first target area are obtained; the processing area is a regular area surrounding the first target area; the texture information of each target pixel in the first target area is determined based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel; the signed distance field information of the first target area is determined based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area; the signed distance field information is used to render the boundary of the first target area. Thus, the signed distance field information of the area is updated only in a targeted manner according to the connected state between the areas, and the area identifier is used to represent the belonging relationship between the area and the pixel, so as to facilitate the calculation of the texture information and the signed distance field information of the target pixel, and the calculation of each pixel is independent of each other, so as to realize efficient multi-threaded parallel calculation.
[0254] In addition, the disclosed embodiments provide a complete set of processing solutions for the target area based on the game engine, including methods for determining boundaries, boundary pixels, SDF, and boundary coloring methods for the target area. Efficient SDF generation can be achieved under multi-threaded parallel computing, and efficient parallel computing can be performed on the CPU side, avoiding mobile GPU compatibility issues and memory overhead. A strategy for local updates of connected parts enables the boundary coloring of the target area to be efficiently and dynamically updated during the game running phase.
[0255] At the same time, the processing scheme of the embodiment of the present disclosure also includes anti-aliasing and boundary-applying solutions, which do not rely on the motion vector buffer and the color buffer of the previous frame, and achieve excellent anti-aliasing effects while maintaining high performance, further improving the picture quality. In addition, according to the different requirements of the sandbox perspective and the big world perspective, the coloring scheme based on SDF and polygon inward is adopted respectively to achieve the best display effect and computing performance.
[0256] Fig.11 is a block diagram of a target area processing device according to an exemplary embodiment. It has the function of implementing the data processing method in the above method embodiment, and the function can be implemented by hardware or by hardware executing corresponding software. Fig.11 , the device includes a first determination module 510, a second determination module 520, an acquisition module 530, a third determination module 540 and a fourth determination module 550:
[0257] The first determination module 510 is configured to determine the first target area based on the to-be-selected area and the first newly added area if the first newly added area and the to-be-selected area of the first account are in a connected state during the current period; the to-be-selected area includes the first historical area or the second newly added area;
[0258] The second determination module 520 is configured to determine the target area identifier of the first target area based on the first historical area identifier of the first historical area;
[0259] The acquisition module 530 is configured to acquire texture coordinates of pixels in a processing area corresponding to the first target area; the processing area is a regular area surrounding the first target area;
[0260] The third determination module 540 is configured to determine the texture information of each target pixel in the first target area based on the target area identification and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel;
[0261] The fourth determination module 550 is configured to determine the signed distance field information of the first target area based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area; the signed distance field information is used to render the boundary of the first target area.
[0262] In some implementations, the first newly added area, the second newly added area, and the first historical area each include at least one basic sub-area; the at least one basic sub-area respectively has a corresponding basic sub-area identifier; and the first determination module 710 is further configured to execute:
[0263] If the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the first historical region indicate that the first newly added region and the first historical region are in a connected state, determining the first target region based on the first newly added region and the first historical region; or;
[0264] If the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the second newly added region indicate that the first newly added region and the second newly added region are in a connected state, a first target region is determined based on the first newly added region and the second newly added region.
[0265] In some implementations, the third determination module 540 is further configured to execute:
[0266] Get the rendering texture of the virtual map;
[0267] Determine the texture coordinates of each target pixel in the first target area according to the rendering texture of the virtual map; the virtual map includes the first newly added area and the area to be selected;
[0268] Determining a processing region of the first target region based on the texture coordinates of each target pixel;
[0269] Determining texture coordinates of each non-target pixel in the processing area based on the rendered texture of the virtual map;
[0270] Based on the texture coordinates of each target pixel and the texture coordinates of each non-target pixel, texture coordinates of pixels in the processing area are determined.
[0271] In some implementations, the third determination module 540 is further configured to execute:
[0272] Determine the target region identifier as a texture identifier for each target pixel;
[0273] Determine the texture coordinates of the boundary pixels corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel and the texture coordinates of each non-target pixel;
[0274] The texture information of each target pixel is determined based on the texture coordinates and texture identifier of the boundary pixel corresponding to each target pixel.
[0275] In some implementations, the third determination module 540 is further configured to execute:
[0276] For each target pixel, perform:
[0277] The currently executed target pixel is regarded as the current pixel;
[0278] Acquire texture coordinates of pixels of a first position type corresponding to the current pixel; the pixels of the first position type are pixels of a preset number of first preset steps in a preset direction of the current pixel and located within the processing area;
[0279] Determine the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel;
[0280] Based on the texture coordinates of the boundary pixel corresponding to the current pixel, the texture coordinates of the boundary pixel corresponding to each target pixel are determined.
[0281] In some implementations, the third determination module 540 is further configured to execute:
[0282] If the first preset step length is greater than the preset step length threshold, the texture coordinates of the second position type pixel corresponding to the current pixel are obtained, the texture coordinates of the second position type pixel are determined as the texture coordinates of the first position type pixel, and the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel; the second position type pixel is a pixel with a preset number of the second preset step length in the preset direction of the current pixel and is located in the processing area, and the first preset step length is twice the second preset step length; or;
[0283] If the first preset step length is less than or equal to the preset step length threshold, the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel.
[0284] In some implementations, the third determination module 540 is further configured to execute:
[0285] Determining a first distance based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel;
[0286] Determine a first target distance in the first distance; the first distance includes the first target distance and the non-first target distance, and the first target distance is less than or equal to the non-first target distance;
[0287] The texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture coordinates of the pixel of the first position type corresponding to the first target distance.
[0288] In some implementations, the third determination module 540 is further configured to execute:
[0289] In the case where there is a target boundary pixel in the first position type pixel, determining a first distance based on the texture coordinates of the current pixel and the texture coordinates of the target boundary pixel;
[0290] The texture ID of the current pixel is different from the texture ID of the target boundary pixel.
[0291] In some implementations, the fourth determination module 550 is further configured to execute:
[0292] Determining a first target distance set based on the texture coordinates of each target pixel and the texture coordinates of the boundary pixel corresponding to each target pixel;
[0293] Determining a second target distance in a first target distance set; the first target distance set includes a second target distance and a non-second target distance, and the second target distance is greater than or equal to the non-second target distance;
[0294] Determine the directed distance field information of each target pixel based on the first target distance and the second target distance;
[0295] Based on the signed distance field information of each target pixel, the signed distance field information of the first target area is determined.
[0296] In some implementations, the first newly added area and the second newly added area are areas corresponding to the second account in the historical period.
[0297] In some implementations, when the second account in the historical period also includes a third newly added area, and the third newly added area belongs to the first account in the current period, the device further includes:
[0298] A fifth determination module is configured to determine a second target area based on the third newly added area if the third newly added area and the to-be-selected area are in a disconnected state;
[0299] The sixth determining module is configured to determine the directed distance field information of the second target area according to the directed distance field information of the virtual map.
[0300] In some embodiments, the device further comprises:
[0301] A seventh determination module is configured to determine the directed distance field information of the virtual map; the virtual map includes a plurality of basic sub-areas;
[0302] The seventh determination module is further configured to execute:
[0303] For each base sub-region, execute:
[0304] Treat the currently executing base sub-region as the current sub-region;
[0305] Get the texture coordinates of the pixels in the processing area corresponding to the current sub-area;
[0306] Determine texture information of each pixel in the current sub-region based on a basic sub-region identifier of the current sub-region and texture coordinates of pixels in a processing region corresponding to the current sub-region;
[0307] Determine the signed distance field information of the current sub-region based on the texture coordinates of the pixels in the processing region corresponding to the current sub-region and the texture information of each pixel in the base sub-region;
[0308] Based on the signed distance field information of each current sub-region, the signed distance field information of the virtual map is determined.
[0309] In some embodiments, the device further comprises:
[0310] A first rendering module is configured to render a boundary of the first target area based on the signed distance field information of the first target area;
[0311] The first newly added area and the to-be-selected area are presented at a first scale.
[0312] In some implementations, when the first account in the historical period also includes a second historical area, the second account in the historical period also includes a fourth newly added area, and the fourth newly added area belongs to the first account in the current period, the device further includes:
[0313] The first acquisition module is configured to execute acquisition of current visual field information and historical visual field information; the second historical area and the fourth newly added area are presented at a second scale; the scale of the second scale is greater than the scale of the first scale; the current visual field information and the historical visual field information are visual field information at different time periods under the main viewing angle;
[0314] An eighth determination module is configured to determine a third target area based on the second historical area and the fourth newly added area if the current field of view information and the historical field of view information indicate that the field of view of the main perspective has changed;
[0315] A second acquisition module is configured to acquire a rendering texture under a top viewing angle based on the third target area and the current field of view information;
[0316] The second rendering module is configured to render a boundary of a third target area under the main viewing angle based on the rendering texture under the top viewing angle.
[0317] In some embodiments, the device further comprises:
[0318] A third acquisition module is configured to acquire a first projection matrix of the main perspective if the current perspective information and the historical perspective information indicate that the perspective of the main perspective is in a static state;
[0319] A fourth acquisition module is configured to add jitter information to the projection matrix to acquire a second projection matrix;
[0320] The third rendering module is configured to rasterize pixels around a boundary of the third target area based on the second projection matrix to obtain a boundary of the third target area.
[0321] In some implementations, the second acquisition module is further configured to execute:
[0322] Based on the current field of view information, determine the rendering range of the top perspective;
[0323] Based on the rendering range of the top viewing angle and the third target area, a rendering texture under the top viewing angle is obtained.
[0324] Regarding the device in the above embodiment, the specific method and beneficial effects of each step have been described in detail in the embodiment of the aforementioned method, and will not be elaborated here.
[0325] Fig.12 is a block diagram of an electronic device according to an exemplary embodiment. Fig.12 The electronic device includes a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps of any target area processing method in the above-mentioned embodiment when executing the instructions stored in the memory.
[0326] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Fig.12 6 is a block diagram of an electronic device for a target area processing method according to an exemplary embodiment. The electronic device 600 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 610 (the processor 610 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 630 for storing data, and one or more storage media 620 (such as one or more mass storage devices) for storing application programs 623 or data 622. Among them, the memory 630 and the storage medium 620 may be short-term storage or permanent storage. The program stored in the storage medium 620 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Furthermore, the central processing unit 610 may be configured to communicate with the storage medium 620 to execute a series of instruction operations in the storage medium 620 on the electronic device 600.
[0327] The electronic device 600 may also include one or more power supplies 660, one or more wired or wireless network interfaces 650, one or more input and output interfaces 640, and / or one or more operating systems 621, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
[0328] The input / output interface 640 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the electronic device 600. In one example, the input / output interface 640 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In an exemplary embodiment, the input / output interface 640 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0329] It can be understood by those skilled in the art that Fig.12 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.12 More or fewer components as shown, or with Fig.12 Different configurations are shown.
[0330] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of the electronic device 600 to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0331] In an exemplary embodiment, a computer storage medium is also provided. When instructions in the computer storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the method provided in any one of the above embodiments.
[0332] In an exemplary embodiment, a computer program product is also provided, the computer program product including a computer program / instruction, and the computer program / instruction is executed by a processor to implement the method provided in any of the above embodiments. Optionally, the computer program is stored in a computer-readable storage medium. The processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device performs the method provided in any of the above embodiments.
[0333] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0334] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0335] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A target area processing method, characterized in that: include: If, in the current time period, the first newly added area and the to-be-selected area of the first account are in a connected state, determining a first target area based on the to-be-selected area and the first newly added area; The selected area includes the first historical area or the second newly added area; determining a target area identifier of the first target area based on a first historical area identifier of the first historical area; Acquire texture coordinates of pixels in a processing area corresponding to the first target area; the processing area is a regular area surrounding the first target area; Determine texture information of each target pixel in the first target area based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes the texture coordinates of the boundary pixels corresponding to each target pixel; Based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area, the signed distance field information of the first target area is determined; and the signed distance field information is used to render the boundary of the first target area.
2. The method according to claim 1, characterized in that The first newly added area, the second newly added area and the first historical area each include at least one basic sub-area; the at least one basic sub-area respectively has a corresponding basic sub-area identifier; If the first newly added area and the to-be-selected area of the first account are in a connected state during the current period, determining the first target area based on the to-be-selected area and the first newly added area includes: If the basic sub-region identifier of the first newly added region and the basic sub-region identifier of the first historical region indicate that the first newly added region and the first historical region are in a connected state, determining the first target region based on the first newly added region and the first historical region; or; If the basic sub-area identifier of the first newly added area and the basic sub-area identifier of the second newly added area indicate that the first newly added area and the second newly added area are in a connected state, the first target area is determined based on the first newly added area and the second newly added area.
3. The method according to claim 1, characterized in that When the processing area includes non-target pixels outside the first target area, acquiring texture coordinates of pixels in the processing area corresponding to the first target area includes: Get the rendering texture of the virtual map; Determine the texture coordinates of each target pixel in the first target area according to the rendering texture of the virtual map; the virtual map includes the first newly added area and the to-be-selected area; Determining a processing area of the first target area based on the texture coordinates of each target pixel; Determining texture coordinates of each non-target pixel in the processing area according to the rendered texture of the virtual map; The texture coordinates of the pixels in the processing area are determined based on the texture coordinates of each target pixel and the texture coordinates of each non-target pixel.
4. The method according to claim 3, characterized in that The step of determining texture information of each target pixel in the first target area based on the target area identifier and the texture coordinates of the pixels in the processing area includes: Determine the target area identifier as a texture identifier of each target pixel; Determine the texture coordinates of the boundary pixels corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel and the texture coordinates of each non-target pixel; The texture information of each target pixel is determined based on the texture coordinates of the boundary pixel corresponding to each target pixel and the texture identifier.
5. The method according to any one of claim 4, characterized in that: The step of determining the texture coordinates of the boundary pixels corresponding to each target pixel based on the texture identifier, the texture coordinates of each target pixel, and the texture coordinates of each non-target pixel includes: For each target pixel, execute: The target pixel currently being executed is regarded as the current pixel; Acquire texture coordinates of pixels of a first position type corresponding to the current pixel; the pixels of the first position type are pixels of a preset number of first preset steps in a preset direction of the current pixel and located within the processing area; Determine the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel; Based on the texture coordinates of the boundary pixel corresponding to the current pixel, the texture coordinates of the boundary pixel corresponding to each target pixel are determined.
6. The method according to claim 5, characterized in that The step of determining the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel includes: If the first preset step length is greater than a preset step length threshold, the texture coordinates of the second position type pixel corresponding to the current pixel are obtained, the texture coordinates of the second position type pixel are determined as the texture coordinates of the first position type pixel, and the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel; the second position type pixel is the preset number of pixels of the second preset step length in the preset direction of the current pixel and is located within the processing area, and the first preset step length is twice the second preset step length; or; If the first preset step size is less than or equal to the preset step size threshold, the texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel.
7. The method according to claim 5 or 6, characterized in that: The step of determining the texture coordinates of the boundary pixel corresponding to the current pixel based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel includes: Determining a first distance based on the texture identifier, the texture coordinates of the first position type pixel, and the texture coordinates of the current pixel; Determine a first target distance in the first distance; the first distance includes the first target distance and a non-first target distance, and the first target distance is less than or equal to the non-first target distance; The texture coordinates of the boundary pixel corresponding to the current pixel are determined based on the texture coordinates of the pixel of the first position type corresponding to the first target distance.
8. The method according to claim 7, characterized in that The determining of the first distance based on the texture identifier, the texture coordinates of the first position type pixel and the texture coordinates of the current pixel comprises: In a case where there is a target boundary pixel in the first position type pixel, determining the first distance based on the texture coordinates of the current pixel and the texture coordinates of the target boundary pixel; The texture identifier of the current pixel is different from the texture identifier of the target boundary pixel.
9. The method according to claim 8, characterized in that The determining the signed distance field information of the first target area based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area comprises: Determining a first target distance set based on the texture coordinates of each target pixel and the texture coordinates of the boundary pixel corresponding to each target pixel; Determining a second target distance in the first target distance set; the first target distance set includes the second target distance and a non-second target distance, and the second target distance is greater than or equal to the non-second target distance; Determining the directed distance field information of each target pixel based on the first target distance and the second target distance; Based on the signed distance field information of each target pixel, the signed distance field information of the first target area is determined.
10. The method according to claim 1, characterized in that The first newly added area and the second newly added area are areas corresponding to the second account in a historical period.
11. The method according to claim 1, characterized in that: When the second account in the historical period further includes a third newly added area, and the third newly added area belongs to the first account in the current period, the method further includes: If the third newly added area and the to-be-selected area are in a disconnected state, determining a second target area based on the third newly added area; The directed distance field information of the second target area is determined according to the directed distance field information of the virtual map.
12. The method according to claim 11, characterized in that Before determining the directed distance field information of the second target area according to the directed distance field information of the virtual map, the method further includes: Determining directed distance field information of the virtual map; the virtual map includes the plurality of basic sub-areas; The determining the directed distance field information of the virtual map includes: For each of the basic sub-regions, execute: Taking the currently executed basic sub-region as the current sub-region; Obtaining texture coordinates of pixels in a processing area corresponding to the current sub-area; Determine texture information of each pixel in the current sub-region based on a basic sub-region identifier of the current sub-region and texture coordinates of pixels in a processing region corresponding to the current sub-region; Determine the signed distance field information of the current sub-region based on the texture coordinates of the pixels in the processing region corresponding to the current sub-region and the texture information of each pixel in the basic sub-region; Based on the signed distance field information of each current sub-region, the signed distance field information of the virtual map is determined.
13. The method according to any one of claims 1, characterized in that: The method further comprises: Rendering a boundary of the first target area based on the signed distance field information of the first target area; The first newly added area and the to-be-selected area are presented at a first scale.
14. The method according to claim 13, characterized in that When the first account in the historical period further includes a second historical area, the second account in the historical period further includes a fourth newly added area, and the fourth newly added area belongs to the first account in the current period, the method further includes: Acquire current visual field information and historical visual field information; the second historical area and the fourth newly added area are presented at a second scale; the scale of the second scale is greater than the scale of the first scale; the current visual field information and the historical visual field information are visual field information at different time periods under a main viewing angle; If the current field of view information and the historical field of view information indicate that the field of view of the primary perspective has changed, determining the third target area based on the second historical area and the fourth newly added area; Based on the third target area and the current field of view information, acquiring a rendering texture under a top viewing angle; Based on the rendering texture at the top viewing angle, a boundary of the third target area at the main viewing angle is rendered.
15. The method according to claim 14, characterized in that After obtaining the current field of view information and the historical field of view information, the method further includes: If the current field of view information and the historical field of view information indicate that the field of view of the main view is in a static state, obtaining a first projection matrix of the main view; Adding jitter information to the projection matrix to obtain a second projection matrix; Pixels around the boundary of the third target area are rasterized based on the second projection matrix to obtain the boundary of the third target area.
16. The method according to claim 14, characterized in that The acquiring, based on the third target area and the current field of view information, a rendering texture under a top viewing angle includes: Based on the current field of view information, determining a rendering range of the top viewing angle; Based on the rendering range of the top viewing angle and the third target area, a rendering texture under the top viewing angle is acquired.
17. A target area processing device, characterized in that: include: A first determination module is configured to determine a first target area based on the to-be-selected area and the first newly added area if the first newly added area and the to-be-selected area of the first account are in a connected state during a current period; The selected area includes the first historical area or the second newly added area; A second determining module is configured to determine a target area identifier of the first target area based on a first historical area identifier of the first historical area; An acquisition module is configured to acquire texture coordinates of pixels in a processing area corresponding to the first target area; the processing area is a regular area surrounding the first target area; A third determination module is configured to determine texture information of each target pixel in the first target area based on the target area identifier and the texture coordinates of the pixels in the processing area; the texture information includes texture coordinates of boundary pixels corresponding to each target pixel; The fourth determination module is configured to determine the signed distance field information of the first target area based on the texture coordinates of the pixels in the processing area and the texture information of the pixels in the first target area; the signed distance field information is used to render the boundary of the first target area.
18. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the target area processing method according to any one of claims 1 to 16.
19. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the target area processing method according to any one of claims 1 to 16.