Picture rendering method and apparatus, storage medium, and electronic device
By selecting the main client in the MMO game client for complete rendering and generating rendering textures, the inefficiency caused by repeated rendering across multiple clients is resolved, improving rendering efficiency and screen smoothness.
Patent Information
- Application Number
- CN202211252407.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-10-13
AI Technical Summary
In MMO game clients, the rendering process of multiple game clients performing the entire process independently leads to low rendering efficiency and is prone to causing screen stuttering.
Select one of the multiple game clients as the main client, render it completely, and generate a render map. Other clients then render based on the render map, reducing redundant rendering processes.
It improves the rendering efficiency of multiple game clients, enhances screen smoothness, and reduces rendering pressure, especially enabling multiple clients to be run simultaneously on low-performance devices.
Smart Images

Figure CN115531876B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to the technical field of games, and specifically to a picture rendering method and device, a storage medium and an electronic device. BACKGROUND
[0002] In an MMO (Massively Multiplayer Online) game client, it is a very common behavior for a player to open multiple game clients, which means that the player uses multiple game accounts to log in to the game client on one device to play the game. With the increase of three-dimensional models and scene resources in the game client, multiple game clients independently render the complete process, which reduces the rendering efficiency and easily causes picture lag. SUMMARY
[0003] The embodiments of the present application provide a picture rendering method and device, a storage medium and an electronic device, which can improve the rendering efficiency of multiple game clients and improve the picture fluency.
[0004] The embodiments of the present application provide a picture rendering method applied to an electronic device, wherein multiple game clients run on the electronic device, and the method comprises the following steps.
[0005] When it is detected that the multiple game clients meet a preset condition, one game client is selected as a main client from the multiple game clients, and the other game clients are selected as auxiliary clients; the preset condition comprises that a repetition ratio of to-be-rendered pictures of the multiple game clients exceeds a preset ratio.
[0006] The to-be-rendered picture of the main client is rendered to obtain a rendering result.
[0007] According to the rendering result, a rendering map is generated.
[0008] According to the rendering map, the to-be-rendered picture of the auxiliary client is rendered.
[0009] Optionally, the method further comprises the following steps.
[0010] When it is detected that the virtual characters corresponding to the multiple game clients are in a team state or the distance between the virtual characters corresponding to the multiple game clients in a game scene is less than a preset distance, it is determined that the repetition ratio of the to-be-rendered pictures of the multiple game clients exceeds the preset ratio.
[0011] Optionally, the preset condition further comprises that the network delay of the multiple game clients is less than a preset value.
[0012] Optionally, the selecting one game client as the master client from the plurality of game clients comprises:
[0013] randomly selecting one game client as the master client from the plurality of game clients.
[0014] Optionally, the selecting one game client as the master client from the plurality of game clients comprises:
[0015] selecting the game client corresponding to the virtual role that enters the game scene first as the master client.
[0016] Optionally, the rendering result comprises a scene rendering result and a role rendering result.
[0017] The rendering the to-be-rendered picture of the master client to obtain a rendering result comprises:
[0018] rendering a game scene in the to-be-rendered picture of the master client to obtain the scene rendering result, and storing the scene rendering result to a scene cache area.
[0019] rendering a virtual role in the to-be-rendered picture of the master client to obtain the role rendering result, and storing the role rendering result to a role cache area.
[0020] Optionally, the rendering map comprises a scene map and a role map.
[0021] The generating a rendering map according to the rendering result comprises:
[0022] generating the scene map according to the scene rendering result in the scene cache area, and storing the scene map to the scene cache area.
[0023] generating the role map according to the role rendering result in the role cache area, and storing the role map to the role cache area.
[0024] Optionally, the rendering the to-be-rendered picture of the slave client according to the rendering map comprises:
[0025] uploading the rendering map to a cloud server.
[0026] sampling a rendering map from the cloud server.
[0027] rendering the to-be-rendered picture of the slave client according to the sampled rendering map.
[0028] Optionally, the method further comprises:
[0029] When it is detected that the main client and the secondary client do not satisfy the preset condition, the to-be-rendered picture of the main client and the to-be-rendered picture of the secondary client are separately rendered.
[0030] The embodiment of the present application further provides a picture rendering device, which is applied to an electronic device, and a plurality of game clients run on the electronic device. The device comprises:
[0031] The selecting module is configured to select one game client as a main client and other game clients as secondary clients from the plurality of game clients when it is detected that the plurality of game clients satisfy a preset condition, and the preset condition comprises that a repetition ratio of to-be-rendered pictures of the plurality of game clients exceeds a preset ratio.
[0032] The first rendering module is configured to render the to-be-rendered picture of the main client to obtain a rendering result.
[0033] The generating module is configured to generate a rendering map according to the rendering result.
[0034] The second rendering module is configured to render the to-be-rendered picture of the secondary client according to the rendering map.
[0035] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor to execute steps in the picture rendering method according to any one of the above embodiments.
[0036] The embodiment of the present application further provides an electronic device, which comprises a memory and a processor, and the memory stores a computer program, and the processor executes steps in the picture rendering method according to any one of the above embodiments by calling the computer program stored in the memory.
[0037] The picture rendering method, device, storage medium and electronic device provided by the embodiment of the present application select one game client as a main client and other game clients as secondary clients from the plurality of game clients when it is detected that the plurality of game clients satisfy a preset condition, and the preset condition comprises that a repetition ratio of to-be-rendered pictures of the plurality of game clients exceeds a preset ratio; render the to-be-rendered picture of the main client to obtain a rendering result; generate a rendering map according to the rendering result; and render the to-be-rendered picture of the secondary client according to the rendering map. When the to-be-rendered pictures of the plurality of game clients are repeated, the embodiment of the present application selects a main client to perform complete picture rendering, and other game clients directly perform rendering according to the rendering result of the main client, thereby reducing the rendering process of the plurality of game clients, improving the rendering efficiency of the plurality of game clients, and improving picture fluency. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a schematic diagram of a screen rendering apparatus provided in an embodiment of this application.
[0040] Figure 2 This is a flowchart illustrating the screen rendering method provided in an embodiment of this application.
[0041] Figure 3 This is a scene diagram illustrating the screen rendering method provided in an embodiment of this application.
[0042] Figure 4 This is another schematic diagram of the screen rendering method provided in the embodiments of this application.
[0043] Figure 5 This is a schematic diagram of the structure of the image rendering device provided in the embodiments of this application.
[0044] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] Embodiments of the present application provide a picture rendering method and device, a storage medium and an electronic device. Specifically, the picture rendering method of embodiments of the present application can be executed by an electronic device, which can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), and the like. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, an instant messaging client, or the like. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms.
[0047] For example, when the picture rendering method is executed by a terminal, the terminal device stores a game application program and is used to present a virtual scene in a game picture. The terminal device is used to interact with a user through a graphical user interface, for example, by downloading and installing a game application program and running the game application program through the terminal device. The terminal device can provide the graphical user interface to the user in various ways, for example, the graphical user interface 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 a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface, the graphical user interface includes a game picture, and the processor is used to run 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.
[0048] For example, when the picture rendering method is run on a server, it can be cloud gaming. Cloud gaming refers to a game mode based on cloud computing. In the running mode of cloud gaming, the running body of the game application and the game picture presentation body are separated, and the storage and running of the skill control method are completed on the cloud game server. The game picture presentation is completed on the cloud game client. The cloud game client is mainly used for receiving, sending and presenting game pictures. For example, the cloud game client can be a display device close to the user side with data transmission function, such as mobile terminal, television, computer, palm computer, personal digital assistant, etc., but the terminal device for game data processing is the cloud game server in the cloud. When playing the game, the user operates the cloud game client to send operation instructions to the cloud game server, the cloud game server runs the game according to the operation instructions, encodes and compresses the game picture data, returns to the cloud game client through the network, and finally decodes and outputs the game picture through the cloud game client.
[0049] Please refer to Figure 1 , Figure 1 The system schematic diagram of the picture rendering device provided by the embodiment of the application is shown in the figure. The system can include a plurality of terminals 1000, at least one server 2000, at least one database 3000, and a network 4000. The terminal 1000 held by the user can be connected to the server of different games through the network 4000. The terminal 1000 is any device with computing hardware capable of supporting and executing software products corresponding to the game. In addition, the terminal 1000 has one or more multi-touch screens for sensing and obtaining the input of the user through touch or sliding operation performed at one or more points of the touch display screen. In addition, when the system includes a plurality of terminals 1000, a plurality of servers 2000, and a plurality of networks 4000, different terminals 1000 can be connected to each other through different networks 4000, through different servers 2000. The network 4000 can be a wireless network or a wired network, such as a wireless network, 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. In addition, different terminals 1000 can also use their own Bluetooth network or hotspot network to connect to other terminals or servers, etc. For example, multiple users can be online through different terminals 1000 to support multi-player games by connecting through appropriate networks and synchronizing with each other. In addition, the system can include a plurality of databases 3000, and the plurality of databases 3000 are coupled to different servers 2000, and information related to the game environment can be continuously stored in the database 3000 when different users are online for multi-player games.
[0050] Embodiments of the present application provide a picture rendering method, which can be executed by a terminal or a server. Embodiments of the present application take an example of a picture rendering method executed by a terminal to illustrate. The terminal comprises a touch display screen and a processor. The touch display screen is configured to present a graphical user interface and receive an operation instruction generated by a user acting on the graphical user interface. When the user operates the graphical user interface through the touch display screen, the graphical user interface can control the content of the terminal locally in response to the received operation instruction, or control the content of a server at the other end in response to the received operation instruction. For example, the operation instruction generated by the user acting on the graphical user interface comprises an instruction for starting a game application. The processor is configured to start the game application after receiving the instruction for starting the game application provided by the user. In addition, the processor is configured to render and draw a graphical user interface associated with the game on the touch display screen. The touch display screen is a multi-touch screen capable of sensing the touch or sliding operation of multiple points on the screen simultaneously. The user uses a finger to perform a touch operation on the graphical user interface. When the graphical user interface detects the touch operation, the graphical user interface controls different virtual objects in the graphical user interface of the game to perform actions corresponding to the touch operation. The game can comprise a virtual scene of the game drawn on the graphical user interface. In addition, the virtual scene of the game can comprise one or more virtual objects controlled by the user (or player), such as a virtual character. In addition, the virtual scene of the game can also comprise one or more obstacles, such as a railing, a ditch, a wall, etc., to limit the movement of the virtual object, for example, to limit the movement of one or more objects to a specific area within the virtual scene. Optionally, the virtual scene of the game also comprises one or more elements, such as skills, scores, character health status, energy, etc., to provide assistance to the player, provide virtual services, increase scores related to the performance of the player, etc. In addition, the graphical user interface can also present one or more indicators to provide indication information to the player. For example, the game can comprise a virtual object controlled by the player and one or more other virtual objects (such as enemy characters). In an embodiment, the one or more other virtual objects are controlled by other players of the game. For example, the one or more other virtual objects can be controlled by a computer, such as a robot using an artificial intelligence (AI) algorithm, to implement a man-machine combat mode. For example, the virtual object has various skills or abilities used by the game player to achieve the goal. For example, the virtual object has one or more weapons, props, tools, etc. that can be used to eliminate other objects from the game. Such skills or abilities can be activated by the game player using one of the plurality of preset touch operations of the touch display screen of the terminal. The processor can be configured to present a corresponding game picture in response to the operation instruction generated by the touch operation of the user.
[0051] The specific embodiments are described in detail below.
[0052] Please refer toFigure 2 This is a schematic flowchart of a screen rendering method provided in an embodiment of this application. The screen rendering method provided in this embodiment is applied to an electronic device, which runs multiple game clients. The specific flow of the method is as follows:
[0053] Step 101: When it is detected that the multiple game clients meet the preset conditions, select one game client from the multiple game clients as the main client and the other game clients as secondary clients; the preset conditions include the repetition ratio of the images to be rendered by the multiple game clients exceeding a preset ratio.
[0054] In this embodiment, multiple game clients are clients of the same game installed on the same electronic device. It is understood that some game applications support multiple client instances, that is, game players can log in to the same game client on one electronic device through multiple game accounts, with each game account corresponding to one game client, thereby running multiple game clients on the electronic device.
[0055] Since multiple game clients are for the same game and are played by the same player, the probability is high that the virtual characters corresponding to these clients will be in the same or similar positions within the game scene. The game scene is the virtual environment provided by the game when it runs on an electronic device. This virtual environment can be a simulation of the real world, a semi-simulated / semi-fictional 3D environment, or a purely fictional 3D environment. A virtual character refers to a character that moves within the game scene, such as a virtual avatar. Each game client corresponds to one virtual character, and players can control different virtual characters through multiple game clients.
[0056] Because the virtual characters corresponding to multiple game clients are highly likely to be in the same or similar positions in the game scene, the probability of screen repetition among multiple game clients is also high. That is, the screens displayed by multiple game clients are likely to be completely identical or largely the same. If each game client is rendered with a complete screen rendering process, and the rendered content is mostly the same, unnecessary rendering processes will be generated, rendering efficiency will be reduced, screen stuttering will occur, and a large amount of memory will be consumed by electronic devices. It may even prevent low-performance electronic devices from running multiple clients simultaneously.
[0057] Based on this, the embodiment pre-sets the opening condition (i.e. preset condition) of the specific rendering mode for multiple game clients (two or more game clients) and detects the multiple game clients in real time. When the preset condition is met, the specific rendering mode is opened to render the pictures of the multiple game clients in the specific rendering mode. The preset condition can include that the repetition ratio of the pictures to be rendered of the multiple game clients exceeds a preset ratio, i.e. the pictures to be rendered of the multiple game clients are at least partially the same, and the ratio of the at least partially same area to the entire display area exceeds the preset ratio. The preset ratio can be set according to actual needs, for example, the preset ratio can be set to 50%.
[0058] The detection method of whether the repetition ratio of the pictures to be rendered of the multiple game clients exceeds the preset ratio can be various. In one embodiment, the state of the virtual characters corresponding to the multiple game clients is detected. If it is detected that the virtual characters corresponding to the multiple game clients are in a team state, it is determined that the repetition ratio of the pictures to be rendered of the multiple game clients exceeds the preset ratio. That is, when it is detected that the virtual characters corresponding to the multiple game clients are in a team state, the specific rendering mode is opened.
[0059] In another embodiment, the positions or distances of the virtual characters corresponding to the multiple game clients in the game scene are detected. If it is detected that the distance of the virtual characters corresponding to the multiple game clients in the game scene is less than a preset distance, it is determined that the repetition ratio of the pictures to be rendered of the multiple game clients exceeds the preset ratio. That is, when it is detected that the distance of the virtual characters corresponding to the multiple game clients in the game scene is less than a preset distance, the specific rendering mode is opened.
[0060] Optionally, the preset condition can also include that the network delay of the multiple game clients is less than a preset value. That is, while detecting the repetition ratio of the pictures to be rendered of the multiple game clients, the network delay of the multiple game clients also needs to be detected. If it is detected that the repetition ratio of the pictures to be rendered of the multiple game clients exceeds the preset ratio, and the network delay of the multiple game clients is less than the preset value, the specific rendering mode is opened. The preset value can be set according to actual needs, for example, the preset value can be set to 5ms.
[0061] It should be noted that network latency detection for multiple game clients can be replaced by network speed detection. In other words, the preset condition can also include multiple game clients having a network speed greater than a preset network speed. That is, while detecting the repetition rate of the rendered frames from multiple game clients, the network speed of each game client also needs to be detected. If the repetition rate of the rendered frames from multiple game clients exceeds a preset rate, and the network speed of each game client is greater than the preset network speed, then a specific rendering mode is activated. The preset network speed can be set according to actual needs; for example, it can be set to 100 MB / s.
[0062] If multiple game clients are detected as not meeting the preset conditions (e.g., the repetition ratio of the images to be rendered by multiple game clients does not exceed the preset ratio, or the network latency of multiple game clients is greater than the preset value, or the network speed of multiple game clients is less than the preset network speed), then the specific rendering mode will not be enabled, and the complete rendering process will be used to render the images to be rendered by multiple game clients separately.
[0063] After enabling a specific rendering mode, one game client is selected from multiple game clients as the primary client, and the others are designated as secondary clients. There are several ways to select the primary client.
[0064] In one implementation, step 101, selecting a game client from the plurality of game clients as the main client, includes: randomly selecting a game client from the plurality of game clients as the main client.
[0065] like Figure 3 As shown, five game clients are running on the electronic device: game client 10a, game client 10b, game client 10c, game client 10d, and game client 10e. After a specific rendering mode is enabled, game client 10a is randomly selected from the five game clients as the main client, and the other four game clients (game client 10b, game client 10c, game client 10d, and game client 10e) are used as secondary clients.
[0066] In another embodiment, step 102, selecting a game client from the plurality of game clients as the main client, includes: selecting the game client corresponding to the virtual character that first enters the game scene from the plurality of game clients as the main client.
[0067] Multiple game clients correspond to virtual characters within a single game scene, allowing only one main client to be set up for each scene. After enabling a specific rendering mode, the time when the virtual characters from multiple game clients enter the game scene is detected. The game client corresponding to the first virtual character to enter the scene is then designated as the main client, with the others designated as secondary clients.
[0068] like Figure 3 The five game clients shown, after enabling a specific rendering mode, detect that the virtual character corresponding to game client 10a enters the game scene first. Then, game client 10a is designated as the main client, and the other four game clients (i.e., game client 10b, game client 10c, game client 10d, and game client 10e) are designated as secondary clients.
[0069] After selecting the main client, if a new game client's corresponding virtual character enters the game scene, that is, if a player logs into the game client on an electronic device with a new game account and the corresponding virtual character enters the game scene after logging in, it can be checked whether the game client and the main client meet preset conditions. For example, it can be checked whether the overlap ratio between the rendering screen of the game client and the rendering screen of the main client is greater than a preset ratio. If so, the game client can be directly used as a secondary client, and a specific rendering mode will be used to render the screen of the game client.
[0070] Step 102: Render the screen to be rendered on the main client to obtain the rendering result.
[0071] In this embodiment, a complete rendering process is employed to render the image to be rendered on the main client, yielding a rendering result. The rendering result is the rendered image, which is then displayed on the main client. For example, lighting rendering is performed on the image to be rendered on the main client. Specifically, the depth map, normal map, and color map of the image to be rendered on the main client are sampled; based on the depth map, the coordinates of each point in the image to be rendered in the projection space are obtained; based on the depth map, the coordinates of each point in the image to be rendered in the world space are obtained; based on the normal map, the normal vector of each point in the image to be rendered in the world space is obtained; based on the color map, the color information of each point in the image to be rendered is obtained; based on the coordinates of each point in the world space, the normal vector in the world space, and the color information, lighting calculations are performed to obtain the pixel color of each point in the image to be rendered; based on the coordinates of each point in the projection space and the pixel color, the rendering result is obtained. It should be noted that the image to be rendered on the main client can also be rendered using other rendering methods, which are not specifically limited here.
[0072] When the to-be-rendered picture of the host client includes a game scene and a virtual character located in the game scene, a complete rendering process can be adopted to render the game scene and the virtual character in the to-be-rendered picture respectively, so as to obtain a scene rendering result and a character rendering result, that is, the rendering result includes the scene rendering result and the character rendering result. The scene rendering result and the character rendering result are synthesized, so as to obtain the rendered picture. It should be noted that if there are multiple virtual characters in the game scene, the complete rendering process needs to be adopted to render the multiple virtual characters respectively to obtain multiple character rendering results, and then the scene rendering result and the multiple character rendering results are synthesized into the rendered picture.
[0073] Specifically, the rendering of the to-be-rendered picture of the host client in step 102 to obtain a rendering result includes: rendering the game scene in the to-be-rendered picture of the host client to obtain the scene rendering result, and storing the scene rendering result to a scene cache area; and rendering the virtual character in the to-be-rendered picture of the host client to obtain the character rendering result, and storing the character rendering result to a character cache area.
[0074] The electronic device is divided into multiple cache areas, such as a scene cache area, a character cache area, and the like. After the game scene and the virtual character in the to-be-rendered picture of the host client are rendered respectively, the scene rendering result and the character rendering result can be stored to different cache areas, that is, the scene rendering result is stored to the scene cache area, and the character rendering result is stored to the character cache area. It should be noted that if there are multiple virtual characters in the game scene, multiple character cache areas are set, and the multiple character rendering results are stored to the multiple character cache areas one by one.
[0075] In step 103, a rendering map is generated according to the rendering result.
[0076] In this embodiment, when the rendering result includes a scene rendering result and a character rendering result, different maps are generated according to the scene rendering result and the character rendering result respectively, that is, the rendering map can include a scene map and a character map.
[0077] Specifically, the generation of the rendering map according to the rendering result in step 103 includes: generating the scene map according to the scene rendering result in the scene cache area, and storing the scene map to the scene cache area; and generating the character map according to the character rendering result in the character cache area, and storing the character map to the character cache area.
[0078] The scene rendering result is written back to a map and saved to obtain a scene map, and the character rendering result is written back to a map and saved to obtain a character map. It should be noted that if the rendering result includes multiple character rendering results, the multiple character rendering results are written back to a map and saved respectively, and multiple character maps are obtained correspondingly. The scene map is stored in a scene cache area, and the multiple character maps are stored in multiple character cache areas. Figure 1 A pair of corresponding storage in multiple character cache areas is stored to reduce the granularity of map storage, and is suitable for the case that the positions of the same virtual character in different game clients are inconsistent.
[0079] In step 104, the rendering picture of the secondary client is rendered according to the rendering map.
[0080] In this embodiment, since the repetition ratio of the rendering picture of the primary client and the rendering picture of the secondary client is high, the rendering map generated based on the rendering result of the primary client can be used to directly render the rendering picture of the secondary client, and the corresponding color can be output, without using a complete rendering process, such as complex lighting calculation, to obtain the same rendering effect as the primary client.
[0081] When the rendering map includes a scene map and a character map, the game scene in the rendering picture of the secondary client is rendered according to the scene map to obtain the scene rendering result of the secondary client, and the virtual character in the rendering picture of the secondary client is rendered according to the character map to obtain the character rendering result of the secondary client. The scene rendering result and the character rendering result of the secondary client are synthesized to obtain the display picture of the secondary client.
[0082] The rendering map can also be uploaded to a cloud server for sampling by more game clients. Specifically, in step 104, the rendering picture of the secondary client is rendered according to the rendering map, including uploading the rendering map to a cloud server, sampling the rendering map from the cloud server, and rendering the rendering picture of the secondary client according to the sampled rendering map.
[0083] In this embodiment, the electronic device uploads rendered textures to a cloud server. Other electronic devices or other clients of the same electronic device can sample the rendered textures uploaded by the electronic device in this embodiment from the cloud server. Other electronic devices can also upload their rendered textures to the cloud server, and the electronic device in this embodiment can also sample the rendered textures uploaded by other electronic devices from the cloud server to achieve better resource sharing. For example, players can log in to the same game client simultaneously via PC and mobile device. The PC uploads rendered textures to the cloud server, and the mobile device can sample the rendered textures uploaded by the PC from the cloud server. The mobile device can also upload rendered textures to the cloud server, and the PC can also sample the rendered textures uploaded by the mobile device from the cloud server.
[0084] Because the game client displays dynamic visuals—meaning the image to be rendered on the game client is dynamic—the electronic device generates rendered textures in real time. After uploading these textures to the cloud server, the electronic device deletes the cached rendered textures. In other words, after uploading scene and character textures to the cloud server, the electronic device deletes the scene textures from the scene cache and the character textures from the character cache. Similarly, after the cloud server distributes the rendered textures to the electronic client, it can also delete the cached rendered textures from that client.
[0085] After sampling the rendering texture, the electronic device can directly render the image to be rendered on the secondary client based on the sampled rendering texture. That is, it can directly output the corresponding color based on the sampled rendering texture without using a complete rendering process, such as complex lighting calculations, and obtain the same rendering effect as the main client.
[0086] like Figure 3 The five game clients shown are designated as follows: Game Client 10a is the main client, and Game Clients 10b, 10c, 10d, and 10e are secondary clients. A complete rendering workflow is employed. The screen to be rendered in Game Client 10a is rendered to obtain the rendering result. A rendering texture is generated based on this result and uploaded to cloud server 20. The rendering texture is sampled from cloud server 20, and based on the sampled rendering texture, the screens to be rendered in Game Clients 10b, 10c, 10d, and 10e are rendered. This effectively saves rendering time for Game Clients 10b, 10c, 10d, and 10e, improving their rendering efficiency.
[0087] In some embodiments, the method further comprises: when it is detected that the master client and the slave client do not satisfy the preset condition, separately rendering the to-be-rendered picture of the master client and the to-be-rendered picture of the slave client respectively.
[0088] After the specific rendering mode is started, if there is one slave client and the master client and the slave client do not satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of the master client and the to-be-rendered picture of the slave client does not exceed the preset ratio), the master client and the slave client both exit the specific rendering mode and separately render the to-be-rendered picture of the master client and the to-be-rendered picture of the slave client respectively by using a complete rendering process.
[0089] After the specific rendering mode is started, if there are multiple slave clients and the master client and each slave client do not satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of the master client and the to-be-rendered picture of each slave client does not exceed the preset ratio), and any two slave clients also do not satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of any two slave clients does not exceed the preset ratio), the master client and the multiple slave clients both exit the specific rendering mode and separately render the to-be-rendered picture of the master client and the to-be-rendered picture of the multiple slave clients respectively by using a complete rendering process.
[0090] After the specific rendering mode is started, if there are multiple slave clients and a certain slave client and the master client do not satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of the slave client and the to-be-rendered picture of the master client does not exceed the preset ratio), and other slave clients and the master client still satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of the other slave clients and the to-be-rendered picture of the master client exceeds the preset ratio), the slave client exits the specific rendering mode and renders the to-be-rendered picture of the slave client by using a complete rendering process, and the master client and the other slave clients still perform picture rendering by using the specific rendering mode.
[0091] After the specific rendering mode is started, if there are multiple slave clients and the master client and each slave client do not satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of the master client and the to-be-rendered picture of each slave client does not exceed the preset ratio), and the multiple slave clients satisfy the preset condition (for example, the repetition ratio of the to-be-rendered picture of the multiple slave clients exceeds the preset ratio), the master client exits the specific rendering mode, reselects a slave client from the multiple slave clients as the master client, and makes the multiple slave clients still perform picture rendering by using the specific rendering mode.
[0092] All the technical solutions described above can be combined to form optional embodiments of the present application, which will not be described again.
[0093] The picture rendering method provided by the embodiments of the present application selects one game client as a master client and selects other game clients as slave clients from the multiple game clients when it is detected that the multiple game clients meet preset conditions; the preset conditions include that a repetition ratio of the to-be-rendered pictures of the multiple game clients exceeds a preset ratio; the to-be-rendered picture of the master client is rendered to obtain a rendering result; a rendering map is generated according to the rendering result; and the to-be-rendered picture of the slave client is rendered according to the rendering map. When the to-be-rendered pictures of the multiple game clients are repeated, the embodiments of the present application select a master client to perform complete picture rendering, and other game clients directly perform rendering according to the rendering result of the master client, thereby reducing the rendering process of the multiple game clients, improving the rendering efficiency of the multiple game clients, improving picture fluency, and ensuring that low-performance devices can also realize multiple opening of game clients.
[0094] Please refer to Figure 4 , Figure 4 Another flowchart of the picture rendering method provided by the embodiments of the present application is shown. The method is applied to an electronic device, and multiple game clients run on the electronic device. The specific flow of the method can be as follows.
[0095] Step 201: When it is detected that virtual characters corresponding to the multiple game clients are in a teaming state, and network delays of the multiple game clients are less than a preset value, a specific rendering mode is started.
[0096] Step 202: One game client is randomly selected as a master client from the multiple game clients, and other game clients are selected as slave clients.
[0097] Step 203: The to-be-rendered picture of the master client is rendered to obtain a scene rendering result and a character rendering result.
[0098] In this step, the to-be-rendered picture of the master client is rendered by using a complete rendering process.
[0099] Step 204: A scene map is generated according to the scene rendering result, and a character map is generated according to the character rendering result.
[0100] Step 205: The scene map and the character map are uploaded to a cloud server.
[0101] Step 206: The scene map and the character map are sampled from the cloud server.
[0102] Step 207: The to-be-rendered picture of the slave client is rendered according to the sampled scene map and character map.
[0103] According to the sampled scene map, the scene in the to-be-rendered picture of the secondary client is rendered, and according to the character map, the virtual character in the to-be-rendered picture of the secondary client is rendered.
[0104] Step 208, when it is detected that the virtual characters corresponding to the multiple game clients exit the team or are in the temporary leave state, or the network delay of the multiple game clients is greater than the preset value, the specific rendering mode is exited.
[0105] If the virtual character corresponding to the game client A (including the primary client or the secondary client) exits the team or is in the temporary leave state, or the network delay of the game client A is greater than the preset value, the virtual characters corresponding to the other game clients (including two or more game clients) are still in the teaming state, and the network delay of the other game clients is less than the preset value, the game client A exits the specific rendering mode. The complete rendering process is used to render the to-be-rendered picture of the game client A. The other game clients still use the specific rendering mode to render the picture (if the other game clients do not have a primary client, a game client can be selected from the other game clients as a new primary client). The temporary leave state refers to a state in which the virtual character does not directly leave the team, but has autonomous control and does not follow the team action.
[0106] The embodiment can reduce the rendering pressure when multiple game clients are opened, and effectively improve the smoothness when multiple game clients are opened.
[0107] All the technical solutions described above can be combined to form optional embodiments of the present application, which will not be described one by one.
[0108] In order to better implement the picture rendering method of the embodiments of the present application, the embodiments of the present application also provide a picture rendering device. Please refer to Figure 5 , Figure 5 The structure diagram of the picture rendering device provided by the embodiments of the present application. The picture rendering device 300 is applied to an electronic device, the electronic device runs multiple game clients, and the picture rendering device 300 can include a selection module 301, a first rendering module 302, a generation module 303 and a second rendering module 304.
[0109] The selection module 301 is used for selecting one game client as a primary client and other game clients as secondary clients from the multiple game clients when it is detected that the multiple game clients meet a preset condition; the preset condition includes that the repetition ratio of the to-be-rendered pictures of the multiple game clients exceeds a preset ratio;
[0110] The first rendering module 302 is used for rendering the to-be-rendered picture of the primary client to obtain a rendering result.
[0111] generating a rendering map according to the rendering result;
[0112] rendering the to-be-rendered picture of the secondary client according to the rendering map.
[0113] Optionally, the apparatus further comprises a determining module configured to:
[0114] determine that the repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds a preset ratio when it is detected that the virtual characters corresponding to the plurality of game clients are in a team formation state or the distance between the virtual characters corresponding to the plurality of game clients in a game scene is less than a preset distance.
[0115] Optionally, the preset condition further comprises that the network delay of the plurality of game clients is less than a preset value.
[0116] Optionally, the selecting module 301 is further configured to:
[0117] randomly select one game client from the plurality of game clients as the primary client.
[0118] Optionally, the selecting module 301 is further configured to:
[0119] select the game client corresponding to the virtual character that enters the game scene first from the plurality of game clients as the primary client.
[0120] Optionally, the rendering result comprises a scene rendering result and a character rendering result.
[0121] The first rendering module 302 is further configured to:
[0122] render the game scene in the to-be-rendered picture of the primary client to obtain the scene rendering result, and store the scene rendering result in a scene cache area;
[0123] render the virtual character in the to-be-rendered picture of the primary client to obtain the character rendering result, and store the character rendering result in a character cache area.
[0124] Optionally, the rendering map comprises a scene map and a character map.
[0125] The generating module 303 is further configured to:
[0126] generate the scene map according to the scene rendering result in the scene cache area, and store the scene map in the scene cache area;
[0127] According to a rendering result of the character in the character buffer area, the character map is generated and stored in the character buffer area.
[0128] Optionally, the second rendering module 304 is further configured to:
[0129] upload the rendering map to a cloud server;
[0130] sample the rendering map from the cloud server;
[0131] render the to-be-rendered picture of the secondary client according to the sampled rendering map.
[0132] Optionally, the device further comprises a third rendering module configured to:
[0133] when it is detected that the primary client and the secondary client do not satisfy the preset condition, separately render the to-be-rendered picture of the primary client and the to-be-rendered picture of the secondary client.
[0134] All the technical solutions described above can be combined to form optional embodiments of the present application, which will not be described again.
[0135] The picture rendering device 300 provided by the embodiments of the present application detects that the plurality of game clients satisfy the preset condition, selects one game client as a primary client and selects other game clients as secondary clients when the plurality of game clients satisfy the preset condition, wherein the preset condition comprises that a repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds a preset ratio; renders the to-be-rendered picture of the primary client to obtain a rendering result; generates a rendering map according to the rendering result; and renders the to-be-rendered picture of the secondary client according to the rendering map. When the to-be-rendered pictures of the plurality of game clients are repeated, the embodiments of the present application select a primary client to perform complete picture rendering, and other game clients directly perform rendering according to the rendering result of the primary client, thereby reducing the rendering process of the plurality of game clients, improving the rendering efficiency of the plurality of game clients, and improving the picture fluency.
[0136] Correspondingly, the embodiments of the present application further provide an electronic device, which can be a terminal or a server. 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 (PC), a personal digital assistant (PDA), and the like. Figure 6 As shown in Figure 6A structural schematic diagram of an electronic device is provided in the embodiments of the present application. The electronic device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. 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 can include more or fewer components than shown in the figure, or combine certain components, or different component arrangements.
[0137] The processor 401 is the control center of the electronic device 400, and connects various parts of the entire electronic device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402 and calling data stored in the memory 402, the processor 401 performs various functions and processes data of the electronic device 400, thereby overall monitoring the electronic device 400.
[0138] In the embodiments of the present application, the processor 401 in the electronic device 400 will load the instructions corresponding to the processes of one or more application programs into the memory 402, and run the application programs stored in the memory 402 by the processor 401, thereby realizing various functions:
[0139] When it is detected that the plurality of game clients meet a preset condition, a game client is selected as a master client from the plurality of game clients, and other game clients are selected as slave clients; the preset condition includes that a repetition ratio of to-be-rendered pictures of the plurality of game clients exceeds a preset ratio;
[0140] The to-be-rendered picture of the master client is rendered to obtain a rendering result;
[0141] According to the rendering result, a rendering map is generated;
[0142] According to the rendering map, the to-be-rendered picture of the slave client is rendered.
[0143] Optionally, the function further includes:
[0144] When it is detected that the virtual characters corresponding to the plurality of game clients are in a team formation state, or the distance between the virtual characters corresponding to the plurality of game clients in a game scene is less than a preset distance, it is determined that the repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds the preset ratio.
[0145] Optionally, the preset condition further includes that the network delay of the plurality of game clients is less than a preset value.
[0146] Optionally, the selecting one game client as the master client from the plurality of game clients comprises:
[0147] randomly selecting one game client as the master client from the plurality of game clients.
[0148] Optionally, the selecting one game client as the master client from the plurality of game clients comprises:
[0149] selecting the game client corresponding to the virtual role that enters the game scene first as the master client.
[0150] Optionally, the rendering result comprises a scene rendering result and a role rendering result.
[0151] The rendering the to-be-rendered picture of the master client to obtain a rendering result comprises:
[0152] rendering a game scene in the to-be-rendered picture of the master client to obtain the scene rendering result, and storing the scene rendering result to a scene cache area.
[0153] rendering a virtual role in the to-be-rendered picture of the master client to obtain the role rendering result, and storing the role rendering result to a role cache area.
[0154] Optionally, the rendering map comprises a scene map and a role map.
[0155] The generating a rendering map according to the rendering result comprises:
[0156] generating the scene map according to the scene rendering result in the scene cache area, and storing the scene map to the scene cache area.
[0157] generating the role map according to the role rendering result in the role cache area, and storing the role map to the role cache area.
[0158] Optionally, the rendering the to-be-rendered picture of the slave client according to the rendering map comprises:
[0159] uploading the rendering map to a cloud server.
[0160] sampling a rendering map from the cloud server.
[0161] rendering the to-be-rendered picture of the slave client according to the sampled rendering map.
[0162] Optionally, the function further comprises:
[0163] When it is detected that the master client and the secondary client do not satisfy preset conditions, the to-be-rendered picture of the master client and the to-be-rendered picture of the secondary client are separately rendered.
[0164] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described herein.
[0165] Optionally, as shown in Figure 6 The electronic device 400 further includes a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected with the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. Those skilled in the art can understand that the electronic device structure shown in Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and can include more or fewer components than shown, or combine certain components, or different component arrangements.
[0166] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by user acting on the graphical user interface. The touch display screen 403 can include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which 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 (such as user operations on or near the touch panel using a finger, a stylus or any suitable object or accessory) of the user thereon or therearound, and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts of a touch detection device and a touch controller. 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, and converts it into touch coordinates, and then sends it to the processor 401, and can also receive and execute the commands sent by the processor 401. The touch panel can cover the display panel, and when the touch panel detects a touch operation thereon or therearound, it transmits to the processor 401 to determine the type of the touch event, and then the processor 401 provides corresponding visual output on the display panel according to the type of the touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can realize the input and output functions as two independent components. That is, the touch display screen 403 can also realize the input function as part of the input unit 406.
[0167] In the embodiments of the present application, the processor 401 executes the road network generation software to generate a graphical user interface on the touch display screen 403. The touch display screen 403 is used to present the graphical user interface and receive operation instructions generated by the user acting on the graphical user interface.
[0168] The radio frequency circuit 404 can be used to transceive radio frequency signals to establish wireless communication with network devices or other electronic devices, and transceive signals between network devices or other electronic devices.
[0169] The audio circuit 405 can be used to provide an audio interface between a user and the electronic device through a speaker and a microphone. The audio circuit 405 can convert received audio data into an electrical signal and transmit the electrical signal to the speaker for conversion into a sound signal and output by the speaker. On the other hand, the microphone can collect a sound signal and convert the sound signal into an electrical signal, which is received by the audio circuit 405 and converted into audio data. The audio data is output to the processor 401 for processing, and then transmitted to another electronic device through the radio frequency circuit 404, for example, or output to the memory 402 for further processing. The audio circuit 405 can also include a jack for a headset to provide communication between the headset and the electronic device.
[0170] The input unit 406 can be used to receive inputted numbers, character information or user feature information (e.g., fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0171] The power supply 407 is used to supply power to various components of the electronic device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so that the power management system can be used to manage charging, discharging and power consumption management, etc. The power supply 407 can also include one or more direct current or alternating current power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, etc.
[0172] Although Figure 6 The electronic device 400 can also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which are not described herein.
[0173] In the above embodiments, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0174] As can be seen from the above, the electronic device provided in the embodiment detects that the plurality of game clients meet a preset condition, selects one game client as a master client from the plurality of game clients, and selects other game clients as slave clients; the preset condition includes that a repetition ratio of to-be-rendered pictures of the plurality of game clients exceeds a preset ratio; a to-be-rendered picture of the master client is rendered to obtain a rendering result; a rendering map is generated according to the rendering result; and a to-be-rendered picture of the slave client is rendered according to the rendering map. When the to-be-rendered pictures of the plurality of game clients are repeated, the embodiment selects a master client to perform complete picture rendering, and other game clients directly perform rendering according to the rendering result of the master client, thereby reducing the rendering process of the plurality of game clients, improving the rendering efficiency of the plurality of game clients, and improving the picture fluency.
[0175] Those skilled 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 related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0176] To this end, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of computer programs capable of being loaded by a processor to execute the steps in any of the picture rendering methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0177] When it is detected that the plurality of game clients meet a preset condition, a game client is selected as a master client from the plurality of game clients, and other game clients are selected as slave clients; the preset condition includes that a repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds a preset ratio;
[0178] The to-be-rendered picture of the master client is rendered to obtain a rendering result;
[0179] According to the rendering result, a rendering map is generated;
[0180] According to the rendering map, the to-be-rendered picture of the slave client is rendered.
[0181] Optionally, the method further includes:
[0182] When it is detected that the virtual characters corresponding to the plurality of game clients are in a team state, or the distance between the virtual characters corresponding to the plurality of game clients in a game scene is less than a preset distance, it is determined that the repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds the preset ratio.
[0183] Optionally, the preset condition further includes that the network delay of the plurality of game clients is less than a preset value.
[0184] Optionally, the selecting a game client as a master client from the plurality of game clients includes:
[0185] A game client is randomly selected as the master client from the plurality of game clients.
[0186] Optionally, the selecting a game client as a master client from the plurality of game clients includes:
[0187] The game client corresponding to the virtual character that enters the game scene first among the plurality of game clients is selected as the master client.
[0188] Optionally, the rendering result comprises a scene rendering result and a character rendering result.
[0189] The rendering of the to-be-rendered picture of the main client obtains a rendering result, comprising:
[0190] The game scene in the to-be-rendered picture of the main client is rendered to obtain the scene rendering result, and the scene rendering result is stored in a scene cache area.
[0191] The virtual character in the to-be-rendered picture of the main client is rendered to obtain the character rendering result, and the character rendering result is stored in a character cache area.
[0192] Optionally, the rendering map comprises a scene map and a character map.
[0193] The rendering map is generated according to the rendering result, comprising:
[0194] The scene map is generated according to the scene rendering result in the scene cache area, and the scene map is stored in the scene cache area.
[0195] The character map is generated according to the character rendering result in the character cache area, and the character map is stored in the character cache area.
[0196] Optionally, the rendering of the to-be-rendered picture of the secondary client according to the rendering map comprises:
[0197] The rendering map is uploaded to a cloud server.
[0198] The rendering map is sampled from the cloud server.
[0199] The to-be-rendered picture of the secondary client is rendered according to the sampled rendering map.
[0200] Optionally, the method further comprises:
[0201] When it is detected that the main client and the secondary client do not satisfy a preset condition, the to-be-rendered picture of the main client and the to-be-rendered picture of the secondary client are respectively rendered individually.
[0202] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here.
[0203] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0204] Since the computer program stored in the storage medium can execute the steps in any of the picture rendering methods provided by the embodiments of the present application, the beneficial effects that can be achieved by any of the picture rendering methods provided by the embodiments of the present application can be achieved, which are described in detail in the foregoing embodiments and will not be described here again.
[0205] The foregoing describes in detail a picture rendering method, device, storage medium and electronic equipment provided by the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples in this paper. The foregoing description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, the specific implementation manners and application ranges will be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A picture rendering method, characterized in that, The method is applied to an electronic device, and a plurality of game clients for the same game run on the electronic device, and the method comprises the following steps: When it is detected that the plurality of game clients meet a preset condition, one game client is selected as a master client from the plurality of game clients, and other game clients are selected as slave clients; the preset condition comprises that a repetition ratio of to-be-rendered pictures of the plurality of game clients exceeds a preset ratio, and network delays of the plurality of game clients are less than a preset value; A to-be-rendered picture of the master client is rendered to obtain a rendering result; According to the rendering result, a rendering map is generated; According to the rendering map, a to-be-rendered picture of the slave client is rendered.
2. The picture rendering method of claim 1, wherein, The method further comprises the following steps: When it is detected that virtual characters corresponding to the plurality of game clients are in a teaming state or the distance between the virtual characters in a game scene is less than a preset distance, it is determined that the repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds the preset ratio.
3. The picture rendering method of claim 1, wherein, The step of selecting one game client as a master client from the plurality of game clients comprises the following steps: One game client is randomly selected as the master client from the plurality of game clients.
4. The picture rendering method of claim 1, wherein, The step of selecting one game client as a master client from the plurality of game clients comprises the following steps: A game client corresponding to a virtual character that enters a game scene first is selected as the master client from the plurality of game clients.
5. The picture rendering method of claim 1, wherein, The rendering result comprises a scene rendering result and a character rendering result; The step of rendering a to-be-rendered picture of the master client to obtain a rendering result comprises the following steps: A game scene in the to-be-rendered picture of the master client is rendered to obtain the scene rendering result, and the scene rendering result is stored in a scene cache area; A virtual character in the to-be-rendered picture of the master client is rendered to obtain the character rendering result, and the character rendering result is stored in a character cache area.
6. The picture rendering method of claim 5, wherein, The rendering map comprises a scene map and a character map; The step of generating a rendering map according to the rendering result comprises the following steps: The scene map is generated according to the scene rendering result in the scene cache area, and the scene map is stored in the scene cache area; The character map is generated according to the character rendering result in the character cache area, and the character map is stored in the character cache area.
7. The picture rendering method of claim 1, wherein, The step of rendering a to-be-rendered picture of the slave client according to the rendering map comprises the following steps: The rendering map is uploaded to a cloud server; The rendering map is sampled from the cloud server; The to-be-rendered picture of the slave client is rendered according to the sampled rendering map.
8. The picture rendering method of claim 1, wherein, The method further comprises the following steps: When it is detected that the master client and the slave client do not meet a preset condition, the to-be-rendered picture of the master client and the to-be-rendered picture of the slave client are separately rendered.
9. An apparatus for rendering a picture, characterized by The device is applied to an electronic device, and a plurality of game clients for the same game run on the electronic device, and the device comprises the following steps: The selecting module is configured to select one game client as a master client and other game clients as slave clients from the plurality of game clients when it is detected that the plurality of game clients meet preset conditions; the preset conditions include that a repetition ratio of the to-be-rendered pictures of the plurality of game clients exceeds a preset ratio and that network delays of the plurality of game clients are less than a preset value; The first rendering module is configured to render the to-be-rendered picture of the master client to obtain a rendering result. The generating module is configured to generate a rendering map according to the rendering result. The second rendering module is configured to render the to-be-rendered picture of the slave client according to the rendering map.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor to execute steps in the picture rendering method according to any one of claims 1-8.
11. An electronic device, comprising: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor executes steps in the picture rendering method according to any one of claims 1-8 by calling the computer program stored in the memory.
Citation Information
Patent Citations
Method and device for rendering
CN103617645A
Distributed video game system and method
US20030130040A1