CN112316433A - Game picture rendering method, device, server and storage medium - Google Patents

Game picture rendering method, device, server and storage medium Download PDF

Info

Publication number
CN112316433A
CN112316433A CN202011242090.7A CN202011242090A CN112316433A CN 112316433 A CN112316433 A CN 112316433A CN 202011242090 A CN202011242090 A CN 202011242090A CN 112316433 A CN112316433 A CN 112316433A
Authority
CN
China
Prior art keywords
model
game
rendering
data
instruction
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.)
Granted
Application number
CN202011242090.7A
Other languages
Chinese (zh)
Other versions
CN112316433B (en
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 CN202011242090.7A priority Critical patent/CN112316433B/en
Publication of CN112316433A publication Critical patent/CN112316433A/en
Application granted granted Critical
Publication of CN112316433B publication Critical patent/CN112316433B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the invention discloses a game picture rendering method, a game picture rendering device, a server and a storage medium; the embodiment of the invention can obtain the picture rendering instruction stream; when the picture rendering instruction is a first type picture rendering instruction, obtaining model rendering data of a game model contained in the first type picture rendering instruction; when a model modification request of a user for a game model is received, modifying model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model; replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction; and sending the replaced first type picture rendering instruction to the client so that the visual effect of the game model in the game picture displayed by the client is changed. The embodiment of the invention can improve the efficiency of modifying the visual effect of the game model in the cloud game.

Description

Game picture rendering method, device, server and storage medium
Technical Field
The invention relates to the field of computers, in particular to a game picture rendering method, a game picture rendering device, a server and a storage medium.
Background
Cloud gaming (Cloud 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.
When a game party needs to modify the visual effect of a game model, the game model in the cloud server needs to be updated, however, the transmission of a video and audio stream to a player game terminal is often required to be closed or suspended during updating, and a player needs to wait for a period of time until the updating is completed, and the player game terminal can show the new visual effect of the game model in a game picture to the player, so that the efficiency of modifying the visual effect of the game model in the cloud game is low at present.
Disclosure of Invention
The embodiment of the invention provides a game picture rendering method, a game picture rendering device, a server and a storage medium, which can improve the efficiency of modifying the visual effect of a game model in a cloud game.
The embodiment of the invention provides a game picture rendering method, which is suitable for a server and comprises the following steps:
when a game picture is rendered, obtaining a picture rendering instruction stream, wherein the picture rendering instruction stream comprises at least one picture rendering instruction, and the picture rendering instruction is an instruction for instructing a graphics processor to render the game picture;
when the picture rendering instruction is a first type picture rendering instruction, obtaining model rendering data of a game model contained in the first type picture rendering instruction, wherein the model rendering data is data used for rendering the game model;
when a model modification request of a user for the game model is received, modifying the model rendering data of the game model based on the model modification request to obtain the modified model rendering data;
replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction;
and sending the replaced first type picture rendering instruction to a client so that the client can render the game model in a game picture according to the replaced first type picture rendering instruction.
The embodiment of the invention provides a game picture rendering method, which is suitable for a client and comprises the following steps:
obtaining a compressed first type picture rendering instruction from a server, wherein the compressed first type picture rendering instruction comprises a compression shader, compressed geometric structure data of a game model and compressed texture mapping data;
carrying out data decompression processing on the compressed geometric structure data and the compressed texture mapping data of the compressed shader and the game model to obtain the geometric structure data and the texture mapping data of the shader and the game model;
replacing the compressed shader, the compressed geometry data, and the compressed texture map data included in the first type of picture rendering instruction with the shader, the geometry data, and the compressed texture map data to obtain a first type of picture rendering instruction;
instruct a graphics processor to render the game model in a game screen based on the first type of screen rendering instructions.
An embodiment of the present invention further provides a game screen rendering apparatus, which is suitable for a server, and includes:
the game system comprises an instruction unit, a display unit and a control unit, wherein the instruction unit is used for acquiring a picture rendering instruction stream when a game picture is rendered, the picture rendering instruction stream comprises at least one picture rendering instruction, and the picture rendering instruction is an instruction used for instructing a graphics processor to render the game picture;
a first instruction unit, configured to, when the picture rendering instruction is a first type picture rendering instruction, obtain model rendering data of a game model included in the first type picture rendering instruction, where the model rendering data is data used for rendering the game model;
the modification unit is used for modifying the model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model when receiving the model modification request of the game model by a user, wherein the model modification request is a request for modifying the visual effect of the game model;
a replacing unit, configured to replace model rendering data of a game model included in the first type picture rendering instruction with modified model rendering data of the game model, to obtain a replaced first type picture rendering instruction;
and the first sending unit is used for sending the replaced first type picture rendering instruction to a client so that the client can render the game model in a game picture according to the replaced first type picture rendering instruction.
In some embodiments, the first instruction unit further comprises:
the mapping subunit is used for acquiring a mapping relation between the image rendering instruction and the instruction type;
and the classification subunit is used for determining the instruction type of the image rendering instruction according to the mapping relation, wherein the instruction type is divided into a first instruction type and a second instruction type, the first instruction type image rendering instruction comprises model rendering data of a game model, and the second instruction type image rendering instruction does not contain the model rendering data of the game model.
In some embodiments, the classification subunit is further configured to:
and when the instruction type of the picture rendering instruction is a preset second type, sending the second type picture rendering instruction to a client so that the client can render a game picture according to the second type picture rendering instruction.
In some embodiments, the classification subunit is further configured to:
performing data compression processing on the second type of picture rendering instruction to obtain a compressed second type of picture rendering instruction;
and sending the compressed second type picture rendering instruction to a client so that the client can render a game picture according to the second type picture rendering instruction after decompressing the compressed second type picture rendering instruction into the second type picture rendering instruction.
In some embodiments, the first instruction unit comprises:
the list acquisition subunit is used for acquiring a model rendering data list;
the geometric acquisition subunit is used for acquiring geometric structure data of the game model from a cache through the cache allocation information;
a table entry generating subunit, configured to generate a geometric table entry, a texture table entry, and a shader table entry of the game model in the model rendering data list, where the texture table entry and the shader table entry both correspond to the game model;
an entry storage subunit, configured to store the geometry data in the geometry entry, store the texture map data in the texture entry, and store the shader in the shader entry.
In some embodiments, the model modification request comprises a geometry modification request, the modification unit to:
when a geometric modification request of a user for the game model is received, determining a vertex to be modified and vertex position information included in the geometric modification request;
setting the position of the vertex to be modified of the geometric structure data in the geometric table entry as the vertex position information.
In some embodiments, the model modification request comprises a texture modification request, the modification unit to:
when a texture modification request of a user for the game model is received, determining a vertex to be modified and vertex texture information included in the texture modification request;
and setting the texture of the vertex to be modified of the texture map data in the geometric table entry as the vertex texture information.
In some embodiments, the model modification request comprises a shader modification request, the modification unit to:
when a shader modification request of a user for the game model is received, determining a shader to be modified, which is included in the shader modification request;
modifying the shader in the shader table entry to the modified shader.
In some embodiments, the model rendering data of the game model includes a shader, geometry data of the game model, and texture map data, the shader is a drawing program loaded on a graphics processor, and the replacement unit is configured to:
performing data compression processing on the shader, the geometric structure data and the texture mapping data of the game model to obtain compressed geometric structure data and compressed texture mapping data of the shader and the game model;
replacing the shader included in the first type of picture rendering instruction with the compressed shader, replacing the geometric structure data with compressed geometric structure data of the game model, and replacing the texture map data with compressed texture map data of the game model to obtain a compressed first type of picture rendering instruction.
The embodiment of the present invention further provides a game picture rendering apparatus, which is suitable for a client, and includes:
a first obtaining unit, configured to obtain, from a server, a compressed first type picture rendering instruction, where the compressed first type picture rendering instruction includes a compression shader, compressed geometry data of a game model, and compressed texture map data;
the first decompression unit is used for carrying out data decompression processing on the compressed geometric structure data and the compressed texture mapping data of the compressed shader and the game model to obtain the geometric structure data and the texture mapping data of the shader and the game model;
a first replacing unit, configured to replace the compressed shader included in the first type of image rendering instruction with the shader, replace the compressed geometry data with the geometry data, and replace the compressed texture map data with the compressed texture map data, so as to obtain a first type of image rendering instruction;
a first rendering unit to instruct a graphics processor to render the game model in a game screen based on the first type screen rendering instruction.
In some embodiments, the game screen rendering device is further configured to:
acquiring a compressed second type picture rendering instruction;
performing data decompression processing on the compressed second type picture rendering instruction to obtain a second type picture rendering instruction, wherein model rendering data of a game model do not exist in the second type picture rendering instruction;
instruct a graphics processor to render a game screen based on the second type of screen rendering instructions.
The embodiment of the invention also provides a server, which comprises a memory, a storage and a control unit, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute any step of the game picture rendering method provided by the embodiment of the invention.
The embodiment of the present invention further provides a computer-readable storage medium, where multiple instructions are stored, and the instructions are suitable for being loaded by a processor to perform any one of the steps in the game picture rendering method provided by the embodiment of the present invention.
The method and the device can acquire the picture rendering instruction stream when the game picture is rendered, wherein the picture rendering instruction stream can comprise at least one picture rendering instruction, and the picture rendering instruction is an instruction which can be used for instructing a graphic processor to render the picture; when the picture rendering instruction is a first type picture rendering instruction, model rendering data of a game model contained in the first type picture rendering instruction is obtained, the game model can comprise a game model, and the model rendering data can be used for rendering the game model; when a model modification request of a user for a game model is received, modifying model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model, wherein the model modification request is a request which can be used for modifying the visual effect of the game model; replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction; and sending the replaced first type picture rendering instruction to the client so that the client renders the game model in the game picture according to the replaced first type picture rendering instruction, and the visual effect of the game model is changed.
In order to prevent the audio and video stream from being compressed to low resolution due to the influence of network bandwidth during transmission, the cloud server provided by the invention can intercept the picture rendering instruction stream sent into a GPU (Graphics Processing Unit) before the GPU renders a game picture, so that a client can send the received picture rendering instruction stream into the GPU carried by the client by transmitting the picture rendering instruction stream with smaller bandwidth, thereby rendering the picture and improving the definition of the game picture finally rendered.
In addition, when the visual effect of the game model is modified, the picture rendering instruction containing the modified game model rendering data can be sent to the client only by modifying the game model rendering data contained in the intercepted picture rendering instruction, so that the client can display the game model with the changed visual effect in the game picture in real time, the game client does not need to be paused or closed, and the user can directly watch the game model with the changed visual effect without waiting. Therefore, the efficiency of modifying the visual effect of the game model in the cloud game is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 system diagram of a game screen rendering method according to an embodiment of the present invention;
FIG. 1b is a schematic flowchart of a game screen rendering method applied to a server according to an embodiment of the present invention;
FIG. 1c is a schematic view of a scene of a game screen rendering method according to an embodiment of the present invention;
FIG. 1d is a schematic diagram illustrating a cache of geometric structure data of a game screen rendering method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a game screen rendering method suitable for a client according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a first structure of a game screen rendering apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a second structure of a game screen rendering apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a game picture rendering method, a game picture rendering device, a server and a storage medium.
The game screen rendering device may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices.
In some embodiments, the server may also be implemented in the form of a terminal.
The server 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 (Content Delivery Network), big data and an artificial intelligence platform.
Cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
The terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, or the like, but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
In some embodiments, a game screen rendering system is provided, which may include a game screen rendering device adapted to a server and a game screen rendering device adapted to a client, wherein the game screen rendering device adapted to the server may be integrated in a cloud server, and the game screen rendering device adapted to the client may be integrated in a terminal.
For example, referring to fig. 1a, the game screen rendering system may include a server 01 and a client 02, wherein the server 01 may communicate with the client 02 through a network.
The server 01 may obtain a picture rendering instruction stream when rendering a game picture, where the picture rendering instruction stream may include at least one picture rendering instruction, and the picture rendering instruction may be an instruction that may be used to instruct a graphics processor to render a picture; when the picture rendering instruction is a first type picture rendering instruction, obtaining model rendering data of a game model contained in the first type picture rendering instruction, wherein the game model can comprise an equipment model assembled on a character model, the model rendering data can be used for rendering the game model, the model rendering data of the game model can comprise a shader, geometric structure data of the game model and texture mapping data, and the shader is a drawing program carried by a graphics processor; when a model modification request of a user for an equipment model is received, modifying the model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model, wherein the model modification request is a request which can be used for modifying the visual effect of the game model; performing data compression processing on geometry data and texture mapping data of the color mapper and the game model to obtain compression geometry data and compression texture mapping data of a compression shader and the game model; replacing a shader contained in the first type of picture rendering instruction with a compressed shader, replacing geometric structure data with compressed geometric structure data of a game model, and replacing texture mapping data with compressed texture mapping data of the game model to obtain a compressed first type of picture rendering instruction; and sending the replaced first type picture rendering instruction to the client 02, so that the client 02 renders the equipment model assembled on the character model in the game picture according to the replaced first type picture rendering instruction, and the visual effect of the equipment model is changed.
The client 02 may obtain a compressed first type image rendering instruction from the server 01, where the compressed first type image rendering instruction may include a compression shader, compressed geometry data of a game model, and compressed texture map data, and the game model may include an equipment model assembled on a character model;
carrying out data decompression processing on compressed geometric structure data and compressed texture mapping data of the compressed shader and the game model to obtain geometric structure data and texture mapping data of the shader and the game model; replacing a compression shader contained in the first type of picture rendering instruction with a shader, replacing compressed geometric structure data with geometric structure data, and replacing compressed texture mapping data with compressed texture mapping data to obtain a first type of picture rendering instruction; the graphics processor is instructed to render an equipment model assembled on the character model in the game screen based on the first type of screen rendering instructions.
The following are detailed below. The numbers in the following examples are not intended to limit the order of preference of the examples.
In this embodiment, a game picture rendering method based on a cloud server is provided, and is applicable to a server, as shown in fig. 1b, a specific process of the game picture rendering method may be as follows:
101. when the game picture is rendered, a picture rendering instruction stream is obtained, wherein the picture rendering instruction stream may include at least one picture rendering instruction, and the picture rendering instruction is an instruction that may be used to instruct a graphics processor to render the game picture.
In this embodiment, a Central Processing Unit (CPU) may be disposed in the server, and the CPU may be used for a server running the game. Specifically, the server may have one or more emulators (Virtual devices) running thereon, such as Virtual machines running therein game programs, and memories of the Virtual machines may include game resources, such as image resources, character resources, audio resources, and the like of games.
The operation of the user on the game terminal can be responded by the virtual machine, namely, the virtual machine can assist the terminal to complete the operation process of the game.
An emulator (also referred to as a virtual container) refers to a complete computer system having complete hardware system functions and operating in a completely isolated environment, which is simulated by a computer program. The work that can be done in a physical computer can be implemented in an emulator. Emulators may include Android emulators, Java emulators, Linux emulators, windows emulators, and the like.
For example, referring to fig. 1c, an Android emulator (AVD) may be run in the server. In a specific implementation process, the AVD may be a software module of the virtual machine, and when a user starts a game through a game terminal (or terminal for short), the server may intercept a picture rendering instruction stream in the AVD, and then may forward the intercepted picture rendering instruction stream to the terminal, and a GPU of the terminal performs image rendering and display.
According to the embodiment, the game process and the image drawing resource consumption can be completely controlled in the server, so that the load of the game terminal is reduced, and the terminal user experience is improved.
The virtual machine runs a graphics library, which is a library of programs used to render computer graphics on a display, performing common rendering tasks by providing a set of optimized functions.
For example, OpenGL (Open Graphics Library) is an Application Programming Interface (API) for rendering two-dimensional and three-dimensional vector Graphics, and is a cross-language and cross-platform Application Program Interface (API). The interface is composed of a plurality of different function call instructions, including image rendering instructions, for rendering an image.
In this embodiment, referring to fig. 1c, the process of rendering the game screen by the server is as follows:
the game program instructs the CPU to package the game resources in the picture rendering instruction, and transmits the picture rendering instruction to a GPU (Graphics Processing Unit);
and the GPU draws the game picture according to the instruction of the picture rendering instruction.
It should be noted that, in this embodiment, the screen rendering instruction may be directly intercepted, and therefore, the server may or may not be equipped with a GPU.
102. When the picture rendering instruction is a first type picture rendering instruction, model rendering data of a game model contained in the first type picture rendering instruction is acquired, and the model rendering data is data which can be used for rendering the game model.
The first type of picture rendering instruction is a picture rendering instruction including model rendering data of a game model.
In some embodiments, the stream of screen rendering instructions may be divided into a first screen rendering instruction and a second screen rendering instruction, where the second screen rendering instruction refers to a screen rendering instruction that does not include model rendering data for the game model.
The game model may include a character model, an object model, an animal model, a building model, a particle light effect model, and the like in a game scene.
The object model can comprise an equipment model, wherein the equipment model refers to a game model assembled on a character model, and the equipment model and the character model have a mapping relation. The equipment model may include a weapon model, a clothing model, an accessory model, a riding model, etc., among others.
For example, in some embodiments, the game model may include an equipment model assembled on a character model.
The model rendering data is data that may be used to render a game model, and in some embodiments, the model rendering data may include shader, geometry data, texture map data for the game model, and so on. To facilitate understanding of the model rendering data, the rendering process of the game screen is described here:
the game picture rendering is to take out data of all points (vertexes) in a game model, convert the data into a two-dimensional plane through space, and draw the data on a screen according to various parameters.
The vertex data may be composed of vertex position information, color information, normal line information, and the like. Wherein the normal information of the vertex is mainly used for illumination calculation and is used for determining the orientation of the vertex relative to the light.
The Texture map data is two-dimensional image data having Texture, and position information of each point on the Texture map (Texture Mapping) can accurately correspond to a vertex of the game model.
Shaders (shaders) are editable programs used to implement image rendering. The shaders are classified by function, and may be classified into a Vertex shader (Vertex shader), a Pixel shader (Pixel shader), a Geometry shader (Geometry shader), a Compute shader (computer shader), a Tessellation shader (Tessellation hull shader), and the like. When a game model is drawn in a game picture, a vertex shader is needed to create a geometric structure of the game model according to vertex information, then a pixel shader can be used to fill colors between areas formed by the vertices, then a part of a texture image in texture map data is mapped onto each primitive to form Primitives (Primitives), the geometric shader can operate the geometric Primitives to form Fragments, and then the Fragments are rasterized into pixels in a frame buffer area. Wherein the frame buffer is a set of logical buffers including a color buffer, a depth buffer, a stencil buffer, and an accumulation buffer, etc., and finally, the display of the game picture is performed according to the pixels in the frame buffer.
The graphic element refers to a basic graphic element, and any graphic representation is composed of a plurality of identical patterns, for example, a graphic composed of a plurality of points, a plurality of lines, or a plurality of planes, and the points, lines, or planes are the basic graphic elements.
In this embodiment, the geometry data may comprise vertex information and the texture map data may comprise a texture map image.
In this embodiment, referring to fig. 1c, the server may include an intercepting module, a compressing module, and a network sending module, where the intercepting module is configured to intercept the screen rendering instruction stream, the compressing module is configured to compress data, and the network sending module is configured to communicate with the client.
When the intercepting module monitors a new picture rendering instruction stream, the intercepting module can directly intercept an AVD cache (Buffer), namely data content in the cache of the Android simulator; intercepting the picture rendering instruction stream refers to storing the picture rendering instruction stream into a memory of the intercepting module.
In some embodiments, in order to reduce the amount of computation and improve the computation efficiency, only the model rendering data of the game model needs to be modified when the visual effect of the game model is modified. Therefore, after the intercepting module intercepts the picture rendering instruction stream, only the first picture rendering instruction containing the model rendering data can be stored in the resource manager by distinguishing the instruction type of the picture rendering instruction in the picture rendering instruction stream, so that the user can modify the model rendering data of the game model by modifying the first picture rendering instruction stored in the resource manager.
Therefore, in some embodiments, before step 102, the following steps may also be included:
(1) and acquiring a mapping relation between the picture rendering instruction and the instruction type.
The mapping relationship between the screen rendering instruction and the instruction type may be a one-to-one mapping relationship, a one-to-many mapping relationship, a many-to-one mapping relationship, or a many-to-many mapping relationship, or the like.
For example, in some embodiments, the screen rendering instruction a may have a mapping relationship with the instruction types a, b, and c at the same time; for example, in some embodiments, the screen rendering instruction a may only have a mapping relationship with instruction type a; for example, in some embodiments, the screen rendering instructions A, B, C may all have a mapping relationship with instruction type a. In some embodiments, the instruction types may be divided into a first instruction type and a second instruction type, each of the first instruction type screen rendering instructions may include model rendering data of the game model, and the second instruction type screen rendering instructions do not include model rendering data of the game model.
Specifically, the mapping relationship between the screen rendering instruction and the instruction type may be preset according to the application scene.
For example, in some embodiments, a frame rendering instruction containing geometry data, such as a cache allocation instruction (e.g., a glBufferData, an OpenGL instruction containing geometry data), may be of the first instruction type.
Wherein a cache allocation instruction (glBufferData) may be used to extract geometry data from the cache containing the geometry data.
For example, in some embodiments, a screen rendering instruction containing texture map data, such as a texture map instruction (e.g., gltexmmage 2D, an OpenGL instruction that contains texture map data), may be of the first instruction type.
For example, in some embodiments, a frame rendering instruction containing texture map data, such as a shader instruction (e.g., a glsharersource, a shader OpenGL instruction containing texture map data), is of the first instruction type.
For example, in some embodiments, model rendering data for which no game model exists may be of the second instruction type of the screen rendering instructions.
For example, model rendering data in which no game model exists, such as glSwapBuffer (an OpenGL instruction for exchanging data stored in two buffers), glFlush (an OpenGL instruction for forcibly refreshing a game screen), and the like, may belong to a screen rendering instruction of the second instruction type.
For example, referring to table 1, table 1 shows a mapping relationship between a screen rendering instruction and an instruction type, where the mapping relationship includes instruction types to which a plurality of different screen rendering instructions belong, that is, the mapping relationship shown in table 1 may include a mapping relationship between a screen rendering instruction and an instruction type, as follows:
Figure BDA0002768753290000131
TABLE 1
For example, the mapping relationship may define that the instruction type of the screen rendering instruction A, B, C is type a, the instruction type of the screen rendering instruction D, E is type b, and so on.
(2) And determining the instruction type of the picture rendering instruction according to the mapping relation.
In some embodiments, the instruction type of the screen rendering instruction may be determined by looking up the instruction name of the screen rendering instruction in the mapping relationship as shown in table 1.
In some embodiments, after the step "(2) determining the type of the screen rendering instruction according to the mapping relation", the following steps may be further included:
(3) and when the instruction type of the picture rendering instruction is a preset second type, sending the second type picture rendering instruction to the client so that the client can render the game picture according to the second type picture rendering instruction.
That is, the screen rendering instructions that are not related to the game model visual effect change are sent directly to the client, and the screen rendering instructions that are related to the game model visual effect change are stored in the resource manager for modification by the user.
In some embodiments, in order to reduce the influence of the network bandwidth on the data transmission speed and improve the real-time performance of the game screen display, the step "(3) of sending the second type screen rendering instruction to the client so that the client renders the game screen according to the second type screen rendering instruction" may further include the steps of:
performing data compression processing on the second type of picture rendering instruction to obtain a compressed second type of picture rendering instruction;
and sending a compressed second type picture rendering instruction to the client so that the client can render the game picture according to the second type picture rendering instruction after decompressing the compressed second type picture rendering instruction into the second type picture rendering instruction.
In some embodiments, the model rendering data of the game model may include shader, cache allocation information, and texture map data of the game model, and step 102 may include the steps of:
obtaining a model rendering data list;
acquiring geometric structure data of the game model from a cache through cache allocation information;
generating a geometric table entry, a texture table entry and a shader table entry of the game model in the model rendering data list, wherein the texture table entry and the shader table entry correspond to the game model;
the method includes storing geometry data in geometry entries, storing texture map data in texture entries, and storing shaders in shader entries.
The model rendering data list is a list used for storing model rendering data in the resource management module, and may include entries of a plurality of game models, and each entry may be associated with one or more game models.
Each time the first-type picture rendering instruction is saved in the resource management module, the model rendering data of the game model included in the first-type picture rendering instruction may be saved in the model rendering data list.
For example, referring to fig. 1d, fig. 1d is vertex information of the game model a stored in the cache, where the position information and the color information of the vertex in the cache may be distinguished by a byte step (stride) of the cache.
After storing the geometry data in the geometry table entry, storing the texture map data in the texture table entry, and storing the shader in the shader table entry, an identifier may also be assigned to the table entry, so that a user may replace model rendering data of one game model in the resource manager with model rendering data of another game model in the resource manager by modifying the identifier of the table entry.
The Identifier of the entry may be described by a Resource Unique Identifier (RUI) and/or a hash value.
The resource unique identifier is a unique group of characters used for identifying a certain data object; the Resource unique Identifier may include a Uniform Resource Identifier (URI), a Uniform Resource Locator (URL), a Uniform Resource Name (URN), and so on.
The Hash value may be calculated by various Hash functions (Hash functions), which may include MD4, MD5, SHA, and so on.
Specifically, MD5 may be used to calculate a hash value and use the resulting hash value as an identifier for the entry.
103. When a model modification request of a user for the equipment model is received, modifying the model rendering data of the game model based on the model modification request to obtain modified model rendering data.
Wherein the model modification request is a request for modifying a visual effect of the game model.
For example, the game clients may include an Android game client, an IOS game client, a PC game client, and the like, and in order to improve the efficiency of the game party for modifying the visual effect of the game model, in this embodiment, the resource manager may dynamically modify resource data in the game, so that the model rendering resource in the first type of picture rendering instruction may be modified by the game party before being sent to the game client, and the modification effect may be displayed in the game client in real time.
Thus, when a model modification request for the equipment model by the user is received, the resource manager may modify the model rendering data of the game model based on the model modification request, resulting in modified model rendering data of the game model.
The model modification request can be divided into a geometry modification request, a texture modification request and a shader modification request according to different functions.
Wherein, the geometric modification request is used for modifying the geometric shape of the game model, namely modifying the geometric structure data of the game model; the texture modification request is used for modifying the mapping texture of the surface of the game model, namely modifying the texture mapping data of the game model; the shader modification request is used to modify the rendering method and rendering effects of the game model, i.e., modify the shader.
In some embodiments, the model modification request may comprise a geometry modification request, and step 103 may comprise the steps of:
when a geometric modification request of a user for an equipment model is received, determining a vertex to be modified and vertex position information which can be included in the geometric modification request;
and setting the position of the vertex to be modified of the geometric structure data in the geometric table entry as vertex position information.
The geometry modification request may include the vertex name of the vertex to be modified and the position information to be replaced. In some embodiments, color information to be replaced by the vertex to be modified may also be included in the geometry modification request.
Referring to fig. 1d, fig. 1d shows vertex information stored in a cache by a game model, and by querying the cache location of the original position information and the original color information of the vertex to be modified in the cache, the position information in the geometric modification request can be overlaid on the original position information of the cache location, and the color information in the geometric modification request can be overlaid on the original color information of the cache location.
In some embodiments, the model modification request may comprise a texture modification request, and step 103 may comprise the steps of:
when a texture modification request of a user for an equipment model is received, determining a vertex to be modified and vertex texture information which can be included in the texture modification request;
and setting the texture of the vertex to be modified of the texture mapping data in the geometric table entry as the vertex texture information.
Wherein the texture modification request may dynamically modify the texture map data. In some embodiments, the gltexmmage 2D interface may be employed to pass in the transformation function of the texture map, e.g., modify the type of texture map data by GLenum target, modify the format used by the texture map when OpenGL stores the texture map data by GLint level, modify the width of the texture map by GLsizei width, modify the height of the texture map by GLsizei height, etc.
As another example, the glTexImage2D interface may be used to import color information, texture information, etc. for a new texture map.
In some embodiments, the model modification request may comprise a shader modification request, and step 103 may comprise the steps of:
when a shader modification request of a user for an equipment model is received, determining a shader to be modified, which can be included in the shader modification request;
and modifying the shader in the shader table entry into a modified shader.
For example, when a user modifies the animation effect of the game equipment, the new shader can replace the original shader.
The shader modification request can dynamically modify a shader used for rendering the game picture. In some embodiments, a glsharersource interface may be employed to import a variety of shader modification functions to modify the shaders, e.g., by the glsharersource creating and loading script source code for the shaders.
In some embodiments, the script source code of the new shader that is written in advance can be replaced by the original shader in the shader table entry in the form of text.
In some embodiments, text modification may be performed directly on script source codes of existing shaders in shader table entries, for example, modifying coordinate transformation of script source codes in a vertex shader, modifying color gradient of script source codes in a texture shader, and so on.
104. And replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain the replaced first type picture rendering instruction.
For example, the model rendering data of the equipment model included in the first type screen rendering instruction may be replaced with the modified model rendering data of the equipment model, so as to obtain a replaced first type screen rendering instruction.
In some embodiments, in order to reduce the influence of the network bandwidth on the data exchange and improve the real-time performance of the game screen rendering, step 104 may include the following steps:
performing data compression processing on geometry data and texture mapping data of the color mapper and the game model to obtain compression geometry data and compression texture mapping data of a compression shader and the game model;
and replacing a shader contained in the first type of picture rendering instruction with a compression shader, replacing the geometric structure data with compression geometric structure data of the game model, and replacing the texture map data with compression texture map data of the game model to obtain a compression first type of picture rendering instruction.
105. And sending the replaced first type picture rendering instruction to the client so that the client renders the game model in the game picture according to the replaced first type picture rendering instruction.
For example, the replaced first type screen rendering instruction may be sent to the client, so that the client renders the equipment model assembled on the character model in the game screen according to the replaced first type screen rendering instruction, and the visual effect of the equipment model is changed.
In the embodiment of the invention, a user can dynamically modify resource data in a game through a resource manager in a server, and can see the visual effect of modified game equipment at a game client in real time after the resource modification is realized in the resource manager without modifying game service terminals of each version (such as an IOS terminal, an Android terminal, a PC terminal and the like).
For example, the geometry of the game model may be scaled up or down, or replaced with the geometry of other game models, the texture map of the game model may be dynamically replaced with new RGB data, the shaders may be replaced with different shaders, and so on; therefore, the visual effect of the game equipment assembled by the game role can be dynamically changed without adjusting the server of each version.
As can be seen from the above, in the embodiment of the present invention, when a game screen is rendered, a screen rendering instruction stream may be obtained, where the screen rendering instruction stream may include at least one screen rendering instruction, and the screen rendering instruction may be an instruction that may be used to instruct a graphics processor to render the screen; when the picture rendering instruction is a first type picture rendering instruction, model rendering data of a game model contained in the first type picture rendering instruction is obtained, the game model can comprise an equipment model assembled on a role model, and the model rendering data can be used for rendering the game model; when a model modification request of a user for an equipment model is received, modifying the model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model, wherein the model modification request is a request which can be used for modifying the visual effect of the game model; replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction; and sending the replaced first type picture rendering instruction to the client so that the client can render the equipment model assembled on the character model in the game picture according to the replaced first type picture rendering instruction, and the visual effect of the equipment model is changed.
Therefore, the scheme can modify the model rendering data of the equipment model in the picture rendering instruction, so that the real-time visual effect change can be realized without adjusting the visual effect of the game equipment in each version server, and the efficiency of modifying the visual effect of the game model in the cloud game is improved.
Correspondingly, according to the method described in the above embodiment, a corresponding description will be made below for the game client.
In this embodiment, a game picture rendering method based on a cloud server is provided, and is applicable to a client, as shown in fig. 2, a specific process of the game picture rendering method may be as follows:
201. compressed first type of picture rendering instructions are obtained from a server, which may include a compression shader, compression geometry data for a game model, and compression texture map data.
For example, the game model included in the compression first type of screen rendering instruction may be an equipment model fitted on a character model.
202. And carrying out data decompression processing on the compressed geometric structure data and the compressed texture mapping data of the compressed shader and the game model to obtain the geometric structure data and the texture mapping data of the shader and the game model.
203. Replacing a compression shader contained in the first type of picture rendering instruction with a shader, replacing the compression geometric structure data with geometric structure data, and replacing the compression texture mapping data with compression texture mapping data to obtain the first type of picture rendering instruction.
204. The graphics processor is instructed to render an equipment model assembled on the character model in the game screen based on the first type of screen rendering instructions.
In some embodiments, the specific flow of the game screen rendering method may further include:
(1) and acquiring a compressed second type picture rendering instruction.
(2) And carrying out data decompression processing on the compressed second type picture rendering instruction to obtain a second type picture rendering instruction, wherein model rendering data of the game model do not exist in the second type picture rendering instruction.
(3) Instructing the graphics processor to render the game screen based on the second type of screen rendering instruction.
Compared with the existing cloud game based on video streaming, the game images displayed by the game client side in the scheme have no loss in definition, and the server side can modify the visual effect of the game model, so that the game client side can display the modified visual effect in real time, the development cost for modifying the game model is reduced, and the operation requirement of a game player is met.
For example, to replace the riding model assembled by the character model, only the cached data corresponding to the riding model assembled by the character model is replaced by the model data (such as vertex position coordinates, normal coordinates, color values, texture coordinates, and the like) of the newly manufactured riding model in the resource manager, so that the change of the visual effect of the riding model can be realized.
As can be seen from the above, the embodiment of the present invention may obtain the compressed first type image rendering instruction from the server, where the compressed first type image rendering instruction may include a compression shader, compressed geometry data of a game model, and compressed texture map data; carrying out data decompression processing on compressed geometric structure data and compressed texture mapping data of the compressed shader and the game model to obtain geometric structure data and texture mapping data of the shader and the game model; replacing a compression shader contained in the first type of picture rendering instruction with a shader, replacing compressed geometric structure data with geometric structure data, and replacing compressed texture mapping data with compressed texture mapping data to obtain a first type of picture rendering instruction; the graphics processor is instructed to render a game model in a game screen based on the first type of screen rendering instructions.
Therefore, the scheme can improve the efficiency of modifying the visual effect of the game model in the cloud game.
In order to better implement the method, an embodiment of the present invention further provides a game screen rendering apparatus, which is suitable for a server, and the game screen rendering apparatus may be specifically integrated in an electronic device, and the electronic device may be a device such as a server. The server may be a cloud server cluster composed of a plurality of servers.
For example, in the present embodiment, the method according to the embodiment of the present invention will be described in detail by taking an example in which a game screen rendering device is specifically integrated in a server.
For example, as shown in fig. 3, the game screen rendering apparatus may include an instruction unit 301, a first instruction unit 302, a modification unit 303, a replacement unit 304, and a first transmission unit 305 as follows:
instruction unit (one) 301:
the instruction unit 301 may be configured to, when rendering a game screen, obtain a screen rendering instruction stream, where the screen rendering instruction stream includes at least one screen rendering instruction, and the screen rendering instruction is an instruction for instructing a graphics processor to render the game screen.
(II) first instruction unit 302:
the first instruction unit 302 may be configured to, when the picture rendering instruction is a first type picture rendering instruction, obtain model rendering data of a game model included in the first type picture rendering instruction, where the model rendering data is data for rendering the game model.
In some embodiments, the first instruction unit 302, may further include a mapping subunit and a classification subunit, as follows:
(1) a mapping subunit:
the mapping subunit may be configured to obtain a mapping relationship between the screen rendering instruction and the instruction type.
(2) A classification subunit:
the classification subunit may be configured to determine an instruction type of the image rendering instruction according to the mapping relationship, where the instruction type is divided into a first instruction type and a second instruction type, where the first instruction type image rendering instruction includes model rendering data of a game model, and the second instruction type image rendering instruction does not include the model rendering data of the game model.
In some embodiments, the classification subunit may also be to:
and when the instruction type of the picture rendering instruction is a preset second type, sending the second type picture rendering instruction to the client so that the client can render the game picture according to the second type picture rendering instruction.
In some embodiments, the classification subunit may also be to:
performing data compression processing on the second type of picture rendering instruction to obtain a compressed second type of picture rendering instruction;
and sending a compressed second type picture rendering instruction to the client so that the client can render the game picture according to the second type picture rendering instruction after decompressing the compressed second type picture rendering instruction into the second type picture rendering instruction.
In some embodiments, the first instruction unit 302 may include a list acquisition subunit, a geometry acquisition subunit, an entry generation subunit, and an entry storage subunit, as follows:
(1) a list acquisition subunit:
the list obtaining subunit may be configured to obtain a list of model rendering data.
(2) A geometry acquisition subunit:
the geometry acquisition subunit may be configured to acquire the geometry data of the game model from the cache by cache allocation information.
(3) The table entry generation subunit:
the entry generation subunit may be configured to generate a geometric entry, a texture entry, and a shader entry of the game model in the model rendering data list, where the texture entry and the shader entry both correspond to the game model.
(4) The table entry storage subunit:
the entry storage subunit may be to store geometry data in geometry entries, texture map data in texture entries, and shaders in shader entries.
(iii) the modification unit 303:
the modifying unit 303 may be configured to, when a model modification request for the game model by a user is received, modify the model rendering data of the game model based on the model modification request, so as to obtain modified model rendering data.
In some embodiments, the model modification request may comprise a geometry modification request, and the modification unit 303 may be configured to:
when a geometric modification request of a user for a game model is received, determining vertexes to be modified and vertex position information which can be included in the geometric modification request;
and setting the position of the vertex to be modified of the geometric structure data in the geometric table entry as vertex position information.
In some embodiments, the model modification request may comprise a texture modification request, and the modification unit 303 may be configured to:
when a texture modification request of a user for a game model is received, determining a vertex to be modified and vertex texture information which can be included in the texture modification request;
and setting the texture of the vertex to be modified of the texture mapping data in the geometric table entry as the vertex texture information.
In some embodiments, the model modification request may include a shader modification request, and the modification unit 303 may be to:
when a shader modification request of a user for a game model is received, determining a shader to be modified, wherein the shader modification request can comprise the shader to be modified;
and modifying the shader in the shader table entry into a modified shader.
(iv) replacement unit 304:
the replacing unit 304 may be configured to replace the model rendering data of the game model included in the first type picture rendering instruction with the modified model rendering data of the game model, so as to obtain a replaced first type picture rendering instruction.
In some embodiments, the model rendering data of the game model may include a shader, geometry data of the game model, and texture map data, the shader being a drawing program hosted by a graphics processor, the replacement unit 304 may be configured to:
performing data compression processing on geometry data and texture mapping data of the color mapper and the game model to obtain compression geometry data and compression texture mapping data of a compression shader and the game model;
and replacing a shader contained in the first type of picture rendering instruction with a compression shader, replacing the geometric structure data with compression geometric structure data of the game model, and replacing the texture map data with compression texture map data of the game model to obtain a compression first type of picture rendering instruction.
(fifth) the first transmission unit 305:
the first sending unit 305 may be configured to send the replaced first type screen rendering instruction to the client, so that the client renders the game screen in the game screen according to the replaced first type screen rendering instruction.
As can be seen from the above, in the game screen rendering apparatus of this embodiment, when the instruction unit renders the game screen, the image rendering instruction stream is obtained, where the image rendering instruction stream includes at least one image rendering instruction, and the image rendering instruction is an instruction for instructing the graphics processor to render the game screen; when the picture rendering instruction is a first type picture rendering instruction, the first instruction unit acquires model rendering data of a game model contained in the first type picture rendering instruction, wherein the model rendering data is data for rendering the game model; when a model modification request of a user for a game model is received by a modification unit, modifying model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model, wherein the model modification request is a request for modifying the visual effect of the game model; replacing the model rendering data of the game model contained in the first type picture rendering instruction by the modified model rendering data of the game model by the replacing unit to obtain a replaced first type picture rendering instruction; and sending the replaced first type picture rendering instruction to the client by the first sending unit so that the client renders the game model in the game picture according to the replaced first type picture rendering instruction.
Therefore, the embodiment of the invention can improve the efficiency of modifying the visual effect of the game model in the cloud game.
In order to better implement the method, an embodiment of the present invention further provides a game screen rendering apparatus, which is suitable for a client, where the game screen rendering apparatus may be specifically integrated in an electronic device, and the electronic device may be a terminal, and the terminal may be a personal computer, a mobile phone, or other device.
For example, in the present embodiment, the method according to the embodiment of the present invention will be described in detail by taking an example in which a game screen rendering device is specifically integrated in a terminal.
For example, as shown in fig. 4, the game screen rendering apparatus may include a first acquisition unit 401, a first decompression unit 402, a first replacement unit 403, and a first rendering unit 404 as follows:
first acquisition unit 401:
the first obtaining unit 401 may be configured to obtain, from the server, a compressed first type of picture rendering instruction that includes a compression shader, compressed geometry data of the game model, and compressed texture map data.
(second) first decompression unit 402:
the first decompression unit 402 may be configured to perform data decompression processing on the compressed geometry data and the compressed texture map data of the compressed shader and the game model to obtain the geometry data and the texture map data of the shader and the game model.
(third) the first replacement unit 403:
the first replacing unit 403 may be configured to replace a compressed shader included in the first type of frame rendering instruction with a shader, replace compressed geometry data with geometry data, and replace compressed texture map data with compressed texture map data, so as to obtain the first type of frame rendering instruction.
(fourth) the first rendering unit 404:
the first rendering unit 404 may be to instruct the graphics processor to render the game model in the game screen based on the first type of screen rendering instructions.
In some embodiments, the game screen rendering device may be further configured to:
acquiring a compressed second type picture rendering instruction;
performing data decompression processing on the compressed second type picture rendering instruction to obtain a second type picture rendering instruction, wherein model rendering data of the game model do not exist in the second type picture rendering instruction;
instructing the graphics processor to render the game screen based on the second type of screen rendering instruction.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, the game image rendering apparatus of this embodiment uses the first obtaining unit to obtain the compressed first type image rendering instruction from the server, where the compressed first type image rendering instruction includes the compression shader, the compression geometry data of the game model, and the compression texture map data; the first decompression unit is used for carrying out data decompression processing on compressed geometric structure data and compressed texture mapping data of the compressed shader and the game model to obtain the geometric structure data and the texture mapping data of the shader and the game model; the first replacing unit is used for replacing a compression shader, compression geometric structure data and compression texture mapping data contained in the first type of picture rendering instruction with a shader, the compression geometric structure data is replaced with geometric structure data, and the compression texture mapping data is replaced with compression texture mapping data to obtain a first type of picture rendering instruction; the first rendering unit is to instruct the graphics processor to render the game model in the game screen based on the first type of screen rendering instruction.
Therefore, the embodiment of the invention can improve the efficiency of modifying the visual effect of the game model in the cloud game.
The embodiment of the invention also provides the electronic equipment which can be equipment such as a terminal, a server and the like. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and the like; the server may be a single server, a server cluster composed of a plurality of servers, or the like.
In some embodiments, the game screen rendering apparatus may be further integrated into a plurality of electronic devices, for example, the game screen rendering apparatus may be integrated into a plurality of servers, and the game screen rendering method of the present invention is implemented by the plurality of servers.
In this embodiment, a detailed description will be given by taking an example that the electronic device of this embodiment is a server or a terminal, for example, as shown in fig. 5, it shows a schematic structural diagram of an electronic device according to an embodiment of the present invention, specifically:
the electronic device may include components such as a processor 501 of one or more processing cores, memory 502 of one or more computer-readable storage media, a power supply 503, an input module 504, and a communication module 505. 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 501 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 502 and calling data stored in the memory 502, thereby performing overall monitoring of the electronic device. In some embodiments, processor 501 may include one or more processing cores; in some embodiments, processor 501 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 501.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by operating the software programs and modules stored in the memory 502. The memory 502 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 502 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 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
The electronic device also includes a power supply 503 for supplying power to the various components, and in some embodiments, the power supply 503 may be logically connected to the processor 501 through a power management system, so that functions such as managing charging, discharging, and power consumption are implemented through the power management system. The power supply 503 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 also include an input module 504, where the input module 504 may be used to receive entered numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The electronic device may also include a communication module 505, and in some embodiments the communication module 505 may include a wireless module by which the electronic device may wirelessly transmit over short distances to provide wireless broadband internet access to the user. For example, the communication module 505 can be used to assist a user in emailing, browsing web pages, accessing streaming media, and the like.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein.
In some embodiments, the electronic device may be a server, and the processor 501 in the server loads an executable file corresponding to one or more processes of an application program into the memory 502 according to the following instructions, and the processor 501 executes the application program stored in the memory 502, so as to implement various functions as follows:
when a game picture is rendered, a picture rendering instruction stream is obtained, wherein the picture rendering instruction stream comprises at least one picture rendering instruction, and the picture rendering instruction is an instruction for instructing a graphics processor to render the game picture;
when the picture rendering instruction is a first type picture rendering instruction, obtaining model rendering data of a game model contained in the first type picture rendering instruction, wherein the model rendering data is data used for rendering the game model;
when a model modification request of a user for a game model is received, modifying model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model, wherein the model modification request is a request for modifying the visual effect of the game model;
replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction;
and sending the replaced first type picture rendering instruction to the client so that the client renders the game model in the game picture according to the replaced first type picture rendering instruction.
In some embodiments, the electronic device may be a terminal, and the processor 501 in the terminal may load an executable file corresponding to one or more processes of an application program into the memory 502 according to the following instructions, and the processor 501 executes the application program stored in the memory 502, so as to implement various functions as follows:
obtaining, from a server, compressed first type of picture rendering instructions, the compressed first type of picture rendering instructions may include a compression shader, compressed geometry data of a game model, and compressed texture map data, the game model may include an equipment model assembled on a character model;
carrying out data decompression processing on compressed geometric structure data and compressed texture mapping data of the compressed shader and the game model to obtain geometric structure data and texture mapping data of the shader and the game model;
replacing a compression shader contained in the first type of picture rendering instruction with a shader, replacing compressed geometric structure data with geometric structure data, and replacing compressed texture mapping data with compressed texture mapping data to obtain a first type of picture rendering instruction;
the graphics processor is instructed to render an equipment model assembled on the character model in the game screen based on the first type of screen rendering instructions.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Therefore, the method and the device can improve the efficiency of modifying the visual effect of the game model in the cloud game.
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 embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the game screen rendering methods provided by the embodiments of the present invention.
For example, in some embodiments, the instructions may perform the steps of:
when a game picture is rendered, a picture rendering instruction stream is obtained, wherein the picture rendering instruction stream comprises at least one picture rendering instruction, and the picture rendering instruction is an instruction for instructing a graphics processor to render the game picture;
when the picture rendering instruction is a first type picture rendering instruction, obtaining model rendering data of a game model contained in the first type picture rendering instruction, wherein the model rendering data is data used for rendering the game model;
when a model modification request of a user for a game model is received, modifying model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model, wherein the model modification request is a request for modifying the visual effect of the game model;
replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction;
and sending the replaced first type picture rendering instruction to the client so that the client renders the game model in the game picture according to the replaced first type picture rendering instruction.
For example, in some embodiments, the instructions may perform the steps of:
obtaining, from a server, compressed first type of picture rendering instructions, the compressed first type of picture rendering instructions may include a compression shader, compressed geometry data of a game model, and compressed texture map data, the game model may include an equipment model assembled on a character model;
carrying out data decompression processing on compressed geometric structure data and compressed texture mapping data of the compressed shader and the game model to obtain geometric structure data and texture mapping data of the shader and the game model;
replacing a compression shader contained in the first type of picture rendering instruction with a shader, replacing compressed geometric structure data with geometric structure data, and replacing compressed texture mapping data with compressed texture mapping data to obtain a first type of picture rendering instruction;
the graphics processor is instructed to render an equipment model assembled on the character model in the game screen based on the first type of screen rendering instructions.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
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 to cause the computer device to perform the methods provided in the various alternative implementations of the cloud gaming aspect or the gaming model modification aspect provided in the above embodiments.
Since the instructions stored in the storage medium can execute the steps in any game screen rendering method provided in the embodiment of the present invention, the beneficial effects that can be achieved by any game screen rendering method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The game picture rendering method, the game picture rendering device, the server and the computer-readable storage medium according to the embodiments of the present invention are described in detail, and a specific example is applied to illustrate the principle and the implementation manner of the present invention, and the description of the embodiments 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 game picture rendering method is applied to a server, and comprises the following steps:
when a game picture is rendered, obtaining a picture rendering instruction stream, wherein the picture rendering instruction stream comprises at least one picture rendering instruction, and the picture rendering instruction is an instruction for instructing a graphics processor to render the game picture;
when the picture rendering instruction is a first type picture rendering instruction, obtaining model rendering data of a game model contained in the first type picture rendering instruction, wherein the model rendering data is data used for rendering the game model;
when a model modification request of a user for the game model is received, modifying the model rendering data of the game model based on the model modification request to obtain the modified model rendering data;
replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction;
and sending the replaced first type picture rendering instruction to a client so that the client can render the game model in a game picture according to the replaced first type picture rendering instruction.
2. The method for rendering game screens according to claim 1, wherein when the screen rendering instruction is a first type screen rendering instruction, before obtaining model rendering data of a game model included in the first type screen rendering instruction, the method further comprises:
acquiring a mapping relation between a picture rendering instruction and an instruction type;
determining the instruction type of the image rendering instruction according to the mapping relation, wherein the instruction type is divided into a first instruction type and a second instruction type, the first instruction type image rendering instruction comprises model rendering data of a game model, and the second instruction type image rendering instruction does not contain the model rendering data of the game model.
3. The game screen rendering method according to claim 2, wherein after determining the screen rendering instruction type according to the mapping relationship, further comprising:
and when the instruction type of the picture rendering instruction is a preset second type, sending the second type picture rendering instruction to a client so that the client can render a game picture according to the second type picture rendering instruction.
4. The game screen rendering method according to claim 3, wherein the sending of the second-type screen rendering instruction to the client so that the client renders the game screen according to the second-type screen rendering instruction, further comprises:
performing data compression processing on the second type of picture rendering instruction to obtain a compressed second type of picture rendering instruction;
and sending the compressed second type picture rendering instruction to a client so that the client can render a game picture according to the second type picture rendering instruction after decompressing the compressed second type picture rendering instruction into the second type picture rendering instruction.
5. The method for rendering game screens according to claim 1, wherein the model rendering data of the game model includes shader cache allocation information and texture map data of the game model, and the obtaining the model rendering data of the game model included in the first type screen rendering instruction includes:
obtaining a model rendering data list;
acquiring the geometric structure data of the game model from a cache through the cache allocation information;
generating a geometric table entry, a texture table entry and a shader table entry of the game model in the model rendering data list, wherein the texture table entry and the shader table entry correspond to the game model;
storing the geometry data in the geometry table entry, storing the texture map data in the texture table entry, and storing the shader in the shader table entry.
6. The game screen rendering method of claim 5, wherein the model modification request comprises a geometric modification request, and when a model modification request for the game model by a user is received, modifying the model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model comprises:
when a geometric modification request of a user for the game model is received, determining a vertex to be modified and vertex position information included in the geometric modification request;
setting the position of the vertex to be modified of the geometric structure data in the geometric table entry as the vertex position information.
7. The game screen rendering method of claim 5, wherein the model modification request comprises a texture modification request, and when a model modification request for the game model by a user is received, modifying the model rendering data of the game model based on the model modification request to obtain modified model rendering data of the game model comprises:
when a texture modification request of a user for the game model is received, determining a vertex to be modified and vertex texture information included in the texture modification request;
and setting the texture of the vertex to be modified of the texture map data in the geometric table entry as the vertex texture information.
8. The method for rendering game pictures according to claim 5, wherein the model modification request includes a shader modification request, and when a shader modification request for the game model by a user is received, the model rendering data of the game model is modified based on the model modification request to obtain modified model rendering data of the game model, the method including:
when a shader modification request of a user for the game model is received, determining a shader to be modified, which is included in the shader modification request;
modifying the shader in the shader table entry to the modified shader.
9. The game screen rendering method according to claim 1, wherein the model rendering data of the game model includes a shader, geometry data of the game model, and texture map data, the shader being a drawing program loaded on a graphics processor;
replacing the model rendering data of the game model contained in the first type picture rendering instruction with the modified model rendering data of the game model to obtain a replaced first type picture rendering instruction, comprising:
performing data compression processing on the shader, the geometric structure data and the texture mapping data of the game model to obtain compressed geometric structure data and compressed texture mapping data of the shader and the game model;
replacing the shader included in the first type of picture rendering instruction with the compressed shader, replacing the geometric structure data with compressed geometric structure data of the game model, and replacing the texture map data with compressed texture map data of the game model to obtain a compressed first type of picture rendering instruction.
10. A game picture rendering method is suitable for a client side and comprises the following steps:
obtaining a compressed first type picture rendering instruction from a server, wherein the compressed first type picture rendering instruction comprises a compression shader, compressed geometric structure data of a game model and compressed texture mapping data;
carrying out data decompression processing on the compressed geometric structure data and the compressed texture mapping data of the compressed shader and the game model to obtain the geometric structure data and the texture mapping data of the shader and the game model;
replacing the compressed shader, the compressed geometry data, and the compressed texture map data included in the first type of picture rendering instruction with the shader, the geometry data, and the compressed texture map data to obtain a first type of picture rendering instruction;
instruct a graphics processor to render the game model in a game screen based on the first type of screen rendering instructions.
11. The game screen rendering method according to claim 10, further comprising:
acquiring a compressed second type picture rendering instruction;
performing data decompression processing on the compressed second type picture rendering instruction to obtain a second type picture rendering instruction, wherein model rendering data of a game model do not exist in the second type picture rendering instruction;
instruct a graphics processor to render a game screen based on the second type of screen rendering instructions.
12. A game screen rendering device applied to a server, comprising:
the game system comprises an instruction unit, a display unit and a control unit, wherein the instruction unit is used for acquiring a picture rendering instruction stream when a game picture is rendered, the picture rendering instruction stream comprises at least one picture rendering instruction, and the picture rendering instruction is an instruction used for instructing a graphics processor to render the game picture;
a first instruction unit, configured to, when the picture rendering instruction is a first type picture rendering instruction, obtain model rendering data of a game model included in the first type picture rendering instruction, where the model rendering data is data used for rendering the game model;
the modification unit is used for modifying the model rendering data of the game model based on the model modification request when receiving the model modification request of the game model by the user, so as to obtain the modified model rendering data;
a replacing unit, configured to replace model rendering data of a game model included in the first type picture rendering instruction with modified model rendering data of the game model, to obtain a replaced first type picture rendering instruction;
and the first sending unit is used for sending the replaced first type picture rendering instruction to a client so that the client can render the game model in a game picture according to the replaced first type picture rendering instruction.
13. A game screen rendering device applied to a client, comprising:
a first obtaining unit, configured to obtain, from a server, a compressed first type picture rendering instruction, where the compressed first type picture rendering instruction includes a compression shader, compressed geometry data of a game model, and compressed texture map data;
the first decompression unit is used for carrying out data decompression processing on the compressed geometric structure data and the compressed texture mapping data of the compressed shader and the game model to obtain the geometric structure data and the texture mapping data of the shader and the game model;
a first replacing unit, configured to replace the compressed shader included in the first type of image rendering instruction with the shader, replace the compressed geometry data with the geometry data, and replace the compressed texture map data with the compressed texture map data, so as to obtain a first type of image rendering instruction;
a first rendering unit to instruct a graphics processor to render the game model in a game screen based on the first type screen rendering instruction.
14. A server comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the game picture rendering method according to any one of claims 1 to 11.
15. A computer-readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the game screen rendering method according to any one of claims 1 to 11.
CN202011242090.7A 2020-11-09 2020-11-09 Game picture rendering method, device, server and storage medium Active CN112316433B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011242090.7A CN112316433B (en) 2020-11-09 2020-11-09 Game picture rendering method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011242090.7A CN112316433B (en) 2020-11-09 2020-11-09 Game picture rendering method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN112316433A true CN112316433A (en) 2021-02-05
CN112316433B CN112316433B (en) 2024-04-23

Family

ID=74316590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011242090.7A Active CN112316433B (en) 2020-11-09 2020-11-09 Game picture rendering method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112316433B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113453073A (en) * 2021-06-29 2021-09-28 北京百度网讯科技有限公司 Image rendering method and device, electronic equipment and storage medium
CN113946402A (en) * 2021-11-09 2022-01-18 中国电信股份有限公司 Cloud mobile phone acceleration method, system, equipment and storage medium based on rendering separation
CN114100130A (en) * 2022-01-20 2022-03-01 北京蔚领时代科技有限公司 Game picture intercepting method, device and equipment and cloud server
CN114377394A (en) * 2022-01-17 2022-04-22 北京永利信达科技有限公司 Cloud game picture rendering method and device
CN117095100A (en) * 2023-06-05 2023-11-21 北京虹宇科技有限公司 Method, device and equipment for rendering three-dimensional content in multi-task system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103399911A (en) * 2013-07-30 2013-11-20 北京小米科技有限责任公司 Access processing method, device and terminal device on basis of browser client
US20140035900A1 (en) * 2012-07-31 2014-02-06 Siemens Corporation Rendering of Design Data
CN103763307A (en) * 2013-12-30 2014-04-30 华中科技大学 Bandwidth optimization method and system
US9583140B1 (en) * 2015-10-06 2017-02-28 Bruce Rady Real-time playback of an edited sequence of remote media and three-dimensional assets
CN108848082A (en) * 2018-05-31 2018-11-20 深圳市腾讯网络信息技术有限公司 Data processing method, device, storage medium and computer equipment
CN110138769A (en) * 2019-05-09 2019-08-16 深圳市腾讯网域计算机网络有限公司 A kind of method and relevant apparatus of image transmitting
CN110393921A (en) * 2019-08-08 2019-11-01 腾讯科技(深圳)有限公司 Processing method, device, terminal, server and the storage medium of cloud game
CN111359220A (en) * 2020-03-04 2020-07-03 深圳市腾讯网域计算机网络有限公司 Game advertisement generation method and device and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140035900A1 (en) * 2012-07-31 2014-02-06 Siemens Corporation Rendering of Design Data
CN103399911A (en) * 2013-07-30 2013-11-20 北京小米科技有限责任公司 Access processing method, device and terminal device on basis of browser client
CN103763307A (en) * 2013-12-30 2014-04-30 华中科技大学 Bandwidth optimization method and system
US9583140B1 (en) * 2015-10-06 2017-02-28 Bruce Rady Real-time playback of an edited sequence of remote media and three-dimensional assets
CN108848082A (en) * 2018-05-31 2018-11-20 深圳市腾讯网络信息技术有限公司 Data processing method, device, storage medium and computer equipment
CN110138769A (en) * 2019-05-09 2019-08-16 深圳市腾讯网域计算机网络有限公司 A kind of method and relevant apparatus of image transmitting
CN110393921A (en) * 2019-08-08 2019-11-01 腾讯科技(深圳)有限公司 Processing method, device, terminal, server and the storage medium of cloud game
CN111359220A (en) * 2020-03-04 2020-07-03 深圳市腾讯网域计算机网络有限公司 Game advertisement generation method and device and computer equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113453073A (en) * 2021-06-29 2021-09-28 北京百度网讯科技有限公司 Image rendering method and device, electronic equipment and storage medium
CN113946402A (en) * 2021-11-09 2022-01-18 中国电信股份有限公司 Cloud mobile phone acceleration method, system, equipment and storage medium based on rendering separation
CN114377394A (en) * 2022-01-17 2022-04-22 北京永利信达科技有限公司 Cloud game picture rendering method and device
CN114100130A (en) * 2022-01-20 2022-03-01 北京蔚领时代科技有限公司 Game picture intercepting method, device and equipment and cloud server
CN117095100A (en) * 2023-06-05 2023-11-21 北京虹宇科技有限公司 Method, device and equipment for rendering three-dimensional content in multi-task system

Also Published As

Publication number Publication date
CN112316433B (en) 2024-04-23

Similar Documents

Publication Publication Date Title
CN112316433B (en) Game picture rendering method, device, server and storage medium
US7830388B1 (en) Methods and apparatus of sharing graphics data of multiple instances of interactive application
EP3264370B1 (en) Media content rendering method, user equipment, and system
CN1856819B (en) System and method for network transmission of graphical data through a distributed application
US20170323418A1 (en) Virtualized gpu in a virtual machine environment
CA2853212C (en) System, server, and control method for rendering an object on a screen
US9928637B1 (en) Managing rendering targets for graphics processing units
CN110751712A (en) Online three-dimensional rendering technology and system based on cloud platform
US11711563B2 (en) Methods and systems for graphics rendering assistance by a multi-access server
US8654134B2 (en) Command remoting
CN113244614B (en) Image picture display method, device, equipment and storage medium
KR20100114050A (en) Graphics remoting architecture
US9396564B2 (en) Atlas generation based on client video configuration
CN108074210B (en) Object acquisition system and method for cloud rendering
CN108762934B (en) Remote graphic transmission system and method and cloud server
US20240096007A1 (en) Rendering Method, Device, and System
CN103679813B (en) The construction method of three-dimensional digital earth and three-dimensional digital earth system
WO2022033162A1 (en) Model loading method and related apparatus
CN115695857B (en) Video coding method and device for cloud application
CN111476851A (en) Image processing method, image processing device, electronic equipment and storage medium
US20240189720A1 (en) Performing rendering processing by a graphics processing unit and a central processing unit
CN113838184A (en) Rendering method, device and system
CN117390322A (en) Virtual space construction method and device, electronic equipment and nonvolatile storage medium
US20180285129A1 (en) Systems and methods for providing computer interface interaction in a virtualized environment
WO2021249358A1 (en) Rendering method, device and system

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: 40038718

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant