[go: up one dir, main page]

CN114225386A - Coding method, device, electronic device and storage medium of scene picture - Google Patents

Coding method, device, electronic device and storage medium of scene picture Download PDF

Info

Publication number
CN114225386A
CN114225386A CN202111651823.7A CN202111651823A CN114225386A CN 114225386 A CN114225386 A CN 114225386A CN 202111651823 A CN202111651823 A CN 202111651823A CN 114225386 A CN114225386 A CN 114225386A
Authority
CN
China
Prior art keywords
target
scene
picture
client
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111651823.7A
Other languages
Chinese (zh)
Inventor
潘博渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Publication of CN114225386A publication Critical patent/CN114225386A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/355Performing operations on behalf of clients with restricted processing capabilities, e.g. servers transform changing game scene into an encoded video stream for transmitting to a mobile phone or a thin client
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a scene picture coding method, a scene picture coding device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring position information of a virtual object controlled by each target client in a target virtual scene; determining a target scene area corresponding to each target client in a target virtual scene according to the position information of the virtual object controlled by each target client; determining a target scene picture corresponding to each target client according to the scene data of each target scene area; carrying out video stream coding according to the target scene picture corresponding to each target client to obtain the video stream of each target client; and sending the video stream to the corresponding target client. The scheme realizes scene picture generation and coding in the scene areas, so that a global scene picture does not need to be generated, the global scene picture does not need to be coded, the picture coding efficiency is improved, and the scheme can be applied to the cloud game.

Description

Scene picture coding method and device, electronic equipment and storage medium
This application claims priority to chinese application No. 202111348276.5, filed on 15/11/2021, which is hereby incorporated by reference in its entirety.
Technical Field
The present application relates to the field of virtual scene technology, and more particularly, to a method and an apparatus for encoding a scene picture, an electronic device, and a storage medium.
Background
In the related art, after executing a game control logic, a game server sends global game data of a game scene to a device in which each player is located in a game office, performs screen rendering by the device in which each player is located, generates a global scene screen of the game scene, and then captures a screen corresponding to the player from the global scene screen and displays the screen on a display screen. In the process, the device where each player is located repeatedly renders the global scene picture of the game scene, and the processing resources of the device are wasted.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present application provide a method and an apparatus for encoding a scene picture, an electronic device, and a storage medium, so as to improve the foregoing problems.
According to an aspect of an embodiment of the present application, there is provided a method for encoding a scene picture, including: acquiring position information of a virtual object controlled by each target client in a target virtual scene, wherein the target client is a client joining a virtual game, and the target virtual scene is a virtual scene corresponding to the virtual game; determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client; determining a target scene picture corresponding to each target client according to the scene data of each target scene area; performing video stream coding according to the target scene picture corresponding to each target client to obtain the video stream of each target client; and sending the video stream to a corresponding target client.
According to an aspect of an embodiment of the present application, there is provided an apparatus for encoding a scene picture, including: the system comprises a position information acquisition module, a position information acquisition module and a position information acquisition module, wherein the position information acquisition module is used for acquiring the position information of a virtual object controlled by each target client in a target virtual scene, the target client refers to a client joining a virtual game, and the target virtual scene refers to a virtual scene corresponding to the virtual game; the target scene area determining module is used for determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client; the target scene picture determining module is used for determining a target scene picture corresponding to each target client according to the scene data of each target scene area; the video stream coding module is used for coding video streams according to the target scene pictures corresponding to the target clients to obtain the video streams of the target clients; and the video stream sending module is used for sending the video stream to the corresponding target client.
In some embodiments of the present application, the target virtual scene is a three-dimensional scene; in this embodiment, the target scene area determining module includes: the visual angle information acquisition unit is used for acquiring visual angle information corresponding to each target client; and the target scene area determining unit is used for determining a target scene area corresponding to each target client in the target virtual scene according to the visual angle information corresponding to each target client and the position information of the virtual object controlled by each target client.
In some embodiments of the present application, the target virtual scene is a three-dimensional scene; in this embodiment, the target scene picture determination module includes: a scene data acquisition unit configured to acquire scene data of each of the target scene areas; the scene data comprises model data and rendering data; the geometric processing unit is used for performing geometric processing according to the model data of each target scene area to obtain a middle scene picture of each target scene area in a screen space; and the rasterization processing unit is used for performing rasterization processing according to the intermediate scene picture of each target scene area in the screen space and the drawing data corresponding to each target scene area to obtain the target scene picture corresponding to each target client.
In some embodiments of the present application, the model data comprises first coordinate information of vertices in the corresponding target scene region; a target scene picture determination module comprising: a first transformation unit, configured to transform each vertex from a model space to a camera space under a corresponding virtual camera according to first coordinate information of each vertex in model data of each target scene area, to obtain second coordinate information of each vertex in the target scene area; the second transformation unit is used for transforming each vertex from the corresponding camera space to the homogeneous clipping space according to the second coordinate information of each vertex in the target scene area to obtain third coordinate information of each vertex in the target scene area; a third transformation unit, configured to transform each vertex from the homogeneous clipping space to the screen space based on third coordinate information of each vertex in the target scene area, to obtain fourth coordinate information of each vertex in the target scene area; and the intermediate scene picture generating unit is used for determining the intermediate scene picture of each target scene area in the screen space according to the fourth coordinate information of all the vertexes in each target scene area.
In some embodiments of the present application, a rasterization processing unit includes: and the first processing unit is used for performing rasterization processing on an intermediate scene picture corresponding to each target scene area according to the drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client.
In some embodiments of the present application, the intermediate scene picture indicates fourth coordinate information of each vertex in the corresponding target scene region in the screen space; in this embodiment, the first processing unit includes: the fragment determining unit is used for determining a plurality of fragments in each target scene area according to fourth coordinate information of each vertex in the target scene area; and the coloring and rendering unit is used for coloring and rendering the plurality of fragments in the target scene area according to the drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client.
In some embodiments of the present application, a rasterization processing unit includes: the splicing unit is used for carrying out picture splicing on the intermediate scene pictures corresponding to all the target scene areas in the target virtual scene to obtain spliced pictures; the second processing unit is used for performing rasterization processing on the spliced picture according to the drawing data corresponding to all the target scene areas to obtain a spliced scene picture; and the determining unit is used for determining the target scene pictures corresponding to the target clients in the spliced scene pictures according to the position information of the intermediate scene pictures corresponding to the target clients in the spliced pictures.
In some embodiments of the present application, the target virtual scene is a two-dimensional scene; the scene data comprises background data and mapping data of a virtual object controlled by a corresponding target client; in this embodiment, the target scene picture determination module includes: the background map generating unit is used for respectively generating a background map of each target scene area according to the background data of each target scene area; and the map processing unit is used for respectively performing map processing on the background maps of the target scene areas according to the map data of the virtual object controlled by each target client, and correspondingly obtaining the target scene pictures corresponding to each target client.
In some embodiments of the present application, an apparatus for encoding a scene picture, further includes: the size information acquisition module is used for acquiring the size information of the target virtual scene; and if the size indicated by the size information exceeds a set size threshold, switching to a target scene area determining module.
In some embodiments of the present application, an apparatus for encoding a scene picture, further includes: a global background map obtaining module, configured to obtain a global background map of the target virtual scene if the size indicated by the size information does not exceed a set size threshold; the mapping module is used for mapping all the objects of the virtual objects controlled by the target client in the global background mapping according to the position information of the virtual objects controlled by the target client in the target virtual scene to obtain a global scene picture; the scene picture area determining module is used for determining a target scene picture corresponding to each target client in the global scene picture according to the position information of the virtual object controlled by each target client and preset picture size information; and the video stream generation module is used for carrying out video stream coding according to the target scene pictures corresponding to the target clients in the global scene pictures to obtain the video streams corresponding to the target clients.
In some embodiments of the present application, a video stream encoding module comprises: the area determining unit is used for determining an overlapped picture area and a non-overlapped picture area of each target scene picture relative to other target scene pictures according to the target scene pictures corresponding to the target clients; an encoding unit for encoding the overlapping picture region and the non-overlapping picture region, respectively; the combination unit is used for combining the coding information of the overlapped picture area and the coding information of the non-overlapped picture area in each target scene picture to obtain the coding information of the target scene picture corresponding to each target client; and the video stream generating unit is used for generating a video stream corresponding to each target client according to the coding information of the target scene picture corresponding to each target client.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: a processor; a memory having computer-readable instructions stored thereon, which, when executed by the processor, implement a method of encoding a scene picture as described above.
According to an aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon computer-readable instructions which, when executed by a processor, implement a method of encoding a scene picture as described above.
According to an aspect of embodiments of the present application, there is provided a computer program product comprising computer instructions which, when executed by a processor, implement the method of encoding a scene picture as described above.
According to the scheme of the application, firstly, a target scene area corresponding to each target client is determined in a virtual scene according to the position information of a virtual object controlled by each target client in a virtual office, then, a target scene picture corresponding to each target client is determined according to scene data of each target scene area, and then video stream coding is carried out according to the target scene picture corresponding to each target client to obtain a video stream of each target client; in the process, different target clients do not need to repeatedly perform overall scene picture rendering on the target virtual scene, and corresponding target scene pictures are generated according to the target scene areas required to be displayed by each target client, so that on the basis of ensuring the scene picture display requirements of each target client, processing resources are saved, and the problem of processing resource waste caused by the fact that picture rendering is required to be performed in all clients in the local area virtually in the related art is effectively solved.
In the related art, because the terminal device where each target client is located performs the picture rendering, and the processing capabilities of different terminal devices are different, the scene pictures presented by different target clients in the same virtual game are asynchronous. The scheme of the application can be executed by the same electronic equipment to obtain multiple paths of video streams, each path of video stream corresponds to one target client, and scene pictures are not generated in different progress due to equipment difference, so that the consistency of scene pictures presented by different target clients in the same virtual game can be effectively ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic diagram of game scene picture rendering in the related art.
Fig. 2 is a schematic diagram illustrating an implementation environment of a method for encoding a scene picture according to an embodiment of the present application.
Fig. 3 is a schematic diagram illustrating an implementation environment of a method for encoding a scene picture according to another embodiment of the present application.
Fig. 4 is a flowchart illustrating a method of encoding a scene picture according to an embodiment of the present application.
Fig. 5 is a schematic diagram illustrating determination of a target scene area corresponding to each target client according to an embodiment of the application.
Fig. 6 is a schematic diagram illustrating target scene areas corresponding to clients under different viewing angles according to an embodiment of the application.
Fig. 7A is a flowchart illustrating a method of encoding a scene picture according to an embodiment of the present application.
Fig. 7B is an architecture diagram of a cloud gaming system according to an embodiment of the present application.
Fig. 7C is an interaction timing diagram in a cloud game scenario according to an embodiment of the application.
Fig. 8 is a flowchart illustrating screen rendering according to an embodiment of the present application.
FIG. 9 is a flow chart of step 430 in one embodiment in the embodiment of FIG. 2.
FIG. 10A is a flow diagram illustrating geometric processing according to an embodiment of the present application.
FIG. 10B shows a schematic view of a projective transformation pyramid.
FIG. 11 is a flowchart of step 920 in one embodiment of the embodiment of FIG. 9.
Fig. 12 is a flowchart illustrating an encoding method of a scene picture according to another embodiment of the present application.
Fig. 13 is a flowchart illustrating a method of encoding a scene picture according to another embodiment of the present application.
Fig. 14 is a flowchart illustrating scene picture encoding according to another embodiment of the present application.
Fig. 15 is a flowchart illustrating scene picture encoding according to another embodiment of the present application.
Fig. 16 is a block diagram of an apparatus for encoding a scene picture according to an embodiment of the present application.
Fig. 17 shows a schematic structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It should be noted that: reference herein to "a plurality" means two or more. "and/or" describe the association relationship of the associated objects, meaning that there may be three relationships, e.g., A and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Before making the detailed description, the terms referred to in the present application are explained as follows:
virtual scene: the method can be used for simulating an environment scene of a real world, can also be used for semi-simulating a semi-fictional three-dimensional environment scene, and can also be used for a purely fictional three-dimensional environment scene. The virtual scene may be a two-dimensional virtual scene or a three-dimensional virtual scene. Virtual scenes such as those constructed in games, which may include a variety of scenes
Virtual object: refers to an object in a virtual scene, which may be a virtual character, a virtual animal, an animation character, a virtual prop, etc., such as: characters, animals, plants, oil drums, walls, stones, etc. displayed in the virtual scene. The controlled virtual object may be an avatar in the virtual scene that is virtual for representing the user
A plurality of virtual objects may be included in the virtual scene, each virtual object having its own shape and volume in the virtual scene, occupying a portion of the space in the virtual scene. Optionally, when the virtual scene is a three-dimensional virtual scene, optionally, the virtual object may be a three-dimensional stereo model, the three-dimensional stereo model may be a three-dimensional character constructed based on a three-dimensional human skeleton technology, and the same virtual object may exhibit different external images by wearing different skins.
Alternatively, the controlled virtual object may be a Player Character controlled by an operation on the client, an Artificial Intelligence (AI) set in a virtual scene match by training, or a Non-Player Character (NPC) set in a virtual scene interaction. Alternatively, the controlled virtual object may be a virtual character playing a game in a virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene may be preset, or may be dynamically determined according to the number of clients participating in the interaction.
ROI (Region of Interest) coding: and (3) encoding a part of region in the complete image, ignoring other parts, and taking the encoded part of region in the complete image as the region of interest in the complete image.
Cloud Gaming (Cloud Gaming), also known as game on demand (Gaming), is an online Gaming technology based on Cloud computing technology. Cloud gaming technology enables light-end devices (Thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not operated in a player game terminal but in a cloud server, and the cloud server renders the game scene into a video and audio stream which is transmitted to the player game terminal through a network. The player game terminal does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring player input instructions and sending the instructions to the cloud server.
Fig. 1 is a flowchart of game scene screen rendering in the related art, and as shown in fig. 1, after a game control logic is executed in a game server 120, global scene data of a game scene is sent to terminal devices where each game client in a game office is located, such as a first terminal device 111, a second terminal device 112, and a third terminal device 113 in fig. 1. In this way, the first terminal device 111, the second terminal device 112, and the third terminal device 113 all perform rendering of the global game scene picture, and then capture corresponding scene pictures from the global game scene picture, for example, a first scene picture corresponding to the first terminal device 111, a second scene picture corresponding to the second terminal device 112, and a third scene picture corresponding to the third device 113. It can be seen that, in this way, the global game scene picture of the game scene is repeatedly rendered in different terminal devices in the game match, rendering processing resources of the terminal devices are wasted, and the requirement on the processing capability of the terminal is high, so how to reduce or avoid repeatedly rendering pictures in the virtual scene is an urgent technology in the prior art. In order to solve the problem, the scheme of the application is provided.
Fig. 2 is a schematic diagram of an implementation environment of a method for encoding a scene picture according to an embodiment of the present application. Referring to fig. 2, the implementation environment includes: a terminal (a first terminal 211 and a second terminal 212 are exemplarily shown in fig. 2) and a server 220.
The server 220 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and an artificial intelligence platform. The server 220 is used for providing background services for the application programs supporting the virtual scenes. The terminal and the server 220 may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
The terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, a smart television, a game terminal, and the like, but is not limited thereto. The terminal is installed and operated with an application program supporting the virtual scene, and the terminal is correspondingly used as a client of the supporting virtual scene. The application program may be any one of a MOBA (Multiplayer Online Battle Arena) Game, a Massively Multiplayer Online Role Playing Game (MMORPG), a First-Person Shooting Game (FPS), a third-Person Shooting Game, a virtual reality application program, a three-dimensional map program, or a Multiplayer gunfight type survival Game.
The user may interact with the server 220 based on the application program that supports the virtual scene running in the terminal, for example, the user may trigger the virtual object to perform an activity in the virtual scene in the scene picture of the virtual scene displayed by the terminal, where the activity includes, but is not limited to: releasing skills, adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing. The terminal generates a corresponding control instruction according to a control operation triggered by the user in the display interface of the terminal, and sends the control instruction to the server 220, where the control instruction is, for example, an instruction for controlling crawling, releasing skill, attack, and the like of the virtual object, and is not limited specifically herein. For example, as shown in fig. 2, the first control command generated by the first terminal 211 and the second control command generated by the second terminal 212 are correspondingly transmitted to the server 220.
In other embodiments, the user may also trigger the virtual object to perform an activity in the virtual scene by means of another manipulation terminal, such as the game pad 230 in fig. 1, in which case the terminal may display a picture of the virtual scene, receive a control instruction from the game pad 230, and send the control instruction to the server 220.
After receiving the control instruction sent by the terminal, the server 220 correspondingly executes the control logic, for example, the control logic for releasing the skill, and meanwhile, in order to ensure that the virtual scene after the control logic is executed is displayed on the display screen of the terminal in real time, the server 220 further performs picture rendering and video stream encoding according to the scene data of the virtual scene after the control logic is executed, so as to display the virtual scene picture on the display screen of the terminal. Specifically, the server 220 may encode a scene picture corresponding to the virtual scene into a video stream according to the method of the present application, and send the video stream to the terminal.
In a virtual game (for example, a game), there are at least two clients joining the virtual game, and the virtual objects manipulated by different clients in the same virtual game are in the same virtual scene, at this time, the virtual objects manipulated by one client can perform antagonistic interaction with other virtual objects in the virtual scene, for example, the virtual objects are divided into different camps or teams, and the virtual objects in an antagonistic or antagonistic relationship can compete in a manner of mutually releasing skills. Virtual objects belonging to the same camp or team may have temporary communication rights between them, in which case a virtual object may release treatment skills to other virtual objects belonging to the same camp or team.
In a local virtual game, although virtual objects manipulated by various clients are in the same virtual scene, due to different virtual objects or different perspectives manipulated by various clients (such as players), pictures presented on different clients are different, and pictures possibly presented on different user interfaces are completely different pictures.
Based on this, in order to improve the efficiency of image rendering and encoding, the server 220 may determine, according to the method of the present application, a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object in the target virtual scene, which is controlled by each target client joining the virtual bureau; then, determining a target scene picture corresponding to each target client according to the scene data of each target scene area; then, video stream coding is carried out according to the target scene picture corresponding to each target client, and the video stream of each target client is obtained; and finally, sending the video stream to the corresponding target client. Therefore, according to the scheme of the application, the video stream corresponding to each target client can be obtained respectively.
Assuming that the client joining a virtual office pair includes a client I in the first terminal 211 and a client II in the second terminal 212, the server 220 may determine a first target scene area 221 corresponding to the client I and a second target scene area 222 corresponding to the client II in the target virtual scene according to the method of the present application, and further perform picture rendering and video stream encoding based on the determined first target scene area 221 and second target scene area 222 to obtain a video stream 1 corresponding to the first terminal 211 and a video stream 2 corresponding to the second terminal 212, respectively.
It is worth mentioning that the applications installed on the terminals may be the same, or the applications installed on the two terminals are the same type of application of different operating system platforms. Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer.
Fig. 3 is a schematic diagram of an implementation environment according to another embodiment of the present application, in comparison to the implementation environment shown in fig. 1, in this implementation, an intermediate device 240 is further disposed between the server 220 and the terminal, and the intermediate device 240 may be a deployed game host, a desktop computer, a notebook computer, or another electronic device that can provide a screen rendering capability.
In this embodiment, each terminal sends a control instruction in a virtual scene (for example, a first control instruction generated by the first terminal 211 and a second control instruction generated by the second terminal 212) to the server 220, the server 220 executes a control logic in the virtual scene, and since the state of a part of virtual objects in the virtual scene changes (for example, the position of a virtual object in the virtual scene changes) after the control logic is executed, after the server 220 executes the control logic, scene data corresponding to the virtual scene is updated correspondingly, and then the scene data is sent to the intermediate device 240, and the intermediate device 240 executes the method of the present application, so as to obtain a video stream 1 corresponding to a client I in the first terminal 211 and a video stream 2 corresponding to a client II in the second terminal 212.
Fig. 4 is a flowchart illustrating a method for encoding a scene picture according to an embodiment of the present application, which may be performed by an electronic device with processing capability, such as a server, a terminal, an edge computing device, and the like, and is not limited in detail herein. Referring to fig. 4, the method includes at least steps 410 to 450, which are described in detail as follows:
step 410, obtaining position information of the virtual object controlled by each target client in a target virtual scene, wherein the target client is a client joining a virtual office, and the target virtual scene is a virtual scene corresponding to the virtual office.
In a multi-user competition scenario, the competition may be performed in terms of a game (or round) as a unit, and the game is referred to as a virtual game. It is understood that the client participating in the virtual game-play includes at least two clients, which may be a game client, a virtual reality application client, and the like, and is not limited in particular. In this scenario, the client participating in a virtual session is referred to as the target client. The virtual scene in which a virtual pair is located is referred to as the target virtual scene.
In the virtual game-alignment, each target client is correspondingly allocated with a virtual object representing the user logged in by the target client, and the allocated virtual object representing the user logged in by the target client can be controlled by the user, for example, the virtual object is controlled to perform skill release, jump, advance, retreat, lie prone and the like.
The position information of the virtual object operated by the target client in the target virtual scene is used to indicate the position of the virtual object operated by the target client in the target virtual scene, and it can be understood that, because the virtual object can be operated and moved by the target client, the positions of the virtual objects operated and moved by the target clients in the target virtual scene may also be correspondingly changed at different times in the virtual game process.
In some embodiments, after receiving the control instruction from each target client, the server executes the corresponding control logic, so that, if the control instruction indicates that the control virtual object moves in the virtual scene, the server may calculate the corresponding movement distance and movement direction according to the control instruction, and determine, in combination with historical position information of the virtual object in the target virtual scene, current position information of the virtual object in the target virtual scene after executing the control instruction, thereby implementing updating and storing the position information of the virtual object in the target virtual scene, and when the position information of the virtual object is needed, the server may read the position information of the corresponding virtual object.
Step 420, determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client.
For the target client, the observation range of the target client in the target virtual scene is limited, and the observation range is only a partial scene area in the target virtual scene, and correspondingly, in order to facilitate the user to know the current situation of the manipulated virtual object in the target virtual environment, the picture displayed by the target client is also a picture of the partial scene area in the target virtual scene.
Therefore, in the solution of the present application, before performing screen rendering, a target scene area corresponding to a target client is determined based on the position information of the virtual object manipulated by each target client. The target scene area refers to a scene area corresponding to a scene picture to be displayed by the target client. It is understood that the target scene area is a partial area in the target virtual scene area. It is understood that, in step 420, the position and size of the target scene area corresponding to the target client in the target virtual scene need to be determined.
In some embodiments, size information of an observation range of a virtual object manipulated by each target client may be preset, where the size information of the observation range is used to indicate a size of a target scene area of the corresponding target client, and then a position of the virtual object in the target virtual scene is used as a position reference, and then a position of the target scene area corresponding to the target client in the target virtual scene is determined by combining the reference position and the size information of the observation range.
Fig. 5 is a schematic diagram illustrating determination of a target scene area corresponding to each target client according to an embodiment of the application. Assuming that the target clients participating in the virtual game alignment comprise a client I, a client II and a client III, setting the observation range of each virtual object to be an area defined by the position of the virtual object as a central point and the size of the area a x b. As shown in fig. 5, if it is set that the virtual object manipulated by the client I is located at the position point S1 in fig. 5, the virtual object manipulated by the client II is located at the position point S2 in fig. 5, and the virtual object manipulated by the client III is located at the position point S3 in fig. 5, the target scene region corresponding to the client I is determined to be the first scene region 510, the target scene region corresponding to the client II is the second scene region 520, and the target scene region corresponding to the client III is determined to be the third scene region 530 according to the size a b with the position of the virtual object as a center point.
In some embodiments, since the viewing angles of the virtual objects are different, and the observation ranges of the virtual objects are also different, in this case, the target scene area corresponding to each target client may be further determined by combining the viewing angles of the virtual objects.
In some embodiments, the target virtual scene is a three-dimensional scene; step 420, comprising: acquiring visual angle information corresponding to each target client; and determining a target scene area corresponding to each target client in the target virtual scene according to the visual angle information corresponding to each target client and the position information of the virtual object controlled by each target client.
The view angle information corresponding to the target client is used for indicating an observation view angle of the virtual object controlled by the target client, and the observation view angle may be a first person view angle, a third person view angle, or a specified observation view angle. In the first-person perspective, the virtual camera is placed inside the virtual object manipulated by the client, which has the advantages of being capable of aiming precisely and bringing about a sense of being personally on the scene, and the visual range of the virtual camera is limited to the front area of the virtual object. Under the third person's perspective, the virtual camera is generally placed behind the virtual object manipulated by the client and moves along with the manipulated virtual object, which has the advantages of wider field of view and contribution to the interaction of the surrounding moving virtual objects.
In some embodiments, the viewing angle corresponding to each virtual object in the virtual scene may be preset, so that after the virtual object manipulated by the target virtual scene is determined, the viewing angle information corresponding to the target client is correspondingly acquired.
In some embodiments, if the user can change the viewing angle of the virtual object manipulated by the target client in the target client, the target client generates a viewing angle change instruction after detecting a trigger operation for changing the viewing angle, and sends the viewing angle change instruction to the server, so that the server determines the current viewing angle of the virtual object manipulated by the target client.
In some embodiments, a correspondence between each viewing perspective and relative position information of a reference point may be set, wherein the relative position information of the reference point is used to indicate a position of the reference point relative to the target scene area. Therefore, the relative position information of the reference point is determined according to the observation angle, the position of the target scene area under the target virtual scene under the virtual object controlled by the client is further used as the reference point, and the position of the target scene area corresponding to each client under the target virtual scene is determined by combining the size information of the target scene area.
Fig. 6 is a schematic diagram illustrating target scene areas corresponding to clients under different viewing angles according to an embodiment of the application. If the position is set under the first person viewing angle, the position of the reference point relative to the target scene area is the center of the lower edge of the target scene area; setting the intersection point of the reference point relative to the left edge and the lower edge of the target scene area under the third person weighing view angle; if the size of the target scene area is set to a × b, if the virtual object manipulated by a client is located at the position point S4 in fig. 6, under the first-person perspective, the position of the target scene area corresponding to the client in the target virtual scene is the first area 610 enclosed by the dashed line in fig. 6; under the third person's perspective, the position of the target scene area corresponding to the client in the target virtual scene is as a second area 620 enclosed by the dashed line in fig. 6.
In some embodiments, since the viewing angles applicable to different virtual objects are different, a first corresponding relationship between the viewing angle of the virtual object and the object type to which the virtual object belongs may be set, and based on the first corresponding relationship, the viewing angle corresponding to the virtual object may be determined according to the object type to which the virtual object belongs, and then the target scene region corresponding to the virtual object may be determined by combining the viewing angle corresponding to the virtual object.
In some embodiments, when the viewing angles applied to the virtual object at different positions are different, for example, if the virtual object is in an indoor environment, the viewing angle corresponding to the virtual object is set as a first-person viewing angle, and if the virtual object is in an outdoor environment, the viewing angle corresponding to the virtual object is set as a third-person viewing angle; therefore, a second corresponding relationship between the position and the observation angle can be set, so that based on the second corresponding relationship, the observation angle corresponding to the virtual object can be determined according to the position information of the virtual object in the target virtual scene, and the target scene area corresponding to the virtual object can be determined by combining the observation angle corresponding to the virtual object and the position information of the virtual object.
In some embodiments, in order to create an immersive experience, the same virtual object is provided with observation ranges (i.e., target scene areas) of different sizes at different positions, so that the size of the target scene area corresponding to the client that manipulates the virtual object may be determined according to the current position information of the virtual object based on a third corresponding relationship between the position of the virtual object and the size of the scene area, and the position of the target scene area corresponding to the client that manipulates the virtual object may be determined by combining the size of the target scene area and a reference point determined based on the position information of the virtual object.
Step 430, determining a target scene picture corresponding to each target client according to the scene data of each target scene area.
The target scene area corresponding to the target client is a partial area in the target virtual scene, the target scene area includes one or more virtual objects, and the virtual object may be a movable virtual object operated by the target client, or a virtual object that remains stationary in the target virtual scene, such as a virtual tree, a virtual rock, a virtual building, a virtual lawn, and the like.
The scene data of the target scene area includes model data of each virtual object included in the target virtual scene and rendering data of each virtual object, where the model data of the virtual object includes coordinate information of each vertex in the virtual object, and the vertex of the virtual object refers to a key point in a model for constructing the virtual object, such as a skeletal key point. The rendering data of the virtual object is used to indicate information such as color and texture of the virtual object.
The scene data of the target scene area represents a situation that a virtual object included in the target virtual scene is in the model space, and in the target client, the situation in the target scene area needs to be presented under a two-dimensional display plane (i.e., a display screen in the terminal device where the target client is located), so that the virtual object included in the target scene area needs to be converted into the screen space to obtain a two-dimensional scene picture under the screen space, and the obtained two-dimensional scene picture under the screen space is the target scene picture.
It can be understood that, because the target scene areas corresponding to different target clients are different, the target scene pictures determined for different target clients are also different.
Step 440, performing video stream coding according to the target scene picture corresponding to each target client, to obtain the video stream of each target client.
Through the process of the above steps 410-430, the target scene pictures corresponding to the target clients at different times are determined, and on this basis, the target scene pictures of the target clients at multiple times are encoded into a video stream according to the set frame rate, so as to obtain the video stream of each target client.
Step 450, sending the video stream to the corresponding target client.
Through the above process, each target client in a virtual game pair can present a corresponding target scene picture based on the received video stream.
In some embodiments, if background music or sound effect special effects are set for the target virtual scene, the background music and the sound effect special effects may be further encoded into an audio stream, the audio stream and the video stream corresponding to each target client are combined into an audio and video stream, and the audio and video stream corresponding to each target client is sent to the corresponding target client.
According to the scheme of the application, firstly, a target scene area corresponding to each target client is determined in a virtual scene according to the position information of a virtual object controlled by each target client in a virtual office, then, a target scene picture corresponding to each target client is determined according to scene data of each target scene area, and then video stream coding is carried out according to the target scene picture corresponding to each target client to obtain a video stream of each target client; in the process, all the clients in the virtual local area are not required to respectively capture partial pictures from the global scene picture after rendering the global scene picture according to the global scene data of the target virtual scene, and the picture rendering of the target virtual scene is not required to be repeated, so that on the basis of ensuring the display requirement of the scene picture on each target client, the processing resources are saved, and the problem of processing resource waste caused by the fact that the pictures are required to be rendered in all the clients in the virtual local area in the related technology is effectively solved.
In the related art, because the terminal device where each target client is located performs the image rendering, different terminal devices have different processing capabilities, and the image rendering speeds are different, the scene images presented by different target clients in the same virtual game are asynchronous. The scheme of the application can be executed by the same electronic equipment to obtain multiple paths of video streams, each path of video stream corresponds to one target client, different rendering schedules caused by equipment difference do not exist, and therefore the synchronism of scene pictures presented by different target clients in the same virtual game can be effectively guaranteed.
Fig. 7A is a flowchart illustrating a method of encoding a scene picture according to an embodiment of the present application. As shown in fig. 7A, it is assumed that the target clients joining the virtual game pair include client I, client II, and client III, a target scene area determined for client I in the target virtual scene is scene area C1, a target scene area determined for client II is scene area C2, and a target scene area determined for client III is scene area C3.
Then, performing picture rendering based on the scene area C1 to determine a target scene picture D1, performing picture rendering based on the scene area C2 to determine a target scene picture D2, performing picture rendering based on the scene area C2 to determine a target scene picture D2; then, carrying out video stream coding according to a target scene picture D1 corresponding to the client I to obtain a video stream E1; carrying out video stream coding according to a target scene picture D2 corresponding to the client II to obtain a video stream E2; and carrying out video stream coding according to the target scene picture D3 corresponding to the client III to obtain a video stream E3. Finally, video stream E1 is sent to client I, video stream E2 is sent to client II, and video stream E3 is sent to client III.
In this way, the client I, the client II, and the client III do not need to perform screen rendering, and only need to perform video stream playing. For the server, the target scene areas corresponding to the target clients are coded, so that the global picture rendering of the target virtual scene is not needed, and the picture rendering is only performed on the target scene areas to be displayed in the target clients, thereby saving the processing resources of the server and improving the picture rendering efficiency.
The scheme of the application can be applied to the cloud game, so that the cloud game service end encodes the video stream of each game client in the game play according to the method of the application, and the synchronism of game pictures displayed by each game client in the same game play is guaranteed. Under the cloud game scene, the number of hardware equipment used for rendering pictures can be reduced by adopting the scheme, the repeated calculation amount is also reduced, a plurality of player equipment are required to operate a rendering pipeline respectively originally by taking a 3D game as an example, the rendering pipeline can be operated on one equipment only by using the scheme, the hardware rendering requirement on the terminal equipment is reduced, and the repeated rendering of the pictures is avoided.
Fig. 7B is an architecture diagram of a cloud gaming system according to an embodiment of the present application, as shown in fig. 7B, the cloud gaming system including a cloud gaming service 711 and a gaming terminal 712 communicatively coupled,
the game terminal 712 may be an electronic device supporting an application program that runs a cloud game, such as a smart television, a smart phone, a tablet computer, a notebook computer, a desktop computer, a vehicle-mounted terminal, and the like. In the process of running the application program of the cloud game on the game terminal 712, the game terminal 712 can be regarded as a game client. In a cloud game scene, the game terminal 712 does not need to perform complicated screen rendering, and after receiving the video stream sent by the cloud game server 711, may perform video stream decoding and display of a game screen.
The user may trigger a game control operation in a game interface based on a game screen displayed on the game terminal 712, or trigger a game control operation through an input device (e.g., a joystick) communicatively connected to the game terminal, and the game terminal 712 generates a game control instruction according to the detected game control operation, where the game control instruction is, for example, a control instruction for controlling a virtual object to advance, lie on the stomach, release a skill, and the like, and sends the game control instruction to the cloud game server 711.
The cloud game service 711 is a cloud server that provides cloud game services, such as a game account management service, a cloud game deployment service, a screen rendering service, a game logic service, and a video stream encoding service.
After receiving the game control instruction sent by the game terminal 712, the cloud game server 711 executes the game control logic according to the game control instruction, updates the game scene data correspondingly, then performs rendering calculation and video stream coding correspondingly to obtain a video stream, and sends the video stream to the game terminal 712. In each game play of the cloud game requiring at least two game terminals to participate, the cloud game service terminal 711 may generate a video stream of each game client in the game play according to the scene picture encoding method provided in the present application.
Fig. 7C is an interaction timing diagram in a cloud game scenario according to an embodiment of the application. In the embodiment corresponding to fig. 7C, it is assumed that the clients joining the game pair include the first game client and the second game client, but of course, in other embodiments, there may be more clients joining the game pair. In the game-playing process, the game client generates a game control instruction according to the detected game control operation and sends the game control instruction to the cloud game server.
In the present embodiment, for convenience of description, the game control instruction generated by the first game client is referred to as a first game control instruction, and the game control instruction generated by the second game client is referred to as a second game control instruction. After generating the game control instructions, the first game client performs step 721: the first game control command is sent, and the second game client executes step 722 to send the second game control command.
After receiving the game control instruction (the first game control instruction and/or the second game control instruction), the cloud game server performs encoding of the game scene picture according to the following steps 723-727.
Step 723, executing the game control logic according to the game control command. After the game control logic is executed, the target game scenes corresponding to the game opponents added by the first game client and the second game client are correspondingly updated, for example, if the first control instruction is an instruction indicating that the virtual object Q is lying down, the cloud game service end corresponds to the game scene of the game opponents and controls the virtual object Q to lie down.
In step 724, position information of the virtual object respectively controlled by each game client in the target game scene is obtained. The target cloud game scene refers to a game scene corresponding to the game match currently added by the first game client and the second game client.
Step 725, determining the target game scene area corresponding to each game client in the target game scene. Specifically, a target game scene area corresponding to the first game client and a target game scene corresponding to the second game client are determined through step 725, where the target game scene area corresponding to each game client is a partial scene area in the target game scene.
Step 726, performing image rendering on the scene data of the target scene area corresponding to each game client, and determining the game scene image corresponding to each game client.
Step 727, video stream coding is carried out according to the game scene pictures corresponding to the game clients to obtain the video streams of the game clients. In the present embodiment, for the sake of distinction, the resulting video stream of the first game client is referred to as a first video stream, and the resulting video stream of the second game client is referred to as a second video stream.
At step 728, the first video stream is transmitted. Then, after receiving the first video stream sent by the cloud game server, the first game client executes steps 730 and 731, where step 730 decodes the first video stream; step 731, displaying the game scene picture corresponding to the first game client.
Step 729, transmitting the second video stream. Then, after receiving the second video stream sent by the cloud game server, the second game client performs steps 732 and 733, where in step 732, the second video stream is decoded; and 733, displaying a game scene picture corresponding to the second game client.
In the embodiment of fig. 7C, the specific implementation process of determining the target game scene area, the game scene picture, and the video stream coding corresponding to each game client by the cloud game server is described above and in the following description, and is not described herein again.
In the cloud game scene of the embodiment, for game play participated in by a plurality of game clients, the cloud game service end firstly determines a target game scene area of each game client in the game play, and then performs picture rendering on scene data of each target game scene area to obtain a game scene picture of each game client.
Under the condition that the cloud game is a 3D game, due to the fact that the observation visual angles corresponding to different game clients are different, if the cloud game server side conducts global picture rendering based on global scene data, the global picture rendering needs to be conducted for multiple times according to the observation visual angles corresponding to the different game clients.
In some embodiments, if the target virtual scene is a three-dimensional scene, the image rendering may be performed according to the process shown in fig. 8, as shown in fig. 8, specifically including three stages, respectively: an application stage 810, a geometry processing stage 820, and a light pruning processing stage 830.
In the application stage 810, the scene data corresponding to each target scene area is loaded into the video memory, rendering states (e.g., states of textures, shaders, etc.) are set to define how the grids in the virtual objects in the corresponding target scene area should be rendered, and then the GPU pipeline is invoked to prepare for the subsequent geometry processing stage 820 and the light pruning processing stage 830.
In the geometry processing stage 820, the virtual objects are transformed from model space into screen space.
Rasterization is a process of transforming a geometric primitive into a two-dimensional image, and in the light-deleting processing stage 830, coordinates of each vertex obtained in the geometric processing stage in a screen space are calculated to cover pixels, and pixel coloring is correspondingly performed.
Combining the scheme, if the target virtual scene is a three-dimensional scene; as shown in fig. 9, step 430 includes: step 910, acquiring scene data of each target scene area; the scene data includes model data and rendering data.
As described above, the model data is used to indicate coordinate information of each vertex in the virtual object, and the vertex of the virtual object refers to a key point in the model that constructs the virtual object, such as a skeletal key point. In the present embodiment, for the sake of convenience of distinction, the coordinate information of each vertex in the model space in the virtual object indicated by the model data is referred to as first coordinate information. The rendering data of the virtual object is used to indicate information such as color and texture of the virtual object.
Step 920, performing geometric processing according to the model data of each target scene area to obtain an intermediate scene picture of each target scene area in the screen space.
As described above, the geometric process is to transform the virtual object from model space to screen space. In the scheme of the present application, a scene picture obtained before each virtual object included in the target scene area is transformed from the model space to the screen space and is not subjected to the rendering processing is referred to as an intermediate scene picture.
In the geometric processing stage, the following processes are involved; 1) model transformation from model space to world space;
2) a viewing transformation from world space to camera space; 3) projective transformation from camera space to a uniform cropping space; 4) screen mapping from homogeneous clip space to screen space. The model space is a space in a model coordinate system set when a model of a virtual object is constructed. The camera space is a coordinate system space which is constructed by taking the position of the virtual camera as an origin and corresponds to the virtual camera.
FIG. 10A is a flow diagram illustrating geometric processing according to an embodiment of the present application, as shown in FIG. 10A, including: after the model of the virtual object is transferred from the model space to the world space, according to the virtual camera corresponding to the virtual object operated and controlled by each target client, the corresponding target scene area is transformed into the camera space (for example, the camera space 1 and the camera space 2. the camera space n in fig. 10A) where the corresponding virtual camera is located, and then projection, clipping and screen mapping are sequentially performed.
The scene picture presented by the client may be understood as a picture obtained by shooting a virtual scene through a virtual camera corresponding to the client. The setting positions of the virtual cameras corresponding to different clients may be different, and correspondingly, the camera spaces corresponding to the clients are also different.
In the camera space, a projective transformation pyramid can be determined correspondingly from the camera anchor point where the virtual camera is located to the virtual object. The projective transformation pyramid is an area that determines the virtual camera to see, and is composed of 6 planes, which are referred to as clipping planes, including a near clipping plane (nearclipplane) and a far clipping plane (far clip plane), which determine the depth range that the virtual camera can see. Fig. 10B is a schematic diagram showing a projective transformation pyramid, in which the origin of coordinates shown in fig. 10B is the anchor point of the virtual camera, a plane T1 perpendicular to the z-axis in fig. 10B is a near clipping plane, and a plane T2 perpendicular to the z-axis is a far clipping plane.
Then, for calculation, the virtual object in the projective transformation vertebral body is transformed to the homogeneous cutting space. Transforming the virtual object from camera space to homogeneous clipping space is the projection process in fig. 10. In the homogeneous clipping space, clipping is performed based on the projective transformation vertebral body in fig. 10B, and vertices not within the projective transformation vertebral body are clipped; and finally, carrying out screen mapping on the clipped and reserved vertex to a screen space to obtain a corresponding pixel position.
In some embodiments, the model data includes first coordinate information for each vertex in the corresponding target scene region; as shown in fig. 11, step 920 includes:
step 1110, transforming each vertex from the model space to a camera space under the corresponding virtual camera according to the first coordinate information of each vertex in the model data of each target scene area, to obtain second coordinate information of each vertex in the target scene area.
Specifically, in step 1110, each vertex in the model data is first transformed from the model space to the world space to obtain coordinates of each vertex in the world space, and in the process, the vertex can be transformed to the world space in a manner of scaling, rotation and translation; and then, transforming each vertex from the world space to a camera space under the corresponding virtual camera to obtain second coordinate information of each vertex in the target scene area under the corresponding camera space, wherein the coordinate information (namely the second coordinate information) of each vertex in the camera space can be obtained through translation, rotation, scaling and inversion in the process.
Step 1120, according to the second coordinate information of each vertex in the target scene area, transforming each vertex from the corresponding camera space to the homogeneous clipping space to obtain third coordinate information of each vertex in the target scene area.
In a specific embodiment, each vertex may be transformed from the corresponding camera space to the homogeneous clipping space through the perspective projection matrix or the orthogonal projection matrix, so as to obtain coordinate information (i.e., third coordinate information) of each vertex in the homogeneous clipping space.
Step 1130, based on the third coordinate information of each vertex in the target scene area, the vertex is transformed from the homogeneous clipping space to the screen space, and the fourth coordinate information of each vertex in the target scene area is obtained.
Step 1140, determining the intermediate scene picture of each target scene area in the screen space according to the fourth coordinate information of all the vertexes in each target scene area.
The coordinates indicated by the fourth coordinate information are the pixel positions corresponding to the vertexes in the screen space, so that the intermediate scene picture of the target scene area in the screen space is obtained by performing pixel combination based on the fourth coordinate information of each vertex.
Referring to fig. 9, in step 930, rasterization is performed according to the middle scene picture of each target scene area in the screen space and the drawing data corresponding to each target scene area, so as to obtain a target scene picture corresponding to each target client.
In some embodiments, step 930 includes: and for each target scene area, performing rasterization processing on an intermediate scene picture corresponding to the target scene area according to the drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client.
In some embodiments, the intermediate scene picture indicates fourth coordinate information of each vertex in the corresponding target scene region in the screen space; in this embodiment, for each target scene area, according to the drawing data corresponding to the target scene area, the step of performing rasterization processing on the intermediate scene picture corresponding to the target scene area to obtain the target scene picture corresponding to the target client further includes: for each target scene area, determining a plurality of fragments in the target scene area according to the fourth coordinate information of each vertex in the target scene area; and according to the drawing data corresponding to the target scene area, coloring and rendering the plurality of fragments in the target scene area to obtain a target scene picture corresponding to the target client.
Specifically, according to the fourth coordinate information of each vertex in the target scene area, based on the set coordinate range of the triangular mesh, whether each vertex is covered by the triangular mesh is checked, if so, a fragment (fragment) is generated, the vertex coordinates of three vertices in the triangular mesh are used for interpolating the whole coverage area, and then a fragment sequence in the target scene area is output.
In some embodiments, the Fragment Shader (Fragment Shader) may be used to perform shading rendering on the Fragment, and specifically, since the drawing data indicates information such as color and texture, the state of the Fragment Shader may be set (for example, color and texture are set) based on the drawing data, and then the Fragment Shader may perform shading on a Fragment-by-Fragment basis.
In this embodiment, the intermediate scene pictures corresponding to each target scene area are rasterized once, so that the intermediate scene pictures corresponding to all the clients in the same virtual bureau can be rasterized synchronously, thereby improving the rasterization efficiency.
In other embodiments of the present application, step 930, comprises: carrying out picture splicing on intermediate scene pictures corresponding to all target scene areas in the target virtual scene to obtain spliced pictures; performing rasterization processing on the spliced picture according to the drawing data corresponding to all the target scene areas to obtain a spliced scene picture; and determining the target scene pictures corresponding to the target clients in the spliced scene pictures according to the position information of the intermediate scene pictures corresponding to the target clients in the spliced pictures.
In this embodiment, before rasterization processing is performed, the intermediate scene pictures respectively corresponding to all the target scene areas are first spliced to obtain a spliced picture, and then rasterization processing is performed on the spliced picture, so that rasterization of the spliced picture can be performed through one rasterization process without performing rasterization processing through a plurality of rasterization processes.
Fig. 12 is a flowchart illustrating an encoding method of a scene picture according to an embodiment of the present application, as shown in fig. 12, including: step 1210, determining a target scene area corresponding to each target client;
step 1220, performing geometric processing on each target scene area; intermediate scene pictures corresponding to all target scene areas can be correspondingly obtained; the specific geometric processing process is described above, and is not described in detail here.
Step 1230, splicing the intermediate scene pictures; therefore, the spliced picture can be correspondingly obtained.
Step 1240, coloring and rendering the spliced picture; the process of rendering shading is the rasterization process above. The spliced scene picture is obtained through step 1240.
Step 1250, performing ROI coding on the spliced scene picture; in the encoding process, the region of interest in the spliced scene picture is the region where the target scene picture corresponding to the target client in the spliced scene picture is located. It can be understood that, according to the fact that the region of the intermediate scene picture in the spliced scene picture is the region of the target scene picture corresponding to the target client in the spliced scene picture, the target scene picture corresponding to each target client can be determined in the spliced scene picture according to the position information of the intermediate scene picture corresponding to each target client in the spliced picture. Thus, in step 1250, a target scene picture corresponding to each target client in the same virtual session, for example, the target scene picture D1, the target scene picture D2... the target scene picture Dn, etc. in fig. 12, can be obtained.
Step 1260, video stream coding. In this process, video stream coding is performed based on a target scene picture corresponding to each target client, so as to obtain a video stream corresponding to each target client, for example, the video stream E1, the video stream E2,. the video stream En, and the like in fig. 12, and then the video streams are respectively sent to the corresponding target clients, for example, the video stream E1 is sent to the target client I, and the video stream E1 is sent to the target client II.
In other embodiments of the present application, the target virtual scene is a two-dimensional scene; the scene data comprises background data and mapping data of a virtual object controlled by a corresponding target client; in this embodiment, step 430 includes: respectively generating a background map of each target scene area according to the background data of each target scene area; and respectively carrying out mapping processing in the background mapping of each target scene area according to mapping data of the virtual object controlled by each target client, and correspondingly obtaining a target scene picture corresponding to each target client.
For a two-dimensional target virtual scene, it does not involve a transformation from a three-dimensional model space to a two-dimensional screen space. Thus, the generation of the corresponding two-dimensional image can be performed directly on the basis of the corresponding scene data. In this embodiment, the scene data of the two-dimensional target scene includes background data and map data of a virtual object manipulated by a corresponding target client. The background data of each target scene area is used for generating a background map corresponding to the background scene area, and the map data of the virtual object controlled by each target client is used for generating a virtual object map corresponding to the virtual object controlled by the target client. Therefore, according to the position information of the virtual object controlled by each target client in the target virtual scene, the virtual object map of the virtual object controlled by the target client is correspondingly combined into the background map of the target scene area corresponding to the target client, namely, the target scene picture corresponding to each target client is correspondingly obtained.
It can be understood that, in the virtual scene, the position of the virtual object as the background, such as a virtual building, a virtual tree, a virtual rock, etc., is substantially unchanged during the virtual game, while the virtual object manipulated by the client is movable, so in this embodiment, the data of the virtual object as the background and the data of the movable virtual object in the target virtual scene are distinguished, thereby facilitating the subsequent combination, i.e., mapping, of the background map and the map of the movable virtual object.
In some embodiments, in the case that the target virtual scene is a two-dimensional scene, the method further comprises: acquiring size information of a target virtual scene; if the size indicated by the size information exceeds the set size threshold, step 420 is performed. Further, according to the procedure in the above-described embodiment, a corresponding target scene screen is generated for the scene data of each target scene area.
In this case, in order to reduce the processing amount, a corresponding target scene area is determined for each target client, and a target scene screen of each target client is generated correspondingly, for example, because the length of the two-dimensional target virtual scene exceeds a set length threshold, the width of the target virtual scene exceeds a set width threshold, and a large number of scene areas are not required to be presented in the target client in the target virtual scene.
In some embodiments, in the case that the target virtual scene is a two-dimensional scene, after the step of acquiring the size information of the target virtual scene, as shown in fig. 13, the method further includes:
in step 1310, if the size indicated by the size information does not exceed the set size threshold, a global background map of the target virtual scene is obtained.
Step 1320, according to the position information of the virtual object operated by each target client in the target virtual scene, mapping the object of the virtual object operated by all the target clients in the global background map to obtain a global scene picture.
Step 1330, determining a target scene picture corresponding to each target client in the global scene picture according to the position information of the virtual object manipulated by each target client and the preset picture size information. The preset picture size information is used for indicating the size of a scene area presented by a picture displayed by the client.
Step 1340, according to the target scene pictures corresponding to the target clients in the global scene pictures, performing video stream coding to obtain video streams corresponding to the target clients.
In step 1340, ROI coding may be performed on the global scene picture, and in the ROI coding process, the region of interest is a region where the target scene picture corresponding to the target client is located, so as to correspondingly obtain a video stream corresponding to each target client.
In the present embodiment, since the size of the two-dimensional target virtual scene is small, for example, the length of the two-dimensional target virtual scene does not exceed the set length threshold, the width of the target virtual scene does not exceed the set width threshold, even if the scene area displayed at each target client is only a partial area in the target virtual scene, however, in general, the target virtual scene has fewer scene areas that are not displayed in the target client, in this case, rather than determining the target scene area and thus the amount of processing of the corresponding target scene picture separately for each target client, respectively, a global picture is generated directly based on the panoramic scene data, the computation of determining the target scene picture corresponding to each target client from the global picture is less consuming, and therefore, the target scene picture corresponding to each target client may be determined in the global scene picture in the manner of this embodiment.
Fig. 14 is a flowchart illustrating scene picture coding according to another embodiment of the present application, and the embodiment of fig. 14 may be applied to a two-dimensional game scene. As shown in fig. 14, the cloud game server may execute the method of the present application, and specifically, after executing the game logic, the cloud game server generates a global background map of the target game scene based on the background scene data of the target game scene; then, correspondingly combining game character maps (such as a game character 1 map and a game character 2 map in fig. 14, namely a game character n map) operated by the clients where the players are located into the global background map to obtain a global scene picture, and then performing ROI coding based on the global background map to obtain a target scene picture (such as a target scene picture P1 and a target scene picture P2.. a target scene picture Pn in fig. 14) corresponding to each target client; then, video stream coding is performed according to a target scene picture corresponding to each target client to obtain a video stream of each target client (for example, in fig. 14, a video stream 1 corresponding to a client where a player 1 is located and a video stream 2 corresponding to a client where a player 2 is located), and then the video streams are sent to the corresponding players.
Fig. 15 is a flowchart illustrating scene picture coding according to another embodiment of the present application, compared to the embodiment illustrated in fig. 14, in the embodiment of fig. 15, a cloud game server executes a corresponding game logic according to a control command sent by each target client, and a rendering device in a local area network executes the method of the present application, so as to obtain a video stream of each target client (e.g., in fig. 15, a video stream 1 corresponding to a client where a player 1 is located, and a video stream 2 corresponding to a client where a player 2 is located). The rendering device in the local area network may be a desktop computer, a game console, etc., and is not particularly limited herein.
In some embodiments, step 1340, comprises: determining an overlapped picture area and a non-overlapped picture area relative to other target scene pictures in each target scene picture according to the target scene pictures corresponding to each target client; respectively encoding the overlapped picture region and the non-overlapped picture region; combining the coding information of the overlapped picture area and the coding information of the non-overlapped picture area in each target scene picture to obtain the coding information of the target scene picture corresponding to each target client; and generating a video stream corresponding to each target client according to the coding information of the target scene picture corresponding to each target client.
The overlapped picture area refers to a picture area overlapped with other target scene pictures in a target scene picture, wherein the overlapped picture area can be a picture area overlapped by two or more target scene pictures. The non-overlapping frame region is a frame region of a target frame region that is not overlapped with other target frame regions.
In the embodiment, for each target scene picture, the overlapped picture area and the non-overlapped picture area relative to other target scene areas in the target scene picture are determined, so that in the process of coding the target scene picture, the coding information of the overlapped picture area can be shared, the overlapped picture area does not need to be repeatedly coded, and the coding efficiency of the picture can be improved.
In some embodiments, after the overlapped picture area is determined, size information of the overlapped picture area may be further determined, and if the size information of the overlapped picture area is greater than a set second size threshold, the overlapped picture area and the non-overlapped picture area are respectively subjected to picture coding to share coding information of the overlapped picture area; on the contrary, if the size information of the overlapped picture area is not greater than the set second size threshold, the picture coding is still performed according to the target scene picture, but the overlapped picture area and the non-overlapped picture area are not respectively subjected to the picture coding, and when the size information of the overlapped picture area is not greater than the set second size threshold, it indicates that the overlapped picture area is small, and at this time, the improvement of the coding efficiency brought by the coding information of the common overlapped picture area may not be large, and therefore, in this case, the overlapped picture area and the non-overlapped picture area may not be respectively subjected to the picture coding.
Embodiments of the apparatus of the present application are described below, which may be used to perform the methods of the above-described embodiments of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the above-described embodiments of the method of the present application.
Fig. 16 is a block diagram illustrating an encoding apparatus of a scene picture according to an embodiment, the encoding apparatus of the scene picture, as illustrated in fig. 16, including: a location information obtaining module 1610, configured to obtain location information of a virtual object operated by each target client in a target virtual scene, where the target client is a client joining a virtual office, and the target virtual scene is a virtual scene corresponding to the virtual office; a target scene area determining module 1620, configured to determine, according to the location information of the virtual object operated by each target client, a target scene area corresponding to each target client in the target virtual scene; a target scene picture determining module 1630, configured to determine, according to the scene data of each target scene area, a target scene picture corresponding to each target client; the video stream coding module 1640 is configured to perform video stream coding according to a target scene picture corresponding to each target client, so as to obtain a video stream of each target client; a video stream sending module 1650, configured to send the video stream to the corresponding target client.
In some embodiments of the present application, the target virtual scene is a three-dimensional scene; in this embodiment, the target scene area determining module 1620 includes: the visual angle information acquisition unit is used for acquiring visual angle information corresponding to each target client; and the target scene area determining unit is used for determining the target scene area corresponding to each target client in the target virtual scene according to the visual angle information corresponding to each target client and the position information of the virtual object controlled by each target client.
In some embodiments of the present application, the target virtual scene is a three-dimensional scene; in this embodiment, the target scene picture determining module 1630 includes: a scene data acquisition unit for acquiring scene data of each target scene area; the scene data comprises model data and drawing data; the geometric processing unit is used for performing geometric processing according to the model data of each target scene area to obtain a middle scene picture of each target scene area in a screen space; and the rasterization processing unit is used for performing rasterization processing according to the intermediate scene picture of each target scene area in the screen space and the drawing data corresponding to each target scene area to obtain the target scene picture corresponding to each target client.
In some embodiments of the present application, the model data includes first coordinate information for each vertex in the corresponding target scene region; the target scene picture determining module 1630 includes: the first transformation unit is used for transforming each vertex from the model space to the camera space under the corresponding virtual camera according to the first coordinate information of each vertex in the model data of each target scene area to obtain the second coordinate information of each vertex in the target scene area; the second transformation unit is used for transforming each vertex from the corresponding camera space to the homogeneous clipping space according to the second coordinate information of each vertex in the target scene area to obtain third coordinate information of each vertex in the target scene area; the third transformation unit is used for transforming each vertex from the homogeneous cutting space to the screen space based on the third coordinate information of each vertex in the target scene area to obtain the fourth coordinate information of each vertex in the target scene area; and the intermediate scene picture generating unit is used for determining the intermediate scene picture of each target scene area in the screen space according to the fourth coordinate information of all the vertexes in each target scene area.
In some embodiments of the present application, a rasterization processing unit includes: and the first processing unit is used for performing rasterization processing on an intermediate scene picture corresponding to the target scene area according to the drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client.
In some embodiments of the present application, the intermediate scene picture indicates fourth coordinate information of each vertex in the corresponding target scene region in the screen space; in this embodiment, the first processing unit includes: the fragment determining unit is used for determining a plurality of fragments in each target scene area according to the fourth coordinate information of each vertex in the target scene area; and the coloring and rendering unit is used for coloring and rendering the plurality of fragments in the target scene area according to the drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client.
In some embodiments of the present application, a rasterization processing unit includes: the splicing unit is used for carrying out picture splicing on intermediate scene pictures corresponding to all target scene areas in the target virtual scene to obtain spliced pictures; the second processing unit is used for carrying out rasterization processing on the spliced picture according to the drawing data corresponding to all the target scene areas to obtain a spliced scene picture; and the determining unit is used for determining the target scene pictures corresponding to the target clients in the spliced scene pictures according to the position information of the intermediate scene pictures corresponding to the target clients in the spliced pictures.
In some embodiments of the present application, the target virtual scene is a two-dimensional scene; the scene data comprises background data and mapping data of a virtual object controlled by a corresponding target client; in this embodiment, the target scene picture determining module 1630 includes: the background map generating unit is used for respectively generating the background maps of the target scene areas according to the background data of the target scene areas; and the map processing unit is used for respectively performing map processing on the background maps of the target scene areas according to the map data of the virtual object controlled by each target client, and correspondingly obtaining the target scene pictures corresponding to each target client.
In some embodiments of the present application, an apparatus for encoding a scene picture, further includes: the size information acquisition module is used for acquiring the size information of the target virtual scene; if the size indicated by the size information exceeds the set size threshold, the method goes to the target scene area determination module 1620.
In some embodiments of the present application, an apparatus for encoding a scene picture, further includes: the global background map obtaining module is used for obtaining a global background map of the target virtual scene if the size indicated by the size information does not exceed a set size threshold; the mapping module is used for mapping the objects of the virtual objects controlled by all the target clients in the global background mapping according to the position information of the virtual objects controlled by all the target clients in the target virtual scene to obtain a global scene picture; the scene picture area determining module is used for determining a target scene picture corresponding to each target client in the overall scene picture according to the position information of the virtual object controlled by each target client and the preset picture size information; and the video stream generation module is used for carrying out video stream coding according to the target scene pictures corresponding to the target clients in the global scene pictures to obtain the video streams corresponding to the target clients.
In some embodiments of the present application, a video stream encoding module comprises: the area determining unit is used for determining an overlapped picture area and a non-overlapped picture area of each target scene picture relative to other target scene pictures according to the target scene pictures corresponding to the target clients; a coding unit for coding the overlapped picture region and the non-overlapped picture region, respectively; the combination unit is used for combining the coding information of the overlapped picture area and the coding information of the non-overlapped picture area in each target scene picture to obtain the coding information of the target scene picture corresponding to each target client; and the video stream generating unit is used for generating the video stream corresponding to each target client according to the coding information of the target scene picture corresponding to each target client.
FIG. 17 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application. It should be noted that the computer system 1700 of the electronic device shown in fig. 17 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments.
As shown in fig. 17, a computer system 1700 includes a processor, such as a Central Processing Unit (CPU)1701 in fig. 17, which can perform various appropriate actions and processes, such as executing the methods in the above-described embodiments, according to a program stored in a Read-Only Memory (ROM) 1702 or a program loaded from a storage portion 1708 into a Random Access Memory (RAM) 1703. In the RAM 1703, various programs and data necessary for system operation are also stored. The CPU1701, ROM1702, and RAM 1703 are connected to each other through a bus 1704. An Input/Output (I/O) interface 1705 is also connected to the bus 1704.
The following components are connected to the I/O interface 1705: an input section 1706 including a keyboard, a mouse, and the like; an output section 1707 including a Display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 1708 including a hard disk and the like; and a communication section 1709 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1709 performs communication processing via a network such as the internet. A driver 1710 is also connected to the I/O interface 1705 as necessary. A removable medium 1711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1710 as necessary, so that a computer program read out therefrom is mounted into the storage portion 1708 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1709, and/or installed from the removable media 1711. When the computer program is executed by a Central Processing Unit (CPU)1701, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable storage medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries computer readable instructions which, when executed by a processor, implement the method of any of the embodiments described above.
According to an aspect of the present application, there is also provided an electronic device, including: a processor; a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method of any of the above embodiments.
According to an aspect of an embodiment of the present application, there is provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the electronic device to perform the method in any of the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A method for encoding a scene picture, comprising:
acquiring position information of a virtual object controlled by each target client in a target virtual scene, wherein the target client is a client joining a virtual game, and the target virtual scene is a virtual scene corresponding to the virtual game;
determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client;
determining a target scene picture corresponding to each target client according to the scene data of each target scene area;
performing video stream coding according to the target scene picture corresponding to each target client to obtain the video stream of each target client;
and sending the video stream to a corresponding target client.
2. The method of claim 1, wherein the target virtual scene is a three-dimensional scene;
determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client, including:
obtaining visual angle information corresponding to each target client;
and determining a target scene area corresponding to each target client in the target virtual scene according to the visual angle information corresponding to each target client and the position information of the virtual object controlled by each target client.
3. The method according to claim 1 or 2, characterized in that the target virtual scene is a three-dimensional scene;
determining a target scene picture corresponding to each target client according to the scene data of each target scene area, including:
acquiring scene data of each target scene area; the scene data comprises model data and rendering data;
performing geometric processing according to the model data of each target scene area to obtain a middle scene picture of each target scene area in a screen space;
and performing rasterization processing according to the intermediate scene picture of each target scene area in the screen space and the drawing data corresponding to each target scene area to obtain the target scene picture corresponding to each target client.
4. The method of claim 3, wherein the model data includes first coordinate information for each vertex in the corresponding target scene region;
the geometric processing is performed according to the model data of each target scene area to obtain a middle scene picture of each target scene area in a screen space, and the method comprises the following steps:
converting each vertex from a model space to a camera space under a corresponding virtual camera according to first coordinate information of each vertex in model data of each target scene area to obtain second coordinate information of each vertex in the target scene area;
according to the second coordinate information of each vertex in the target scene area, converting each vertex from the corresponding camera space to a homogeneous cutting space to obtain third coordinate information of each vertex in the target scene area;
based on the third coordinate information of each vertex in the target scene area, converting each vertex from the homogeneous cutting space to the screen space to obtain fourth coordinate information of each vertex in the target scene area;
and determining an intermediate scene picture of each target scene area in the screen space according to the fourth coordinate information of all the vertexes in each target scene area.
5. The method according to claim 3, wherein the performing rasterization processing according to the intermediate scene picture of each target scene area in the screen space and the drawing data corresponding to each target scene area to obtain the target scene picture corresponding to each target client includes:
and for each target scene area, performing rasterization processing on an intermediate scene picture corresponding to the target scene area according to the drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client.
6. The method according to claim 5, wherein the intermediate scene picture indicates fourth coordinate information of each vertex in the corresponding target scene area in the screen space;
for each target scene area, performing rasterization processing on an intermediate scene picture corresponding to the target scene area according to drawing data corresponding to the target scene area to obtain a target scene picture corresponding to the target client, including:
for each target scene area, determining a plurality of fragments in the target scene area according to fourth coordinate information of each vertex in the target scene area;
and according to the drawing data corresponding to the target scene area, performing coloring rendering on the multiple fragments in the target scene area to obtain a target scene picture corresponding to the target client.
7. The method according to claim 3, wherein the performing rasterization processing according to the intermediate scene picture of each target scene area in the screen space and the drawing data corresponding to each target scene area to obtain the target scene picture corresponding to each target client includes:
performing picture splicing on intermediate scene pictures corresponding to all target scene areas in the target virtual scene to obtain spliced pictures;
performing rasterization processing on the spliced picture according to the drawing data corresponding to all the target scene areas to obtain a spliced scene picture;
and determining the target scene pictures corresponding to the target clients in the spliced scene pictures according to the position information of the intermediate scene pictures corresponding to the target clients in the spliced pictures.
8. The method of claim 1, wherein the target virtual scene is a two-dimensional scene; the scene data comprises background data and mapping data of a virtual object controlled by a corresponding target client;
determining a target scene picture corresponding to each target client according to the scene data of the target scene area corresponding to each target client comprises:
respectively generating a background map of each target scene area according to the background data of each target scene area;
and according to the mapping data of the virtual object controlled by each target client, mapping processing is respectively carried out in the background mapping of each target scene area, and a target scene picture corresponding to each target client is correspondingly obtained.
9. The method of claim 8, further comprising:
acquiring size information of the target virtual scene;
and if the size indicated by the size information exceeds a set size threshold, executing the step of determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client.
10. The method of claim 9, wherein after obtaining the size information of the target virtual scene, the method further comprises:
if the size indicated by the size information does not exceed a set size threshold, acquiring a global background map of the target virtual scene;
according to the position information of the virtual objects controlled by the target clients in the target virtual scene, mapping all the object maps of the virtual objects controlled by the target clients in the global background map to obtain a global scene picture;
determining a target scene picture corresponding to each target client in the global scene picture according to the position information of the virtual object controlled by each target client and preset picture size information;
and carrying out video stream coding according to the target scene picture corresponding to each target client in the global scene picture to obtain the video stream corresponding to each target client.
11. The method according to claim 10, wherein the performing video stream coding according to a target scene picture corresponding to each target client in the global scene picture to obtain a video stream corresponding to each target client comprises:
determining an overlapped picture area and a non-overlapped picture area relative to other target scene pictures in each target scene picture according to the target scene pictures corresponding to each target client;
encoding the overlapping picture region and the non-overlapping picture region, respectively;
combining the coding information of the overlapped picture area and the coding information of the non-overlapped picture area in each target scene picture to obtain the coding information of the target scene picture corresponding to each target client;
and generating a video stream corresponding to each target client according to the coding information of the target scene picture corresponding to each target client.
12. An apparatus for encoding a scene picture, comprising:
the system comprises a position information acquisition module, a position information acquisition module and a position information acquisition module, wherein the position information acquisition module is used for acquiring the position information of a virtual object controlled by each target client in a target virtual scene, the target client refers to a client joining a virtual game, and the target virtual scene refers to a virtual scene corresponding to the virtual game;
the target scene area determining module is used for determining a target scene area corresponding to each target client in the target virtual scene according to the position information of the virtual object controlled by each target client;
the target scene picture determining module is used for determining a target scene picture corresponding to each target client according to the scene data of each target scene area;
the video stream coding module is used for coding video streams according to the target scene pictures corresponding to the target clients to obtain the video streams of the target clients;
and the video stream sending module is used for sending the video stream to the corresponding target client.
13. An electronic device, comprising:
a processor;
a memory having computer-readable instructions stored thereon which, when executed by the processor, implement the method of any of claims 1-11.
14. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1-11.
15. A computer program product comprising computer instructions, characterized in that the computer instructions, when executed by a processor, implement the method of any of claims 1-11.
CN202111651823.7A 2021-11-15 2021-12-30 Coding method, device, electronic device and storage medium of scene picture Pending CN114225386A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2021113482765 2021-11-15
CN202111348276 2021-11-15

Publications (1)

Publication Number Publication Date
CN114225386A true CN114225386A (en) 2022-03-25

Family

ID=80744756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111651823.7A Pending CN114225386A (en) 2021-11-15 2021-12-30 Coding method, device, electronic device and storage medium of scene picture

Country Status (1)

Country Link
CN (1) CN114225386A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615522A (en) * 2022-05-11 2022-06-10 北京畅发科技有限公司 Low-delay streaming media transcoding and distributing processing method
CN114972594A (en) * 2022-04-25 2022-08-30 北京百度网讯科技有限公司 Data processing method, device, equipment and medium for meta universe
CN115509406A (en) * 2022-11-23 2022-12-23 煤炭科学研究总院有限公司 Coal mine multi-scene fusion method and device, storage medium and electronic equipment
WO2024255263A1 (en) * 2023-06-12 2024-12-19 华为云计算技术有限公司 Cloud game processing method, server, and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140286390A1 (en) * 2013-03-20 2014-09-25 Nvidia Corporation Encoder controller graphics processing unit and method of encoding rendered graphics
CN105025061A (en) * 2014-04-29 2015-11-04 中国电信股份有限公司 Method and server for constructing cloud-end shared game scene
CN110177275A (en) * 2019-05-30 2019-08-27 广州酷狗计算机科技有限公司 Method for video coding and device, storage medium
CN110227259A (en) * 2018-03-06 2019-09-13 华为技术有限公司 A kind of method, apparatus of data processing, server and system
CN111340684A (en) * 2020-02-12 2020-06-26 网易(杭州)网络有限公司 Method and device for processing graphics in game
CN113345060A (en) * 2021-06-01 2021-09-03 温州大学 Rendering method of digital twin model, and visual cone removing method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140286390A1 (en) * 2013-03-20 2014-09-25 Nvidia Corporation Encoder controller graphics processing unit and method of encoding rendered graphics
CN105025061A (en) * 2014-04-29 2015-11-04 中国电信股份有限公司 Method and server for constructing cloud-end shared game scene
CN110227259A (en) * 2018-03-06 2019-09-13 华为技术有限公司 A kind of method, apparatus of data processing, server and system
CN110177275A (en) * 2019-05-30 2019-08-27 广州酷狗计算机科技有限公司 Method for video coding and device, storage medium
CN111340684A (en) * 2020-02-12 2020-06-26 网易(杭州)网络有限公司 Method and device for processing graphics in game
CN113345060A (en) * 2021-06-01 2021-09-03 温州大学 Rendering method of digital twin model, and visual cone removing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
姚寿文: "刚体实时动态仿真基础", 31 March 2021, 北京理工大学出版社, pages: 6 - 9 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972594A (en) * 2022-04-25 2022-08-30 北京百度网讯科技有限公司 Data processing method, device, equipment and medium for meta universe
CN114615522A (en) * 2022-05-11 2022-06-10 北京畅发科技有限公司 Low-delay streaming media transcoding and distributing processing method
CN114615522B (en) * 2022-05-11 2022-07-29 北京畅发科技有限公司 Low-delay streaming media transcoding and distributing processing method
CN115509406A (en) * 2022-11-23 2022-12-23 煤炭科学研究总院有限公司 Coal mine multi-scene fusion method and device, storage medium and electronic equipment
CN115509406B (en) * 2022-11-23 2023-03-14 煤炭科学研究总院有限公司 Coal mine multi-scene fusion method and device, storage medium and electronic equipment
WO2024255263A1 (en) * 2023-06-12 2024-12-19 华为云计算技术有限公司 Cloud game processing method, server, and system

Similar Documents

Publication Publication Date Title
CN114225386A (en) Coding method, device, electronic device and storage medium of scene picture
US9665334B2 (en) Rendering system, rendering server, control method thereof, program, and recording medium
KR101623288B1 (en) Rendering system, rendering server, control method thereof, program, and recording medium
US11724191B2 (en) Network-based video game editing and modification distribution system
JP6959365B2 (en) Shadow optimization and mesh skin adaptation in a foveal rendering system
JP5952406B2 (en) Video game device having remote drawing capability
US8363051B2 (en) Non-real-time enhanced image snapshot in a virtual world system
JP6341986B2 (en) Drawing apparatus, drawing method thereof, program, and recording medium
KR101536501B1 (en) Moving image distribution server, moving image reproduction apparatus, control method, recording medium, and moving image distribution system
US11704868B2 (en) Spatial partitioning for graphics rendering
US11107183B2 (en) Adaptive mesh skinning in a foveated rendering system
CN114419099B (en) Method for capturing motion trail of virtual object to be rendered
EP3324364B1 (en) Image processing method and computer-readable medium
CN113230659B (en) Game display control method and device
EP2954495B1 (en) Information processing apparatus, method of controlling the same, program, and storage medium
CN113313796B (en) Scene generation method, device, computer equipment and storage medium
CN116958390A (en) Image rendering method, device, equipment, storage medium and program product
CN112396683B (en) Shadow rendering method, device, equipment and storage medium for virtual scene
JP2008027064A (en) Program, information recording medium, and image forming system
CN116567274A (en) Live interactive method, device and system
CN115970271A (en) Game action execution method, game action execution device, storage medium, and device
JP2007241868A (en) Program, information storage medium, and image generation system
CN115463412A (en) A display processing method and device for cloud games
JP2005209217A (en) Game system and information storage medium
CN116966556A (en) Virtual object rendering method, device, equipment, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination