Frame rendering method, device, storage medium and computer equipment

Through the frame rendering method, the collection of models to be rendered is obtained and combined with the target frame and the cache pool camera is solved, and the smoothness and rendering efficiency of the game screen are improved.

CN116030175BActive Publication Date: 2025-08-26GUANGDONG Q-DAZZLE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310011917.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-05
Publication Date
2025-08-26
Estimated Expiration
2043-01-05

AI Technical Summary

Technical Problem

In the website and applet environment, due to the lack of support for multi-threading and GPU, the CPU's single-core performance bottleneck is caused, and the smoothness of the game screen is difficult to meet expectations, affecting the user experience.

Method used

The frame-by-frame rendering method is adopted, and the target frame and target model collection are determined by obtaining the set of models to be rendered, and the target frame is rendered using the target cache pool and a virtual camera. The rendering data of the target frame is generated by combining the data from the previous frame and written to the default camera cache.

Benefits of technology

Reduce rendering workload, reduce CPU pressure, improve rendering efficiency, while not reducing the number of visible models, and improving the smoothness of the game screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116030175B_ABST
    Figure CN116030175B_ABST
Patent Text Reader

Abstract

The frame rendering method, device, storage medium and computer equipment provided by the present application obtain a set of all models to be rendered in this frame rendering as a set of models to be rendered; determine the target frame that needs to be rendered currently; determine the target model set corresponding to the target frame from the set of models to be rendered based on the frame number of the target frame; determine the target cache pool and the target virtual camera based on the frame number of the target frame; if the target frame is not the first frame, render the models to be rendered in the target model set corresponding to the target frame based on the target virtual camera, obtain target data, and write the target data into the target cache pool; obtain the rendering data of the target frame based on the data in the target cache pool and the data in the target cache pool corresponding to the previous frame; and write the rendering data of the target frame into the cache of the set default camera. While reducing the rendering workload, the visible number of models is not reduced, thereby improving the rendering efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional rendering technology, and in particular to a frame rendering method, device, storage medium and computer equipment. Background Art

[0002] In the process of making games in Unity, the rendering of 3D games takes up a lot of CPU (central processing unit) resources. In order to reduce the pressure on the CPU, GPU (graphics processing unit) is usually used for general calculations other than rendering.

[0003] However, in the environment of websites and mini-programs, due to the lack of support for multi-threading and GPU, bottlenecks are very likely to occur in the single-core performance of the CPU. In order to ensure the normal operation of the game, the standard of art resources can usually only be lowered, resulting in the smoothness of the game screen being difficult to meet expectations, affecting the user's gaming experience. Summary of the Invention

[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defects in the existing technology that, in order to enable the game to run normally in the environment of websites and mini-programs, the standard of art resources can usually only be lowered, resulting in the smoothness of the game screen being difficult to meet expectations, affecting the user's gaming experience.

[0005] In a first aspect, the present application provides a frame rendering method, the method comprising:

[0006] Obtain a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering;

[0007] Determine the target frame that needs to be rendered currently;

[0008] According to the frame number of the target frame, determining a target model set corresponding to the target frame from the set of models to be rendered; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set;

[0009] Determining a target buffer pool and a target virtual camera according to the number of the target frame; wherein, when writing data into the target buffer pool, the data already existing in the target buffer pool will be overwritten;

[0010] If the target frame is not the first frame, rendering the to-be-rendered model in the target model set corresponding to the target frame based on the target virtual camera to obtain target data, and writing the target data into the target buffer pool;

[0011] Obtaining rendering data of the target frame based on the data in the target buffer pool and the data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same to-be-rendered model, and a union of the two is equal to the to-be-rendered model set;

[0012] The rendering data of the target frame is written into the cache of the set default camera; wherein the rendering data of the target frame is used to be displayed as the final image of the target frame.

[0013] In one embodiment, the method further comprises:

[0014] If the target frame is the first frame, the model to be rendered in the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target buffer pool.

[0015] In one embodiment, determining the target model set corresponding to the target frame from the set of models to be rendered according to the frame number of the target frame includes:

[0016] Dividing the set of models to be rendered into a first model subset and a second model subset;

[0017] Determining whether the frame number of the target frame is an odd number;

[0018] If the number of the target frames is an odd number, the first model subset is determined as the target model set.

[0019] In one embodiment, determining a target model set corresponding to the target frame from the set of models to be rendered according to the frame number of the target frame further includes:

[0020] If the number of the target frames is an even number, the second model subset is determined as the target model set.

[0021] In one embodiment, determining the target buffer pool and the target virtual camera according to the number of the target frame includes:

[0022] Determining whether the frame number of the target frame is an odd number;

[0023] If the number of the target frame is an odd number, the set first buffer pool is determined as the target buffer pool and the set first virtual camera is determined as the target virtual camera.

[0024] In one embodiment, determining the target buffer pool and the target virtual camera according to the number of the target frame further includes:

[0025] If the number of the target frame is an even number, the set second buffer pool is determined as the target buffer pool and the set second virtual camera is determined as the target virtual camera.

[0026] In one embodiment, rendering the to-be-rendered model in the target model set corresponding to the target frame to obtain target data includes:

[0027] After completing the rendering of the to-be-rendered model in the target model set corresponding to the target frame, recording the depth of the to-be-rendered model and generating depth buffer data;

[0028] Recording the color of the model to be rendered and generating color cache data;

[0029] According to the depth buffer data and the color buffer data, target data corresponding to the to-be-rendered model in the target model set corresponding to the target frame is obtained.

[0030] In a second aspect, the present application provides a frame rendering device, the device comprising:

[0031] An acquisition module is used to acquire a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering;

[0032] The target frame determination module is used to determine the target frame that needs to be rendered currently;

[0033] A first determining module is configured to determine, based on the number of the target frame, a target model set corresponding to the target frame from the set of models to be rendered; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set;

[0034] A second determining module is configured to determine a target buffer pool and a target virtual camera according to the number of frames of the target frame; wherein when writing data into the target buffer pool, the data already existing in the target buffer pool will be overwritten;

[0035] a first rendering module configured to render, based on the target virtual camera, a model to be rendered in a target model set corresponding to the target frame if the target frame is not the first frame, to obtain target data, and write the target data into the target buffer pool;

[0036] a rendering data acquisition module, configured to obtain rendering data of the target frame based on the data in the target buffer pool and the data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same to-be-rendered model, and the union of the two is equal to the to-be-rendered model set;

[0037] The display module is used to write the rendering data of the target frame into the cache of the set default camera; wherein the rendering data of the target frame is used to be displayed as the final image of the target frame.

[0038] In a third aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the frame rendering method described in any of the above embodiments.

[0039] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0040] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the frame rendering method described in any one of the above embodiments are performed.

[0041] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0042] The frame rendering method, device, storage medium and computer equipment provided by the present application obtain a set of all models to be rendered in this frame rendering as a set of models to be rendered; determine the target frame that needs to be rendered currently; determine the target model set corresponding to the target frame from the set of models to be rendered according to the frame number of the target frame; wherein the target model set is a true subset of the set of models to be rendered and is not an empty set; that is, for each frame rendering, not all the models to be rendered in the set of models to be rendered are rendered, but a part of the models to be rendered in the set of models to be rendered is rendered, which can reduce the rendering workload and reduce the CPU pressure, and then determine the target cache pool and the target virtual camera according to the frame number of the target frame; wherein, when writing data in the target cache pool, the data already existing in the target cache pool will be overwritten According to; if the target frame is not the first frame, then based on the target virtual camera, the model to be rendered in the target model set corresponding to the target frame is rendered to obtain target data, and the target data is written into the target cache pool; based on the data in the target cache pool and the data in the target cache pool corresponding to the previous frame, the rendering data of the target frame is obtained; wherein, the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same model to be rendered, and the union of the two is equal to the model set to be rendered; therefore, only a part of the model to be rendered is rendered, and by combining it with the rendering data of the previous frame, the complete rendering data can be obtained, and finally the rendering data of the target frame is written into the cache of the set default camera; wherein, the rendering data of the target frame is used to display as the final image of the target frame. While reducing the rendering workload, the visible number of models is not reduced, thereby improving the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 A schematic diagram of a flow chart of a frame rendering method provided in an embodiment of the present application;

[0045] Figure 2 A flowchart illustrating the steps of determining a target model set corresponding to a target frame from a set of models to be rendered according to the frame number of the target frame provided in an embodiment of the present application;

[0046] Figure 3 A flowchart illustrating steps for determining a target buffer pool and a target virtual camera according to the number of target frames provided in an embodiment of the present application;

[0047] Figure 4 A flowchart of the steps of rendering a model to be rendered in a target model set corresponding to a target frame to obtain target data provided by an embodiment of the present application;

[0048] Figure 5 A schematic structural diagram of a frame rendering device provided in an embodiment of the present application;

[0049] Figure 6 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0051] In one embodiment, the present application provides a frame rendering method. The following embodiments illustrate this method as applied to a server. It is understood that the frame rendering method can be executed by a single server or a server cluster consisting of multiple servers, and this application does not impose specific limitations on this.

[0052] like Figure 1 As shown, the present application provides a frame rendering method, the method comprising:

[0053] Step S101: Obtain a set of models to be rendered.

[0054] The set of models to be rendered is the set of all models to be rendered in this frame rendering.

[0055] Step S102: Determine the target frame that currently needs to be rendered.

[0056] Specifically, the target frame that needs to be rendered currently can be determined according to the number of frames to be rendered, thereby achieving rendering of each frame.

[0057] Step S103: determining a target model set corresponding to the target frame from the set of models to be rendered according to the frame number of the target frame.

[0058] The target model set is a proper subset of the model set to be rendered and is not an empty set.

[0059] Exemplarily, assuming that the set of models to be rendered is models No. 1 to 10 to be rendered, the target model set may be models No. 1 to 5 to be rendered, or models No. 1 to 7 to be rendered, or models No. 5 to 10 to be rendered.

[0060] Step S104: Determine a target buffer pool and a target virtual camera according to the number of target frames.

[0061] When writing data into the target cache pool, the data already existing in the target cache pool will be overwritten.

[0062] It can be understood that since two different virtual cameras are used for alternating rendering, it is necessary to determine the virtual camera used for this rendering based on the frame number of the current target frame. For any two adjacent frames, the target buffer pool and target virtual camera corresponding to these two frames are different.

[0063] For example, assuming that target data A is written into target cache pool B, the next time target data C is written into target cache pool B, target data C will overwrite target data A. At this time, only target data C exists in target cache pool B, and target data A does not exist.

[0064] Step S105: Determine whether the target frame is the first frame.

[0065] Step S106: If the target frame is the first frame, based on the target virtual camera, the to-be-rendered model in the target model set corresponding to the target frame is rendered to obtain target data, and the target data is written into the target buffer pool.

[0066] Since the first frame does not have the data of the previous frame as part of the final rendering data, the data rendered by the first frame is only part of the data required for the final display of the second frame. Therefore, the first frame is not displayed, and the image is displayed starting from the second frame.

[0067] Step S107: if the target frame is not the first frame, then based on the target virtual camera, render the to-be-rendered model in the target model set corresponding to the target frame to obtain target data, and write the target data into the target buffer pool;

[0068] Step S108: Obtain rendering data of the target frame based on the data in the target buffer pool and the data in the target buffer pool corresponding to the previous frame.

[0069] The target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same model to be rendered, and the union of the two is equal to the model set to be rendered.

[0070] Since the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same model to be rendered, and the union of the two is equal to the model set to be rendered, the resulting rendering data of the target frame contains rendered data of all models to be rendered in the model set to be rendered. Therefore, the rendering data can be used to display the final image of the target frame.

[0071] Step S109: writing the rendering data of the target frame into the buffer of the set default camera.

[0072] The rendering data of the target frame is used to display the final image of the target frame.

[0073] The frame rendering method provided by the present application obtains a set of all models to be rendered in this frame rendering as a set of models to be rendered; determines the target frame that needs to be rendered currently; determines a target model set corresponding to the target frame from the set of models to be rendered according to the frame number of the target frame; wherein the target model set is a true subset of the set of models to be rendered and is not an empty set; that is, for each frame rendering, not all the models to be rendered in the set of models to be rendered are rendered, but a part of the models to be rendered in the set of models to be rendered is rendered, which can reduce the rendering workload and reduce the CPU pressure, and then determine the target cache pool and the target virtual camera according to the frame number of the target frame; wherein, when writing data in the target cache pool, the data already existing in the target cache pool will be overwritten; if the target frame is not If it is the first frame, the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target cache pool; based on the data in the target cache pool and the data in the target cache pool corresponding to the previous frame, the rendering data of the target frame is obtained; wherein, the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same target model to be rendered, and the union of the two is equal to the target model set to be rendered; therefore, only a part of the target model to be rendered is rendered, and by combining it with the rendering data of the previous frame, the complete rendering data can be obtained, and finally the rendering data of the target frame is written into the cache of the set default camera; wherein, the rendering data of the target frame is used to display the final image of the target frame. While reducing the rendering workload, the visible number of models is not reduced, thereby improving the rendering efficiency.

[0074] like Figure 2 As shown, in one embodiment, determining a target model set corresponding to the target frame from the set of models to be rendered according to the frame number of the target frame includes:

[0075] Step S201: Divide the to-be-rendered model set into a first model subset and a second model subset.

[0076] Exemplarily, assuming that the set of models to be rendered is models No. 1 to 10 to be rendered, when the first model subset is models No. 1 to 5 to be rendered, the second model subset is models No. 6 to 10 to be rendered; when the first model subset is models No. 1 to 7 to be rendered, the second model subset is models No. 8 to 10 to be rendered; when the first model subset is models No. 1 to 4 to be rendered, the second model subset is models No. 6 to 10 to be rendered, and so on.

[0077] Step S202: Determine whether the target frame number is an odd number.

[0078] Step S203: If the number of target frames is an odd number, the first model subset is determined as the target model set.

[0079] Step S204: If the number of target frames is an even number, the second model subset is determined as the target model set.

[0080] It can be understood that by judging the parity of the frame number of the target frame, the model to be rendered that needs to be rendered in the target frame is determined, thereby achieving alternating rendering, which reduces the rendering workload while not reducing the visible number of models, thereby reducing the rendering workload and improving rendering efficiency.

[0081] like Figure 3 As shown, in one embodiment, determining a target buffer pool and a target virtual camera according to the number of target frames includes:

[0082] Step S301: determining whether the target frame number is an odd number;

[0083] Step S302: If the number of the target frame is an odd number, the set first buffer pool is determined as the target buffer pool and the set first virtual camera is determined as the target virtual camera.

[0084] Step S303: If the number of the target frame is an even number, the set second buffer pool is determined as the target buffer pool and the set second virtual camera is determined as the target virtual camera.

[0085] It is understandable that by judging the parity of the frame number of the target frame and then determining the target buffer pool and target virtual camera corresponding to the target frame, alternate rendering can be achieved, which can reduce the rendering workload and improve rendering efficiency.

[0086] For example, assuming that the set of models to be rendered is models No. 1 to 10 to be rendered, first determine that the current target frame is the first frame, and according to the frame number of the current target frame, determine that the target model set is models No. 1 to 5 to be rendered in the set of models to be rendered, and determine the target cache pool A and the target virtual camera B, based on the target virtual camera B, render the models No. 1 to 5 to be rendered, obtain the rendered target data C, and write the target data C into the target cache pool A; again determine that the current target frame is the second frame, and according to the frame number of the current target frame, determine that the target model set is models No. 6 to 10 to be rendered in the set of models to be rendered, and determine the target cache pool D and the target virtual camera E, and based on the target virtual camera E, render the models No. 6 to 10 to be rendered, obtain the rendered target data F, and write the target data According to F, it is written into the target cache pool D, and the data in the target cache pool A and the data in the target cache pool D are combined to obtain the rendering data G, which is the data of the second frame used to display the final image; the current target frame is determined to be the third frame again, and according to the frame number of the current target frame, the target model set is determined to be models No. 1 to 5 to be rendered in the set of models to be rendered, and the target cache pool A and the target virtual camera B are determined. Based on the target virtual camera B, models No. 1 to 5 to be rendered are rendered to obtain the rendered target data H, and the target data H is written into the target cache pool A. At this time, the target data H will overwrite the target data C, and the data in the target cache pool A and the data in the target cache pool D are combined to obtain the rendering data I, which is the data of the third frame used to display the final image, and so on.

[0087] like Figure 4 As shown, in one embodiment, rendering the to-be-rendered model in the target model set corresponding to the target frame to obtain target data includes:

[0088] Step S401: after the rendering of the to-be-rendered model in the target model set corresponding to the target frame is completed, the depth of the to-be-rendered model is recorded, and depth buffer data is generated.

[0089] Specifically, depth is the Z value corresponding to the distance of the model to be rendered from the camera in the 3D world, where the Z axis represents the depth. Generally speaking, the larger the depth value (Z value), the closer the corresponding model to be rendered is to the camera.

[0090] Step S402: Record the color of the model to be rendered and generate color cache data.

[0091] Step S403: Obtain target data corresponding to the to-be-rendered model in the target model set corresponding to the target frame according to the depth buffer data and the color buffer data.

[0092] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0093] The following describes a frame rendering device provided in an embodiment of the present application. The frame rendering device described below and the frame rendering method described above can refer to each other.

[0094] like Figure 5 As shown, the present application provides a frame rendering device 500, which includes:

[0095] The acquisition module 501 is used to acquire a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering;

[0096] The target frame determination module 502 is used to determine the target frame that needs to be rendered currently;

[0097] A first determining module 503 is configured to determine a target model set corresponding to the target frame from the set of models to be rendered according to the number of the target frame; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set;

[0098] The second determining module 504 is configured to determine a target buffer pool and a target virtual camera according to the number of target frames; wherein when writing data into the target buffer pool, the data already existing in the target buffer pool will be overwritten;

[0099] A first rendering module 505 is configured to render the to-be-rendered model in the target model set corresponding to the target frame based on the target virtual camera if the target frame is not the first frame, obtain target data, and write the target data into a target buffer pool;

[0100] A rendering data acquisition module 506 is configured to obtain rendering data for a target frame based on the data in the target buffer pool and the data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same model to be rendered, and the union of the two is equal to the model set to be rendered;

[0101] The display module 507 is configured to write the rendering data of the target frame into the cache of the set default camera; wherein the rendering data of the target frame is used to be displayed as the final image of the target frame.

[0102] In one embodiment, the apparatus further comprises:

[0103] The second rendering module is used to render the to-be-rendered model in the target model set corresponding to the target frame based on the target virtual camera if the target frame is the first frame, obtain target data, and write the target data into the target buffer pool.

[0104] In one embodiment, the first determining module 503 includes:

[0105] A division submodule, configured to divide the set of models to be rendered into a first model subset and a second model subset;

[0106] The first judgment submodule is used to judge whether the frame number of the target frame is an odd number;

[0107] The first determining submodule is configured to determine the first model subset as the target model set if the number of target frames is an odd number.

[0108] In one embodiment, the first determining module 503 further includes:

[0109] The second determining submodule is configured to determine the second model subset as the target model set if the number of target frames is an even number.

[0110] In one embodiment, the second determining module 504 includes:

[0111] The second judgment submodule is used to judge whether the frame number of the target frame is an odd number;

[0112] The third determining submodule is configured to determine the set first buffer pool as the target buffer pool and the set first virtual camera as the target virtual camera if the number of frames of the target frame is an odd number.

[0113] In one embodiment, the second determining module 504 further includes:

[0114] The fourth determining submodule is configured to determine the set second buffer pool as the target buffer pool and the set second virtual camera as the target virtual camera if the number of the target frame is an even number.

[0115] In one embodiment, the first rendering module 505 includes:

[0116] A first recording submodule is configured to record the depth of a to-be-rendered model in a target model set corresponding to a target frame after rendering is completed, and generate depth buffer data;

[0117] A second recording submodule is used to record the color of the model to be rendered and generate color cache data;

[0118] The acquisition submodule is used to obtain target data corresponding to the to-be-rendered model in the target model set corresponding to the target frame according to the depth buffer data and the color buffer data.

[0119] The division of the various modules in the above-mentioned frame rendering device is for illustration only. In other embodiments, the frame rendering device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned frame rendering device. The various modules in the above-mentioned frame rendering device can be implemented in whole or in part through software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of the above-mentioned modules.

[0120] In one embodiment, the present application further provides a storage medium having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps:

[0121] Obtain a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering;

[0122] Determine the target frame that needs to be rendered currently;

[0123] According to the frame number of the target frame, a target model set corresponding to the target frame is determined from the set of models to be rendered; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set;

[0124] Determine a target buffer pool and a target virtual camera according to the number of target frames; wherein, when writing data into the target buffer pool, the data already existing in the target buffer pool will be overwritten;

[0125] If the target frame is not the first frame, the model to be rendered in the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target buffer pool;

[0126] Obtaining rendering data of the target frame based on data in the target buffer pool and data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same to-be-rendered model, and a union of the two is equal to the to-be-rendered model set;

[0127] The rendering data of the target frame is written into the buffer of the set default camera; wherein the rendering data of the target frame is used to display the final image of the target frame.

[0128] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:

[0129] If the target frame is the first frame, the to-be-rendered model in the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target buffer pool.

[0130] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:

[0131] Dividing the set of models to be rendered into a first model subset and a second model subset;

[0132] Determine whether the frame number of the target frame is an odd number;

[0133] If the number of target frames is an odd number, the first model subset is determined as the target model set.

[0134] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:

[0135] If the number of target frames is an even number, the second model subset is determined as the target model set.

[0136] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:

[0137] Determine whether the frame number of the target frame is an odd number;

[0138] If the number of the target frame is an odd number, the set first buffer pool is determined as the target buffer pool and the set first virtual camera is determined as the target virtual camera.

[0139] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:

[0140] If the number of the target frame is an even number, the set second buffer pool is determined as the target buffer pool and the set second virtual camera is determined as the target virtual camera.

[0141] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:

[0142] After the rendering of the to-be-rendered model in the target model set corresponding to the target frame is completed, the depth of the to-be-rendered model is recorded, and depth buffer data is generated;

[0143] Recording the color of the model to be rendered and generating color cache data;

[0144] According to the depth buffer data and the color buffer data, target data corresponding to the to-be-rendered model in the target model set corresponding to the target frame is obtained.

[0145] In one embodiment, the present application further provides a computer device having computer-readable instructions stored therein, wherein when the one or more processors execute the computer-readable instructions, the following steps are performed:

[0146] Obtain a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering;

[0147] Determine the target frame that needs to be rendered currently;

[0148] According to the frame number of the target frame, a target model set corresponding to the target frame is determined from the set of models to be rendered; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set;

[0149] Determine a target buffer pool and a target virtual camera according to the number of target frames; wherein, when writing data into the target buffer pool, the data already existing in the target buffer pool will be overwritten;

[0150] If the target frame is not the first frame, the model to be rendered in the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target buffer pool;

[0151] Obtaining rendering data of the target frame based on data in the target buffer pool and data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same to-be-rendered model, and a union of the two is equal to the to-be-rendered model set;

[0152] The rendering data of the target frame is written into the buffer of the set default camera; wherein the rendering data of the target frame is used to display the final image of the target frame.

[0153] In one embodiment, when the processor executes the computer readable instructions, it further performs the following steps:

[0154] If the target frame is the first frame, the to-be-rendered model in the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target buffer pool.

[0155] In one embodiment, when the processor executes the computer readable instructions, it further performs the following steps:

[0156] Dividing the set of models to be rendered into a first model subset and a second model subset;

[0157] Determine whether the frame number of the target frame is an odd number;

[0158] If the number of target frames is an odd number, the first model subset is determined as the target model set.

[0159] In one embodiment, when the processor executes the computer readable instructions, it further performs the following steps:

[0160] If the number of target frames is an even number, the second model subset is determined as the target model set.

[0161] In one embodiment, when the processor executes the computer readable instructions, it further performs the following steps:

[0162] Determine whether the frame number of the target frame is an odd number;

[0163] If the number of the target frame is an odd number, the set first buffer pool is determined as the target buffer pool and the set first virtual camera is determined as the target virtual camera.

[0164] In one embodiment, when the processor executes the computer readable instructions, it further performs the following steps:

[0165] If the number of the target frame is an even number, the set second buffer pool is determined as the target buffer pool and the set second virtual camera is determined as the target virtual camera.

[0166] In one embodiment, when the processor executes the computer readable instructions, it further performs the following steps:

[0167] After the rendering of the to-be-rendered model in the target model set corresponding to the target frame is completed, the depth of the to-be-rendered model is recorded, and depth buffer data is generated;

[0168] Recording the color of the model to be rendered and generating color cache data;

[0169] According to the depth buffer data and the color buffer data, target data corresponding to the to-be-rendered model in the target model set corresponding to the target frame is obtained.

[0170] Schematically, as Figure 6 As shown, Figure 6 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 600 can be provided as a server. Figure 6 Computer device 600 includes a processing component 602, which further includes one or more processors, and a memory resource represented by memory 601 for storing instructions executable by processing component 602, such as an application. The application stored in memory 601 may include one or more modules, each corresponding to a set of instructions. In addition, processing component 602 is configured to execute the instructions to perform the frame rendering method of any of the above embodiments.

[0171] The computer device 600 may further include a power supply component 603 configured to perform power management of the computer device 600, a wired or wireless network interface 604 configured to connect the computer device 600 to a network, and an input / output (I / O) interface 605. The computer device 600 may operate based on an operating system stored in the memory 601, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.

[0172] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0173] Finally, it should be noted that, in this article, relational terms such as first and second are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element. In this article, the singular forms "a," "an," and "said / the" may also include plural forms unless the context clearly indicates otherwise. It should also be understood that the terms "comprise," "comprising," or "having" specify the presence of the stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof.

[0174] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0175] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A frame rendering method, characterized in that: The method comprises: Obtain a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering; Determine the target frame that needs to be rendered currently; According to the frame number of the target frame, determining a target model set corresponding to the target frame from the set of models to be rendered; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set; Determining a target buffer pool and a target virtual camera according to the frame number of the target frame; wherein when writing data into the target buffer pool, the data already existing in the target buffer pool will be overwritten, and the target buffer pools and target virtual cameras corresponding to any two adjacent frames are different; If the target frame is not the first frame, rendering the to-be-rendered model in the target model set corresponding to the target frame based on the target virtual camera to obtain target data, and writing the target data into the target buffer pool; Obtaining rendering data of the target frame based on the data in the target buffer pool and the data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same to-be-rendered model, and a union of the two is equal to the to-be-rendered model set; The rendering data of the target frame is written into the cache of the set default camera; wherein the rendering data of the target frame is used to be displayed as the final image of the target frame.

2. The frame rendering method according to claim 1, wherein: The method further comprises: If the target frame is the first frame, the model to be rendered in the target model set corresponding to the target frame is rendered based on the target virtual camera to obtain target data, and the target data is written into the target buffer pool.

3. The frame rendering method according to claim 1, wherein: The step of determining, based on the number of the target frame, a target model set corresponding to the target frame from the set of models to be rendered comprises: Dividing the set of models to be rendered into a first model subset and a second model subset; Determining whether the frame number of the target frame is an odd number; If the number of the target frames is an odd number, the first model subset is determined as the target model set.

4. The frame rendering method according to claim 3, wherein: The step of determining a target model set corresponding to the target frame from the set of models to be rendered according to the number of the target frame further includes: If the number of the target frames is an even number, the second model subset is determined as the target model set.

5. The frame rendering method according to claim 1, wherein: Determining a target buffer pool and a target virtual camera according to the number of the target frame includes: Determining whether the frame number of the target frame is an odd number; If the number of the target frame is an odd number, the set first buffer pool is determined as the target buffer pool and the set first virtual camera is determined as the target virtual camera.

6. The frame rendering method according to claim 5, characterized in that: The step of determining a target buffer pool and a target virtual camera according to the number of frames of the target frame further includes: If the number of the target frame is an even number, the set second buffer pool is determined as the target buffer pool and the set second virtual camera is determined as the target virtual camera.

7. The frame rendering method according to claim 1, wherein: The step of rendering the to-be-rendered model in the target model set corresponding to the target frame to obtain target data includes: After completing the rendering of the to-be-rendered model in the target model set corresponding to the target frame, recording the depth of the to-be-rendered model and generating depth buffer data; Recording the color of the model to be rendered and generating color cache data; According to the depth buffer data and the color buffer data, target data corresponding to the to-be-rendered model in the target model set corresponding to the target frame is obtained.

8. A frame rendering device, characterized in that: The device comprises: An acquisition module is used to acquire a set of models to be rendered; wherein the set of models to be rendered is a set of all models to be rendered in this frame rendering; The target frame determination module is used to determine the target frame that needs to be rendered currently; A first determining module is configured to determine, based on the number of the target frame, a target model set corresponding to the target frame from the set of models to be rendered; wherein the target model set is a proper subset of the set of models to be rendered and is not an empty set; A second determining module is configured to determine a target buffer pool and a target virtual camera based on the number of the target frame; wherein when data is written to the target buffer pool, the data already in the target buffer pool is overwritten, and the target buffer pools and target virtual cameras corresponding to any two adjacent frames are different; a first rendering module configured to render, based on the target virtual camera, a model to be rendered in a target model set corresponding to the target frame if the target frame is not the first frame, to obtain target data, and write the target data into the target buffer pool; a rendering data acquisition module, configured to obtain rendering data of the target frame based on the data in the target buffer pool and the data in the target buffer pool corresponding to the previous frame; wherein the target model set corresponding to the previous frame and the target model set corresponding to the target frame do not have the same to-be-rendered model, and the union of the two is equal to the to-be-rendered model set; The display module is used to write the rendering data of the target frame into the cache of the set default camera; wherein the rendering data of the target frame is used to be displayed as the final image of the target frame.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the frame rendering method according to any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the frame rendering method according to any one of claims 1 to 7 are performed.

Citation Information

Patent Citations

  • Rendering optimization method for region division and terminal

    CN111340925A

  • Merging videos and still images from the same event based on the global motion vector of this video.

    JP2012509635A