Game scene rendering method, device, electronic device and storage medium

By dividing the reachable area grid in the game scene and determining the subscenes visible to the target virtual character, the problem of large rendering performance overhead in the open-world game scene is solved, and efficient game scene rendering is achieved.

CN113952720BActive Publication Date: 2025-05-27NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111243154.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-05-27
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

In open-world game scenarios, complex object models and wide range of sight lead to huge overhead in game scene rendering performance, and the prior art is difficult to effectively reduce this overhead.

Method used

By dividing multiple reachable area grids in the game scene and determining the target area grid where the target virtual character is located, the association relationship between each reachable area grid and the corresponding visible subscene is obtained, and only the target visible subscene visible to the target virtual character is loaded and rendered.

Benefits of technology

It reduces the performance overhead of electronic devices, improves the efficiency of game scene rendering, avoids rendering invisible game subscenes, and thus improves game performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113952720B_ABST
    Figure CN113952720B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a game scene rendering method, apparatus, electronic device, and storage medium. The method includes: determining, in multiple reachable area grids of a game scene, a target area grid where a target virtual character is located in the game scene, and the area included in the reachable area grid is the area that the target virtual character can reach in the game scene; obtaining the association relationship between each reachable area grid and the corresponding visible sub-scene, where the visible sub-scene includes the game sub-scene visible to the target virtual character in the reachable area grid, and the game sub-scene includes the scene divided based on the game scene; determining the target visible sub-scene corresponding to the target virtual character being located in the target area grid based on the association relationship; loading the target visible sub-scene, and performing rendering processing on the current game interface based on the target visible sub-scene. Only partial sub-scenes are rendered in the game scene, reducing the performance overhead of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technologies, and particularly to a game scene rendering method, apparatus, electronic device, and storage medium. Background Art

[0002] In an open-world game scene, there are usually complex object models (such as tree models, wall models, etc.) that impede the straight movement of virtual characters. With the continuous development of game technologies, the scene details of games are becoming increasingly rich, the scene viewing distance is becoming increasingly wide, and the scene undulations are becoming increasingly severe. The game scenes to be rendered in the game interface are becoming more and more complex. If all the scenes and object models in the open-world game scene are rendered without culling, it will bring a very large performance overhead to the electronic device. Summary of the Invention

[0003] Embodiments of this application provide a game scene rendering method, apparatus, electronic device, and storage medium, which only render some sub-scenes in the game scene, reducing the performance overhead of the electronic device.

[0004] Embodiments of this application provide a game scene rendering method, including:

[0005] Among multiple reachable area grids of a game scene, determine a target area grid where a target virtual character is located in the game scene, and the area included in the reachable area grid is the area that the target virtual character can reach in the game scene;

[0006] Obtain the association relationship between each reachable area grid and the corresponding visible sub-scene, where the visible sub-scene includes the game sub-scene visible to the target virtual character in the reachable area grid, and the game sub-scene includes the scene divided based on the game scene;

[0007] Based on the association relationship, determine the target visible sub-scene corresponding to when the target virtual character is located in the target area grid;

[0008] Load the target visible sub-scene, and perform rendering processing on the current game interface based on the target visible sub-scene.

[0009] Correspondingly, embodiments of this application also provide a game scene rendering apparatus, including:

[0010] A first determination unit, configured to determine a target area grid where a target virtual character is located in the game scene among multiple reachable area grids of the game scene, and the area included in the reachable area grid is the area that the target virtual character can reach in the game scene;

[0011] An acquisition unit, configured to acquire the association relationship between each of the reachable area grids and the corresponding visible sub-scenes, where the visible sub-scenes include game sub-scenes visible to the target virtual character in the reachable area grids, and the game sub-scenes include scenes divided based on the game scene;

[0012] A second determination unit, configured to determine the target visible sub-scene corresponding to the target virtual character when it is located in the target area grid based on the association relationship;

[0013] A rendering unit, configured to load the target visible sub-scene and perform rendering processing on the current game interface based on the target visible sub-scene.

[0014] Optionally, the acquisition unit is further configured to:

[0015] Acquire multiple object models in the game scene;

[0016] Among the multiple object models, determine candidate object models visible to the target virtual character in the reachable area grids;

[0017] Divide the game scene into multiple game sub-scenes according to the candidate object models;

[0018] In the multiple game sub-scenes, acquire the game sub-scenes visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid;

[0019] Set the association relationship between each reachable area grid and the corresponding visible sub-scene.

[0020] Optionally, the acquisition unit is further configured to:

[0021] Acquire a number of first reference points in the reachable area grid and acquire a number of second reference points in each object model;

[0022] Connect line segments between the first reference points and the second reference points in each object model;

[0023] According to the line segments connected between the reachable area grid and each object model, determine the candidate object models visible to the target virtual character in the reachable area grid among the multiple object models.

[0024] Optionally, the number of the first reference points is one, and the number of the second reference points in one object model is one. The acquisition unit is further configured to:

[0025] If the line segments connecting the reachable area grid and each of the object models are not blocked by other object models, when it is determined that the target virtual character is in the reachable area grid, the object model is visible to the target virtual character;

[0026] Determine the object model as the candidate object model that is visible to the target virtual character in the reachable area grid.

[0027] Optionally, the number of the first reference points is multiple, and the number of the second reference points in one object model is multiple. The obtaining unit is further configured to:

[0028] Connect line segments between each of the first reference points and each of the second reference points in each of the object models;

[0029] If the ratio of the line segments that are not blocked by other object models among the multiple line segments connecting the reachable area grid and one object model exceeds a preset ratio, when it is determined that the target virtual character is in the reachable area grid, the object model is visible to the target virtual character;

[0030] Obtain all the object models that are visible to the target virtual character in the reachable area grid as the candidate object models that are visible to the target virtual character in the reachable area grid.

[0031] Optionally, the number of the first reference points is multiple, and the number of the second reference points in one object model is multiple. The obtaining unit is further configured to:

[0032] Obtain the first necessary reference point of the reachable area grid among the multiple first reference points, and obtain the second necessary reference point of each object model among the multiple second reference points of each object model;

[0033] Obtain the necessary line segments connecting the first necessary reference point of the reachable area grid and the second necessary reference points of each object model;

[0034] If the necessary line segments connecting the reachable area grid and one object model are not blocked by other object models, when it is determined that the target virtual character is in the reachable area grid, the object model is visible to the target virtual character;

[0035] Obtain all the object models that are visible to the target virtual character in the reachable area grid as the candidate object models that are visible to the target virtual character in the reachable area grid.

[0036] Optionally, the obtaining unit is further configured to:

[0037] Among the multiple object models, determine at least two division reference models;

[0038] Based on the candidate object models visible to the target virtual character in each reachable area grid, obtain the reachable area grids of the candidate object models that include at least two of the division reference models as reference grids;

[0039] Obtain the first quantity of the reference grids and the total quantity of the reachable area grids;

[0040] Calculate the reference ratio of the first quantity to the total quantity;

[0041] If the reference ratio exceeds a preset ratio, divide the area where at least two of the division reference models are located in the game scene into a reference sub-scene;

[0042] If the same object model is included in different reference sub-scenes, divide the reference sub-scenes including the same object model into the game sub-scenes.

[0043] Optionally, the obtaining unit is further configured to:

[0044] Obtain the candidate object models visible to the target virtual character in each reachable area grid;

[0045] According to the multiple game sub-scenes, determine the game sub-scenes formed by the candidate object models visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid.

[0046] Optionally, the rendering unit is further configured to:

[0047] Determine the location of the target virtual character in the game scene;

[0048] In the multiple game sub-scenes, obtain the game sub-scenes whose distance from the location is less than a preset distance as candidate sub-scenes;

[0049] Determine the sub-scenes other than the target visible sub-scene in the candidate sub-scenes as new sub-scenes;

[0050] Load the new sub-scenes and perform the rendering process on the current game interface based on the new sub-scenes.

[0051] Optionally, the first determining unit is further configured to:

[0052] Obtain the reachable area of the target virtual character in the game scene;

[0053] Divide the reachable area into multiple polygon meshes of the same size according to a preset grid size;

[0054] Use the polygon mesh as the reachable area mesh.

[0055] Optionally, the rendering unit is further configured to:

[0056] Determine the location of the target virtual character in the game scene;

[0057] In multiple game sub-scenes, obtain the game sub-scenes whose distance from the location is less than a preset distance as candidate sub-scenes;

[0058] Perform an intersection operation on the candidate sub-scenes and the target visible sub-scenes to obtain a first visible sub-scene;

[0059] Load the first visible sub-scene and perform rendering processing on the current game interface based on the first visible sub-scene.

[0060] Similarly, an embodiment of the present application further provides an electronic device, including:

[0061] A memory for storing a computer program;

[0062] A processor for executing the steps of any one of the game scene rendering methods.

[0063] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the game scene rendering methods are implemented.

[0064] An embodiment of the present application provides a game scene rendering method, device, electronic device and storage medium, which can pre-divide the reachable area of the target virtual character in the game scene into multiple reachable area meshes, and pre-divide the game scene into game sub-scenes. When the target virtual character moves in the game interface, according to the association relationship between the obtained reachable area mesh and the visible sub-scene corresponding to the mesh, determine the target visible sub-scene corresponding to the target area mesh where the target virtual character is specifically located during the movement, so as to only render the target visible sub-scene in the current game interface, avoiding rendering other invisible game sub-scenes and reducing the performance overhead of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0066] Figure 1 It is a system schematic diagram of a game scene rendering device provided by an embodiment of the present application;

[0067] Figure 2 It is a flowchart of a game scene rendering method provided by an embodiment of the present application;

[0068] Figure 3 It is a schematic diagram of the line connection between the reachable area grid and the object model provided by an embodiment of the present application;

[0069] Figure 4 It is another flowchart of a game scene rendering method provided by an embodiment of the present application;

[0070] Figure 5 It is a structural schematic diagram of a game scene rendering device provided by an embodiment of the present application;

[0071] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0072] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0073] Embodiments of the present application provide a game scene rendering method, apparatus, electronic device, and storage medium. Specifically, the game scene rendering method of the embodiments of the present application can be executed by an electronic device, where the electronic device can be a terminal or a server, etc. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal can also include a client, and the client can be a game application client, a browser client carrying a game program, or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution network services, and big data and artificial intelligence platforms.

[0074] For example, when the game scene rendering method runs on a terminal, the terminal device stores a game application program and is used to present the scene in the game screen. The terminal device is used to interact with the user through a graphical user interface. For example, the game application program is downloaded and installed on the terminal device and run. The way the terminal device provides the graphical user interface to the user can include various methods. For example, it can be rendered and displayed on the display screen of the terminal device, or the graphical user interface can be presented through holographic projection. For example, the terminal device can include a touch display screen and a processor. The touch display screen is used to present the graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The graphical user interface includes a game interface. The processor is used to run the game application program and the game, generate the graphical user interface, respond to the operation instructions, and control the display of the graphical user interface on the touch display screen.

[0075] For example, when the game scene rendering method runs on a server, it can be a cloud game. A cloud game refers to a game mode based on cloud computing. In the operating mode of a cloud game, the running entity of the game application and the entity presenting the game screen are separated. The storage and running of the cloud game product interaction method are completed on the cloud game server. The presentation of the game screen is completed on the cloud game client. The cloud game client is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud game client can be a display device with data transmission function near the user side, such as a mobile terminal, a television, a computer, a handheld computer, a personal digital assistant, etc. However, the terminal device for processing game data is the cloud game server in the cloud. When playing a game, the user operates the cloud game client to send an operation instruction to the cloud game server. The cloud game server runs the game program according to the operation instruction, encodes and compresses data such as the game screen, returns it to the cloud game client through the network, and finally, the cloud game client decodes and outputs the game screen.

[0076] Please refer to Figure 1 , Figure 1 which is a system schematic diagram of the game scene rendering device provided by the embodiment of the present application. The system may include at least one terminal and at least one game server. The terminal held by the user can be connected to the game servers of different games through different networks. For example, the network can be a wireless network or a wired network. The wireless network can be a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. The terminal is used to determine the target area grid where the target virtual character is located in the game scene among multiple reachable area grids in the game scene. The area included in the reachable area grid is the area that the target virtual character can reach in the game scene; obtain the association relationship between each reachable area grid and the corresponding visible sub-scene. The visible sub-scene includes the game sub-scene visible to the target virtual character in the reachable area grid. The game sub-scene includes the scene divided based on the game scene; determine the target visible sub-scene corresponding to when the target virtual character is located in the target area grid based on the association relationship; load the target visible sub-scene and perform rendering processing on the current game interface based on the target visible sub-scene.

[0077] The game server is used to send the game scene to the terminal and provide the association relationship between the reachable area grid and the corresponding visible sub-scene to the terminal.

[0078] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0079] This embodiment will be described from the perspective of a game scene rendering device, which can be specifically integrated in a terminal, and the terminal can include devices such as smartphones, laptops, tablets, and personal computers.

[0080] A game scene rendering method provided by an embodiment of the present application can be executed by a processor of a terminal. As Figure 2 shown, the specific process of the game scene rendering method mainly includes steps 201 to 204, which are described in detail as follows:

[0081] Step 201: In multiple reachable area grids of the game scene, determine the target area grid where the target virtual character is located in the game scene. The area included in the reachable area grid is the area that the target virtual character can reach in the game scene.

[0082] In the embodiment of the present application, the game scene is all the virtual scenes included in the game battle situation after the target virtual character enters the game battle situation. There are various virtual elements (such as buildings, trees, mountains, sky, etc.) included in the game world environment in the game scene. The game scene can be fully displayed in the game interface of the terminal or partially displayed in the game interface of the terminal.

[0083] In an implementation manner of the present application, the target virtual character can be a virtual object operated by the current player in the game interface of the terminal. For example, it can be a virtual character or a virtual animal in the game, etc. The target virtual character can also be an NPC (non-player character) set by game designers in the game to increase the fun of the game. In addition, the target virtual character is located in the game scene and can move in the game scene.

[0084] In the embodiment of the present application, before "in multiple reachable area grids of the game scene, determine the target area grid where the target virtual character is located in the game scene" in the above step 201, it is also necessary to obtain multiple reachable area grids in the game scene. The specific steps for dividing the reachable area grids can be:

[0085] Obtain the reachable area of the target virtual character in the game scene;

[0086] Divide the reachable area into multiple polygon grids of the same size according to a preset grid size;

[0087] Use the polygon grids as the reachable area grids.

[0088] In an embodiment of the present application, the target virtual character can move in the game scene. Since there may be virtual objects such as walls and trees in the game scene that prevent the target virtual character from moving straight ahead, the target virtual character may not be able to rise into the air, and the target virtual character may not be able to climb onto the roof of a tall building, etc. Therefore, there are areas in the game scene that the target virtual character cannot reach. Except for the areas in the game scene that the target virtual character cannot reach, the reachable areas of the target virtual character in the game scene can be obtained.

[0089] In an embodiment of the present application, the preset grid size can include the lengths of the sides of the divided polygon grids, the volume of the preset grids, etc. In addition, the polygon grids can be regular regular polygon grids, or irregular polygon grids, etc. The specific shape of the polygon grids is not limited here and can be flexibly set according to the actual situation.

[0090] In an embodiment of the present application, the preset grid size can be polygon grids of the same size, that is, the sizes and shapes of the multiple polygon grids for reachable area division are equal. The preset grid size can also be polygon grids of different sizes, that is, the sizes and shapes of the multiple polygon grids for reachable area division are different from each other or partially the same.

[0091] In an implementation manner of the application, among the multiple reachable area grids in the game scene, determining the target area grid where the target virtual character is located in the game scene can be to determine the reachable area grid where the eyes of the target virtual character are located in the game scene as the target area grid, so that the visible sub-scene corresponding to the target area grid determined according to the association relationship can better represent the game sub-scene seen by the target virtual character in the game scene.

[0092] In some embodiments of the present application, among the multiple reachable area grids in the game scene, determine the target area grid where the target virtual character is located in the game scene; it can also be to determine that all the reachable area grids where the entire body of the target virtual character is located are the target area grids, so that the visible sub-scene corresponding to the target area grid determined according to the association relationship can more completely include all the game sub-scenes that the target virtual character may be able to see in the game scene.

[0093] Step 202, obtain the association relationship between each reachable area grid and the corresponding visible sub-scene. The visible sub-scene includes the game sub-scene visible to the target virtual character in the reachable area grid, and the game sub-scene includes the scene divided based on the game scene.

[0094] In the embodiment of the present application, before the step 202 of "obtaining the association relationship between each reachable area grid and the corresponding visible sub-scene", it is also necessary to divide the game scene into multiple game sub-scenes, and determine the visible sub-scene corresponding to each reachable area grid, and then the association relationship between each reachable area grid and the corresponding visible sub-scene can be obtained. The specific steps may be:

[0095] Obtain multiple object models in the game scene;

[0096] Among the multiple object models, determine the candidate object models that are visible to the target virtual character in the reachable area grid;

[0097] Divide the game scene into multiple game sub-scenes according to the candidate object models;

[0098] In the multiple game sub-scenes, obtain the game sub-scenes that are visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid;

[0099] Set the association relationship between each reachable area grid and the corresponding visible sub-scene.

[0100] Among them, the multiple object models may be virtual object models that the target virtual character in the game scene cannot pass through. For example, virtual tree models, virtual wall models, and so on.

[0101] In the embodiment of the present application, the candidate object model may be an object model that the target virtual character can see when the eyes of the target virtual character are located in a reachable area grid. Each reachable area grid may correspond to one or more candidate object models.

[0102] In the embodiment of the present application, the visible sub-scene may be the game sub-scene that the target virtual character can see after calculation when the eyes of the target virtual character are located in a reachable area grid. Each reachable area grid may correspond to one or more visible sub-scenes.

[0103] In the embodiment of the present application, the above step of "among the multiple object models, determine the candidate object models that are visible to the target virtual character in the reachable area grid" may be:

[0104] Obtain several first reference points in the reachable area grid, and obtain several second reference points in each object model;

[0105] Connect line segments between the first reference points and the second reference points in each object model;

[0106] According to the multiple line segments connected between the reachable area grid and each object model, determine the candidate object models that are visible to the target virtual character in the reachable area grid among the multiple object models.

[0107] In the embodiments of the present application, since the shape of the object model is irregular, in order to obtain the second reference point more conveniently, a corresponding bounding box can be generated according to each object model, and the second reference point is set on the bounding box corresponding to each object model.

[0108] In the embodiments of the present application, the first reference point can be randomly selected. For example, any number of reference points can be selected at any position in the reachable area grid as the first reference point, or the first reference point can be selected according to a certain rule. For example, a reference point can be selected at the center of each face of the reachable area grid as the first reference point. The selection of the first reference point is not limited herein.

[0109] Similarly, the second reference point can be randomly selected. For example, any number of reference points can be selected at any position of the object model as the second reference point, or the second reference point can be selected according to a certain rule. For example, a reference point can be selected at the center of each edge of the object model as the second reference point. The selection of the second reference point is not limited herein.

[0110] Specifically, in order to determine all visible candidate object models corresponding to a reachable area grid, line segments can be connected between each first reference point of each reachable area grid and each second reference point in each object model. In addition, line segments can also be connected between some first reference points in each reachable area grid and some second reference points in each object model, where the selected first reference points and second reference points can be random.

[0111] In the embodiments of the present application, after multiple line segments are connected between a reachable area grid and an object model, when the line segment connected between a first reference point of the reachable area grid and a second reference point of the object model is not blocked by other object models, it indicates that at the position of the first reference point of the reachable area grid, the position of the second reference point of the object model is visible, and when the line segment connected between a first reference point of the reachable area grid and a second reference point of the object model is blocked by other object models, it indicates that at the position of the first reference point of the reachable area grid, the position of the second reference point of the object model is invisible.

[0112] When the number of first reference points in a reachable area grid can be one, and the number of second reference points in an object model can also be one, it indicates that the line segment connected between a reachable area grid and an object model is one. At this time, the above step "determine the candidate object models visible to the target virtual character in the reachable area grid according to the line segments connected between the reachable area grid and each object model" can be:

[0113] If the line segments connecting the reachable area grid and each object model are not blocked by other object models, it is determined that when the target virtual character is in the reachable area grid, the object model is visible;

[0114] Determine the object model as a candidate object model visible to the target virtual character in the reachable area grid.

[0115] When the number of first reference points is multiple and the number of second reference points in an object model is multiple, the above step of "connecting line segments between the first reference points and the second reference points in each object model" can be: connecting line segments between each first reference point and each second reference point in each object model. At this time, there are multiple line segments between a reachable area grid and an object model, and it may occur that some line segments are not blocked by other object models while some line segments are blocked by other object models. At this time, two methods can be used to determine whether the target virtual character is visible to the object model with the connected line segments at the reachable area grid. One can be determined according to the ratio of the line segments not blocked by other object models to all line segments, and the other can be determined according to whether the necessary line segments between the reachable area grid and the object model are blocked by other object models.

[0116] For example, as Figure 3 shown in the schematic diagram of the line segment connection between the reachable area grid and the object model, the game scene 30 includes the reachable area grid 301, and also includes the object model 302, the object model 303, and the object model 304. The first reference point 3011 is set on the reachable area grid 301, the second reference point 3031 is set on the object model 303, and the second reference point 3041 is set on the object model 304. A line segment is connected between the first reference point 3011 and the second reference point 3031. Since the line segment connected between the first reference point 3011 and the second reference point 3031 will be blocked by the object model 302, it indicates that the eyes of the target virtual object are not visible to the second reference point 3031 at the first reference point 3011. A line segment is connected between the first reference point 3011 and the second reference point 3041. Since the line segment connected between the first reference point 3011 and the second reference point 3041 will not be blocked by the object model 302 and other object models, it indicates that the eyes of the target virtual object are visible to the second reference point 3041 at the first reference point 3011.

[0117] Specifically, when using the method of determining whether the target virtual character is visible to the object model with the connected line segments at the reachable area grid according to the ratio of the line segments not blocked by other object models to all line segments, the above step of "determining the candidate object model visible to the target virtual character in the reachable area grid among multiple object models according to the multiple line segments connected between the reachable area grid and each object model" can be:

[0118] If, among multiple line segments connecting a reachable area grid and an object model, the ratio of the line segments not blocked by other object models to the multiple line segments exceeds a preset ratio, it is determined that when the target virtual character is in the reachable area grid, the object model is visible;

[0119] Obtain all the object models visible to the target virtual character in the reachable area grid as the candidate object models visible to the target virtual character in the reachable area grid.

[0120] For example, 100 line segments are connected between reachable area grid n and an object model m, 90 line segments are not blocked by other object models, the ratio of the line segments not blocked by other object models to the multiple line segments is 90%, and the preset ratio is 80%, which indicates that the target virtual character is visible to the object model m in the reachable area grid n.

[0121] Optionally, when determining whether the target virtual character is visible to the object model connected by the line segment at the reachable area grid according to whether the necessary line segment between the reachable area grid and the object model is blocked by other object models, the above step "According to the multiple line segments connected between the reachable area grid and each object model, among multiple object models, determine the candidate object models visible to the target virtual character in the reachable area grid" can be:

[0122] Obtain the first necessary reference point of the reachable area grid among multiple first reference points, and obtain the second necessary reference point of each object model among the multiple second reference points of each object model;

[0123] Obtain the necessary line segments connecting the first necessary reference point of the reachable area grid and the second necessary reference points of each object model;

[0124] If the necessary line segment connected between the reachable area grid and an object model is not blocked by other object models, it is determined that when the target virtual character is in the reachable area grid, the object model is visible;

[0125] Obtain all the object models visible to the target virtual character in the reachable area grid as the candidate object models visible to the target virtual character in the reachable area grid.

[0126] In the embodiments of the present application, the selection of the first necessary reference point is not restricted. For example, the point at the center of each face of each reachable area grid can be used as the first necessary reference point, and the selection of the second necessary reference point is also not restricted. For example, the points on each edge of each object model can be used as the second necessary reference point.

[0127] For example, if there is a first necessary reference point p on the reachable area grid s and a second necessary reference point q on the object model t, and the line segment pq connecting the first necessary reference point p and the second reference point q is not blocked by other object models, it can be indicated that the target virtual character is visible to the object model t in the reachable area grid s.

[0128] In the embodiments of the present application, it is also possible to combine two methods, namely, the ratio of the line segments not blocked by other object models to all line segments and whether the necessary line segments between the reachable area grid and the object model are blocked by other object models, to determine whether the target virtual character is visible to the object model of the connected line segment at the reachable area grid. That is, among the multiple line segments connected between a reachable area grid and an object model, if the ratio of the line segments not blocked by other object models to the multiple line segments exceeds a preset ratio, and the necessary line segments connected between the reachable area grid and the object model are not blocked by other object models, it is determined that the target virtual character is visible to the object model in the reachable area grid. In addition, it is also possible to determine whether the target virtual character is visible to the object model of the connected line segment at the reachable area grid according to other rules, which are not limited herein.

[0129] In the embodiments of the present application, the number of first reference points in a reachable area grid can be one, while the number of second reference points in each object model can be multiple. Line segments can be connected between the first reference point in a reachable area grid and each second reference point in each object model. Among the multiple line segments connected between a reachable area grid and an object model, if the ratio of the line segments not blocked by other object models to all line segments exceeds a preset ratio, it is determined that the target virtual character is visible to the object model when in the reachable area grid, and all the object models visible to the target virtual character in the reachable area grid are obtained as the candidate object models visible to the target virtual character in the reachable area grid.

[0130] In an implementation manner of the present application, the number of first reference points in a reachable area grid can be multiple, while the number of second reference points in each object model can be one. Line segments can be connected between each first reference point in a reachable area grid and one second reference point in each object model. Among the multiple line segments connected between a reachable area grid and an object model, if the ratio of the line segments not blocked by other object models to all line segments exceeds a preset ratio, it is determined that the target virtual character is visible to the object model when in the reachable area grid, and all the object models visible to the target virtual character in the reachable area grid are obtained as the candidate object models visible to the target virtual character in the reachable area grid.

[0131] In an embodiment of the present application, the game scene may be divided into multiple game sub-scenes according to multiple object models in the game scene. The above step of "dividing the game scene into multiple game sub-scenes according to the candidate object models" may be as follows:

[0132] Among the multiple object models, determine at least two division reference models;

[0133] Based on the candidate object models visible to the target virtual character in each reachable area grid, obtain the reachable area grids of the candidate object models that include at least two division reference models as reference grids;

[0134] Obtain the first quantity of the reference grids and the total quantity of the reachable area grids;

[0135] Calculate the reference ratio of the first quantity to the total quantity;

[0136] If the reference ratio exceeds a preset ratio, divide the area where at least two division reference models are located in the game scene into a reference sub-scene;

[0137] If the same object model is included in different reference sub-scenes, divide the reference sub-scenes including the same object model into game sub-scenes.

[0138] For example, among r object models, object model A and object model B may be used as division reference models. Obtain all candidate object models visible to the target virtual character in each reachable area grid, and determine all reachable area grids of the candidate object models that include both object model A and object model B as reference grids. If the ratio of the first quantity of the reference grids to the total quantity of the reachable area grids exceeds the preset ratio, divide the area where object model A is located in the game scene and the area where object model B is located in the game scene into a reference sub-scene. If reference sub-scene M includes object model A and object model B, and reference sub-scene N includes object model B and object model C, since both reference sub-scene M and reference sub-scene N include object model B, reference sub-scene M and reference sub-scene N can be merged into a game sub-scene. In addition, if the ratio of the number of reachable area grids where an object model L and any other object model can be seen simultaneously to the total quantity does not exceed the preset quantity, and object model L is not included in all reference sub-scenes, then object model L is taken as a game sub-scene alone.

[0139] In an embodiment of the present application, after dividing the game scene into game sub-scenes, it is possible to further determine the game sub-scenes visible to the target virtual character in the reachable area grid based on whether the target virtual character can see each object model in the reachable area grid. In this case, the above step "in multiple game sub-scenes, obtain the game sub-scenes visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid" may be:

[0140] Obtain the candidate object models visible to the target virtual character in each reachable area grid;

[0141] Based on multiple game sub-scenes, determine the game sub-scenes formed by the candidate object models visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid.

[0142] For example, the candidate object models visible to the target virtual character in the reachable area grid c are object model e and object model f. If object model e and object model f form a game sub-scene d, then the game sub-scene d can be the visible sub-scene corresponding to the target virtual character in the reachable area grid c.

[0143] Step 203: Determine the target visible sub-scene corresponding to the target virtual character when it is located in the target area grid based on the association relationship.

[0144] In an embodiment of the present application, since the association relationship records the visible sub-scenes corresponding to the target virtual character when it is located in each reachable area grid, after determining the target area grid where the target virtual character is located, the visible sub-scene corresponding to the target area grid can be determined in the association relationship as the target visible sub-scene.

[0145] Step 204: Load the target visible sub-scene and perform rendering processing on the current game interface based on the target visible sub-scene.

[0146] In an embodiment of the present application, after determining the target visible sub-scene of the target virtual character in the target area grid, the target sub-scene can be rendered in the game interface currently displayed on the terminal, so that only the game sub-scenes visible to the target virtual character when it is in the target area grid are displayed on the current game interface, and the game sub-scenes invisible to the target virtual character in the target area grid are not displayed, thereby reducing the number of terminal drawing calls and the calculation amount of the shader, and further reducing the performance consumption of the terminal for rendering the scene.

[0147] In the embodiments of the present application, since only the game sub-scenes visible to the target virtual character in the target area grid are displayed in the current game interface, and other game sub-scenes are not displayed, it may cause some game sub-scenes that are relatively close to the target virtual character not to be displayed. At this time, the game sub-scenes that can be added for rendering can be determined according to the distance from the target virtual character. The specific method can be as follows:

[0148] Determine the location of the target virtual character in the game scene;

[0149] In multiple game sub-scenes, obtain the game sub-scenes whose distance from the location is less than a preset distance as candidate sub-scenes;

[0150] Determine the sub-scenes in the candidate sub-scenes other than the target visible sub-scenes as the newly added sub-scenes;

[0151] Load the newly added sub-scenes and perform rendering processing on the current game interface based on the newly added sub-scenes.

[0152] In an implementation manner of the present application, after determining the target visible sub-scenes, there may be sub-scenes in the target visible sub-scenes that are relatively far from the target virtual character. Generally, these target visible sub-scenes that are relatively far from the target virtual character in the game scene have little impact on the game behavior of the target virtual character. In order to further reduce the performance consumption of the terminal for rendering the scene, these sub-scenes may not be loaded. At this time, the above step "Load the target visible sub-scenes and perform rendering processing on the current game interface based on the target visible sub-scenes" may further include:

[0153] Determine the location of the target virtual character in the game scene;

[0154] In multiple game sub-scenes, obtain the game sub-scenes whose distance from the location is less than a preset distance as candidate sub-scenes;

[0155] Perform an intersection operation on the candidate sub-scenes and the target visible sub-scenes to obtain the first visible sub-scenes;

[0156] Load the first visible sub-scenes and perform rendering processing on the current game interface based on the first visible sub-scenes.

[0157] In the embodiments of the present application, after determining the target visible sub-scenes and the candidate sub-scenes, sub-scenes that belong to both the target visible sub-scenes and the candidate sub-scenes can be selected as the first visible sub-scenes.

[0158] In the embodiments of the present application, since the terminal only loads the target visible sub-scenes, that is, only reads the relevant data of the target visible sub-scenes from the hard disk to the memory, and does not load the game scenes other than the target visible sub-scenes in the game scene, the memory of the terminal can be greatly saved.

[0159] Any combination of the above technical solutions can form an optional embodiment of the present application, which will not be elaborated one by one here.

[0160] The game scene rendering method provided by the embodiment of the present application can pre-divide the reachable area of the target virtual character in the game scene into multiple reachable area grids, and pre-divide the game scene into game sub-scenes. When the target virtual character moves in the game interface, according to the obtained association relationship between the reachable area grid and the visible sub-scene corresponding to the grid, determine the target visible sub-scene corresponding to the target area grid where the target virtual character is specifically located during the movement, so as to only render the target visible sub-scene in the current game interface, avoid rendering other invisible game sub-scenes, and reduce the performance overhead of the electronic device.

[0161] Please refer to Figure 4 , Figure 4 which is another schematic flowchart of the game scene rendering method provided by the embodiment of the present application. The specific process of this method can be as follows:

[0162] Step 401: Pre-divide the reachable area of the target virtual character in the game scene into multiple reachable area grids.

[0163] For example, obtain the reachable area of the target virtual character in the game scene; divide the reachable area into multiple polygon grids of the same size according to the preset grid size; use the polygon grids as the reachable area grids.

[0164] Step 402: Pre-obtain multiple object models in the game scene.

[0165] Step 403: Pre-determine the candidate object models visible to the target virtual character in the reachable area grids among the multiple object models.

[0166] For example, obtain multiple first reference points in the reachable area grids, and obtain multiple second reference points in each object model; connect line segments between each first reference point and each second reference point in each object model; calculate the candidate object models visible to the target virtual character in the reachable area grids among the multiple object models according to the multiple line segments connected between the reachable area grids and each object model.

[0167] Step 404: Pre-divide the game scene into multiple game sub-scenes according to the candidate object models.

[0168] For example, among r object models, object model A and object model B can be used as reference models for division. All candidate object models visible to the target virtual character in each reachable area grid are obtained, and all reachable area grids where the candidate object models include both object model A and object model B are determined as reference grids. If the proportion of the first quantity of the reference grids in the total quantity of the reachable area grids exceeds a preset ratio, the area where object model A is located in the game scene and the area where object model B is located in the game scene are divided into a reference sub-scene. If reference sub-scene M includes object model A and object model B, and reference sub-scene N includes object model B and object model C, since both reference sub-scene M and reference sub-scene N include object model B, reference sub-scene M and reference sub-scene N can be merged into a game sub-scene.

[0169] Step 405: Pre-obtain the game sub-scenes visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid, and set the association relationship between each reachable area grid and the corresponding visible sub-scene.

[0170] For example, the candidate object models visible to the target virtual character in reachable area grid c are object model e and object model f. If object model e and object model f form a game sub-scene d, then game sub-scene d can be the visible sub-scene corresponding to the target virtual character in reachable area grid c.

[0171] Step 406: When the target virtual character is in the game scene, determine the target area grid where the target virtual character is located.

[0172] For example, it can be determined that the reachable area grid where the eyes of the target virtual character are located in the game scene is the target area grid.

[0173] Step 407: Based on the association relationship, determine the target visible sub-scene corresponding to the target virtual character when it is located in the target area grid.

[0174] Step 408: Load the target visible sub-scene and perform rendering processing on the current game interface based on the target visible sub-scene.

[0175] All the above technical solutions can be combined arbitrarily to form optional embodiments of the present application, which will not be elaborated one by one here.

[0176] The game scene rendering method provided by the embodiments of the present application can pre-divide the reachable areas of the target virtual character in the game scene into multiple reachable area grids, and pre-divide the game scene into game sub-scenes. When the target virtual character moves in the game interface, according to the obtained association relationship between the reachable area grids and the visible sub-scenes corresponding to the grids, determine the target visible sub-scene corresponding to the target area grid where the target virtual character is located during the movement, so as to only render the target visible sub-scene in the current game interface, avoid rendering other invisible game sub-scenes, and reduce the performance overhead of the electronic device.

[0177] To facilitate better implementation of the game scene rendering method of the embodiments of the present application, the embodiments of the present application also provide a game scene rendering device. Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of the game scene rendering device provided by the embodiments of the present application. The game scene rendering device may include a first determination unit 501, an acquisition unit 502, a second determination unit 503, and a rendering unit 504.

[0178] Among them, the first determination unit 501 is configured to determine the target area grid where the target virtual character is located in the game scene among multiple reachable area grids of the game scene, and the area included in the reachable area grid is the area that the target virtual character can reach in the game scene;

[0179] The acquisition unit 502 is configured to acquire the association relationship between each reachable area grid and the corresponding visible sub-scene, and the visible sub-scene includes the game sub-scenes that the target virtual character can see in the reachable area grid, and the game sub-scenes include the scenes divided based on the game scene;

[0180] The second determination unit 503 is configured to determine the target visible sub-scene corresponding to the target virtual character when it is located in the target area grid based on the association relationship;

[0181] The rendering unit 504 is configured to load the target visible sub-scene and perform rendering processing on the current game interface based on the target visible sub-scene.

[0182] Optionally, the acquisition unit 502 is further configured to:

[0183] acquire multiple object models in the game scene;

[0184] determine candidate object models that the target virtual character can see in the reachable area grid among the multiple object models;

[0185] divide the game scene into multiple game sub-scenes according to the candidate object models;

[0186] In multiple game sub-scenarios, obtain the game sub-scenarios where the target virtual character is visible in the grid of each reachable area, as the visible sub-scenarios corresponding to the grids of each reachable area;

[0187] Set the association relationship between each reachable area grid and the corresponding visible sub-scenario.

[0188] Optionally, the obtaining unit 502 is further configured to:

[0189] Obtain several first reference points in the reachable area grid, and obtain several second reference points in each object model;

[0190] Connect line segments between the first reference point and the second reference points in each object model;

[0191] According to the multiple line segments connected between the reachable area grid and each object model, determine, among multiple object models, the candidate object models where the target virtual character is visible in the reachable area grid.

[0192] Optionally, the number of first reference points is one, and the number of second reference points in one object model is one. The obtaining unit 502 is further configured to:

[0193] If the line segments connected between the reachable area grid and each object model are not blocked by other object models, it is determined that when the target virtual character is in the reachable area grid, the object model is visible;

[0194] Determine that the object model is a candidate object model where the target virtual character is visible in the reachable area grid.

[0195] Optionally, the number of first reference points is multiple, and the number of second reference points in one object model is multiple. The obtaining unit 502 is further configured to:

[0196] Connect line segments between each first reference point and each second reference point in each object model;

[0197] If the ratio of the line segments that are not blocked by other object models among the multiple line segments connected between the reachable area grid and one object model exceeds a preset ratio, it is determined that when the target virtual character is in the reachable area grid, the object model is visible;

[0198] Obtain all the object models where the target virtual character is visible in the reachable area grid, as the candidate object models where the target virtual character is visible in the reachable area grid.

[0199] Optionally, the number of first reference points is multiple, and the number of second reference points in one object model is multiple. The obtaining unit 502 is further configured to:

[0200] Obtain the first necessary reference points of the reachable area grid among multiple first reference points, and obtain the second necessary reference points of each object model among the multiple second reference points of each object model;

[0201] Obtain the necessary line segments connecting the first necessary reference points of the reachable area grid and the second necessary reference points of each object model;

[0202] If the necessary line segments connecting the reachable area grid and an object model are not blocked by other object models, it is determined that when the target virtual character is in the reachable area grid, the object model is visible;

[0203] Obtain all the object models visible to the target virtual character in the reachable area grid as the candidate object models visible to the target virtual character in the reachable area grid.

[0204] Optionally, the obtaining unit 502 is further configured to:

[0205] Divide multiple object models into multiple model sets composed of at least two object models;

[0206] Based on the candidate object models visible to the target virtual character in each reachable area grid, obtain the reachable area grids where the target virtual character is visible to all the object models included in the model set as the reference grids;

[0207] Obtain the total number of reference grids corresponding to the model set;

[0208] If the total number exceeds the preset number, divide the area where the object models included in the model set are located in the game scene into a game sub-scene until the game scene is divided into multiple game sub-scenes.

[0209] Optionally, the obtaining unit 502 is further configured to:

[0210] Obtain the candidate object models visible to the target virtual character in each reachable area grid;

[0211] According to multiple game sub-scenes, determine the game sub-scene formed by the candidate object models visible to the target virtual character in each reachable area grid as the visible sub-scene corresponding to each reachable area grid.

[0212] Optionally, the rendering unit 504 is further configured to:

[0213] Determine the location of the target virtual character in the game scene;

[0214] In multiple game sub-scenes, obtain the game sub-scenes whose distance from the location is less than the preset distance as the candidate sub-scenes;

[0215] Determine the sub-scenes in the candidate sub-scenes other than the target visible sub-scene as the newly added sub-scenes;

[0216] Load the newly added sub-scenes, and perform rendering processing on the current game interface based on the newly added sub-scenes.

[0217] Optionally, the first determination unit 501 is further configured to:

[0218] Obtain the reachable area of the target virtual character in the game scene;

[0219] Divide the reachable area into multiple polygon meshes of the same size according to the preset grid size;

[0220] Use the polygon meshes as the reachable area meshes.

[0221] Optionally, the rendering unit 504 is further configured to:

[0222] Determine the location of the target virtual character in the game scene;

[0223] In multiple game sub-scenes, obtain the game sub-scenes whose distance from the location is less than the preset distance as the candidate sub-scenes;

[0224] Perform an intersection operation on the candidate sub-scenes and the target visible sub-scene to obtain the first visible sub-scene;

[0225] Load the first visible sub-scene, and perform rendering processing on the current game interface based on the first visible sub-scene.

[0226] All of the above technical solutions can be combined arbitrarily to form alternative embodiments of the present application, which will not be elaborated herein one by one.

[0227] The game scene rendering device provided by the embodiments of the present application, through the first determination unit 501, determines the target area grid where the target virtual character is located in the game scene among multiple reachable area grids of the game scene. Then, through the acquisition unit 502, the association relationship between each reachable area grid and the corresponding visible sub-scene is obtained. Then, through the second determination unit 503, based on the association relationship, the target visible sub-scene corresponding to when the target virtual character is located in the target area grid is determined. Finally, through the rendering unit 504, the target visible sub-scene is loaded, and the current game interface is rendered based on the target visible sub-scene. Thus, only the target visible sub-scene is rendered in the current game interface, avoiding rendering other invisible game sub-scenes and reducing the performance overhead of the electronic device.

[0228] Correspondingly, the embodiments of the present application further provide an electronic device, which can be a terminal, and the terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer, a personal digital assistant, etc. AsFigure 6 As shown Figure 6 Figure 6 This is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 600 includes a processor 601 having one or more processing cores, a memory 602 having one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. Among them, the processor 601 is electrically connected to the memory 602. Those skilled in the art can understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0229] The processor 601 is the control center of the electronic device 600, connecting various parts of the entire electronic device 600 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 602, and invoking data stored in the memory 602, it executes various functions of the electronic device 600 and processes data, thereby monitoring the entire electronic device 600.

[0230] In the embodiment of the present application, the processor 601 in the electronic device 600 will load the instructions corresponding to the processes of one or more application programs into the memory 602 according to the following steps, and the processor 601 will run the application programs stored in the memory 602 to achieve various functions:

[0231] In multiple reachable area grids of the game scenario, determine the target area grid where the target virtual character is located in the game scenario. The area included in the reachable area grid is the area that the target virtual character can reach in the game scenario;

[0232] Obtain the association relationship between each reachable area grid and the corresponding visible sub-scene. The visible sub-scene includes the game sub-scene visible to the target virtual character in the reachable area grid, and the game sub-scene includes the scene divided based on the game scenario;

[0233] Based on the association relationship, determine the target visible sub-scene corresponding to when the target virtual character is located in the target area grid;

[0234] Load the target visible sub-scene, and perform rendering processing on the current game interface based on the target visible sub-scene.

[0235] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, and details will not be elaborated here.

[0236] Optionally, as Figure 6As shown, the electronic device 600 further includes: a touch display screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. Among them, the processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607 respectively. Those skilled in the art can understand that Figure 6 the structure of the electronic device shown in does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.

[0237] The touch display screen 603 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using any suitable object or accessory such as a finger or a stylus on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 601, and can receive commands sent by the processor 601 and execute them. The touch panel can cover the display panel. After the touch panel detects a touch operation on or near it, it transmits it to the processor 601 to determine the type of touch event. Subsequently, the processor 601 provides corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to implement the input function.

[0238] In an embodiment of the present application, after obtaining the reachable area grid divided according to the areas reachable by the target virtual character in the game scene and the association relationship between each reachable area grid and the corresponding visible sub-scene, the processor 601 determines the target area grid where the target virtual character is located in real time during the movement in the game scene, and determines the target visible sub-scene visible to the target virtual character in the target area grid where it is located in real time, so that the processor 601 renders the target visible sub-scene on the game interface of the electronic device.

[0239] The radio frequency circuit 604 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic devices through wireless communication, and transmit and receive signals with the network device or other electronic devices.

[0240] The audio circuit 605 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 605 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and then converted into audio data. After the audio data is output to the processor 601 for processing, it is transmitted through the radio frequency circuit 604 to, for example, another electronic device, or the audio data is output to the memory 602 for further processing. The audio circuit 605 may also include an earphone jack to provide communication between the peripheral earphone and the electronic device.

[0241] The input unit 606 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0242] The power supply 607 is used to supply power to each component of the electronic device 600. Optionally, the power supply 607 can be logically connected to the processor 601 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 607 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0243] Although Figure 6 not shown in the figure, the electronic device 600 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.

[0244] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0245] As can be seen from the above, the electronic device provided in this embodiment can pre-divide the areas reachable by the target virtual character in the game scene into multiple reachable area grids, and pre-divide the game scene into game sub-scenes. When the target virtual character moves in the game interface, according to the obtained association relationship between the reachable area grids and the visible sub-scenes corresponding to the grids, the target visible sub-scene corresponding to the target area grid where the target virtual character is located during the movement is determined, so as to only render the target visible sub-scene in the current game interface, avoiding rendering other invisible game sub-scenes and reducing the performance overhead of the electronic device.

[0246] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0247] Therefore, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute the steps in any of the game scene rendering methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:

[0248] Among the multiple reachable area grids of the game scene, determine the target area grid where the target virtual character is located in the game scene. The area included in the reachable area grid is the area reachable by the target virtual character in the game scene;

[0249] Obtain the association relationship between each reachable area grid and the corresponding visible sub-scene. The visible sub-scene includes the game sub-scenes visible to the target virtual character in the reachable area grid, and the game sub-scene includes the scenes divided based on the game scene;

[0250] Based on the association relationship, determine the target visible sub-scene corresponding to when the target virtual character is located in the target area grid;

[0251] Load the target visible sub-scene and perform rendering processing on the current game interface based on the target visible sub-scene.

[0252] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.

[0253] Among them, the storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or optical disc, etc.

[0254] Since the computer program stored in the storage medium can execute the steps in any of the game scene rendering methods provided in the embodiments of the present application, the beneficial effects achievable by any of the game scene rendering methods provided in the embodiments of the present application can be realized. For details, refer to the previous embodiments and will not be elaborated here.

[0255] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0256] The above has introduced in detail a game scene rendering method, device, electronic device, and storage medium provided by the embodiments of the present application. Specific examples are used herein to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the technical solutions and their core ideas of the present invention; those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for rendering a game scene, characterized in that, it includes: In multiple reachable area grids of the game scene, determine the target area grid where the target virtual character is located in the game scene, and the area included in the reachable area grid is the area that the target virtual character can reach in the game scene; Obtain the association relationship between each reachable area grid and the corresponding visible sub-scene, where the visible sub-scene includes the game sub-scene visible to the target virtual character in the reachable area grid, and the game sub-scene includes the scene divided based on the game scene; Based on the association relationship, determine the target visible sub-scene corresponding to when the target virtual character is located in the target area grid; Load the target visible sub-scene, and perform rendering processing on the current game interface based on the target visible sub-scene; Wherein, the association relationship is set through the following steps: Obtain multiple object models in the game scene; Among the multiple object models, determine the candidate object models visible to the target virtual character in each reachable area grid; Determine at least two division reference models among the multiple object models; Determine the reachable area grid including the at least two division reference models in the candidate object models as the reference grid; If the ratio between the number of reference grids and the number of reachable area grids exceeds a preset ratio, divide the area where the at least two division reference models are located in the game scene into a reference sub-scene; Merge the reference sub-scenes including the same object models into one game sub-scene, and use the reference sub-scenes with object models different from those included in other reference sub-scenes as game sub-scenes; Among the multiple game sub-scenes, obtain the game sub-scenes visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid; Set the association relationship between each reachable area grid and the corresponding visible sub-scene.

2. The game scene rendering method according to claim 1, characterized in that, The step of determining the candidate object models visible to the target virtual character in the reachable area grid among the multiple object models includes: Obtain several first reference points in the reachable area grid, and obtain several second reference points in each object model; Connect line segments between the first reference points and the second reference points in each object model; Based on the line segments connected between the reachable area grid and each object model, determine the candidate object models visible to the target virtual character in the reachable area grid among the multiple object models.

3. The game scene rendering method according to claim 2, characterized in that, The number of the first reference points is one, and the number of the second reference points in one object model is one. Determining the candidate object models visible to the target virtual character in the reachable area grid among multiple object models according to the line segments connecting the reachable area grid and each object model includes: If the line segments connecting the reachable area grid and each object model are not blocked by other object models, it is determined that when the target virtual character is in the reachable area grid, the object model is visible. Determine that the object model is the candidate object model visible to the target virtual character in the reachable area grid.

4. The game scene rendering method according to claim 2, wherein, the number of the first reference points is multiple, and the number of the second reference points in one object model is multiple. Connecting line segments between the first reference points and the second reference points in each object model includes: Connecting line segments between each first reference point and each second reference point in each object model; Determining the candidate object models visible to the target virtual character in the reachable area grid among multiple object models according to the line segments connecting the reachable area grid and each object model includes: If the ratio of the line segments not blocked by other object models among the multiple line segments connecting the reachable area grid and one object model exceeds a preset ratio, it is determined that when the target virtual character is in the reachable area grid, the object model is visible; Obtain all the object models visible to the target virtual character in the reachable area grid as the candidate object models visible to the target virtual character in the reachable area grid.

5. The game scene rendering method according to claim 4, wherein, the number of the first reference points is multiple, and the number of the second reference points in one object model is multiple. Determining the candidate object models visible to the target virtual character in the reachable area grid among multiple object models according to the line segments connecting the reachable area grid and each object model includes: Obtain the first necessary reference points of the reachable area grid among the multiple first reference points, and obtain the second necessary reference points of each object model among the multiple second reference points of each object model; Obtain the necessary line segments connecting the first necessary reference points of the reachable area grid and the second necessary reference points of each object model; If the necessary line segments connecting the reachable area grid and one object model are not blocked by other object models, it is determined that when the target virtual character is in the reachable area grid, the object model is visible; Obtain all the object models visible to the target virtual character in the reachable area grid as the candidate object models visible to the target virtual character in the reachable area grid.

6. The game scene rendering method according to claim 1, wherein, in the multiple game sub-scenes, obtaining the game sub-scenes visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid includes: obtaining the candidate object models visible to the target virtual character in each reachable area grid; determining, according to the multiple game sub-scenes, the game sub-scenes formed by the candidate object models visible to the target virtual character in each reachable area grid as the visible sub-scenes corresponding to each reachable area grid.

7. The game scene rendering method according to claim 1, wherein, after loading the target visible sub-scene and performing rendering processing on the current game interface based on the target visible sub-scene, it further includes: determining the location of the target virtual character in the game scene; in the multiple game sub-scenes, obtaining the game sub-scenes whose distance from the location is less than a preset distance as candidate sub-scenes; determining the sub-scenes other than the target visible sub-scene in the candidate sub-scenes as new added sub-scenes; loading the new added sub-scenes and performing the rendering processing on the current game interface based on the new added sub-scenes.

8. The game scene rendering method according to claim 1, wherein, before determining the target area grid where the target virtual character is located in the game scene among the multiple reachable area grids of the game scene, it further includes: obtaining the reachable area of the target virtual character in the game scene; dividing the reachable area into multiple polygon grids of the same size according to a preset grid size; using the polygon grids as the reachable area grids.

9. The game scene rendering method according to claim 1, wherein, loading the target visible sub-scene and performing rendering processing on the current game interface based on the target visible sub-scene includes: determining the location of the target virtual character in the game scene; in the multiple game sub-scenes, obtaining the game sub-scenes whose distance from the location is less than a preset distance as candidate sub-scenes; performing an intersection operation on the candidate sub-scenes and the target visible sub-scene to obtain a first visible sub-scene; loading the first visible sub-scene and performing rendering processing on the current game interface based on the first visible sub-scene.

10. A game scene rendering device, wherein, it includes: a first determination unit, configured to determine a target area grid where a target virtual character is located in a game scene among multiple reachable area grids of the game scene, and the area included in the reachable area grid is the area reachable by the target virtual character in the game scene; an obtaining unit, configured to obtain the association relationship between each reachable area grid and the corresponding visible sub-scene, where the visible sub-scene includes the game sub-scenes visible to the target virtual character in the reachable area grid, and the game sub-scene includes a scene divided based on the game scene; A second determination unit, configured to determine a target visible sub-scene corresponding to the target virtual character when it is located in the target area grid based on the association relationship; A rendering unit, configured to perform rendering processing on the current game interface based on the target visible sub-scene; Wherein, the association relationship is set through the following steps: Obtain a plurality of object models in the game scene; Among the plurality of object models, determine candidate object models that are visible to the target virtual character in each of the reachable area grids; Determine at least two division reference models among the plurality of object models; Determine the reachable area grids of the candidate object models that include the at least two division reference models as reference grids; If the ratio between the number of the reference grids and the number of the reachable area grids exceeds a preset ratio, divide the area where the at least two division reference models are located in the game scene into a reference sub-scene; Merge the reference sub-scenes including the same object models into one game sub-scene, and use the reference sub-scene with object models different from those included in other reference sub-scenes as a game sub-scene; Among the multiple game sub-scenes, obtain the game sub-scenes that are visible to the target virtual character in each of the reachable area grids as the visible sub-scenes corresponding to each of the reachable area grids; Set the association relationship between each of the reachable area grids and the corresponding visible sub-scene.

11. An electronic device Characterized in that It includes: A memory, configured to store a computer program; A processor, configured to implement the steps in the game scene rendering method according to any one of claims 1 to 9 when executing the computer program.

12. A computer-readable storage medium Characterized in that A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the game scene rendering method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method for processing cosmically complex three-dimensional scene based on eight-fork tree

    CN101281654A

  • HDR rendering method and device in game, electronic equipment and storage medium

    CN109364486A