CN112316433B - 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
CN112316433B
CN112316433B CN202011242090.7A CN202011242090A CN112316433B CN 112316433 B CN112316433 B CN 112316433B CN 202011242090 A CN202011242090 A CN 202011242090A CN 112316433 B CN112316433 B CN 112316433B
Authority
CN
China
Prior art keywords
instruction
model
game
rendering
data
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.)
Active
Application number
CN202011242090.7A
Other languages
Chinese (zh)
Other versions
CN112316433A (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

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

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 acquire 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 the 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 a first type of picture rendering instruction after replacement 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 present invention relates to the field of computers, and in particular, to a game screen rendering method, a game screen 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 lightweight devices (THIN CLIENT) with relatively limited graphics processing and data computing capabilities to run high quality games. In a cloud game scene, the game is not run in a player game terminal, but is run in a cloud server, the cloud server renders the game scene into a video and audio stream, and the video and audio stream 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 capability, and only needs to have basic streaming media playing capability and the capability of acquiring player input instructions and sending the player input instructions to the cloud server.
When a player needs to modify the visual effect of the game model, the game model in the cloud server needs to be updated, however, when updating, the video and audio stream needs to be closed or paused to be transmitted to the player game terminal, the 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 the game screen to the player, so that the current efficiency of modifying the visual effect of the game model in the cloud game is low.
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, 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 graphic 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 for rendering the game model;
when a model modification request of a user for the game model is received, modifying model rendering data of the game model based on the model modification request to obtain 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 the client so that the client renders 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 compressed first type picture rendering instructions from a server, the compressed first type picture rendering instructions comprising compressed shader, compressed geometry data of a game model, and compressed texture map data;
Performing data decompression processing on the compressed geometry data and the compressed texture map data of the compressed shader and the game model to obtain geometry data and texture map data of the shader and the game model;
replacing the compression shader contained in the first type picture rendering instruction with the shader, replacing the compression geometric structure data with the geometric structure data, and replacing the compression texture map data with the compression texture map data to obtain a first type picture rendering instruction;
The graphics processor is instructed to render the game model in a game screen based on the first type of screen rendering instructions.
The embodiment of the invention also provides a game picture rendering device which is suitable for the server and comprises:
the instruction unit is used for acquiring a picture rendering instruction stream when a game picture is rendered, wherein the picture rendering instruction stream comprises at least one picture rendering instruction which is an instruction for instructing a graphic processor to render the game picture;
the first instruction unit is used for acquiring model rendering data of a game model contained in the first type picture rendering instruction when the picture rendering instruction is the first type picture rendering instruction, wherein the model rendering data is data 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 user for the game model 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;
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 the client so that the client renders 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 the mapping relation between the picture rendering instruction and the instruction type;
The classifying subunit is used for determining the instruction type of the picture rendering instruction according to the mapping relation, wherein the instruction type is divided into a first instruction type and a second instruction type, the picture rendering instruction of the first instruction type comprises model rendering data of a game model, and the picture rendering instruction of the second instruction type does not comprise 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 the client so that the client renders the 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 the client so that the client decompresses the compressed second-type picture rendering instruction into a second-type picture rendering instruction and then renders the game picture according to the second-type picture rendering instruction.
In some embodiments, the first instruction unit includes:
A list acquisition subunit for acquiring a model rendering data list;
a geometry acquisition subunit, configured to acquire geometry data of the game model from a cache through the cache allocation information;
A table item generating subunit, configured to generate, in the model rendering data list, a geometric table item, a texture table item, and a shader table item of the game model, where the texture table item and the shader table item both correspond to the game model;
An entry storage subunit operable to store the geometry data in the geometry entry, the texture map data in the texture entry, and the shader in the shader entry.
In some embodiments, the model modification request comprises a geometric modification request, the modification unit being configured 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;
And 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 item 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 to-be-modified shader 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, which is a graphics processor-piggybacked rendering program, geometry data and texture map data of the game model, the replacement unit to:
Performing data compression processing on the geometry data and the texture map data of the shader and the game model to obtain compressed geometry data and compressed texture map data of the shader and the game model;
And replacing the shader contained in the first type picture rendering instruction with the compressed shader, replacing the geometric structure data with the compressed geometric structure data of the game model, and replacing the texture map data with the compressed texture map data of the game model to obtain a compressed first type picture rendering instruction.
The embodiment of the invention also provides a game picture rendering device which is suitable for the client and comprises:
A first acquisition unit configured to acquire a compressed first-type picture rendering instruction from a server, the compressed first-type picture rendering instruction including a compressed shader, compressed geometry data of a game model, and compressed texture map data;
The first decompression unit is used for performing 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;
A first replacing unit, configured to replace the compressed shader included in the first type of picture 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 picture rendering instruction;
And a first rendering unit for instructing 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 does not exist in the second-type picture rendering instruction;
And instructing the graphics processor to render a game screen based on the second type of screen rendering instruction.
The embodiment of the invention also provides a server, which comprises a memory and a server, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute steps in any game picture rendering method provided by the embodiment of the invention.
The embodiment of the invention also provides a computer readable storage medium, which stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor to execute the steps in any game picture rendering method provided by the embodiment of the invention.
The embodiment of the invention can acquire a picture rendering instruction stream when a game picture is rendered, wherein the picture rendering instruction stream can comprise at least one picture rendering instruction which is an instruction capable of being used for indicating 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, wherein the game model can comprise a game model, and the model rendering data is data which can be used for rendering the game model; when a model modification request of a user for the 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 visual effects 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 a 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 audio and video streams from being compressed to low resolution under the influence of network bandwidth during transmission, the cloud server provided by the invention can intercept a picture rendering instruction stream sent to the GPU before the GPU (Graphics Processing Unit, a graphic processor) renders a game picture, so that a client can send the received picture rendering instruction stream to the GPU carried by the client by transmitting the picture rendering instruction stream occupying smaller bandwidth, thereby performing picture rendering, and improving the definition of the finally rendered game picture.
In addition, when the visual effect of the game model is modified, only the game model rendering data contained in the intercepted picture rendering instruction is required to be modified, and the picture rendering instruction containing the modified game model rendering data can be sent to the client side, so that the client side can display the game model with the changed visual effect in a game picture in real time, the game client side does not need to be paused or closed, and a user can directly watch the game model with the changed visual effect without waiting. Therefore, the scheme effectively improves the efficiency of modifying the visual effect of the game model in the cloud game.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic diagram of a game screen rendering method according to an embodiment of the present invention;
FIG. 1b is a flowchart illustrating a game screen rendering method suitable for a server according to an embodiment of the present invention;
FIG. 1c is a schematic view 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 data of a game frame rendering method according to an embodiment of the present invention;
Fig. 2 is a flowchart of 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 configuration of a game screen rendering device according to an embodiment of the present invention;
Fig. 4 is a schematic diagram of a second structure of a game screen rendering device 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 following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the 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 picture rendering device can be integrated in an electronic device, and the electronic device can be a terminal, a server and 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 cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Cloud technology (Cloud technology) refers to a hosting technology for integrating hardware, software, network and other series resources in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
The terminal may be, but not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
In some embodiments, a game screen rendering system is provided, which may include a game screen rendering device applicable to a server and a game screen rendering device applicable to a client, wherein the game screen rendering device for the server may be integrated in a cloud server, and the game screen rendering device applicable 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 can acquire a picture rendering instruction stream when rendering a game picture, 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 indicating a graphic processor to render the 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 equipment models assembled on character models, 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 and texture map data of the game model, and the shader is a drawing program carried by a graphic processor; when a model modification request of a user for equipment models is received, modifying model rendering data of the game models based on the model modification request to obtain modified model rendering data of the game models, wherein the model modification request is a request for modifying visual effects of the game models; performing data compression processing on geometry data and texture map data of the shader and the game model to obtain compressed geometry data and compressed texture map data of the compressed shader and the game model; replacing a shader contained in the first type picture rendering instruction with a compressed shader, replacing geometric structure data with compressed geometric structure data of a game model, and replacing texture map data with compressed texture map data of the game model to obtain a compressed first type picture rendering instruction; and sending a 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.
Wherein the client 02 may obtain compressed first type picture rendering instructions from the server 01, the compressed first type picture rendering instructions may include compressed shader, compressed geometry data and compressed texture map data of a game model, and the game model may include an equipment model assembled on a character model;
Performing 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; replacing a compression shader contained in the first type picture rendering instruction with a shader, replacing compression geometric structure data with geometric structure data, and replacing compression texture map data with compression texture map data to obtain the first type picture rendering instruction; the graphics processor is instructed to render the equipment model assembled on the character model in the game screen based on the first type of screen rendering instructions.
The following will describe in detail. The numbers of the following examples are not intended to limit the preferred order of the examples.
In this embodiment, a game screen rendering method based on a cloud server is provided, which is applicable to a server, as shown in fig. 1b, and the specific flow of the game screen 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 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 game picture.
In this embodiment, a CPU (Central Processing Unit ) may be disposed in the server, and the CPU may be used for a server side running the game. Specifically, the server may have one or more emulators (Virtual devices) running thereon, where the emulators may be Virtual machines, and the Virtual machines may have game programs running therein, and the memory of the Virtual machines may include game resources, such as image resources, character resources, audio resources, and so on, of the game.
The operation of the game terminal by the user can be responded by the virtual machine, namely the virtual machine can assist the terminal to complete the operation process of the game.
Wherein an emulator (also referred to as a virtual container) refers to a complete computer system, with complete hardware system functionality, that is run in a completely isolated environment, emulated by a computer program. Work that can be done in a physical computer can be done in an emulator. The simulator may include an Android simulator, a Java simulator, a Linux simulator, a windows simulator, and the like.
For example, referring to FIG. 1c, an Android emulator (Android Virtual Device, AVD) may 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 simply referred to as a terminal), the server may intercept a picture rendering instruction stream in the AVD and then forward the intercepted picture rendering instruction stream to the terminal, and the GPU of the terminal performs image rendering and display.
The embodiment can control the game process and the image drawing resource consumption in the server, thereby reducing the load of the game terminal and improving the terminal user experience.
The virtual machine has a graphics library running therein, which is a library for rendering computer graphics on a display, by providing an optimized set of functions to perform common rendering tasks.
For example, an OpenGL (Open Graphics Library ) may be run in the virtual machine, which is a cross-language, cross-platform application programming interface (Application Programming Interface, API) for rendering two-dimensional and three-dimensional vector graphics. 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 flow of the server rendering the game screen is as follows:
The game program instructs the CPU to package the game resource in a picture rendering instruction and to transfer the picture rendering instruction to the GPU (Graphics Processing Unit, graphics processor);
And the GPU draws the game picture according to the indication of the picture rendering instruction.
Note that, in this embodiment, since the screen rendering instruction may be directly intercepted, the GPU may or may not be mounted in the server.
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 obtained, wherein the model rendering data is data which can be used for rendering the game model.
The first type of picture rendering instruction refers to a picture rendering instruction containing model rendering data of a game model.
In some embodiments, the stream of picture rendering instructions may be divided into a first picture rendering instruction and a second picture rendering instruction, where the second picture rendering instruction refers to a picture rendering instruction that does not include model rendering data of the game model.
The game model may include, among other things, character models, object models, animal and plant models, building models, particle light effect models, and the like in a game scene.
Wherein the object model may include an equipment model, which refers to a game model assembled on a character model, the equipment model and the character model having a mapping relationship therebetween. The equipment model may include, among other things, a weapon model, a clothing model, an accessory model, a riding model, and the like.
For example, in some embodiments, the game model may include an equipment model assembled on the character model.
Model rendering data is data that may be used to render a game model, and in some embodiments, model rendering data may include shaders, geometry data, texture map data for a game model, and so forth. To facilitate understanding of model rendering data, an introduction is made herein to a rendering process of a game screen:
The game picture rendering refers to taking out the data of all points (vertexes) in the game model, converting the data into a two-dimensional plane through space, and then drawing on a screen according to various parameters and data.
The vertex data may be composed of vertex position information, color information, normal line information, and the like. The normal information of the vertex is mainly used for illumination calculation and is used for determining the orientation of the vertex relative to light.
The Texture map data is two-dimensional image data having textures, and position information of each point on the Texture map (Texture Mapping) can be accurately corresponding to the vertex of the game model.
A Shader (loader) is an editable program used to implement image rendering. The shaders may be classified by function into Vertex shaders (Vertex shaders), pixel shaders (Pixel shaders), geometry shaders (Geometry shaders), compute shaders (Compute shaders), subdivision surface shaders (Tessellation or hull shader), and so on. In drawing a game model in a game frame, a vertex shader is required to create a geometric structure of the game model from vertex information, then a pixel shader may be used to fill in colors between areas of vertices, then a portion of the texture image in the texture map data is mapped onto each primitive to form Primitives (PRIMITIVES), the geometric shader may manipulate the geometrically primitives to form Fragments (Fragments), and then rasterize the Fragments into pixels in a frame buffer. Wherein the frame buffer is a set of logical buffers including a color buffer, a depth buffer, a stencil buffer, and a 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 expression is formed by combining a plurality of identical patterns, for example, a graphic formed by a plurality of points, a plurality of lines or a plurality of planes, wherein the points, the lines or the planes are the basic graphic elements.
In this embodiment, the geometry data may include vertex information and the texture map data may include texture map images.
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 used to intercept the image rendering instruction stream, the compressing module is used to compress data, and the network sending module is used to communicate with the client.
When the intercepting module monitors a new picture rendering instruction stream, the intercepting module can directly intercept the AVD cache (Buffer), namely the data content in the cache of the Android simulator; the intercepting the picture rendering instruction stream refers to saving 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 computing efficiency, only model rendering data of the game model needs to be modified when modifying visual effects of the game model. 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 types of the picture rendering instructions in the picture rendering instruction stream, so that a user can modify the model rendering data of the game model by modifying the first picture rendering instruction stored in the resource manager.
Thus, in some embodiments, prior to step 102, the following steps may also be included:
(1) And obtaining the mapping relation between the picture rendering instruction and the instruction type.
The mapping relationship between the image 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, etc.
For example, in some embodiments, the picture rendering instruction a may have a mapping relationship with the instruction types a, b, c at the same time; for example, in some embodiments, the picture rendering instruction a may only have a mapping relationship with the instruction type a; for example, in some embodiments, the picture 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, where the first instruction type may include model rendering data of the game model in the screen rendering instruction, and the second instruction type may include no model rendering data of the game model in the screen rendering instruction.
Specifically, the mapping relationship between the picture rendering instruction and the instruction type may be preset according to the application scene.
For example, in some embodiments, a picture rendering instruction containing geometry data, such as a cache allocation instruction (e.g., glBufferData, an OpenGL instruction containing geometry data) may be of the first instruction type.
Wherein the cache allocation instruction (glBufferData) is operable to extract geometry data from a cache containing geometry data.
For example, in some embodiments, a picture rendering instruction containing texture map data, such as a texture map instruction (e.g., glTexImage D, an OpenGL instruction containing texture map data, etc.), may be of a first instruction type.
For example, in some embodiments, a shader instruction (e.g., glShaderSourc, a shader OpenGL instruction containing texture map data) or the like, a picture rendering instruction containing texture map data, is of the first instruction type.
For example, in some embodiments, the model rendering data for which there is no game model may belong to a picture rendering instruction of the second instruction type.
For example, glSwapBuffer (an OpenGL instruction for exchanging data stored in two buffers), glFlush (an OpenGL instruction for forced refresh of game pictures), etc. model rendering data for which there is no game model may belong to a picture rendering instruction of the second instruction type.
For example, referring to table 1, table 1 shows a mapping relationship between a picture rendering instruction and an instruction type, where the mapping relationship includes a plurality of instruction types to which different picture rendering instructions belong, that is, the mapping relationship shown in table 1 may include a mapping relationship between a picture rendering instruction and an instruction type, as follows:
TABLE 1
For example, the mapping relationship may define that the instruction type of the picture rendering instruction A, B, C is type a, the instruction type of the picture 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 picture rendering instruction may be determined by querying the instruction name of the picture rendering instruction in a mapping relationship as shown in table 1.
In some embodiments, after step "(2) determining the picture rendering instruction type" according to the mapping relationship, the method may further include the steps of:
(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 renders the game picture according to the second type picture rendering instruction.
That is, the screen rendering instructions that are independent of the change in the visual effect of the game model are directly transmitted to the client, and the screen rendering instructions that are dependent on the change in the visual effect of the game model are stored in the resource manager for modification by the user.
In some embodiments, in order to reduce the impact 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 a 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 decompresses the compressed second type picture rendering instruction into a second type picture rendering instruction and then renders the game picture according to the second type picture rendering instruction.
In some embodiments, the model rendering data of the game model may include shaders, 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;
obtaining geometric structure data of the game model from the cache through the cache allocation information;
Generating a geometric table item, a texture table item and a shader table item of the game model in a model rendering data list, wherein the texture table item and the shader table item correspond to the game model;
The geometry data is stored in a geometry table entry, the texture map data is stored in a texture table entry, and the shader is stored in a shader table entry.
Wherein the model rendering data list is a list in the resource management module for storing model rendering data, the list 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 of screen rendering instruction is saved in the resource management module, model rendering data of the game model included in the first type of screen rendering instruction may be saved in the model rendering data list.
In the cache allocation information, how the geometric structure data of the game model is stored in the cache may be recorded, 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 color information of the vertices in the cache may be distinguished by byte step (stride) of the cache.
When geometry data is stored in a geometry entry, texture map data is stored in a texture entry, and a shader is stored in a shader entry, the entry may also be given an identifier 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 entry.
Wherein the identifier of the entry may be described in terms of a resource unique identifier (Resource Unique Identifier, RUI) and/or a hash value.
Wherein the resource unique identifier refers to a unique set of characters for identifying a certain data object; the resource unique identifier may include a uniform resource identifier (Uniform Resource Identifier, URI), a uniform resource locator (Uniform Resource Locator, URL), a uniform resource name (Uniform Resource Name, URN), and so forth.
The Hash value may be calculated from various Hash functions (Hash functions) including MD4, MD5, SHA, etc.
Specifically, MD5 may be used to calculate a hash value and use the resulting hash value as an identifier of an entry.
103. When a model modification request of a user for the equipment model is received, modifying 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.
Because the game client is of various types, for example, the game client may include an Android game client, an IOS game client, a PC game client, and so on, in order to improve the efficiency of modifying the visual effect of the game model by the game party, in this embodiment, the resource manager may dynamically modify the resource data in the game, so that the model rendering resource in the first type of image rendering instruction may be modified by the game party before being sent to the game client, so that the modification effect may be revealed to the game client in real time.
Thus, when a model modification request for the equipment model is received by the user, the resource manager may modify model rendering data of the game model based on the model modification request, resulting in modified model rendering data of the game model.
Wherein, 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 effect of the game model, i.e., to modify the shader.
In some embodiments, the model modification request may comprise a geometric 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 vertices 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 geometric modification request may include a vertex name of the vertex to be modified and location information to be replaced. In some embodiments, the geometric modification request may further include color information to be replaced by the vertex to be modified.
Referring to fig. 1d, fig. 1d is vertex information of a game model stored in a buffer, by querying a buffer location of original location information and original color information of a vertex to be modified in the buffer, location information in a geometric modification request can be overlaid on original location information of the buffer location, and color information in the geometric modification request can be overlaid on original color information of the buffer 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 vertices 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 map data in the geometric table item as vertex texture information.
Wherein the texture modification request may dynamically modify the texture map data. In some embodiments, a transfer function of glTexImage D interface incoming texture map may be employed, e.g., modifying the texture map data type by GLenum target, modifying the format used by the texture map when OpenGL stores the texture map data by GLINT LEVEL, modifying the width of the texture map by GLsizei width, modifying the height of the texture map by GLsizei height, and so on.
For another example, a glTexImage D interface may be used to introduce 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 for the equipment model is received by a user, determining a shader to be modified, which can be included in the shader modification request;
The shader in the shader table entry is modified to a modified shader.
For example, when a user modifies the animation effect of a game device, this may be accomplished by replacing the original shader with a new shader.
Wherein the shader modification request may dynamically modify a shader employed to render the game frame. In some embodiments, glShaderSource interfaces may be employed to pass in various shader modification functions to modify the shader, for example, by creating and loading script source code for the shader through glShaderSourc.
In some embodiments, the script source code of the new pre-written shader may be substituted for the original shader in the shader entry in text form.
In some embodiments, text modification may be directly performed on script source code of an original shader in a shader table entry, for example, modifying a coordinate conversion manner of script source code in a vertex shader, modifying a color gradient manner of script source code 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 a replaced first type picture rendering instruction.
For example, model rendering data of an equipment model included in the first type of screen rendering instruction may be replaced with modified model rendering data of the equipment model, resulting in a replaced first type of screen rendering instruction.
In some embodiments, in order to reduce the impact of network bandwidth on data exchange and improve the real-time performance of game screen rendering, step 104 may include the following steps:
performing data compression processing on geometry data and texture map data of the shader and the game model to obtain compressed geometry data and compressed texture map data of the compressed shader and the game model;
Replacing a shader contained in the first type picture rendering instruction with a compressed shader, replacing geometry data with compressed geometry data of a game model, and replacing texture map data with compressed texture map data of the game model to obtain a compressed first type picture rendering instruction.
105. And sending a 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, a post-replacement 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 post-replacement first type screen rendering instruction such that a visual effect of the equipment model changes.
In the embodiment of the invention, a user can dynamically modify resource data in a game through a resource manager in a server without modifying each version (such as an IOS (input/output) end, an Android end, a PC (personal computer) end and the like) of a game service end one by one, and after the resource modification is realized in the resource manager, the visual effect of the modified game equipment can be seen at a game client in real time.
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 shader may be replaced with a different shader, and so on; thereby realizing that the visual effect of the game equipment assembled by the game role can be dynamically changed without adjusting the server side of each version.
As can be seen from the above, when the game picture is rendered, the embodiment of the present invention can obtain a picture rendering instruction stream, where the picture rendering instruction stream may include at least one picture rendering instruction, and the picture rendering instruction is an instruction that can be used to instruct the graphics processor to render the 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 role model, and the model rendering data is data which can be used for rendering the game model; when a model modification request of a user for equipment models is received, modifying model rendering data of the game models based on the model modification request to obtain modified model rendering data of the game models, wherein the model modification request is a request for modifying visual effects of the game models; 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 a replaced first type picture rendering instruction to the client so that the client 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.
Therefore, the scheme can realize real-time visual effect change without adjusting the visual effect of game equipment in each version of server side by modifying the model rendering data of the equipment model in the picture rendering instruction, and improves the efficiency of modifying the visual effect of the game model in the cloud game.
Accordingly, according to the method described in the above embodiment, a corresponding explanation will be made below for the game client.
In this embodiment, a game screen rendering method based on a cloud server is provided, which is applicable to a client, as shown in fig. 2, and the specific flow of the game screen rendering method may be as follows:
201. The method may include obtaining, from a server, compressed first type picture rendering instructions, which may include a compressed shader, compressed geometry data of a game model, and compressed texture map data.
For example, the game model included in the compressed first type of screen rendering instructions may be a setup model assembled on the character model.
202. And performing 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.
203. And replacing the compression shader contained in the first type picture rendering instruction with a shader, replacing the compression geometric structure data with geometric structure data, and replacing the compression texture map data with compression texture map data to obtain the first type picture rendering instruction.
204. The graphics processor is instructed to render the 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 the second type picture rendering instruction, wherein model rendering data of the game model does not exist in the second type picture rendering instruction.
(3) The graphics processor is instructed to render the game screen based on the second type of screen rendering instruction.
Compared with the existing cloud games based on video streaming, the video streaming method and the video streaming system have the advantages that the game pictures 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 of modifying the game model is reduced, and the operation requirement of a game party is met.
For example, to replace a riding model assembled by a character model, the visual effect of the riding model can be changed by replacing the buffer data corresponding to the riding model assembled by the character model with model data (such as vertex position coordinates, normal coordinates, color values, texture coordinates and the like) of a newly manufactured riding model in a resource manager.
From the above, the embodiment of the present invention may obtain, from a server, a compressed first type of image rendering instruction, where the compressed first type of image rendering instruction may include compressed shader, compressed geometry data of a game model, and compressed texture map data; performing 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; replacing a compression shader contained in the first type picture rendering instruction with a shader, replacing compression geometric structure data with geometric structure data, and replacing compression texture map data with compression texture map data to obtain the first type picture rendering instruction; the graphics processor is instructed to render the game model in the 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 above method, the embodiment of the present invention also provides a game screen rendering device, which is suitable for a server, and the game screen rendering device may be 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, a method according to an embodiment of the present invention will be described in detail by taking a specific integration of a game screen rendering device in a server as an example.
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:
(one) instruction unit 301:
The instruction unit 301 may be configured to obtain a picture rendering instruction stream when rendering a game picture, where the picture rendering instruction stream includes at least one picture rendering instruction, and the picture rendering instruction is an instruction for instructing the graphics processor to render the game picture.
(II) first instruction unit 302:
the first instruction unit 302 may be configured to obtain, when the frame rendering instruction is a first type frame rendering instruction, model rendering data of a game model included in the first type frame 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 sorting subunit, as follows:
(1) Mapping subunit:
The mapping subunit may be configured to obtain a mapping relationship between the picture rendering instruction and the instruction type.
(2) Classification subunit:
The classifying subunit may be configured to determine an instruction type of a picture rendering instruction according to the mapping relationship, where the instruction type is classified into a first instruction type and a second instruction type, where the first instruction type picture rendering instruction includes model rendering data of a game model, and the second instruction type picture rendering instruction does not include model rendering data of the game model.
In some embodiments, the classification subunit may also be used 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 renders the game picture according to the second type picture rendering instruction.
In some embodiments, the classification subunit may also be used 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 decompresses the compressed second type picture rendering instruction into a second type picture rendering instruction and then renders the game picture according to the second type picture rendering instruction.
In some embodiments, the first instruction unit 302 may include a list fetch subunit, a geometry fetch subunit, an entry generation subunit, and an entry storage subunit, as follows:
(1) List acquisition subunit:
The list acquisition subunit may be configured to acquire a model rendering data list.
(2) Geometry acquisition subunit:
the geometry acquisition subunit may be configured to acquire geometry data of the game model from the cache via the cache allocation information.
(3) An entry generation subunit:
the table entry generation subunit may be configured to generate, in the model rendering data list, a geometric table entry, a texture table entry, and a shader table entry of the game model, each of the texture table entry and the shader table entry corresponding to the game model.
(4) An entry storage subunit:
The table entry storage subunit may be configured to store geometry data in the geometry table entry, texture map data in the texture table entry, and shader in the shader table entry.
(III) modification unit 303:
the modification unit 303 may be configured to, when receiving a model modification request for a game model from a user, modify model rendering data of the game model based on the model modification request, to obtain modified model rendering data.
In some embodiments, the model modification request may comprise a geometric 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 vertices 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 vertices 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 map data in the geometric table item as vertex texture information.
In some embodiments, the model modification request may comprise a shader modification request, and the modification unit 303 may be configured to:
when a shader modification request of a user for a game model is received, determining a shader to be modified, which can be included in the shader modification request;
The shader in the shader table entry is modified to a modified shader.
(IV) a replacement unit 304:
the replacing unit 304 may be configured to replace model rendering data of the game model included in the first type of screen rendering instruction with modified model rendering data of the game model, to obtain a replaced first type of screen rendering instruction.
In some embodiments, the model rendering data of the game model may include a shader, which is a drawing program carried by a graphics processor, geometry data of the game model, and texture map data, and the replacement unit 304 may be configured to:
performing data compression processing on geometry data and texture map data of the shader and the game model to obtain compressed geometry data and compressed texture map data of the compressed shader and the game model;
Replacing a shader contained in the first type picture rendering instruction with a compressed shader, replacing geometry data with compressed geometry data of a game model, and replacing texture map data with compressed texture map data of the game model to obtain a compressed first type picture rendering instruction.
(Fifth) a first transmitting unit 305:
The first transmitting unit 305 may be configured to transmit a post-replacement first type picture rendering instruction to the client so that the client renders the game picture in the game picture according to the post-replacement first type picture rendering instruction.
As can be seen from the above, when the instruction unit renders the game screen, the game screen rendering device of the present embodiment obtains 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 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 the game model is received by the 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 visual effects of the game model; replacing model rendering data of the game model contained in the first type picture rendering instruction by a replacing unit to modified model rendering data of the game model, so as 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 above method, the embodiment of the present invention further provides a game screen rendering device, which is suitable for a client, and the game screen rendering device may be specifically integrated in an electronic device, where the electronic device may be a terminal, and the terminal may be a device such as a personal computer or a mobile phone.
For example, in the present embodiment, a method according to an embodiment of the present invention will be described in detail by taking a specific integration of a game screen rendering device in a terminal as an example.
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:
(one) a first acquisition unit 401:
The first obtaining unit 401 may be configured to obtain, from a server, a compressed first type of picture rendering instruction, the compressed first type of picture rendering instruction including a compressed shader, compressed geometry data of a game model, and compressed texture map data.
(Two) a 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, so as to obtain geometry data and texture map data of the shader and the game model.
(Iii) a first replacement unit 403:
The first replacing unit 403 may be configured to replace a compression shader included in the first type of picture rendering instruction with a shader, replace compression geometry data with geometry data, and replace compression texture map data with compression texture map data, so as to obtain the first type of picture rendering instruction.
(Fourth) the first rendering unit 404:
The first rendering unit 404 may be configured to instruct the graphics processor to render the game model in the game screen based on the first type of screen rendering instruction.
In some embodiments, the game screen rendering device may also be used to:
acquiring a compressed second type picture rendering instruction;
performing data decompression processing on the compressed second type picture rendering instruction to obtain the second type picture rendering instruction, wherein model rendering data of a game model does not exist in the second type picture rendering instruction;
The graphics processor is instructed to render the game screen based on the second type of screen rendering instruction.
In the implementation, each unit may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each unit may be referred to the foregoing method embodiment, which is not described herein again.
As can be seen from the above, the game screen rendering device of the present embodiment is configured to obtain, from the server, a compressed first type of screen rendering instruction by the first obtaining unit, where the compressed first type of screen rendering instruction includes a compressed shader, compressed geometry data of the game model, and compressed texture map data; the first decompression unit is used for performing 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; the first replacing unit is used for replacing a compression shader contained in the first type picture rendering instruction with a shader, replacing compression geometric structure data with geometric structure data and replacing compression texture mapping data with compression texture mapping data to obtain the first type picture rendering instruction; the graphics processor is instructed by the first rendering unit 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 electronic equipment which can be a terminal, a server and other equipment. 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 integrated in a plurality of electronic devices, for example, the game screen rendering apparatus may be integrated in 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 taking an example that the electronic device of this embodiment is a server or a terminal, for example, as shown in fig. 5, which shows a schematic structural diagram of the electronic device according to the embodiment of the present invention, specifically:
The electronic device may include one or more processing cores 'processors 501, one or more computer-readable storage media's memory 502, a power supply 503, an input module 504, and a communication module 505, among other components. Those skilled in the art will appreciate that the electronic device structure shown in fig. 4 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components. Wherein:
The processor 501 is a control center of the electronic device, connects various parts of the entire electronic device 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 invoking data stored in the memory 502. In some embodiments, processor 501 may include one or more processing cores; in some embodiments, the processor 501 may integrate an application processor that primarily processes operating systems, user interfaces, applications, etc., with a modem processor that primarily processes 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 executing the software programs and modules stored in the memory 502. The memory 502 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, 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 access to the memory 502 by the processor 501.
The electronic device also includes a power supply 503 for powering the various components, and in some embodiments, the power supply 503 may be logically connected to the processor 501 via a power management system, such that functions such as charge, discharge, and power consumption management are performed by the power management system. The power supply 503 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may also include an input module 504, which input module 504 may be used to receive entered numeric or character information and to 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 through which the electronic device may wirelessly transmit over a short distance, thereby providing wireless broadband internet access to the user. For example, the communication module 505 may be used to assist a user in e-mail, browsing web pages, accessing streaming media, and the like.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein.
In some embodiments, the electronic device may be a server, where the processor 501 loads executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 executes the application programs 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 graphic processor to render the game 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, wherein the model rendering data is data for rendering the game model;
When a model modification request of a user for the 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 visual effects 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 a 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, where the processor 501 loads executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 executes the application programs stored in the memory 502, so as to implement various functions, as follows:
Obtaining compressed first type picture rendering instructions from a server, the compressed first type picture rendering instructions may include a compressed shader, compressed geometry data and compressed texture map data for a game model, the game model may include an equipment model assembled on a character model;
Performing 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;
replacing a compression shader contained in the first type picture rendering instruction with a shader, replacing compression geometric structure data with geometric structure data, and replacing compression texture map data with compression texture map data to obtain the first type picture rendering instruction;
the graphics processor is instructed to render the equipment model assembled on the character model in the game screen based on the first type of screen rendering instructions.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
From the above, the present solution can improve the efficiency of modifying the visual effect of the game model in the cloud game.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present invention provides a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any one of the game screen rendering methods provided by the embodiment 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 graphic processor to render the game 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, wherein the model rendering data is data for rendering the game model;
When a model modification request of a user for the 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 visual effects 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 a 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 compressed first type picture rendering instructions from a server, the compressed first type picture rendering instructions may include a compressed shader, compressed geometry data and compressed texture map data for a game model, the game model may include an equipment model assembled on a character model;
Performing 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;
replacing a compression shader contained in the first type picture rendering instruction with a shader, replacing compression geometric structure data with geometric structure data, and replacing compression texture map data with compression texture map data to obtain the first type picture rendering instruction;
the graphics processor is instructed to render the 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, random Access Memory), magnetic or optical disk, and the like.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in various alternative implementations of the cloud gaming aspects or the gaming model modification aspects provided in the above-described embodiments.
The instructions stored in the storage medium can execute the steps in any game picture rendering method provided by the embodiment of the present invention, so that the beneficial effects that any game picture rendering method provided by the embodiment of the present invention can achieve can be achieved, and detailed descriptions of the previous embodiments are omitted herein.
The above describes in detail a game screen rendering method, a device, a server and a computer readable storage medium provided by the embodiments of the present invention, and specific examples are applied to illustrate the principles and embodiments of the present invention, where the above description of the embodiments is only for helping to understand the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present invention, the present description should not be construed as limiting the present invention.

Claims (15)

1. The game picture rendering method is applied to a cloud game, is suitable for a server and comprises the following steps:
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 graphic processor to render the game picture;
acquiring a mapping relation between a picture rendering instruction and an instruction type, and determining the instruction type of the picture rendering instruction based on the mapping relation, wherein the instruction type comprises a first instruction type, and the picture rendering instruction of the first instruction type comprises model rendering data of a game model;
when the type of the picture rendering instruction is the first instruction type, storing the picture rendering instruction of the first instruction type into a resource manager;
When a model modification request of a game side developer user for the game model is received, modifying model rendering data of the game model contained in the picture rendering instruction of the first instruction type stored in the resource manager based on the model modification request to obtain modified model rendering data;
In the resource manager, replacing model rendering data of a game model contained in the picture rendering instruction of the first instruction type with modified model rendering data of the game model to obtain a picture rendering instruction of the replaced first instruction type;
and sending the picture rendering instruction of the replaced first instruction type to the client so that the picture rendering instruction of the client renders the game model in a game picture according to the picture rendering instruction of the replaced first instruction type.
2. The game screen rendering method according to claim 1, wherein the instruction types are divided into a first instruction type and a second instruction type, and model rendering data of a game model does not exist in the screen rendering instruction of the second instruction type.
3. The game screen rendering method according to claim 2, wherein after the screen rendering instruction type is determined 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 the client so that the client renders the game picture according to the second type picture rendering instruction.
4. The game screen rendering method of claim 3, wherein the transmitting 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 the client so that the client decompresses the compressed second-type picture rendering instruction into a second-type picture rendering instruction and then renders the game picture according to the second-type picture rendering instruction.
5. The game screen rendering method according to claim 1, wherein the model rendering data of the game model includes a shader, cache allocation information and texture map data of the game model, the method further comprising:
Obtaining a model rendering data list;
obtaining geometric structure data of the game model from a cache through the cache allocation information;
generating geometric table items, texture table items and shader table items of the game model in the model rendering data list, wherein the texture table items and the shader table items correspond to the game model;
the geometry data is stored in the geometry table entry, the texture map data is stored in the texture table entry, and the shader is stored in the shader table entry.
6. The game screen rendering method according to claim 5, wherein the model modification request includes a geometric modification request, and when a model modification request for the game model is received by a user, modifying model rendering data of the game model included in the screen rendering instruction of the first instruction type stored in the resource manager based on the model modification request to obtain modified model rendering data of the game model, includes:
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;
And 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 includes a texture modification request, and modifying model rendering data of the game model based on the model modification request when receiving the model modification request for the game model 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 item as the vertex texture information.
8. The game screen rendering method of claim 5, wherein the model modification request includes a shader modification request, and when a user's shader modification request for the 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, comprising:
When a shader modification request of a user for the game model is received, determining a to-be-modified shader 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, which is a drawing program carried by a graphics processor, geometry data of the game model, and texture map data;
replacing model rendering data of a game model contained in the picture rendering instruction of the first instruction type with modified model rendering data of the game model to obtain a picture rendering instruction of the replaced first instruction type, wherein the picture rendering instruction comprises the following steps:
Performing data compression processing on the geometry data and the texture map data of the shader and the game model to obtain compressed geometry data and compressed texture map data of the shader and the game model;
And replacing the shader contained in the picture rendering instruction of the first instruction type with the compressed shader, replacing the geometric structure data with the compressed geometric structure data of the game model, and replacing the texture map data with the compressed texture map data of the game model to obtain the picture rendering instruction of the compressed first instruction type.
10. A game screen rendering method, which is suitable for a client, comprising:
If a server receives a model modification request of a game side developer user for a game model, acquiring a picture rendering instruction of a compressed first instruction type from a resource manager of the server, wherein the picture rendering instruction of the compressed first instruction type comprises a compressed shader, compressed geometric structure data of the game model and compressed texture map data; the method comprises the steps that a picture rendering instruction of a first instruction type is compressed in a resource manager, after the picture rendering instruction is determined to be the first instruction type based on the mapping relation between the acquired picture rendering instruction and the instruction type by the server, the picture rendering instruction is stored in the resource manager, and model rendering data of a game model are contained in the picture rendering instruction of the first instruction type;
Performing data decompression processing on the compressed geometry data and the compressed texture map data of the compressed shader and the game model to obtain geometry data and texture map data of the shader and the game model;
Replacing the compression shader contained in the picture rendering instruction of the first instruction type with the shader, replacing the compression geometric structure data with the geometric structure data, and replacing the compression texture map data with the compression texture map data to obtain a picture rendering instruction of the replaced first instruction type;
a screen rendering instruction based on the replaced first instruction type instructs a graphics processor to render the game model in a game screen.
11. The game screen rendering method according to claim 10, wherein the method further comprises:
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 does not exist in the second-type picture rendering instruction;
And instructing the graphics processor to render a game screen based on the second type of screen rendering instruction.
12. A game screen rendering device, which is adapted to a server, comprising:
the instruction unit is used for acquiring a picture rendering instruction stream when a game picture is rendered, wherein the picture rendering instruction stream comprises at least one picture rendering instruction which is an instruction for instructing a graphic processor to render the game picture;
The first instruction unit is used for acquiring a mapping relation between a picture rendering instruction and an instruction type, determining the instruction type of the picture rendering instruction based on the mapping relation, wherein the instruction type comprises a first instruction type, and the picture rendering instruction of the first instruction type comprises model rendering data of a game model;
when the picture rendering instruction is of a first instruction type, storing the picture rendering instruction of the first instruction type into a resource manager;
The modification unit is used for modifying the model rendering data of the game model contained in the picture rendering instruction of the first instruction type stored in the resource manager based on the model modification request when receiving a model modification request of a game side developer user for the game model, so as to obtain modified model rendering data;
A replacing unit, configured to replace, in the resource manager, model rendering data of a game model included in the picture rendering instruction of the first instruction type with modified model rendering data of the game model, to obtain a picture rendering instruction of the replaced first instruction type;
And the first sending unit is used for sending the picture rendering instruction of the replaced first instruction type to the client so that the client renders the game model in a game picture according to the picture rendering instruction of the replaced first instruction type.
13. A game screen rendering apparatus, characterized by being adapted to a client, comprising:
The first acquisition unit is used for acquiring a picture rendering instruction of a compressed first instruction type from a resource manager of the server when the server receives a model modification request of a game side developer user for a game model, wherein the picture rendering instruction of the compressed first instruction type comprises a compression shader, compression geometric structure data of the game model and compression texture mapping data; the method comprises the steps that a picture rendering instruction of a first instruction type is compressed in a resource manager, after the picture rendering instruction is determined to be the first instruction type based on the mapping relation between the acquired picture rendering instruction and the instruction type by the server, the picture rendering instruction is stored in the resource manager, and model rendering data of a game model are contained in the picture rendering instruction of the first instruction type;
The first decompression unit is used for performing 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;
A first replacing unit, configured to replace the compressed shader included in the first instruction type picture 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 replaced first instruction type picture rendering instruction;
and the first rendering unit is used for indicating the graphic processor to render the game model in a game picture based on the picture rendering instruction of the replaced first instruction type.
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 in the game screen rendering method according to any one of claims 1 to 11.
15. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the game screen rendering method of 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 CN112316433A (en) 2021-02-05
CN112316433B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113453073B (en) * 2021-06-29 2023-01-06 北京百度网讯科技有限公司 Image rendering method and device, electronic equipment and storage medium
CN114377394B (en) * 2022-01-17 2023-05-05 吉林省磨铁互娱手游研发有限公司 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

Citations (7)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9378582B2 (en) * 2012-07-31 2016-06-28 Siemens Product Lifecycle Management Software Inc. Rendering of design data

Patent Citations (7)

* 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
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

Also Published As

Publication number Publication date
CN112316433A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN112316433B (en) Game picture rendering method, device, server and storage medium
WO2022116759A1 (en) Image rendering method and apparatus, and computer device and storage medium
US11909984B2 (en) Video encoding and decoding for cloud gaming
EP3264370B1 (en) Media content rendering method, user equipment, and system
US7830388B1 (en) Methods and apparatus of sharing graphics data of multiple instances of interactive application
KR101692193B1 (en) Crowd-sourced video rendering system
US20170323418A1 (en) Virtualized gpu in a virtual machine environment
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
CN107729095B (en) Image processing method, virtualization platform and computer-readable storage medium
US8988434B1 (en) Text rendering for browsers and mobile based applications
US9396564B2 (en) Atlas generation based on client video configuration
US20140292803A1 (en) System, method, and computer program product for generating mixed video and three-dimensional data to reduce streaming bandwidth
CN111476851B (en) Image processing method, device, electronic equipment and storage medium
US20240096007A1 (en) Rendering Method, Device, and System
CN108074210B (en) Object acquisition system and method for cloud rendering
WO2023197762A1 (en) Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product
CN113838184A (en) Rendering method, device and system
WO2021249358A1 (en) Rendering method, device and system
US20230343021A1 (en) Visible element determination method and apparatus, storage medium, and electronic device
WO2022033162A1 (en) Model loading method and related apparatus
CN114904274A (en) Picture rendering method and device of cloud game, electronic equipment and storage medium

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