CN105597314B - Rendering system and method of 2D game and terminal equipment - Google Patents

Rendering system and method of 2D game and terminal equipment Download PDF

Info

Publication number
CN105597314B
CN105597314B CN201510728166.XA CN201510728166A CN105597314B CN 105597314 B CN105597314 B CN 105597314B CN 201510728166 A CN201510728166 A CN 201510728166A CN 105597314 B CN105597314 B CN 105597314B
Authority
CN
China
Prior art keywords
rendering
model
frame data
sequence frame
unit
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
CN201510728166.XA
Other languages
Chinese (zh)
Other versions
CN105597314A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201510728166.XA priority Critical patent/CN105597314B/en
Publication of CN105597314A publication Critical patent/CN105597314A/en
Application granted granted Critical
Publication of CN105597314B publication Critical patent/CN105597314B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Abstract

The invention discloses a rendering system of a 2D game, which comprises a 2D rendering unit, a rendering unit and a display unit, wherein the 2D rendering unit is used for loading 2D sequence frame data to be rendered according to a game rendering request and rendering to generate game picture frames sent to user equipment; the sequence frame data sharing unit is used for storing and providing the 2D sequence frame data to be rendered to the 2D rendering unit; the 3D rendering unit is used for rendering a preset 3D model based on a set visual angle to generate the 2D sequence frame data and transmitting the 2D sequence frame data to the sequence frame data sharing unit; and the 3D model resource storage unit is used for storing the 3D model for loading and using by the 3D rendering unit. The invention can generate the 2D sequence frame data locally in real time through the 3D rendering unit without presetting the manually drawn 2D sequence frame data in the game resource packet, thereby reducing the size of the game resource packet and the workload of art and accelerating the development speed of games.

Description

