CN114904274A - Picture rendering method and device of cloud game, electronic equipment and storage medium - Google Patents

Picture rendering method and device of cloud game, electronic equipment and storage medium Download PDF

Info

Publication number
CN114904274A
CN114904274A CN202110174738.XA CN202110174738A CN114904274A CN 114904274 A CN114904274 A CN 114904274A CN 202110174738 A CN202110174738 A CN 202110174738A CN 114904274 A CN114904274 A CN 114904274A
Authority
CN
China
Prior art keywords
instruction
parameter
image
data
target
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
CN202110174738.XA
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
Priority to CN202110174738.XA priority Critical patent/CN114904274A/en
Publication of CN114904274A publication Critical patent/CN114904274A/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/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • 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

Landscapes

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

Abstract

The application discloses a picture rendering method, a picture rendering device, electronic equipment and a storage medium for a cloud game, wherein the picture rendering method comprises the following steps: the method comprises the steps of obtaining image rendering instruction data of a target game, determining image instruction parameters with the parameter types being preset parameter types from at least one image instruction parameter as target image instruction parameters according to the parameter types of the image instruction parameters, compressing data sequences of the target image instruction parameters into data sequences in a preset format according to the parameter values of the target image instruction parameters to obtain processed instruction parameters, carrying out fusion processing on the processed instruction parameters to obtain fused image rendering instructions, and sending the fused image rendering instructions to a terminal so that the terminal can render pictures of the target game according to the fused image rendering instructions.

Description

Picture rendering method and device of cloud game, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a picture rendering method and device for a cloud game, electronic equipment and a storage medium.
Background
Cloud gaming (Cloud gaming), which may also be referred to as game on demand (gaming), is an online game technology based on Cloud computing technology. Cloud game 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 scenario, the game is not run on the player's gaming terminal, but rather in a cloud server.
Currently, cloud games include a video streaming cloud game and an instruction streaming cloud game, in which a cloud server renders a game scene into a video and audio stream, and the video and audio stream is transmitted to a game terminal of a player through a network. The game terminal of the player 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 the input instruction of the player and sending the input instruction to the cloud server; in the instruction stream cloud game, the cloud server transmits the image rendering instruction to the player game terminal, the player game terminal renders a picture by using the image processor of the player game terminal, and compared with the video stream cloud game, the advantage that the image quality of the game is not lost, but the bandwidth occupied by the instruction stream cloud game is far higher than that of the video stream cloud game.
Disclosure of Invention
The application provides a picture rendering method and device for a cloud game, an electronic device and a storage medium, which can reduce the bandwidth occupied by the cloud game on the premise of ensuring that the game image quality is not lost.
The application provides a picture rendering method of a cloud game, which comprises the following steps:
acquiring image rendering instruction data of a target game, wherein the image rendering instruction data comprises at least one image rendering instruction, and the image rendering instruction comprises at least one image instruction parameter;
determining an image instruction parameter with a parameter type being a preset parameter type from at least one image instruction parameter as a target image instruction parameter according to the parameter type of the image instruction parameter;
compressing the data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter;
performing fusion processing on the processed instruction parameters to obtain a fused image rendering instruction;
and sending the fused image rendering instruction to a terminal so that the terminal can render the picture of the target game according to the fused image rendering instruction.
Correspondingly, the present application further provides a picture rendering apparatus for a cloud game, comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring image rendering instruction data of a target game, the image rendering instruction data comprises at least one image rendering instruction, and the image rendering instruction comprises at least one image instruction parameter;
the determining module is used for determining the image instruction parameter with the parameter type being a preset parameter type from at least one image instruction parameter as a target image instruction parameter according to the parameter type of the image instruction parameter;
the compression module is used for compressing the data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter;
the fusion module is used for carrying out fusion processing on the processed instruction parameters to obtain a fused image rendering instruction;
and the sending module is used for sending the fused image rendering instruction to a terminal so that the terminal can render the picture of the target game according to the fused image rendering instruction.
Optionally, in some embodiments of the present application, the compression module includes:
the acquisition unit is used for acquiring the parameter value of the target image instruction parameter;
the determining unit is used for determining the cache sequence distributed by the target image instruction parameter;
and the compression unit is used for compressing the data sequence of the target image instruction parameter into a data sequence with a preset format based on the parameter value of the target image instruction parameter and the distributed cache sequence to obtain a processed instruction parameter.
Optionally, in some embodiments of the present application, the compression unit includes:
the determining subunit is configured to determine, based on the parameter value of the target image instruction parameter, the number of bytes required for caching the target image instruction parameter, so as to obtain a target byte stream;
a deleting subunit, configured to delete, in the cache sequence allocated to the target image instruction parameter, a numerical value corresponding to an unoccupied byte to obtain a deleted data sequence;
and the compression subunit is used for compressing the data of the deleted data sequence into the target byte stream to generate a data sequence conforming to a preset format so as to obtain a processed instruction parameter.
Optionally, in some embodiments of the present application, the compressing subunit is specifically configured to:
detecting the symbol type of the parameter value of the target image instruction parameter;
filling a numerical value corresponding to the symbol type in the highest order of the target byte stream;
generating a numerical value sequence conforming to a preset format based on the data of the deleted data sequence;
and sequentially adding the numerical value sequence to the filled target byte stream by taking the second highest order of the filled target byte stream as a reference so as to obtain a processed instruction parameter.
Optionally, in some embodiments of the present application, the fusion module includes:
the calling unit is used for calling a game canvas of the target game;
the modification unit is used for modifying the canvas data of the game canvas by the processed instruction parameters to obtain modified canvas data;
and the generating unit is used for generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
Optionally, in some embodiments of the application, the generating unit is specifically configured to:
storing the modified canvas data into a cache space;
and when an image drawing request is received, generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
Optionally, in some embodiments of the present application, the apparatus further includes a compression module, where the compression module is specifically configured to:
determining image instruction parameters with parameter types not being preset parameter types as image instruction parameters to be compressed;
compressing the image instruction parameter to be compressed according to the parameter type of the image instruction parameter to be compressed;
the fusion module is specifically configured to: and performing fusion processing on the compressed image rendering instruction and the processed image rendering instruction to obtain a fused image rendering instruction.
After image rendering instruction data of a target game are obtained, the image rendering instruction data comprise at least one image rendering instruction, the image rendering instruction comprises at least one image instruction parameter, the image instruction parameter with the parameter type being a preset parameter type is determined as the target image instruction parameter from the at least one image instruction parameter according to the parameter type of the image instruction parameter, then, a data sequence of the target image instruction parameter is compressed into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter, then, the processed instruction parameter is subjected to fusion processing to obtain a fused image rendering instruction, and finally, the fused image rendering instruction is sent to a terminal so that the terminal can render images of the target game according to the fused image rendering instruction, according to the picture rendering scheme of the cloud game, the image instruction parameters of the preset parameter types are compressed into the data sequence of the preset format, and the plurality of processed instruction parameters are fused, so that the image rendering instructions are compressed, the data volume of the image rendering instruction data is reduced, and the bandwidth occupied by the cloud game can be reduced on the premise that the quality of the game image is not lost.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a scene schematic diagram of a picture rendering method of a cloud game provided by the present application;
fig. 1b is a schematic flowchart of a picture rendering method of a cloud game provided by the present application;
FIG. 1c is a schematic diagram illustrating the distribution of command parameter occupied bytes in a current command stream cloud game;
FIG. 2a is another schematic flow chart of a screen rendering method of a cloud game provided in the present application;
FIG. 2b is a schematic structural diagram of a screen rendering system of a cloud game provided in the present application;
FIG. 2c is a schematic diagram of a graphics cache state machine of a cloud game provided in the present application;
FIG. 3a is a schematic structural diagram of a screen rendering apparatus of a cloud game provided in the present application;
FIG. 3b is another schematic structural diagram of a screen rendering apparatus of a cloud game provided in the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The application provides a picture rendering method and device for a cloud game, electronic equipment and a storage medium.
The picture rendering device of the cloud game can be specifically integrated in a server, the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and an artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
For example, referring to fig. 1a, the present application provides a cloud game screen rendering system, which includes a cloud game server 10, a game terminal 20 and a user 30, wherein the game terminal 20 may display a game list including a plurality of cloud games, when the user 30 selects a target game from the game list, the cloud game server 10 may obtain image rendering instruction data of the target game, the image rendering instruction data includes at least one image rendering instruction, the image rendering instruction includes at least one image instruction parameter, the cloud game server 10 then selects a target image instruction parameter with an instruction parameter type of a preset instruction parameter type from the at least one image instruction parameter, the cloud game server 10 then compresses a data sequence of the target image instruction parameter into a data sequence with a predetermined format to obtain a processed instruction parameter, then, the cloud game server 10 performs fusion processing on the processed instruction parameters to obtain a fused image rendering instruction, and finally, the cloud game server 10 sends the fused image rendering instruction to the game terminal 20, so that the game terminal 20 displays a picture of the target game according to the fused image rendering instruction.
According to the picture rendering method of the cloud game, the image instruction parameters of the preset parameter types are compressed into the data sequence of the preset format, and the plurality of processed instruction parameters are fused, so that the compression of the image rendering instruction is realized, the data volume of the image rendering instruction data is reduced, and the bandwidth occupied by the cloud game can be reduced on the premise of ensuring that the game image quality is not lost.
The following are detailed descriptions. It should be noted that the description sequence of the following embodiments is not intended to limit the priority sequence of the embodiments.
A picture rendering method of a cloud game comprises the following steps: the method comprises the steps of obtaining image rendering instruction data of a target game, determining image instruction parameters with parameter types being preset parameter types from at least one image instruction parameter as target image instruction parameters according to the parameter types of the image instruction parameters, compressing a data sequence of the target image instruction parameters into a data sequence with a preset format according to the parameter values of the target image instruction parameters to obtain processed image rendering instructions, carrying out fusion processing on the processed instruction parameters to obtain fused image rendering instructions, and sending the fused image rendering instructions to a terminal so that the terminal can render pictures of the target game according to the fused image rendering instructions.
Referring to fig. 1b, fig. 1b is a schematic flowchart illustrating a screen rendering method of a cloud game according to the present application. The specific flow of the picture rendering method of the cloud game can be as follows:
101. image rendering instruction data of a target game is acquired.
The target game can be a multiplayer online tactical sports game or a multiplayer shooting game, image rendering instruction data of the target game can be acquired through a wired network or a wireless network, and in the application, the game needing picture rendering is determined as the target game.
Rendering is the last process of computer animation, and English is Render. Because the rendering and coloring are two distinct concepts in three-dimensional software, although they function similarly, they are different. Shading is a display scheme that typically appears in the main window of three-dimensional software and acts as an auxiliary viewing model as a wire-frame diagram of a three-dimensional model. In a video display scheme, a model or a scene is often output as an image file, a video signal or a motion picture film, and this is necessary to go through a rendering program, and an image rendering instruction is a set of codes that can perform image rendering.
The image rendering instruction data includes at least one image rendering instruction, and the image rendering instruction includes at least one image instruction parameter, and different image instruction parameters correspond to different functions, for example, the image rendering instruction data includes an image rendering instruction glBufferData, which is a function for copying user-defined data to a current binding buffer, and includes image instruction parameters "GL _ STREAM _ DRAW" and "GL _ DYNAMICs _ DRAW", where the "GL _ STREAM _ DRAW" image instruction parameter indicates that data may change each time an image is drawn, and the "GL _ DYNAMICs _ DRAW" indicates that data may change a lot each time an image is drawn.
Specifically, a player controls the operation of the terminal according to a game image, then the terminal sends an operation instruction of the user to the server by using a wired or wireless communication mode, and the server generates an image rendering instruction through the calculation of the central processing unit after receiving the operation instruction, where the image rendering instruction may be an image rendering instruction of an Open Graphics Library (OpenGL) or a Web Graphics Library (Web gl), and the OpenGL is a cross-language and cross-platform Application Programming Interface (API) for rendering 2D and 3D vector Graphics. This interface consists of nearly 350 different function calls to draw from simple graphics bits to complex three-dimensional scenes; WebGL is a 3D drawing protocol, the drawing technical standard allows JavaScript and OpenGL ES 2.0 to be combined together, and by adding one JavaScript binding of OpenGL ES 2.0, WebGL can provide hardware 3D accelerated rendering for HTML5 Canvas, so that a Web developer can more smoothly display 3D scenes and models in a browser by means of a system display card, and complex navigation and data visualization can be created. Obviously, the WebGL technical standard eliminates the trouble of developing web page-specific rendering plug-ins, can be used to create web site pages with complex 3D structures, and can even be used to design 3D web games, and the like.
102. And determining the image instruction parameter with the parameter type being a preset parameter type from at least one image instruction parameter as a target image instruction parameter according to the parameter type of the image instruction parameter.
When the image rendering instruction data of the target game is acquired from 101, the image rendering instruction in the image rendering data is acquired. Wherein the image rendering instruction comprises at least one image instruction parameter. Taking OpenGL image rendering instructions as an example, for example, OpenGL shader instruction glShaderSource, the meaning of the instruction is that a function compiles a shader object into a first parameter, which includes the following image instruction parameters, respectively: "fluent shader" and "glucr string", where "fluent shader" is a parameter type of long integer, and "glucr string" is a parameter type of character string, and for an image instruction parameter of numeric type (such as long integer, short integer, and byte type), it may be compressed into an image instruction parameter of a predetermined format, that is, optionally, in some embodiments, the step "determining a current target image instruction parameter from at least one image instruction parameter according to a parameter type of the image instruction parameter" may specifically include:
(11) detecting the parameter type of the image instruction parameter;
(12) and determining the image instruction parameter with the parameter type being the preset parameter type as a target image instruction parameter to obtain at least one target image instruction parameter.
For example, a specific image rendering instruction includes an image rendering instruction parameter a, an image rendering instruction parameter B, an image rendering instruction parameter C, an image rendering instruction parameter D, and an image rendering instruction parameter E, where the image rendering instruction parameter a, the image rendering instruction parameter B, the image rendering instruction parameter C, and the image rendering instruction parameter D are all image instruction parameters of preset parameter types, the image rendering instruction parameter a, the image rendering instruction parameter B, the image rendering instruction parameter C, and the image rendering instruction parameter D are determined as target image instruction parameters, and then, a current target image instruction parameter is determined in the 4 image rendering instruction parameters.
It should be noted that, in an instruction stream cloud game, an image rendering instruction needs to be transmitted to a terminal, and the terminal analyzes the image rendering instruction, so as to render a corresponding game picture, the present application provides a picture rendering scheme based on the cloud game, and an image instruction parameter of a preset type is compressed by using the scheme, it can be understood that, in order to facilitate the subsequent transmission of the image rendering instruction to the terminal, for an image instruction parameter (non-target image instruction parameter) that is not of the preset parameter type, such as an image instruction parameter of a character string type, an image instruction parameter of the preset parameter type can be compressed by using a Zstandard compression algorithm, which is a lossless compression algorithm of a semantic-free data stream compressed based on statistical information of data amount; for the image instruction parameter of the texture picture type, compressing the image instruction parameter of the type by using a Sharp p compression algorithm, specifically including prediction space transformation, color space conversion, using a palette, packing multiple pixels into one pixel, and transparent channel value replacement, that is, optionally, in some embodiments, specifically, further including:
(21) determining image instruction parameters with parameter types not being preset parameter types as image instruction parameters to be compressed;
(22) and compressing the image instruction parameters to be compressed according to the parameter types of the image instruction parameters to be compressed.
In a game scene, there is a three-dimensional model consisting of a set of three-dimensional polygonal patches, each patch comprising a plurality of interconnected polygons. The polygon is a closed figure formed by sequentially connecting three or more line segments end to end, wherein the polygon in the three-dimensional model is a triangle. The three-dimensional model can be presented by real objects or imaginary objects, including but not limited to three-dimensional maps, three-dimensional devices, three-dimensional characters, three-dimensional games, and the like.
In a three-dimensional model, the vertices of each polygon are the vertices of the three-dimensional model, and the vertex coordinates are three-dimensional coordinates, such as (x, y, z). A texture is a picture in two-dimensional space, actually a two-dimensional array, whose elements are color values. The individual color values are referred to as texels or texels. Each texel has a unique address in the texture, i.e. texture coordinates, which are two-dimensional coordinates and can be represented by (u, v). There are cases where a certain number of vertex coordinates are shared in the three-dimensional model, i.e., one vertex coordinate may correspond to a plurality of texture coordinates. Typically at the inflection point of the three-dimensional model, multiple texture coordinates share a vertex coordinate. Thus, in a three-dimensional model, the number of texture coordinates is greater than the number of vertex coordinates.
For the image instruction parameters of the texture picture type, the vertex coordinates and the texture coordinates may be subjected to data type conversion. Specifically, the vertex coordinates are converted according to the coordinate value range of the vertex coordinates, and the texture coordinates are converted according to the coordinate value range of the texture coordinates, so that the compression of the image instruction parameters of the texture picture type is realized.
103. And compressing the data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter.
In order to reduce the data amount during data transmission, after a target image instruction parameter is determined, the present application compresses a data sequence of the target image instruction parameter into a binary data sequence to implement compression of the target image instruction parameter, which is described in detail below by taking an OpenGL instruction as an example, in the OpenGL instruction, each parameter basically occupies more than 4 bytes of memory, such as a texture drawing gltexmage 2d instruction of OpenGL, an image instruction parameter Glenum, an image instruction parameter Glint and an image instruction parameter Glsizei occupy more than 4 bytes of memory, but most of values actually corresponding to the image instruction parameter are index numbers, such as an index number of a GPU cache, for example, 0 represents a first block cache, 1 represents a 2 nd block cache, and cannot exceed 128 block caches in total, for example, an image instruction parameter target, 0 represents drawing a two-dimensional graph, 1 represents drawing a three-dimensional graph, such as a parameter value of a shader instruction parameter is equal to 1, the hexadecimal notation is 0x 000000000001, and Byte (Byte) is a measurement unit used by computer information technology for measuring storage capacity, and since in computer information technology, one Byte stores 8-bit unsigned numbers, and the stored value range is 0 to 255, the image instruction parameter target and shader parameter only needs 1 Byte for transmission, that is, optionally, in some embodiments, the step "compress the data sequence of the target image instruction parameter into a data sequence of a predetermined format to obtain a processed image rendering instruction" may specifically include:
(31) acquiring a parameter value of a target image instruction parameter;
(32) determining a cache sequence distributed by the target image instruction parameter;
(33) and compressing the data sequence of the target image instruction parameters into a data sequence with a preset format based on the parameter values of the target image instruction parameters and the distributed cache sequence to obtain the processed instruction parameters.
The compression method provided by this embodiment dynamically determines the size of the memory occupied according to the value of the actual parameter of the interface, and the smaller the parameter value is, the smaller the memory occupied is, so that the data volume to be transmitted by each image rendering instruction can be greatly reduced.
Further, a number of bytes required by the target image instruction parameter may be determined, and then, in a cache sequence allocated to the target image instruction parameter, a value corresponding to an unoccupied byte is deleted to obtain a processed instruction parameter, that is, optionally, in some embodiments, the step "compress a data sequence of the target image instruction parameter into a data sequence in a predetermined format based on the parameter value of the target image instruction parameter and the allocated cache sequence to obtain the processed instruction parameter" may specifically include:
(41) determining the number of bytes required by the caching target image instruction parameter according to the parameter value to obtain a target byte;
(42) deleting the numerical value corresponding to the unoccupied byte of the target image instruction parameter in the distributed cache sequence to obtain a deleted data sequence;
(43) and compressing the data of the deleted data sequence into a target byte to generate a data sequence conforming to a preset format so as to obtain a processed instruction parameter.
In the application, the target byte stream refers to a byte stream that needs to be buffered in a packing manner, or is exemplified by an image instruction parameter shader equal to 1, in OpenGL, the image instruction parameter shader occupies 4 bytes, that is, the number of cache sequences allocated by the image instruction parameter loader is 4, and 0x 0000000000000001 is expressed by hexadecimal, it is understood that, in the image instruction parameter shader, there are three bytes of corresponding data that are null, i.e., all "0000", then the value corresponding to the unoccupied byte of the target image instruction parameter in the allocated buffer sequence may be deleted, then, compressing the data of the deleted data sequence into a target byte to generate a data sequence conforming to a predetermined format, that is, the data of the first three bytes of 0000000000000001 is deleted, resulting in 0001, and at this time, 0001 may represent an image instruction parameter shader, that is, a processed image rendering instruction is obtained.
It should be noted that, for data with a symbol (i.e. a plus sign or a symbol), when the data is compressed, the symbol needs to be represented in the data sequence in a binary representation manner of 0 or 1, so that a subsequent terminal can correctly display a game picture of a target game, that is, optionally, in some embodiments, the step "compress data of the deleted data sequence into a target byte to generate a data sequence conforming to a predetermined format to obtain a processed image rendering instruction" may specifically include:
(51) detecting the symbol type of the parameter value of the target image instruction parameter;
(52) filling the highest bit of the target byte stream with a numerical value corresponding to the symbol type;
(53) generating a numerical sequence conforming to a preset format according to the data of the deleted data sequence;
(54) and sequentially adding the numerical value sequence to the filled target byte stream by taking the second highest bit of the filled target byte stream as a reference so as to obtain a processed image rendering instruction.
In this application, 7 bits in one byte are used to represent data, the highest bit (bit) represents whether the next byte has data 0, if yes, the byte is the last byte of the integer, 1 represents that the following bytes represent the high bits of the data, such as the first parameter shader value in glsharersource is 3543, the interface definition according to OpenGL is used with GLuint4 bytes, and in fact, 3543 is represented with 12 bits (| 00000000 | 00000000 | 00001101 | 11010111 |).
For this situation, this embodiment provides a novel compression scheme, please refer to fig. 1c, which removes all 0 bits in the upper bits of the bytes from being used for transmission (i.e. removes bytes without data), assuming that the value corresponding to the image command parameter is V, occupies M bytes, each byte has 8 bits (0 or 1) to represent data, the buffer to be packed for transmission, i.e. the target byte stream B, takes the lower 7 bits of V to B, shifts V to the right by 7 bits, if V can be represented by 7 bits, then the 8 th bit is 0, if not, the highest bit of B is assigned 1, wherein, the blank space appearing during the digital shift is completely filled with 0, and it should be noted that, if the 8 th bit of the 1 st byte is 1, if the bit number is 0, the following high-order data is not present, and as shown in the figure, the 8 th bit of the 2 nd byte is 0, and the data occupies 2 bytes when stored.
It should be noted that, if the data is signed, the most significant bit represents a positive or negative number, 1 represents a negative number, 0 represents a positive number, and the most significant bit needs to be right-shifted to the least significant bit, and the data is converted into unsigned data and then compressed by the above method, for example, the value of the image instruction parameter is-127, and it can be seen that the 2-system original code of 127 is 01111111, the inverse code thereof is 10000000, and the addition of 1 after the inverse code is 10000001, which is the 2-system representation of-127.
104. And performing fusion processing on the processed instruction parameters to obtain a fused image rendering instruction.
For example, specifically, in the present application, the processed instruction parameter and the non-target image instruction parameter that is not of the preset parameter type are subjected to fusion processing to obtain a fused image rendering instruction, and for the processing of the non-target image instruction parameter, please refer to the foregoing embodiment, which is not described herein again.
In order to further reduce the data amount during data transmission and further reduce the occupied bandwidth, the embodiment provides a new method for performing fusion processing on an unprocessed image rendering instruction and a processed image rendering instruction, and first, an image drawing flow of a current instruction stream cloud game is described.
In actual application, the image rendering instruction parameter glBufferData writes 3D model data into a game canvas (memory space), the game canvas can be understood as a graphics container, and the running logic code can draw graphics such as text, lines, rectangles, and circles on the canvas through a drawing interface. The canvas may include an on-screen canvas and an off-screen canvas. The upper screen canvas is already displayed on the screen of the terminal and is as wide as the screen and as high as the screen. The off-screen canvas is not yet displayed on the screen of the terminal. The game drawing resource is a material for drawing game drawing elements in the game screen. The game drawing resources include static game drawing resources and dynamic game drawing resources. Static game drawing resources are game drawing resources that have universal consistency. It is to be understood that the game screen of the game-type sub-application may be the same screen for each user. Dynamic game drawing resources are game drawing resources with diversity. Such as a response screen after interaction with the user. After 3D model data is written in the game canvas, the game canvas is transmitted to a terminal; when the model data is modified, the game drawing is required to be transmitted to a terminal by the image rendering instruction parameter lMapBufferRange/glBufferSubData; the image rendering instruction parameter glVertexAttribPonter indicates the data cached by the game canvas in the D model attribute; the image rendering instruction parameter glDrawElement indicates vertex data that the terminal needs to draw, and it can be known from this flow that when a game picture changes, data needs to be frequently transmitted between the server and the terminal, which results in occupying a large amount of bandwidth, based on this, the present application can modify canvas data of a game canvas based on a plurality of processed instruction parameters, to obtain modified canvas data, so as to generate a fused image rendering instruction, that is, optionally, in some embodiments, the step "fuse the processed instruction parameters, to obtain the fused image rendering instruction" may specifically include:
(61) calling a game canvas of a target game;
(62) modifying canvas data of the game canvas based on the plurality of processed instruction parameters to obtain modified canvas data;
(63) and generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
Specifically, the image rendering instruction parameters do not need to be transmitted to the terminal, and only the game data of the local game canvas needs to be modified.
105. And sending the fused image rendering instruction to the terminal so that the terminal can render and display the picture of the target game according to the fused image rendering instruction.
For example, specifically, the fused image rendering instruction may be sent to the terminal based on mobile communication of the third Generation Partnership Project (3 GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on a TCP/IP Protocol Suite (TCP/IP), User Datagram Protocol (UDP) Protocol, so that the terminal displays a picture of the target game.
It should be noted that, when the terminal receives the fused image rendering instruction, the fused image rendering instruction needs to be decoded, that is, the fused image rendering instruction is restored to a corresponding graphics library language type, assuming that the received byte B is determined according to the OpenGL standard, for example, the received byte B is a glndbuffer instruction, the type of the parameter 1 must be a GLuint, the decoding is an inverse process of the encoding, assuming that the OpenGL type is stored by a V, the V takes a value of the 7 th bit of B, if the 8 th bit of B is 1, it indicates that data exists behind the parameter, the V is shifted to the left by 7 bits, and if the 8 th bit is 0, it indicates that the V taking is ended.
After image rendering instruction data of a target game are obtained, the image rendering instruction data comprise at least one image rendering instruction, the image rendering instruction comprises at least one image instruction parameter, the image instruction parameter with the parameter type being a preset parameter type is determined as the target image instruction parameter from the at least one image instruction parameter according to the parameter type of the image instruction parameter, then a data sequence of the target image instruction parameter is compressed into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter, then the processed instruction parameter is fused to obtain a fused image rendering instruction, and finally the fused image rendering instruction is sent to a terminal so that the terminal can render images of the target game according to the fused image rendering instruction, and the image rendering scheme of the cloud game is provided by the application, the image instruction parameters of the preset parameter types are compressed into a data sequence of a preset format, and a plurality of processed instruction parameters are fused, so that the compression of the image rendering instruction is realized, the data volume of the image rendering instruction data is reduced, and the bandwidth occupied by the cloud game can be reduced on the premise of ensuring that the game image quality is not lost.
The method according to the examples is further described in detail below by way of example.
In the present embodiment, the screen rendering apparatus of the cloud game is specifically integrated in the server as an example.
Referring to fig. 2a, a method for rendering a cloud game image includes the following steps:
201. the server acquires image rendering instruction data of a target game.
The target game can be a multi-player online tactical competitive game or a multi-player shooting game, image rendering instruction data of the target game can be acquired through a wired network or a wireless network, in the application, the game needing picture rendering is determined as the target game, the image rendering instruction data comprises at least one image rendering instruction, the image rendering instruction comprises at least one image instruction parameter, the corresponding functions of different image instruction parameters are different, concretely, a player carries out operation control on the terminal according to a game picture, then, the terminal can send the operation instruction of the user to a server through a wired or wireless communication mode, and the server generates the image rendering instruction through the calculation of a central processing unit after receiving the operation instruction.
202. And the server determines the image instruction parameter with the parameter type being the preset parameter type from at least one image instruction parameter as the target image instruction parameter according to the parameter type of the image instruction parameter.
After obtaining the image rendering data of the target game, the server obtains the image rendering instruction in the image rendering data. The image rendering instruction comprises at least one image instruction parameter.
Specifically, the image rendering instruction of OpenGL is taken as an example, for example, a shader instruction glsharersource of OpenGL includes the following image instruction parameters, which are respectively: the "cursor shader" and "cursor string" are the parameter types of the long integer, and the "cursor string" is the parameter type of the character string, and for the image instruction parameters of the numeric type (such as long integer, short integer, and byte type), the server can compress them into the image instruction parameters of the predetermined format.
203. And the server compresses the data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter.
The server may dynamically determine the size of the memory occupied according to the value size of the actual parameter of the interface, and the smaller the value of the parameter, the smaller the memory occupied, and may greatly reduce the data amount to be transmitted by each image rendering instruction, for example, specifically, the server may delete the value corresponding to the unoccupied byte of the target image instruction parameter in the allocated cache sequence, then compress the data of the deleted data sequence into the target byte stream, and generate a data sequence conforming to a predetermined format, for example, the server deletes the value corresponding to the unoccupied byte of the image instruction parameter shader having the image instruction parameter value of 1 in the allocated cache sequence, that is, deletes the data of the first three bytes of 000000000001, and obtains 0001, and obtains the processed image rendering instruction.
204. And the server performs fusion processing on the plurality of processed instruction parameters to obtain a fused image rendering instruction.
For example, specifically, the server may call a game canvas of the target game, and then modify canvas data of the game canvas based on the plurality of processed instruction parameters to obtain modified canvas data, and when receiving an image drawing request, the server generates an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
205. And the server sends the fused image rendering instruction to the terminal so that the terminal can render and display the picture of the target game according to the fused image rendering instruction.
For example, specifically, the server may transmit the fused image rendering instruction to the terminal based on mobile communication of a third Generation Partnership Project (3rd Generation Partnership Project, 3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on a TCP/IP Protocol Suite (TCP/IP), User Datagram Protocol (UDP) Protocol, so that the terminal displays a picture of the target game.
The method comprises the steps that after image rendering instruction data of a target game are obtained by a server, the image rendering instruction data comprise at least one image rendering instruction, the image rendering instruction comprises at least one image instruction parameter, the server determines the image instruction parameter with the parameter type being a preset parameter type from the at least one image instruction parameter as the target image instruction parameter according to the parameter type of the image instruction parameter, then the server compresses a data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter, then the server performs fusion processing on the processed instruction parameter to obtain a fused image rendering instruction, and finally the server sends the fused image rendering instruction to a terminal so that the terminal can render pictures of the target game according to the fused image rendering instruction, according to the picture rendering scheme of the cloud game, the image instruction parameters of the preset parameter types are compressed into the data sequence of the preset format, and the plurality of processed instruction parameters are fused, so that the image rendering instructions are compressed, the data volume of the image rendering instruction data is reduced, and the bandwidth occupied by the cloud game can be reduced on the premise that the quality of the game image is not lost.
In order to further understand the picture rendering scheme of the cloud game of the present application, specifically, taking an example of updating a game picture as an example, please refer to fig. 2b, the present application provides a picture rendering system of an instruction stream cloud game, where the system includes a server and a terminal, the server includes an application program of a target game, an open graphics library, an OpenGL instruction, an instruction intercepting module, and a graphics cache state machine, the terminal includes a display screen, an instruction receiving module, and a graphics processor, the instruction intercepting module is configured to intercept an instruction and compress the intercepted instruction, and the instruction receiving module is configured to receive an instruction and decompress the received instruction, so as to display a game picture of the target game on the display screen of the terminal.
Firstly, an instruction interception module of a server intercepts an OpenGL interface instruction and parameters, and if the value of the instruction parameter is of an unsigned numerical value type, the instruction parameter is handed to an unsigned integer compression module for processing; if the data is signed data, the highest bit represents a positive number or a negative number, 1 represents a negative number, 0 represents a positive number, the highest sign bit needs to be shifted to the lowest bit right, and the data is converted into unsigned data and then encoded; if the parameter is a string type, such as string parameter in glShaderSource, it is compressed by a compression algorithm zstd; if the parameters of the texture picture type, such as pixel values in the gltexmmage 2D, are compressed by sharpP, please refer to the foregoing embodiment specifically, and will not be described herein again.
Further, referring to fig. 2c, since the conventional cloud game image rendering command is called as a basic unit for each draw (glDrawArray/glDrawElement), that is, geometric data is prepared and rendered by using a graphics processor, when a game screen of a target game is drawn, it is required to call glMapBufferRage many times to write vertex and color attribute data into a cache, and finally call glDrawElement so that the graphics processor renders a corresponding triangle surface,
in the application, an image rendering instruction for drawing geometric figure data each time is recorded by using a graphic cache state machine, which is a mathematical model representing finite states and behaviors such as transfer, action and the like among the states, the graphic cache state machine is combined into an instruction and sent to a terminal, and the terminal receives the combined instruction and then restores the combined instruction into a nominal OpenGL instruction, and then a display card of the terminal performs rendering display.
The target game operated by the server side calls a glCreateBuffer image rendering instruction to find a graph cache state machine to create a memory to store data to be drawn, the cache index number is returned as 1, the server does not have image processor hardware, the memory is allocated depending on the graph cache state machine, the terminal receives the glCreateBuffer image rendering instruction, the image processor of the terminal can allocate a cache in the image processor at the terminal, and the cache index number can be 2, so that the terminal can increase a resource mapping table to record the one-to-one corresponding relationship between the server and the terminal resources (namely the corresponding relationship between the server cache index number and the terminal cache index number).
When the server obtains the target game calling image rendering instruction, for example, the image rendering instructions such as lmapbuffer range, glflushmappedbuffer range, glumapbuffer and/or glBufferSubData, the purpose of these image rendering instructions is to indicate the change of geometric figure, such as the vertex position, color value and/or texture coordinate of the game character, the server may not transmit these image rendering instructions to the terminal first, but store these data in the index 1 cache in the figure cache state machine, the target game calling glVertexAttribPointer image rendering instruction of the server needs to use the cached data to draw the geometric figure, all figures are composed of triangles, the server only needs to record the range of vertex attribute in the cache, at the same time, the server will store the hash value corresponding to the image rendering instruction, and mark the image rendering instruction transmitted to the terminal, then transmit it subsequently, thereby reducing the amount of data transmitted by the server. In addition, when the server receives the image drawing request, the server determines an image instruction parameter of which the parameter type is a preset parameter type from at least one image instruction parameter as a target image instruction parameter according to the parameter type of the image instruction parameter, then, the server compresses the data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter, fusing the processed instruction parameters to obtain a fused image rendering instruction, specifically generating a glDrawElementWithData image rendering instruction by the server, and sends the image rendering command to the terminal, when the terminal receives the gldraawelementwithata image rendering command, the image rendering operation parameters and data recorded in the gldramineelementwithdata image rendering instruction are obtained by decompressing the gldraminethreadwithdata image rendering instruction, so as to render the game picture of the target game.
In order to better implement the picture rendering method of the cloud game, the application also provides a picture rendering device (display device for short) based on the cloud game. The meaning of the noun is the same as that in the above-mentioned picture rendering method of the cloud game, and the specific implementation details may refer to the description in the method embodiment.
Referring to fig. 3a, fig. 3a is a schematic structural diagram of a picture rendering apparatus of a cloud game provided in the present application, where the distribution apparatus may include an obtaining module 301, a determining module 302, a compressing module 303, a fusing module 304, and a sending module 305, which may specifically be as follows:
an obtaining module 301, configured to obtain image rendering instruction data of a target game.
The target game may be a multiplayer online tactical sports game or a multiplayer shooting game, and the obtaining module 301 may obtain image rendering instruction data of the target game through a wired network or a wireless network.
A determining module 302, configured to determine a current target image instruction parameter from at least one image instruction parameter according to a parameter type of the image instruction parameter.
After obtaining the image rendering data of the target game, the determining module 302 obtains an image rendering instruction in the image rendering data. The image rendering instruction includes at least one image instruction parameter, which is specifically described by taking an image rendering instruction of OpenGL as an example, for example, a shader instruction glshader source of OpenGL includes the following image instruction parameters, which are respectively: "fluent shader" and "glucr string", where "fluent shader" is a parameter type of long integer and "glucr string" is a parameter type of character string, and for image command parameters of numeric type (such as long integer, short integer, and byte type), the determination module 302 may compress them into image command parameters of a predetermined format.
And a compression module 303, configured to compress the data sequence of the target image instruction parameter into a data sequence in a predetermined format according to the parameter value of the target image instruction parameter, so as to obtain a processed instruction parameter.
The compression module 303 may dynamically determine the size of the memory occupied according to the value of the actual parameter of the interface, and the smaller the parameter value is, the smaller the memory occupied is, so that the data amount to be transmitted by each image rendering instruction may be greatly reduced.
Optionally, in some embodiments, the compressing module 303 may specifically include:
the acquisition unit is used for acquiring the parameter value of the target image instruction parameter;
the determining unit is used for determining a cache sequence allocated by the target image instruction parameter;
and the compression unit is used for compressing the data sequence of the target image instruction parameter into a data sequence with a preset format based on the parameter value of the target image instruction parameter and the distributed cache sequence to obtain the processed instruction parameter.
Optionally, in some embodiments, the compressing unit may specifically include:
the determining subunit is used for determining the number of bytes required for caching the target image instruction parameter based on the parameter value of the target image instruction parameter to obtain a target byte stream;
the deleting subunit is used for deleting the numerical value corresponding to the unoccupied byte in the cache sequence distributed by the target image instruction parameter to obtain a deleted data sequence;
and the compression subunit is used for compressing the data of the deleted data sequence into the target byte stream to generate a data sequence conforming to a preset format so as to obtain the processed instruction parameters.
Optionally, in some embodiments, the compressing subunit may specifically be configured to: detecting the symbol type of the parameter value of the target image instruction parameter; filling a numerical value corresponding to the symbol type in the highest bit of the target byte stream; generating a numerical value sequence conforming to a preset format based on the data of the deleted data sequence; and sequentially adding the numerical value sequence to the filled target byte stream by taking the second highest bit of the filled target byte stream as a reference so as to obtain a processed instruction parameter.
And the fusion module 304 is configured to perform fusion processing on the processed instruction parameters to obtain a fused image rendering instruction.
The fusion module 304 may modify the canvas data of the game canvas based on the plurality of processed instruction parameters to obtain the modified canvas data, so as to generate a fused image rendering instruction, that is, optionally, in some embodiments, the fusion module 304 may specifically include:
the calling unit is used for calling a game canvas of the target game;
the modification unit is used for modifying the canvas data of the game canvas by the processed instruction parameters to obtain modified canvas data;
and the generating unit is used for generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
Optionally, in some embodiments, the generating unit may be specifically configured to: and storing the modified canvas data into a cache space, and generating an image rendering instruction corresponding to the modified canvas data when an image drawing request is received to obtain a fused image rendering instruction.
Optionally, in some embodiments, referring to fig. 3b, the display device may further include a compression module 306, and the compression module 306 may be specifically configured to: determining image instruction parameters with parameter types not being preset parameter types as image instruction parameters to be compressed, and compressing the image instruction parameters to be compressed according to the parameter types of the image instruction parameters to be compressed;
the fusion module 304 may be specifically configured to: and performing fusion processing on the compressed image rendering instruction and the processed image rendering instruction to obtain a fused image rendering instruction.
A sending module 305, configured to send the fused image rendering instruction to a terminal, so that the terminal renders the picture of the target game according to the fused image rendering instruction.
For example, the sending module 305 may specifically send the fused image rendering instruction to the terminal based on mobile communication of the third Generation Partnership Project (3rd Generation Partnership Project, 3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on TCP/IP Protocol Suite (TCP/IP), User Datagram Protocol (UDP) Protocol, so that the terminal displays the picture of the target game
After obtaining the image rendering instruction data of the target game, the obtaining module 301 of the present application obtains the image rendering instruction data including at least one image rendering instruction, where the image rendering instruction includes at least one image instruction parameter, the determining module 302 determines, according to the parameter type of the image instruction parameter, the image instruction parameter with the parameter type being a preset parameter type from among the at least one image instruction parameter as the target image instruction parameter, then the compressing module 303 compresses the data sequence of the target image instruction parameter into a data sequence with a predetermined format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter, then the fusing module 304 performs a fusing process on the processed instruction parameter to obtain a fused image rendering instruction, and finally, the sending module 305 sends the fused image rendering instruction to the terminal so that the terminal renders the picture of the target game according to the fused image rendering instruction, according to the picture rendering scheme of the cloud game, the image instruction parameters of the preset parameter types are compressed into the data sequence of the preset format, and the plurality of processed instruction parameters are fused, so that the image rendering instructions are compressed, the data volume of the image rendering instruction data is reduced, and the bandwidth occupied by the cloud game can be reduced on the premise that the quality of the game image is not lost.
In addition, the present application also provides an electronic device, as shown in fig. 4, which shows a schematic structural diagram of the electronic device related to the present application, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions as follows:
the method comprises the steps of obtaining image rendering instruction data of a target game, determining image instruction parameters with parameter types being preset parameter types from at least one image instruction parameter as target image instruction parameters according to the parameter types of the image instruction parameters, compressing a data sequence of the target image instruction parameters into a data sequence with a preset format according to the parameter values of the target image instruction parameters to obtain processed image rendering instructions, carrying out fusion processing on the processed instruction parameters to obtain fused image rendering instructions, and sending the fused image rendering instructions to a terminal so that the terminal can render pictures of the target game according to the fused image rendering instructions.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
After image rendering instruction data of a target game are obtained, the image rendering instruction data comprise at least one image rendering instruction, the image rendering instruction comprises at least one image instruction parameter, the image instruction parameter with the parameter type being the preset parameter type is determined to be the target image instruction parameter from the at least one image instruction parameter according to the parameter type of the image instruction parameter, then a data sequence of the target image instruction parameter is compressed to be a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter, then the processed instruction parameter is fused to obtain a fused image rendering instruction, and finally the fused image rendering instruction is sent to a terminal so that the terminal can render images of the target game according to the fused image rendering instruction, and the image rendering scheme of the cloud game is provided by the application, the image instruction parameters of the preset parameter types are compressed into a data sequence of a preset format, and a plurality of processed instruction parameters are fused, so that the compression of the image rendering instruction is realized, the data volume of the image rendering instruction data is reduced, and the bandwidth occupied by the cloud game can be reduced on the premise of ensuring that the game image quality is not lost.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in the picture rendering method of any cloud game provided in the present application. For example, the instructions may perform the steps of:
the method comprises the steps of obtaining image rendering instruction data of a target game, determining image instruction parameters with parameter types being preset parameter types from at least one image instruction parameter as target image instruction parameters according to the parameter types of the image instruction parameters, compressing a data sequence of the target image instruction parameters into a data sequence with a preset format according to the parameter values of the target image instruction parameters to obtain processed image rendering instructions, carrying out fusion processing on the processed instruction parameters to obtain fused image rendering instructions, and sending the fused image rendering instructions to a terminal so that the terminal can render pictures of the target game according to the fused image rendering instructions.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in the image rendering method of any cloud game provided by the present application, the beneficial effects that can be achieved by the image rendering method of any cloud game provided by the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the above-mentioned various alternative implementation modes.
The foregoing describes in detail a picture rendering method, an apparatus, an electronic device, and a storage medium for a cloud game provided in the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present invention, and the description of the foregoing embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (15)

1. A picture rendering method of a cloud game is characterized by comprising the following steps:
acquiring image rendering instruction data of a target game, wherein the image rendering instruction data comprises at least one image rendering instruction, and the image rendering instruction comprises at least one image instruction parameter;
determining an image instruction parameter with a parameter type being a preset parameter type from at least one image instruction parameter as a target image instruction parameter according to the parameter type of the image instruction parameter;
compressing the data sequence of the target image instruction parameters into a data sequence in a preset format according to the parameter values of the target image instruction parameters to obtain processed instruction parameters;
performing fusion processing on the processed instruction parameters to obtain a fused image rendering instruction;
and sending the fused image rendering instruction to a terminal so that the terminal can render the picture of the target game according to the fused image rendering instruction.
2. The method according to claim 1, wherein the compressing the data sequence of the target image command parameter into a data sequence of a predetermined format according to the parameter value of the target image command parameter to obtain a processed command parameter comprises:
acquiring a parameter value of the target image instruction parameter;
determining a cache sequence distributed by the target image instruction parameter;
and compressing the data sequence of the target image instruction parameters into a data sequence with a preset format based on the parameter values of the target image instruction parameters and the distributed cache sequence to obtain the processed instruction parameters.
3. The method according to claim 2, wherein the compressing the data sequence of the target image instruction parameter into a data sequence of a predetermined format based on the parameter value of the target image instruction parameter and the allocated buffer sequence to obtain a processed instruction parameter comprises:
determining the number of bytes required for caching the target image instruction parameter based on the parameter value of the target image instruction parameter to obtain a target byte stream;
deleting the numerical value corresponding to the unoccupied byte in the cache sequence distributed by the target image instruction parameter to obtain a deleted data sequence;
and compressing the data of the deleted data sequence into the target byte stream to generate a data sequence conforming to a preset format so as to obtain a processed instruction parameter.
4. The method according to claim 3, wherein the compressing the data of the deleted data sequence into the target byte stream to generate a data sequence conforming to a predetermined format to obtain the processed instruction parameters comprises:
detecting the symbol type of the parameter value of the target image instruction parameter;
filling a numerical value corresponding to the symbol type in the highest bit of the target byte stream;
generating a numerical value sequence conforming to a preset format based on the data of the deleted data sequence;
and adding the numerical value sequence to the filled target byte stream to obtain a processed instruction parameter.
5. The method according to any one of claims 1 to 4, wherein the fusing the processed instruction parameters to obtain fused instruction parameters comprises:
calling a game canvas of the target game;
modifying the canvas data of the game canvas based on the processed instruction parameters to obtain modified canvas data;
and generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
6. The method according to claim 5, wherein the generating of the image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction comprises:
storing the modified canvas data into a cache space;
and when an image drawing request is received, generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
7. The method of any of claims 1 to 4, further comprising:
determining image instruction parameters with parameter types not being preset parameter types as image instruction parameters to be compressed;
and compressing the image instruction parameters to be compressed according to the parameter types of the image instruction parameters to be compressed.
8. A picture rendering apparatus for a cloud game, comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring image rendering instruction data of a target game, the image rendering instruction data comprises at least one image rendering instruction, and the image rendering instruction comprises at least one image instruction parameter;
the determining module is used for determining the image instruction parameter with the parameter type being a preset parameter type from at least one image instruction parameter as a target image instruction parameter according to the parameter type of the image instruction parameter;
the compression module is used for compressing the data sequence of the target image instruction parameter into a data sequence with a preset format according to the parameter value of the target image instruction parameter to obtain a processed instruction parameter;
the fusion module is used for carrying out fusion processing on the processed instruction parameters to obtain a fused image rendering instruction;
and the sending module is used for sending the fused image rendering instruction to a terminal so that the terminal can render the picture of the target game according to the fused image rendering instruction.
9. The apparatus of claim 8, wherein the compression module comprises:
the acquisition unit is used for acquiring the parameter value of the target image instruction parameter;
the determining unit is used for determining the cache sequence distributed by the target image instruction parameter;
and the compression unit is used for compressing the data sequence of the target image instruction parameter into a data sequence with a preset format based on the parameter value of the target image instruction parameter and the distributed cache sequence to obtain a processed instruction parameter.
10. The apparatus of claim 9, wherein the compression unit comprises:
a determining subunit, configured to determine, based on the parameter value of the target image instruction parameter, a number of bytes required for caching the target image instruction parameter, to obtain a target byte stream;
a deleting subunit, configured to delete, in the cache sequence allocated to the target image instruction parameter, a numerical value corresponding to an unoccupied byte to obtain a deleted data sequence;
and the compression subunit is used for compressing the data of the deleted data sequence into the target byte stream to generate a data sequence conforming to a preset format so as to obtain a processed instruction parameter.
11. The apparatus according to claim 10, wherein the compression subunit is specifically configured to:
detecting the symbol type of the parameter value of the target image instruction parameter;
filling a numerical value corresponding to the symbol type in the highest bit of the target byte stream;
generating a numerical value sequence conforming to a preset format based on the data of the deleted data sequence;
and sequentially adding the numerical value sequence to the filled target byte stream by taking the second highest order of the filled target byte stream as a reference so as to obtain a processed instruction parameter.
12. The apparatus of any one of claims 8 to 11, wherein the fusion module comprises:
the calling unit is used for calling the game canvas of the target game;
the modification unit is used for modifying the canvas data of the game canvas by the processed instruction parameters to obtain modified canvas data;
and the generating unit is used for generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
13. The apparatus according to claim 12, wherein the generating unit is specifically configured to:
storing the modified canvas data into a cache space;
and when an image drawing request is received, generating an image rendering instruction corresponding to the modified canvas data to obtain a fused image rendering instruction.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the picture rendering method of the cloud game according to any of claims 1-8.
15. A computer-readable storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the picture rendering method of the cloud game according to any one of claims 1 to 8.
CN202110174738.XA 2021-02-08 2021-02-08 Picture rendering method and device of cloud game, electronic equipment and storage medium Pending CN114904274A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110174738.XA CN114904274A (en) 2021-02-08 2021-02-08 Picture rendering method and device of cloud game, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110174738.XA CN114904274A (en) 2021-02-08 2021-02-08 Picture rendering method and device of cloud game, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114904274A true CN114904274A (en) 2022-08-16

Family

ID=82762205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110174738.XA Pending CN114904274A (en) 2021-02-08 2021-02-08 Picture rendering method and device of cloud game, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114904274A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472371A (en) * 2023-10-09 2024-01-30 北京趋动智能科技有限公司 Remote rendering method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472371A (en) * 2023-10-09 2024-01-30 北京趋动智能科技有限公司 Remote rendering method, device and storage medium

Similar Documents

Publication Publication Date Title
US11909984B2 (en) Video encoding and decoding for cloud gaming
CN1856819B (en) System and method for network transmission of graphical data through a distributed application
US10699361B2 (en) Method and apparatus for enhanced processing of three dimensional (3D) graphics data
US9928637B1 (en) Managing rendering targets for graphics processing units
CN112316433B (en) Game picture rendering method, device, server and storage medium
US8654134B2 (en) Command remoting
CN105917382B (en) Method and system for interactive graphics streaming
KR20210151114A (en) Hybrid rendering
CN113946402B (en) Cloud mobile phone acceleration method, system, equipment and storage medium based on rendering separation
WO2019040222A1 (en) Rendering an image from computer graphics using two rendering computing devices
US20140292803A1 (en) System, method, and computer program product for generating mixed video and three-dimensional data to reduce streaming bandwidth
US9396564B2 (en) Atlas generation based on client video configuration
CN111346378B (en) Game picture transmission method, device, storage medium and equipment
CN112307403B (en) Page rendering method and device, storage medium and terminal
CN112714357B (en) Video playing method, video playing device, electronic equipment and storage medium
WO2022033162A1 (en) Model loading method and related apparatus
US20240189720A1 (en) Performing rendering processing by a graphics processing unit and a central processing unit
WO2023134277A1 (en) Visible element determination method and apparatus, and storage medium and electronic device
CN113838184A (en) Rendering method, device and system
CN117390322A (en) Virtual space construction method and device, electronic equipment and nonvolatile storage medium
CN114491352A (en) Model loading method and device, electronic equipment and computer readable storage medium
CN114904274A (en) Picture rendering method and device of cloud game, electronic equipment and storage medium
WO2023160041A1 (en) Image rendering method and apparatus, computer device, computer-readable storage medium and computer program product
JP5536093B2 (en) Improved command remoting technology
JPH10198823A (en) Video generating device

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40073918

Country of ref document: HK