Rendering system and method of 2D game and terminal equipment
Technical Field
The invention relates to the field of game rendering, in particular to a rendering system and method of a 2D game and terminal equipment.
Background
With the popularity of computers and mobile smart machines, gaming has become an increasingly popular form of entertainment. In order to improve the playability of a game and the experience of a player during the operation of the game, it is often necessary to play animation of actions such as walking, running, attacking, and executing of a game character.
For the current 2D game, playing the related animation of the game character is generally realized by playing the corresponding sequence frame animation or skeleton animation. Each frame of the sequence frame animation can be regarded as a snapshot of a specific gesture of the game character, for example, for an animation that the game character walks, the game character can be imagined to walk, the camera is taken up to take pictures for the game character, and the pictures are played continuously to see the animation that the character walks. The fluency and the smoothing effect of the sequence frame animation are both determined by the number of times of photographing in a predetermined time period, i.e. the number of frames. The skeleton animation is the animation produced by binding the body part pictures of each part of the game character to a bone with mutually connected roots and controlling the position, the rotation direction, the magnification and the reduction of the skeleton. It can be imagined that the skeleton of a person is drawn out, corresponding picture blocks are hung on different bones, and the picture blocks bound on the bones are driven to move when the skeleton moves.
Disclosure of Invention
The sequence frame animation has the advantages of simple implementation and high fluency. However, the current sequence frame animation is manually drawn by art, namely, each time an animation is added, a set of sequence frame animation needs to be drawn separately. For example, n game characters need to prepare n × m sets of sequence frame animation resources to ride m ride combinations, and if the combination requirements of weapons, viewing angles and the like are added, the problem of resource combination explosion is faced. Although the resource amount can be reduced by splicing the sequence frame animations, for example, the sequence frame animations of a certain game role riding posture and the sequence frame animations when a ride is ridden are output separately, and splicing is performed in real time according to different rides ridden by different game roles in a game, the required resource amount is still huge, and the scheme still needs art to perform manual drawing, and is not flexible in implementation.
Although the problem of combination explosion of sequence frame animation is solved by combining component pictures, the traditional 2d skeleton animation can only make animation in one direction, cannot meet the requirement of multiple visual angles, and is not as smooth as the sequence frame animation.
The technical problem to be solved by the invention is to provide a rendering system, a rendering method and a rendering terminal for a 2D game, wherein a sequence frame animation with a set visual angle is generated in a real-time rendering mode.
The invention solves the technical problems by the following technical means:
a rendering system for a 2D game, comprising:
a 2D rendering unit for loading 2D sequence frame data to be rendered according to a game rendering request and rendering to generate a game picture frame transmitted to the user equipment,
the sequence frame data sharing unit is used for storing and providing the 2D sequence frame data to be rendered to the 2D rendering unit;
the 3D rendering unit is used for rendering a preset 3D model based on a set visual angle to generate the 2D sequence frame data and transmitting the 2D sequence frame data to the sequence frame data sharing unit;
and the 3D model resource storage unit is used for storing the 3D model for loading and using by the 3D rendering unit.
In the technical scheme provided by the invention, the preset 3D model is rendered through the 3D rendering unit, so that 2D sequence frame data (equivalent to sequence frame animation) with a required visual angle is locally generated in real time, and compared with the existing technology for manually drawing the sequence frame animation, on one hand, all the sequence frame animation are not required to be directly preset in a game resource packet, so that the problems of overlong download waiting time and large occupied storage space caused by overlarge game resource packet are avoided; on the other hand, because the sequence frame animation does not need to be drawn manually, the art workload is reduced, and the game development speed is accelerated. Meanwhile, the 2D rendering unit and the 3D rendering unit are decoupled based on the sequence frame data sharing unit, and under the condition that a plurality of game clients (including the 2D rendering unit) run simultaneously on the same device, each game client can share the 2D sequence frame data in the sequence frame data sharing unit, so that repeated rendering is reduced to the maximum extent.
Preferably, the 3D rendering unit includes: a 3D model resource loading module for loading at least two 3D models from the 3D model resource storage unit; the 3D model hooking module is used for hooking the at least two 3D models to each other according to a preset hooking point in the 3D models to form a target model to be rendered; and the 3D animation rendering module is used for performing 3D rendering based on the target model to obtain a 3D animation and generating the 2D sequence frame data based on the 3D animation and a set visual angle.
According to the optimal scheme, different 3D models are hooked and then rendered to obtain the 3D animation of the target model, and the 2D sequence frame data of the target model are generated based on the 3D animation and the set visual angle, so that the problem of generating the 2D sequence frame data of the combined model is solved.
Preferably, the 3D animation rendering module includes: the rendering submodule is used for performing 3D rendering on the basis of the target model to obtain 3D animation; the hollow processing submodule is used for hollowing out the parts, which are shielded by the 3D models with the layers lower than the self part, in the 3D models of all the layers of the 3D animation based on the preset 3D model layer relation and the set visual angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models; and the layered rendering submodule is used for rendering each hollowed-out 3D model respectively so as to obtain 2D sequence frame data corresponding to each 3D model.
For the previous preferred scheme, the preferred scheme further performs hollowing processing on each 3D model forming the target model according to the relation of the level (the 3D model with the level needs to be hollowed according to the part shielded by the 3D model with the level lower), and obtains 2D sequence frame data corresponding to each 3D model, so that the generated 2D sequence frame data can be multiplexed without rendering again when the 3D model is subsequently increased or decreased or the 3D model is replaced, and a player changes a seat, a weapon, and a head gear, thereby improving the rendering efficiency.
Preferably, the 3D animation rendering module further includes: the bottom layer 2D sequence frame data loading module is used for acquiring 2D sequence frame preset data corresponding to the 3D model at the bottommost layer from preset 2D image resources; and the bottom layer 2D sequence frame data replacing module is used for replacing the 2D sequence frame data corresponding to the 3D model at the bottom layer with the 2D sequence frame preset data.
In view of the above preferred embodiment, in the present preferred embodiment, since the 2D-series frame data corresponding to the 3D model at the lowermost layer does not need to be processed by punching out, the 2D-series frame data corresponding to the 3D model at the lowermost layer can be replaced with the 2D-series frame preset data (i.e., the art-drawn series frame animation), and since the image quality of the art-drawn series frame animation is better than that of the series frame data generated by 3D rendering, the image quality of the game can be improved.
Preferably, the layered rendering submodule is further configured to sequentially render each hollowed-out 3D model according to a level relation of the 3D model to obtain 2D sequence frame data corresponding to each 3D model; wherein the hierarchically higher 3D model will be rendered preferentially.
The invention also provides a rendering method of the 2D game, wherein the rendering method of the 2D game is in one-to-one correspondence with the rendering system, and the rendering method comprises the following steps:
the 2D rendering unit responds to the game rendering request, requests the sequence frame data sharing unit to load 2D sequence frame data to be rendered and renders to generate a game picture frame sent to the user equipment;
the sequence frame data sharing unit responds to the 2D sequence frame data loading request, provides corresponding 2D sequence frame data or requests the 3D rendering unit to render and generate corresponding 2D sequence frame data;
the 3D rendering unit responds to a 2D sequence frame data rendering generation request, requests a 3D model resource storage unit to load a preset 3D model, renders the preset 3D model based on a set visual angle to generate 2D sequence frame data and transmits the 2D sequence frame data to the sequence frame data sharing unit;
the 3D model resource storage unit provides a preset 3D model to the 3D rendering unit in response to a 3D model loading request.
Preferably, the 3D rendering unit, in response to the request for generating the 2D sequence frame data by rendering, requests the 3D model resource storage unit to load a preset 3D model, and generates the 2D sequence frame data by rendering the preset 3D model based on a set viewing angle and transmits the generated 2D sequence frame data to the sequence frame data sharing unit, specifically including:
the 3D rendering unit loads at least two 3D models from the 3D model resource storage unit according to the 2D sequence frame data rendering generation request;
the 3D rendering unit mutually articulates the at least two 3D models according to an articulating point preset in the 3D models to form a target model to be rendered;
and the 3D rendering unit performs 3D rendering based on the target model to obtain 3D animation, and generates the 2D sequence frame data based on the 3D animation and the set visual angle.
Preferably, the 3D rendering unit performs 3D rendering based on the target model to obtain a 3D animation, and generates the 2D sequence frame data based on the 3D animation and a set viewing angle, which specifically includes:
the 3D rendering unit performs 3D rendering based on the target model to obtain 3D animation;
the 3D rendering unit is used for hollowing out the parts, which are shielded by the 3D models with the layers lower than the 3D rendering unit, in the 3D models of the 3D animation in each layer based on the preset 3D model layer relation and the set visual angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models;
and the 3D rendering unit respectively renders each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model.
Preferably, the method further comprises the following steps:
the 3D rendering unit acquires 2D sequence frame preset data corresponding to the 3D model at the bottommost layer from preset 2D image resources;
and replacing the 2D sequence frame data corresponding to the 3D model at the bottommost layer by the 2D sequence frame preset data by the 3D rendering unit.
Preferably, the 3D rendering unit respectively renders each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model, specifically:
the 3D rendering unit sequentially renders each hollowed-out 3D model according to the level relation of the 3D models to obtain 2D sequence frame data corresponding to each 3D model; wherein the hierarchically higher 3D model will be rendered preferentially.
The invention also provides terminal equipment which comprises a 3D rendering system and at least one game client; the 3D rendering system comprises the sequence frame data sharing unit, a 3D rendering unit and a 3D model resource storage unit, and the game client comprises a game processing unit and the 2D rendering unit;
the game processing unit is used for generating a game rendering request;
the 2D rendering unit is used for requesting the 3D rendering system to load 2D sequence frame data to be rendered according to the game rendering request and rendering the data to generate game picture frames;
and the 3D rendering system is used for responding to the game rendering request and providing the 2D sequence frame data to be rendered to the 2D rendering unit.
The terminal equipment provided by the invention realizes the decoupling of the 2D rendering unit and the 3D rendering unit. Under the condition that the same device simultaneously runs a plurality of game clients, each game client can share the 2D sequence frame data in the sequence frame data sharing unit, and repeated rendering is reduced to the maximum extent.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a rendering system of a 2D game according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of the 3D rendering unit shown in fig. 1.
Fig. 3 is a schematic view of a ride model according to an embodiment of the present invention.
FIG. 4 is a schematic diagram of a character model provided by an embodiment of the invention.
FIG. 5 is a schematic view of a ride model and a character model being articulated by an articulation point.
Fig. 6(a) to 6(g) are schematic diagrams of rendering the ride model and the character model in different directions.
Fig. 7 is a schematic structural diagram of the 3D animation rendering module shown in fig. 3.
Fig. 8 is a schematic diagram of the 2D-series frame data of the ride model and the 2D-series frame data of the character model after being hooked.
Fig. 9 is another structural diagram of the 3D animation rendering module shown in fig. 3.
Fig. 10 is a flowchart illustrating a rendering method of a 2D game according to an embodiment of the present invention.
Fig. 11 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Fig. 12 is a schematic structural diagram of the 3D rendering system shown in fig. 11.
Fig. 13 is a schematic configuration diagram of the game client shown in fig. 11.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a rendering system of a 2D game according to an embodiment of the present invention. The rendering system 100 includes a 2D rendering unit 10, a sequential frame data sharing unit 20, a 3D rendering unit 30, and a 3D model resource storage unit 40, wherein:
the 2D rendering unit 10 is configured to load 2D sequence frame data to be rendered according to a game rendering request and render the data to generate a game frame sent to the user equipment.
A sequential frame data sharing unit 20, configured to store and provide the 2D sequential frame data to be rendered to the 2D rendering unit 10.
And a 3D rendering unit 30, configured to render a preset 3D model based on a set viewing angle to generate the 2D sequence frame data and transmit the 2D sequence frame data to the sequence frame data sharing unit.
A 3D model resource storage unit 40, configured to store the 3D model for loading and use by the 3D rendering unit 30.
Specifically, in the embodiment of the present invention, the 2D rendering unit 10 may be configured to render the 2D sequence frame data to generate game frame data, and the game frame data may be displayed on a display screen of the user equipment.
In the embodiment of the invention, during the game, animation of the game character walking, running, attacking or executing, and the like is required to be played frequently. At this time, the game client may issue a game rendering request to the 2D rendering unit 10 according to the game running logic or the operation of the user, where the game rendering request may include an identifier of 2D sequence frame data to be rendered. After receiving the game rendering request, the 2D rendering unit 10 requests the sequence frame data sharing unit 20 to obtain corresponding 2D sequence frame data to be rendered according to the game rendering request.
In the embodiment of the present invention, after receiving the request of the 2D rendering unit 10, the sequence frame data sharing unit 20 queries whether the required 2D sequence frame data to be rendered is stored, and if so, the sequence frame data sharing unit 20 directly provides the 2D sequence frame data to be rendered to the 2D rendering unit 10; if not, the serial frame data sharing unit 20 may put the received game rendering request into a request queue.
In this embodiment of the present invention, the 3D rendering unit 30 may periodically check the request queue of the sequence frame data sharing unit 20, when the request queue is not empty, the 3D rendering unit 30 extracts a game rendering request located at the head of the request queue, requests the 3D model resource storage unit 40 to load a preset 3D model according to the game rendering request, and sends 2D sequence frame data to the sequence frame data sharing unit 20 after rendering the preset 3D model to generate the 2D sequence frame data based on a viewing angle set by the game rendering request, and the sequence frame data sharing unit 20 stores the 2D sequence frame data.
In this embodiment of the present invention, the 2D rendering unit 10 may detect whether the game rendering request is completed every predetermined time, so as to obtain the required 2D sequence frame data from the sequence frame data sharing unit 20, and perform rendering according to the 2D sequence frame data to generate a game frame sent to the user equipment.
It should be noted that, in order to prevent the serial frame data sharing unit 20 from storing too many 2D serial frame data and occupying the storage space, the serial frame data sharing unit 20 may also eliminate the less 2D serial frame data through a certain elimination strategy, such as a least Recently Used algorithm (L east received Used, L RU).
In summary, in the rendering system 100 for a 2D game provided in the embodiment of the present invention, the 3D rendering unit 30 directly loads a preset 3D model from the 3D model resource storage unit 40 according to a game rendering request, generates 2D sequence frame data to be rendered, and then sends the 2D sequence frame data to the sequence frame data sharing unit 20. The 2D rendering unit 10 further obtains the required 2D sequence frame data to be rendered from the sequence frame data sharing unit 20 to generate a game frame to be sent to the user equipment. Compared with the prior art, the rendering system 100 provided by the embodiment of the present invention has the advantages that 2D sequence frame data is generated by rendering in real time by the 3D rendering unit 30 (or generated by rendering by the 3D rendering unit 30 and stored in the sequence frame data sharing unit 20), on one hand, since the sequence frame data does not need to be directly preset in the game resource package, the problems of long download waiting time and too large storage space of the user equipment due to too large game resource package are avoided; on the other hand, because the sequence frame animation does not need to be drawn manually, the art workload is reduced, and the game development speed is accelerated.
In addition, the embodiment of the present invention further realizes decoupling between the 2D rendering unit 10 and the 3D rendering unit 30 based on the sequence frame data sharing unit 20. Specifically, for a 2D game in which a plurality of game clients (each game client includes one 2D rendering unit 10) can be simultaneously run on the same device, the 2D rendering units 10 of the respective game clients can share the 2D sequence frame data in the sequence frame data sharing unit 20, thereby maximally reducing repetitive rendering.
To further illustrate the aspects of the present invention in more detail, some preferred embodiments of the invention are specifically described or exemplified below:
first, a preferred embodiment of the 3D rendering unit 30 is directed.
In the embodiment of the present invention, although the above technical solution solves how to directly generate the required 2D sequence frame data to be rendered by using the 3D rendering unit 30, for a 2D game, a game character model is often formed by combining a plurality of models, for example, for a game character model, a riding model, a clothing model, an equipment model, and the like, and thus it is necessary to discuss how to obtain the corresponding 2D sequence frame data by rendering the combined model by using the 3D rendering unit 30.
Specifically, referring to fig. 2, in a preferred embodiment of the present invention, the 3D rendering unit 30 includes:
a 3D model resource loading module 31, configured to load at least two 3D models from the 3D model resource storage unit 40.
And the 3D model hooking module 32 is used for hooking the at least two 3D models to each other according to a preset hooking point in the 3D models so as to form a target model to be rendered.
And a 3D animation rendering module 33, configured to perform 3D rendering based on the target model to obtain a 3D animation, and generate the 2D sequence frame data based on the 3D animation and a set viewing angle.
In an embodiment of the present invention, the game rendering request stored in the message queue of the sequence frame data sharing unit 20 may include names, actions, and perspectives of at least two 3D models, wherein each 3D model is preset with at least one suspension point. The 3D model resource loading module 31 may load at least two corresponding 3D models from the 3D model resource storage unit 40 according to names and actions of the at least two 3D models, and the 3D model hooking module 32 hooks the at least two 3D models to each other according to a hooking point preset in the 3D models to form a target model to be rendered. Finally, the 3D animation rendering module 33 performs 3D rendering on the target model to obtain a 3D animation, and generates the 2D sequence frame data based on the 3D animation and a set viewing angle.
For example, as shown in fig. 3 and 4, the at least two 3D models are a ride model and a character model, respectively, and the rendering generation request may include a name of the ride model (e.g., flying horse), an action (walk), a name of the character model (e.g., XX), and an action (ride _ use _ 2). At this time, after extracting the game rendering request, the 3D model resource loading module 31 reads the character model with a name of a horse flight, a motion of walk, and a name of XX, and a motion of ride _ user _2 from the 3D model resource storage unit 40.
In an embodiment of the present invention, the at least two 3D models respectively include at least one hooking point (sk _ edge _0 in fig. 3 and sk _ edge _0 in fig. 4), and the 3D model hooking module 32 hooks the at least two 3D models to each other according to a preset hooking point in the 3D models to form an object model to be rendered (as shown in fig. 5). When hooking, the 3D model hooking module 32 makes the coordinates of different 3D models having the same hooking point coincide. It should be understood that fig. 5 only shows the hooking of two 3D models, and in fact, hooking of more models can be implemented. For example, a weapon model may be added on the basis of fig. 5, and at this time, there is also one hanging point (for example, may be marked as sk _ edge _1) on the weapon model and the character model, and during the combination, only the coordinates of the same hanging point on different models need to be overlapped, which is not described herein again.
Referring to fig. 6(a) to 6(g), in an embodiment of the present invention, the 3D animation rendering module 33 simultaneously plays the walk motion of the flying horse model and the ride _ user _2 motion of the character model, and then generates the required 2D sequence frame data according to the set viewing angle, and it is conceivable that, during the animation playing process, the 3D animation rendering module 33 takes a picture of the moving target model in real time at the set viewing angle to obtain the 2D sequence frame data.
In the preferred embodiment, the 3D animation of the target model is obtained by hooking different 3D models by the 3D model hooking module 32 and then rendering by the 3D animation rendering module 33, and the 2D sequence frame data of the target model is generated based on the 3D animation and the set viewing angle, so that the problem of generating the 2D sequence frame data of the combined model is solved.
Second, the preferred embodiment of the 3D animation rendering module 33 is directed.
Although the above-described first preferred embodiment addresses the rendering of a combined model, it is normally desirable for a 2D game to replace or add or subtract a ride model, a clothing model, a weapon model, or even a character model. If the 3D model needs to be rendered again to generate a set of corresponding sequence frame data every time the 3D model is replaced or added or subtracted, the overall rendering efficiency is inevitably affected, and the operation burden of the 3D rendering unit 30 is increased.
Referring to fig. 7, in order to solve the problem of repeated rendering, in a preferred embodiment of the present invention, the 3D animation rendering module 33 includes:
and the rendering submodule 331 is configured to perform 3D rendering based on the target model to obtain a 3D animation.
The hollowing processing submodule 332 is configured to perform hollowing processing on a part, which is shielded by a 3D model with a layer lower than the layer, in the 3D model of each layer of the 3D animation based on a preset 3D model layer relationship and the set viewing angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models.
And the layered rendering submodule 333 is configured to respectively render each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model.
In the embodiment of the invention, a target model is rendered by adopting a layered rendering method. For example, assuming that the initial object model is a person model riding a riding model, at this time, the rendering sub-module 331 first performs 3D rendering based on the initial object model to obtain a 3D animation. Then, the hollowing processing submodule 332 hollows out a part, which is shielded by a 3D model with a layer lower than the self layer, in the 3D model of each layer of the 3D animation based on a preset 3D model layer relationship and the set view angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models. Here, the level of the seating model is lower than the level of the character model, so the character model needs to be hollowed out of the portion shielded by the seating model (as shown in fig. 8, during rendering, the character model needs to be hollowed out according to the seating model during rendering, that is, the right foot of the character model should not be rendered, otherwise, the right foot of the character model covers the seating model during hooking). Finally, the layered rendering submodule 333 respectively renders each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model, that is, 2D sequence frame data of a seating model and 2D sequence frame data of a character model that has been hollowed-out are respectively obtained.
In the embodiment of the present invention, the generated 2D sequence frame data may be stored in the sequence frame data sharing unit 20. When a hat model needs to be added on the basis of the initial target model (assuming that the level of the hat model is higher than that of the character model), at this time, only 2D sequence frame data of the hat model needs to be regenerated (the hat model needs to perform hollow processing on the part shielded by the character model), and the existing 2D sequence frame data of the sitting and riding model and the 2D sequence frame data of the character model which is subjected to hollow processing do not need to be generated through repeated rendering.
When the model needs to be replaced, if the character model needs to be replaced, the hollow-out and shielding relations between different 3D models need to be considered again, so that the 2D sequence frame data of the character model and the 2D sequence frame data of the hat model need to be rendered again at the same time, and the 2D sequence frame data of the sitting model at the bottommost layer can still be reused.
In the preferred embodiment, the hollowing processing submodule 332 is used to hollow out the 3D models at each level, and the layered rendering submodule 333 is used to respectively render each hollowed 3D model so as to obtain 2D sequence frame data corresponding to each 3D model. Therefore, in the actual use process, the 2D sequence frame data corresponding to each 3D model can be multiplexed according to actual scenes and requirements, repeated rendering is avoided, and rendering efficiency is improved.
It should be noted that, for the second preferred embodiment, when rendering each 3D model after the hollowing processing to obtain 2D sequence frame data corresponding to each 3D model, the hierarchical rendering sub-module 333 may preferentially render and generate 2D sequence frame data of a 3D model with a higher hierarchy, and first send the 2D sequence frame data to the sequence frame data sharing unit 20. The request process of the 2D rendering unit 10 is performed asynchronously, and the data requested by the sequential frame data sharing unit 20 is the 2D sequential frame data corresponding to the 3D model of each level, not the entire 2D sequential frame data of the target model. Different levels have different priorities, for example, the level of the character model is higher than the level of the clothes model and the weapon model, and when a player just enters a scene with a large number of other players, the player can see that other characters appear first and then see clothes, weapons and the like. Therefore, the long waiting time possibly brought by loading the animation at one time can be avoided, and the experience of the player is prevented from being influenced.
And thirdly, aiming at the optimal embodiment of the bottom-most layer 3D model.
As can be seen from the second preferred embodiment, the 3D model at the bottom layer does not need to be hollowed out. Since the 2D sequence frame data rendered in real time by the 3D rendering unit 30 is not as good as a sequence frame animation (hereinafter, referred to as 2D sequence frame preset data) drawn by hand in terms of data reading efficiency and quality of image, it is conceivable to replace the 2D sequence frame data of the 3D model at the bottom layer with the 2D sequence frame preset data.
Referring to fig. 9, in particular, in the embodiment of the present invention, the 3D animation rendering module 33 further includes:
and the bottom layer 2D sequence frame data loading module 334 is configured to obtain preset 2D sequence frame data corresponding to the 3D model at the bottom layer from preset 2D image resources.
And a bottom layer 2D sequence frame data replacing module 335, configured to replace the 2D sequence frame data corresponding to the 3D model at the bottom layer with the 2D sequence frame preset data.
The 2D image resource is preset data of 2D sequence frames manually drawn by art. For example, for a 2D game including a ride system, the ride model is the bottommost model, and thus the 2D image resource only needs to store the 2D sequence frame preset data of the ride model at different viewing angles. Although manual drawing by art is still needed, as only the preset data of the 2D sequence frame corresponding to the 3D model at the bottom layer needs to be drawn, the work load of art and the data load of resources are not too large, and compared with the improvement of the whole image quality and the data reading efficiency of the game, the replacement operation can still bring better game experience to the player.
Referring to fig. 10, fig. 10 is a flowchart illustrating a rendering method of a 2D game according to an embodiment of the present invention. The rendering method of the 2D game comprises the following steps:
s101, the 2D rendering unit responds to a game rendering request, requests the sequence frame data sharing unit to load 2D sequence frame data to be rendered and renders and generates a game picture frame sent to the user equipment.
And S102, the sequence frame data sharing unit provides corresponding 2D sequence frame data or requests the 3D rendering unit to generate corresponding 2D sequence frame data in response to the 2D sequence frame data loading request.
And S103, the 3D rendering unit responds to the 2D sequence frame data rendering generation request, requests the 3D model resource storage unit to load a preset 3D model, renders the preset 3D model based on a set visual angle to generate 2D sequence frame data and transmits the 2D sequence frame data to the sequence frame data sharing unit.
And S104, the 3D model resource storage unit responds to the 3D model loading request and provides a preset 3D model for the 3D rendering unit.
In summary, in the rendering method for the 2D game provided by the embodiment of the present invention, the 3D rendering unit directly loads the preset 3D model from the 3D model resource storage unit according to the rendering generation request, generates the 2D sequence frame data to be rendered, and then sends the 2D sequence frame data to the sequence frame data sharing unit. And the 2D rendering unit acquires the required 2D sequence frame data to be rendered from the sequence frame data sharing unit to generate a game picture frame sent to the user equipment. Compared with the prior art, the rendering method provided by the embodiment of the invention has the advantages that 2D sequence frame data is generated by the 3D rendering unit in a real-time rendering manner (or generated by the 3D rendering unit in a rendering manner and stored in the sequence frame data sharing unit), on one hand, the sequence frame data does not need to be directly preset in the game resource packet, so that the problems of long downloading waiting time and large occupied storage space caused by overlarge game resource packet are avoided; on the other hand, because the sequence frame animation does not need to be drawn manually, the art workload is reduced, and the game development speed is accelerated.
In a preferred embodiment, step S103 specifically includes:
and S1031, the 3D rendering unit loads at least two 3D models from the 3D model resource storage unit according to the 2D sequence frame data rendering generation request.
S1032, the 3D rendering unit articulates the at least two 3D models to each other according to an articulating point preset in the 3D models to form a target model to be rendered.
And S1033, the 3D rendering unit performs 3D rendering based on the target model to obtain a 3D animation, and generates the 2D sequence frame data based on the 3D animation and a set visual angle.
In the preferred embodiment, the 3D rendering unit articulates different 3D models and renders the models to obtain the 3D animation of the target model, and generates the 2D sequence frame data of the target model based on the 3D animation and the set viewing angle, thereby solving the problem of generating the 2D sequence frame data of the combined model.
In a preferred embodiment, step S1033 specifically includes:
s10331, the 3D rendering unit performs 3D rendering based on the target model to obtain a 3D animation.
S10332, the 3D rendering unit hollows out a part, which is shielded by a 3D model with a layer lower than the 3D rendering unit, in the 3D model of each layer of the 3D animation based on a preset 3D model layer relation and the set visual angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models.
S10333, the 3D rendering unit renders each hollowed-out 3D model respectively to obtain 2D sequence frame data corresponding to each 3D model.
In this preferred embodiment, the 3D rendering unit performs hollowing processing on the 3D models of each layer, and then renders each hollowed 3D model to obtain 2D sequence frame data corresponding to each 3D model. Therefore, in the actual use process, the 2D sequence frame data corresponding to each 3D model can be multiplexed according to actual scenes and requirements, repeated rendering is avoided, and rendering efficiency is improved.
It should be noted that, in the preferred embodiment, step S10333 specifically includes: the 3D rendering unit sequentially renders each hollowed-out 3D model according to the level relation of the 3D models to obtain 2D sequence frame data corresponding to each 3D model; wherein the hierarchically higher 3D model will be rendered preferentially.
Specifically, when the 3D rendering unit respectively renders each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model, the 3D rendering unit may preferentially render and generate 2D sequence frame data of a 3D model with a high hierarchy, and first send the 2D sequence frame data to the sequence frame data sharing unit. The request process of the 2D rendering unit is performed asynchronously, and the data requested by the sequence frame data sharing unit is 2D sequence frame data corresponding to the 3D model of each level, not the overall 2D sequence frame data of the target model. Different levels have different priorities, for example, the level of the character model is higher than the level of the clothes model and the weapon model, and when a player just enters a scene with a large number of other players, the player can see that other characters appear first and then see clothes, weapons and the like. Therefore, the long waiting time possibly brought by loading the animation at one time can be avoided, and the experience of the player is prevented from being influenced.
In a preferred embodiment, after step S10333, the method further includes:
the 3D rendering unit acquires 2D sequence frame preset data corresponding to the 3D model at the bottommost layer from preset 2D image resources.
And replacing the 2D sequence frame data corresponding to the 3D model at the bottommost layer by the 2D sequence frame preset data by the 3D rendering unit.
In this preferred embodiment, the 2D image resource is preset data of a 2D sequence frame manually drawn by art. For example, for a 2D game including a ride system, the ride model is the bottommost model, and thus the 2D image resource only needs to store the 2D sequence frame preset data of the ride model at different viewing angles. Although drawing still needs art manual drawing, the 2D sequence frame preset data corresponding to the 3D model of the bottom layer only needs to be drawn, the art workload and the resource data volume are not too large, and compared with the improvement of the whole image quality and the data reading efficiency of the game, the replacement operation can bring better game experience to the player.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. The terminal device 1000 includes a 3D rendering system 200 and at least one game client 300. Referring to fig. 12 and 13, the 3D rendering system 200 includes the sequential frame data sharing unit 20, the 3D rendering unit 30 and the 3D model resource storage unit 40 according to any of the above embodiments, and the game client 300 includes the game processing unit 310 and the 2D rendering unit 10 according to any of the above embodiments;
the game processing unit 310 is configured to generate a game rendering request.
The 2D rendering unit 10 is configured to request the 3D rendering system 200 to load 2D sequence frame data to be rendered according to the game rendering request and render the 2D sequence frame data to generate a game frame.
The 3D rendering system 200 is configured to respond to the game rendering request and provide the 2D sequence frame data to be rendered to the 2D rendering unit 10.
The terminal device 1000 provided by the invention realizes the decoupling of the 2D rendering unit 10 and the 3D rendering unit 30 (or the 3D rendering system 200), and is suitable for 2D games which can run a plurality of game clients on one device at the same time. The 2D rendering unit 10 in any game client 300 may initiate a game rendering request to the sequence frame data sharing unit 20 of the 3D rendering system 200 to obtain corresponding 2D sequence frame data to be rendered, that is, each game client 300 may share the 2D sequence frame data in the sequence frame data sharing unit 20, so that repeated rendering may be maximally reduced, and rendering efficiency is improved.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.

Claims (7)

1. A rendering system of a 2D game comprises a 2D rendering unit, which is used for loading 2D sequence frame data to be rendered according to a game rendering request and rendering the data to generate game picture frames sent to user equipment, and is characterized by further comprising:
the sequence frame data sharing unit is used for storing and providing the 2D sequence frame data to be rendered to the 2D rendering unit;
the 3D rendering unit is used for rendering a preset 3D model based on a set visual angle to generate the 2D sequence frame data and transmitting the 2D sequence frame data to the sequence frame data sharing unit;
a 3D model resource storage unit for storing the 3D model for loading and using by the 3D rendering unit;
wherein the 3D rendering unit includes:
a 3D model resource loading module for loading at least two 3D models from the 3D model resource storage unit;
the 3D model hooking module is used for hooking the at least two 3D models to each other according to a preset hooking point in the 3D models to form a target model to be rendered;
the 3D animation rendering module is used for performing 3D rendering based on the target model to obtain a 3D animation and generating the 2D sequence frame data based on the 3D animation and a set visual angle;
and, the 3D animation rendering module includes:
the rendering submodule is used for performing 3D rendering on the basis of the target model to obtain 3D animation;
the hollow processing submodule is used for hollowing out the parts, which are shielded by the 3D models with the layers lower than the self part, in the 3D models of all the layers of the 3D animation based on the preset 3D model layer relation and the set visual angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models;
and the layered rendering submodule is used for rendering each hollowed-out 3D model respectively so as to obtain 2D sequence frame data corresponding to each 3D model.
2. The rendering system of claim 1, wherein the 3D animation rendering module further comprises:
the bottom layer 2D sequence frame data loading module is used for acquiring 2D sequence frame preset data corresponding to the 3D model at the bottommost layer from preset 2D image resources;
and the bottom layer 2D sequence frame data replacing module is used for replacing the 2D sequence frame data corresponding to the 3D model at the bottom layer with the 2D sequence frame preset data.
3. The rendering system of claim 1,
the layered rendering submodule is further used for rendering each hollowed-out 3D model in sequence according to the level relation of the 3D model to obtain 2D sequence frame data corresponding to each 3D model; wherein the hierarchically higher 3D model will be rendered preferentially.
4. A rendering method for a 2D game, comprising the steps of:
the 2D rendering unit responds to the game rendering request, requests the sequence frame data sharing unit to load 2D sequence frame data to be rendered and renders to generate a game picture frame sent to the user equipment;
the sequence frame data sharing unit responds to the 2D sequence frame data loading request, provides corresponding 2D sequence frame data or requests the 3D rendering unit to render and generate corresponding 2D sequence frame data;
the 3D rendering unit responds to a 2D sequence frame data rendering generation request, requests a 3D model resource storage unit to load a preset 3D model, renders the preset 3D model based on a set visual angle to generate 2D sequence frame data and transmits the 2D sequence frame data to the sequence frame data sharing unit;
the 3D model resource storage unit responds to a 3D model loading request and provides a preset 3D model for the 3D rendering unit;
the method includes that the 3D rendering unit requests a 3D model resource storage unit to load a preset 3D model in response to a 2D sequence frame data rendering generation request, and renders the preset 3D model to generate 2D sequence frame data based on a set viewing angle and transmits the 2D sequence frame data to the sequence frame data sharing unit, and specifically includes:
the 3D rendering unit loads at least two 3D models from the 3D model resource storage unit according to the 2D sequence frame data rendering generation request;
the 3D rendering unit mutually articulates the at least two 3D models according to an articulating point preset in the 3D models to form a target model to be rendered;
the 3D rendering unit performs 3D rendering based on the target model to obtain 3D animation, and generates the 2D sequence frame data based on the 3D animation and a set visual angle;
and the 3D rendering unit performs 3D rendering based on the target model to obtain a 3D animation, and generates the 2D sequence frame data based on the 3D animation and a set viewing angle, which specifically includes:
the 3D rendering unit performs 3D rendering based on the target model to obtain 3D animation;
the 3D rendering unit is used for hollowing out the parts, which are shielded by the 3D models with the layers lower than the 3D rendering unit, in the 3D models of the 3D animation in each layer based on the preset 3D model layer relation and the set visual angle; the 3D model hierarchy is a relation file for describing the levels of the 3D models;
and the 3D rendering unit respectively renders each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model.
5. The rendering method according to claim 4, wherein after the 3D rendering unit respectively renders each 3D model after the hollowing processing to obtain 2D sequence frame data corresponding to each 3D model, the rendering method further comprises:
the 3D rendering unit acquires 2D sequence frame preset data corresponding to the 3D model at the bottommost layer from preset 2D image resources;
and the 3D rendering unit replaces the 2D sequence frame data corresponding to the 3D model at the bottommost layer with the 2D sequence frame preset data.
6. The rendering method according to claim 4, wherein the 3D rendering unit respectively renders each hollowed-out 3D model to obtain 2D sequence frame data corresponding to each 3D model, specifically:
the 3D rendering unit sequentially renders each hollowed-out 3D model according to the level relation of the 3D models to obtain 2D sequence frame data corresponding to each 3D model; wherein the hierarchically higher 3D model will be rendered preferentially.
7. A terminal device is characterized by comprising a 3D rendering system and at least one game client; wherein the 3D rendering system comprises the sequential frame data sharing unit, the 3D rendering unit and the 3D model resource storage unit according to any one of claims 1 to 3, and the game client comprises the game processing unit and the 2D rendering unit according to any one of claims 1 to 5;
the game processing unit is used for generating a game rendering request;
the 2D rendering unit is used for requesting the 3D rendering system to load 2D sequence frame data to be rendered according to the game rendering request and rendering the data to generate game picture frames;
and the 3D rendering system is used for responding to the game rendering request and providing the 2D sequence frame data to be rendered to the 2D rendering unit.
CN201510728166.XA 2015-10-29 2015-10-29 Rendering system and method of 2D game and terminal equipment Active CN105597314B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510728166.XA CN105597314B (en) 2015-10-29 2015-10-29 Rendering system and method of 2D game and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510728166.XA CN105597314B (en) 2015-10-29 2015-10-29 Rendering system and method of 2D game and terminal equipment

Publications (2)

Publication Number Publication Date
CN105597314A CN105597314A (en) 2016-05-25
CN105597314B true CN105597314B (en) 2020-07-10

Family

ID=55978001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510728166.XA Active CN105597314B (en) 2015-10-29 2015-10-29 Rendering system and method of 2D game and terminal equipment

Country Status (1)

Country Link
CN (1) CN105597314B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108404414B (en) * 2018-03-26 2021-09-24 网易(杭州)网络有限公司 Picture fusion method and device, storage medium, processor and terminal
CN110223367B (en) * 2018-11-30 2023-01-06 腾讯科技(深圳)有限公司 Animation display method, device, terminal and storage medium
CN111481926A (en) * 2019-01-25 2020-08-04 上海察亚软件有限公司 Game character face rendering and processing system
CN110124316B (en) * 2019-05-15 2022-07-12 网易(杭州)网络有限公司 Method and device for processing special effects in game, electronic equipment and storage medium
CN111111176B (en) * 2019-12-18 2023-11-14 北京像素软件科技股份有限公司 Method and device for managing object LOD in game and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592315A (en) * 2011-01-12 2012-07-18 上海库达数字信息技术有限公司 3D rendering platform based on GPU cloud cluster
CN102982577A (en) * 2011-06-14 2013-03-20 三星电子株式会社 Image processing apparatus and method
CN103559730A (en) * 2013-11-20 2014-02-05 广州博冠信息科技有限公司 Rendering method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592315A (en) * 2011-01-12 2012-07-18 上海库达数字信息技术有限公司 3D rendering platform based on GPU cloud cluster
CN102982577A (en) * 2011-06-14 2013-03-20 三星电子株式会社 Image processing apparatus and method
CN103559730A (en) * 2013-11-20 2014-02-05 广州博冠信息科技有限公司 Rendering method and device

Also Published As

Publication number Publication date
CN105597314A (en) 2016-05-25

Similar Documents

Publication Publication Date Title
CN105597314B (en) Rendering system and method of 2D game and terminal equipment
TWI608856B (en) Information processing apparatus, rendering apparatus, method and program
JP6310073B2 (en) Drawing system, control method, and storage medium
CN108619720B (en) Animation playing method and device, storage medium and electronic device
US9665334B2 (en) Rendering system, rendering server, control method thereof, program, and recording medium
CN111641844B (en) Live broadcast interaction method and device, live broadcast system and electronic equipment
US9839844B2 (en) Sprite strip renderer
EP3760287A1 (en) Method and device for generating video frames
US10137376B2 (en) System and method for creating and streaming augmented game sessions
JP5952406B2 (en) Video game device having remote drawing capability
CN111767503A (en) Game data processing method and device, computer and readable storage medium
US11724191B2 (en) Network-based video game editing and modification distribution system
CN106163624A (en) It is particularly useful for the Video coding based on area-of-interest using prompting of video-game
JP6379107B2 (en) Information processing apparatus, control method therefor, and program
US20160271495A1 (en) Method and system of creating and encoding video game screen images for transmission over a network
EP4180945A1 (en) Graphics rendering
JP7360366B2 (en) Virtual viewpoint video rendering device, method and program
CA2798066A1 (en) Method and system of creating and encoding video game screen images for transmission over a network
CA2798934A1 (en) Video gaming device with remote rendering capability
CN116939297A (en) Dynamic capturing equipment data unified driving method and system
WO2014108214A1 (en) Client-server system for a web-based furniture shop
CN115253299A (en) Rendering method and device, computer equipment and storage medium
Rojas Immersive “Playthrough” system for 3D video games

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant