WO2018166470A1 - Animation display method based on frame rate and terminal device - Google Patents

Animation display method based on frame rate and terminal device Download PDF

Info

Publication number
WO2018166470A1
WO2018166470A1 PCT/CN2018/078976 CN2018078976W WO2018166470A1 WO 2018166470 A1 WO2018166470 A1 WO 2018166470A1 CN 2018078976 W CN2018078976 W CN 2018078976W WO 2018166470 A1 WO2018166470 A1 WO 2018166470A1
Authority
WO
WIPO (PCT)
Prior art keywords
offset
current
frame rate
normal
frame
Prior art date
Application number
PCT/CN2018/078976
Other languages
French (fr)
Chinese (zh)
Inventor
陈翔
唐斌
潘杰茂
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018166470A1 publication Critical patent/WO2018166470A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging

Definitions

  • the present application relates to the field of information processing technologies, and in particular, to a frame rate-based animation display method and a terminal device.
  • H5 Hypertext Markup Language Version 5, HTML5
  • HTML5 Hypertext Markup Language Version 5
  • the frame rate is 60 frames per second
  • the loop operation rate following the frame rate is 60 times per second.
  • Each frame is a rendering of the result of a loop operation, which is a still image.
  • the frame is formed by displaying the frame in rapid succession, so that the animation effect is achieved by cyclically drawing the image of each frame. High frame rates for smoother, more realistic animations. And if the frame rate drops, the number of corresponding loop operations will also decrease.
  • the embodiment of the present application provides a frame rate-based animation display method and a terminal device, which dynamically determine a current offset of a loop operation in each frame of an animation page according to a current frame rate of the animation page.
  • An embodiment of the present application provides a frame rate-based animation display method, including:
  • a current offset of an operation relative to a previous frame in the current frame to be displayed such that the animation calculated according to the current offset
  • the total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset
  • the embodiment of the present application further provides a terminal device, including: a processor and a memory, where the computer stores computer readable instructions, where the computer readable instructions are executed by the processor to complete the following operations:
  • a current offset of an operation relative to a previous frame in the current frame to be displayed such that the animation calculated according to the current offset
  • the total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset
  • the embodiment of the present application provides a frame rate-based animation display method, which is applied to a terminal device, and the method includes:
  • a current offset of an operation relative to a previous frame in the current frame to be displayed such that the animation calculated according to the current offset
  • the total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset
  • a non-volatile storage medium having stored therein computer readable instructions executable by a processor to perform the following operations:
  • a current offset of an operation relative to a previous frame in the current frame to be displayed such that the animation calculated according to the current offset
  • the total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • FIG. 2A is a flowchart of a frame rate-based animation display method provided by an embodiment of the present application
  • 2B is a flowchart of another frame rate-based animation display method provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of a frame rate-based animation display method provided in an application embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of another terminal device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of still another terminal device according to an embodiment of the present application.
  • the refresh rate of the display of the terminal device is 60 times per second, which matches the frame rate of the game animation.
  • the terminal device moves the position of the animated image by a certain distance in a certain direction, for example, 1 pixel (px).
  • px 1 pixel
  • the position of the image that is refreshed each time the display is different from the previous image position by 1px, people will see the image moving. Due to the visual pause effect of the human eye, the impression of the image at the current position staying in the brain has not disappeared, and then the image is moved to the next position, so that the image is seen to move smoothly.
  • Frame loss generally refers to the phenomenon that the frame is slowed down (or short time or long time) due to insufficient hardware to load the dynamic display refresh rate of the display screen. Loss of frame in the game is the process of playing the game, the card appears this situation, the image is not refreshed in time, the picture is sticky.
  • the method of periodically calling the function to perform the loop operation is generally adopted, so that the number of loop operations for calling the related function is fixed at about 30 times per second.
  • the function called is, for example, a function that moves the background of the game, a function that adjusts the amount of blood in the game, and the like.
  • the number of loop operations is small, the number of page refreshes is small, and the problem of slow game execution may occur.
  • the embodiment of the present application provides a frame rate based animation display method and apparatus.
  • the terminal device calculates the current frame rate of the animated page in real time, and determines the cyclic operation of the current frame to be displayed according to the product of the preset normal frame rate and the normal offset and the current frame rate.
  • a current offset wherein a total offset per second of the loop operation in the animation page calculated according to the current offset is a product of the normal frame rate and a normal offset, or a fixed value, and Presents the current frame based on the current offset.
  • the current offset of the loop operation that depends on the frame rate can be dynamically determined, so that the rate of the loop operation in the animation page remains unchanged, and It decreases due to the decrease of the frame rate, thus ensuring the execution speed of the game, smoothly presenting the game screen, and avoiding the phenomenon of the animation being stuck.
  • the present application automatically calculates the offset that should be cyclically operated according to the frame rate in real time, the hardware performance of the terminal device can be better utilized to adapt to various terminal devices.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • the implementation environment includes a terminal device 10 and a server 20 that provides services to the terminal device.
  • the terminal device 10 is connected to the server 20 via a wireless or wired network.
  • the terminal device 10 can be an electronic device capable of accessing the server 20, and can be, for example, a computer, a smart phone, a tablet, or other electronic device.
  • Server 20 can be one or more web servers, application servers, or a cloud storage center. The user can click on the corresponding game module in the application client on the terminal device 10 to request the server to run the corresponding game, such as the H5 page game program.
  • the server After receiving the request from the application client, the server issues all data for running the game to the application client, and the game is run by the application client.
  • the application client is, for example, an instant messaging client or a game client.
  • a frame rate based animation display device 11 and a memory 12 for storing various data required to run the game are included in the terminal device 10.
  • FIG. 2A is a flowchart of a frame rate based animation display method provided by an embodiment of the present application.
  • the frame rate-based animation display method therein can be performed by a terminal device (such as a game terminal or the like) that supports frame rate-based animation. As shown in FIG. 2A, the method includes:
  • Step 101 Calculate a current frame rate of the animated page, that is, a number of frames of the animated page per second.
  • the terminal device When displaying a frame rate-based animated page, the terminal device needs to make each frame of the animated page and then display the generated animated page.
  • the frame rate of an animated page is fixed, that is, the number of frames of an animated page displayed by the terminal device per second is the same, for example, 60 frames per second.
  • the frame rate is dynamically changed.
  • the current frame rate of the animated page needs to be calculated in real time.
  • the number of frames is the amount of pictures transferred in one second. It can also be understood that the processor can be refreshed several times per second, usually expressed in fps (Frames Per Second).
  • the method in this embodiment may be a process in which the terminal device is triggered by a fixed period, and the fixed period is, for example, 16 milliseconds; or the process triggered by the terminal device when the lost frame of the animation page is detected.
  • the terminal device detects that the number of frames of the animated page displayed per second is relatively large, it may be determined that the animation page of the terminal device is out of frame.
  • the terminal device can record the current time point when it starts generating each frame of the animation page.
  • a preset threshold for example, 16 milliseconds
  • Step 102 Determine, according to a product of a normal frame rate and a normal offset, and a current frame rate calculated in the foregoing step 101, a current offset of an operation in the current frame to be displayed relative to a previous frame, so that the current offset is determined according to the current offset.
  • the total offset per second of the operation in the animation page obtained by the shift calculation is the product of the above normal frame rate and the normal offset, or a fixed value.
  • the normal frame rate is the frame rate when the animation page is not lost.
  • the normal offset is the offset of the operation of the current frame relative to the previous frame when the animation page is not lost.
  • a fixed value is The difference between the above-mentioned product of the normal frame rate and the normal offset is a value within a preset range.
  • the normal frame rate and the normal offset may be preset by the user in the terminal device, or may be calculated by the terminal device and stored in the terminal device when the animation page has not lost frames.
  • the operation here can be called a loop operation, which refers to the same operation in each frame of the animation page, such as the operation of the background moving forward in the game screen. For example, when the terminal device draws each frame of the animated page, it executes a requestAnimationFrame function (or method).
  • this requestAnimationFrame function a function that performs specific business processing in each frame of the animation page. Execute these functions for the appropriate business processing. For example, it includes updating the map function to update the map in the game; updating the menu function to update the menu display in the game; collision detection function to detect whether there is a collision; the stage update function, updating the stage in the game, and the like.
  • the loop execution of these functions in each frame of the animation page is a loop operation.
  • each frame will have an offset from the previous frame.
  • the Stage Update function might update the position of the Stage, moving the Stage backwards by a certain amount of offset, which will make the characters in the animation appear dynamic relative to the Stage.
  • the offset of the loop operation in each frame of the animation page is also fixed, so that the number of loop operations in the animation page displayed by the terminal device per second is also fixed, for example, 60 times per second.
  • the animation page is out of frame, in order to make the rate of the loop operation unchanged, in this embodiment, it is required to determine the corresponding current offset according to the current frame rate in real time, so that the generated animation page is calculated according to the current offset.
  • the total offset per second of the loop operation is unchanged, such as the total offset per second of the loop operation in the animation page under normal conditions (that is, the product of the normal offset and the normal frame rate), or it can be fixed to A certain value is not limited here.
  • the normal offset of the loop operation in each frame of the animation page is 1 pixel, and 60 frames per second, the total offset per second of the loop operation in the animation page is 60 pixels.
  • the corresponding current offset may be determined such that the product of the current frame rate and the current offset is 60.
  • the ratio of the product of the normal frame rate to the normal offset and the current frame rate may be directly determined as the current offset.
  • the terminal device needs to determine that the difference between the product of the normal frame rate and the normal offset is a certain fixed value, and then a fixed value. The ratio to the current frame rate is determined as the current offset.
  • Step 103 Display the current frame according to the current offset determined in step 102. Specifically, on the basis of the displayed one-frame animation page, the object of the loop operation is offset according to the current offset determined according to the frame animation page, and the next frame animation page is obtained, and the next frame animation page is displayed. , and so on, showing each frame of the animation page.
  • the terminal device calculates the current frame rate of the animated page in real time, and then determines each frame according to the product of the normal frame rate and the normal offset amount when the animation page is not lost, and the current frame rate.
  • the current offset of the loop operation in the animation page such that the total offset per second of the loop operation in the animation page is the product of the normal frame rate and the normal offset, or a fixed value, and based on the current offset
  • the volume shows the animated page.
  • the terminal device may record the corresponding start generation time when starting to generate each frame of the animation page, and then determine the animation of each frame according to the start time of each frame of the animation page.
  • the average time of the page the current frame rate is determined based on the average time. For example, when the average time of each frame of animation is 16.7 milliseconds, the frame rate is 60 frames per second.
  • the difference between the start generation time of the adjacent frame animation page may be obtained first, and then the difference values are averaged to obtain the average time of each frame of the animation page, and the current frame rate is obtained. It is the ratio of 1 second to the average time consuming.
  • the terminal device is generated by calling the drawing function of the animation page when generating the animation page of each frame
  • a certain frame animation page may be generated. Record the call time as the start generation time of the corresponding frame animation page.
  • the drawing function of the animated page may be a request animation frame (requestAnimationFrame) function, and the terminal device executes the requestAnimationFrame function every time an animation page is drawn.
  • the drawing function of the animated page can also be a set spacing function (setInterval) or a set timeout (setTimeout) function.
  • setInterval means that a piece of code is looped according to the specified event interval.
  • setTimeout represents a piece of code that executes after a certain time interval.
  • the requestAnimationFrame function corresponds to the frame rate, that is, the drawing of each frame of the animation page is called, in this embodiment, the calling time can be recorded directly when the function is called.
  • the setInterval function or the setTimeout function does not correspond to the frame rate. That is, when the terminal device displays each frame of the animation page, it is not necessary to call this type function. In this case, the user needs to pass the terminal device. In advance, you need to call this type function (setInterval function or setTimeout function) when displaying each frame of animation page, so that this type of function corresponds to the frame rate, so that the terminal device can call the call time according to the call of this type function. Get the average time spent on each frame of animated pages.
  • the current offset of the loop operation dependent on the frame rate can be dynamically determined, and the animation is made.
  • the rate of the loop operation in the page remains unchanged, and does not decrease due to the decrease of the frame rate, thereby ensuring the execution speed of the game, smoothly presenting the game screen, and avoiding the phenomenon of the animation being stuck.
  • the present application automatically calculates the offset that should be cyclically operated according to the frame rate in real time, the hardware performance of the terminal device can be better utilized to adapt to various terminal devices.
  • the terminal device may perform the following step 104:
  • step 104 it is determined whether the current frame rate calculated in the above step 101 is consistent with the normal frame rate. If they are consistent, step 105 is performed. If not, the above steps 102 and 103 are performed.
  • Step 105 Display the current frame according to a normal offset.
  • the terminal device considers that if the frame rate of the animation page does not change, the current offset may not be re-determined, but the animation page of each frame is directly displayed according to the normal offset.
  • the method of the embodiment of the present application is described in a specific embodiment.
  • the terminal device in this embodiment is a game terminal, and the animation page displayed by the terminal device is a game page.
  • the method in this embodiment includes:
  • Step 201 the game terminal sets the game page when the frame is not lost, the frame rate of the game page is 60, that is, 60 frames per second, and the loop operation in the game page (for example, the background element in the game continuously moves forward)
  • the normal offset is X(px)
  • the normal state is 60 frames in the next second.
  • the total amount of motion for the loop operation in the animation page is 60X (px).
  • Step 202 When the game terminal is started, when the game page of each frame is generated, the requestAnimationFrame function is called to generate a game page, and the game terminal records the time of calling the requested animation frame function, so that according to the recorded time, according to the one-frame game The difference between the generation time of the page and the generation time of the next frame game page is calculated, and the time T of the game page of the frame is calculated, so that the current frame rate Y of the game page is 1 second/T.
  • Step 204 the product of the normal offset X and the ratio Z of the normal frame rate to the current frame rate is used as the current offset of the loop operation in the game page.
  • Step 205 The game terminal displays the next frame of the game page according to the current offset.
  • the gaming terminal loops through the above steps 202 and 203 to ensure that the total offset per second of the looping operation in the game page (the background moving forward in the game page) is close to 60X (px).
  • the loop operation in each frame of the animation page is Mario's automatic forward running.
  • Mario automatically moves forward by 1 pixel (px) per frame of the game page.
  • the frame rate of the game page may only be 20 frames per second.
  • the embodiment of the present application further provides a terminal device, and a schematic structural diagram thereof is shown in FIG. 4, and specifically includes:
  • a frame rate calculation unit 10 configured to calculate a current frame rate of the animation page
  • the offset determining unit 11 is configured to determine, according to a product of a normal frame rate and a normal offset and a current frame rate calculated by the frame rate calculating unit 10, an operation of the current frame to be displayed relative to a previous frame thereof.
  • the current offset such that the total offset per second of the operation in the animated page calculated according to the current offset is the product of the normal frame rate and the normal offset, or a fixed value;
  • the normal frame rate is a frame rate when the animation page has not lost frames, and the normal offset is an offset of an operation of the current frame relative to a previous frame when the animation page is not lost.
  • a fixed value is a value within a preset range of the product of the normal frame rate and the normal offset; specifically, the offset determining unit 11 is configured to compare the normal frame rate with The ratio of the product of the normal offset to the current frame rate is determined as the current offset; or the difference between the product of the normal frame rate and the normal offset is determined to be within a preset range a value of the fixed value, the fixed value and the current frame rate Value is determined as the current offset.
  • the first display unit 12 is configured to display the current frame according to the current offset determined by the offset determining unit 11.
  • the frame rate calculation unit 10 calculates the current frame rate of the animation page in real time, and then the offset amount determining unit 11 compares the normal frame rate with the normal offset amount and the current time when the animation page has not lost the frame.
  • a frame rate the current offset of the operation in the current frame relative to the previous frame to be displayed, such that the total offset per second of the operation in the animated page calculated according to the current offset is the normal frame rate
  • the product of the normal offset is either a fixed value, and the first display unit 12 presents the current frame based on the current offset.
  • the terminal device may include a second display unit 13 and a setting unit 14 in addition to the structure of FIG. 4, and the frame rate calculation unit 10 may pass
  • the time recording unit 110 and the time consuming computing unit 120 are implemented, specifically:
  • the time recording unit 110 is configured to record a corresponding start generation time when starting to generate each frame of the animation page; wherein, if the generating each frame of the animation page is generated by calling a drawing function of the animation page, the time recording The unit 110 is specifically configured to record a call time as a start generation time of the corresponding frame animation page when the drawing function of the animation page is generated to generate a certain frame animation page.
  • the drawing function of the animation page may be a function of requesting an animation frame function, setting a spacing function or setting a timeout function, and if the drawing function of the animation page is setting a spacing function or setting a timeout function, the terminal device also needs to set
  • the unit 14 is configured to call the set pitch function or set the timeout function when displaying each frame of the animation page, so that the time recording unit 110 records the calling time of the function according to the setting of the setting unit 14.
  • the time consuming calculation unit 120 is configured to determine an average time consumption of each frame of the animation page according to the start generation time of each frame of the animation page recorded by the time recording unit 110, and determine the current frame rate according to the average time consuming.
  • the second display unit 13 is configured to display each frame of the animation page according to the normal offset amount if the current frame rate calculated by the time consuming calculation unit 120 in the frame rate calculation unit 10 is consistent with the normal frame rate.
  • the current frame animation page is displayed by the second display unit 13. If the current frame rate does not coincide with the normal frame rate, the current frame animation page is displayed by the first display unit 12 after the offset amount determining unit 11 determines the current offset.
  • the frame rate-based animation display device of the embodiment of the present application when the frame rate of the animation page is dynamically changed when the animation page is lost, the current offset of the loop operation dependent on the frame rate can be dynamically determined, and the animation is made.
  • the rate of the loop operation in the page remains unchanged, and does not decrease due to the decrease of the frame rate, thereby ensuring the execution speed of the game, smoothly presenting the game screen, and avoiding the phenomenon of the animation being stuck.
  • the present application automatically calculates the offset that should be cyclically operated according to the frame rate in real time, the hardware performance of the terminal device can be better utilized to adapt to various terminal devices.
  • the embodiment of the present application further provides a terminal device, which is shown in FIG. 6.
  • the terminal device may have a large difference due to different configurations or performances, and may include one or more central processing units (central processing units, CPU) 20 (eg, one or more processors) and memory 21, one or more storage media 22 that store application 221 or data 222 (eg, one or one storage device in Shanghai).
  • the memory 21 and the storage medium 22 may be short-term storage or persistent storage.
  • the program stored on the storage medium 22 may include one or more modules (not shown), each of which may include a series of instruction operations in the terminal device.
  • central processor 20 may be arranged to communicate with storage medium 22 to perform a series of instruction operations in storage medium 22 on the terminal device.
  • the application 221 stored in the storage medium 22 includes an application program based on a frame rate-based animation
  • the program may include the frame rate calculation unit 10 in the above-described terminal device, the offset determination unit 11, the first display The unit 12, the second display unit 13 and the setting unit 14 are not described herein.
  • the central processor 20 can be arranged to communicate with the storage medium 22 to perform a series of operations corresponding to the application of the frame rate based animation stored in the storage medium 22 on the terminal device.
  • the application of the frame rate based animation display may also include the operations described in Figures 2A, 2B, and 3.
  • the terminal device may also include one or more power sources 23, one or more wired or wireless network interfaces 24, one or more input and output interfaces 25, and/or one or more operating systems 223, such as Windows ServerTM, Mac OS. XTM, UnixTM, LinuxTM, FreeBSDTM and more.
  • the steps performed by the terminal device described in the foregoing method embodiments may be based on the structure of the terminal device shown in FIG. 6.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Read only memory (ROM), random access memory (RAM), magnetic or optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Processing Or Creating Images (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

Disclosed are an animation display method based on a frame rate and a terminal device. A terminal device calculates a current frame rate of an animation page in real time, and then according to a product of a normal frame rate and a normal offset when no frame of the animation page is lost, and the current frame rate, determines a current offset relative to an operation of the previous frame in a current frame to be displayed such that the total offset of each second of an operation in the animation page calculated according to the current offset is the product of the normal frame rate and the normal offset or is a certain fixed value, and the current frame is displayed according to the current offset.

Description

基于帧率的动画展示方法及终端设备Frame rate-based animation display method and terminal device
本申请要求于2017年03月17日提交中国专利局、申请号为201710159973.3、发明名称为“一种基于帧率的动画展示方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on March 17, 2017, to the Chinese Patent Office, Application No. 201710159973.3, entitled "A Frame Rate-Based Animation Display Method and Terminal Device", the entire contents of which are incorporated by reference. Combined in this application.
技术领域Technical field
本申请涉及信息处理技术领域,特别涉及一种基于帧率的动画展示方法及终端设备。The present application relates to the field of information processing technologies, and in particular, to a frame rate-based animation display method and a terminal device.
背景技术Background technique
H5(超文本标记语言第5版,HTML5)技术是一系列制作网页互动效果的技术集合,可以用于构建web页面和开发游戏。正常情况下,终端设备在展示游戏动画时,帧率为每秒60帧,跟随帧率的循环操作则为每秒60次。每一帧都是一次循环操作结果的渲染,是静止的图象,快速连续地显示帧便形成了运动,这样通过循环绘制各帧的图像来实现动画的效果。高的帧率可以得到更流畅、更逼真的动画。而如果帧率下降,则相应的循环操作的次数也会减少。比如在移动端H5游戏页面失帧的状态下,所有依赖帧率做循环的操作,比如游戏背景移动或人物自动移动等,会因为帧率的降低导致游戏运行时的每秒循环操作的次数降低从而影响到游戏的运行速率和呈现效果。H5 (Hypertext Markup Language Version 5, HTML5) technology is a collection of techniques for creating interactive web effects that can be used to build web pages and develop games. Under normal circumstances, when the terminal device displays the game animation, the frame rate is 60 frames per second, and the loop operation rate following the frame rate is 60 times per second. Each frame is a rendering of the result of a loop operation, which is a still image. The frame is formed by displaying the frame in rapid succession, so that the animation effect is achieved by cyclically drawing the image of each frame. High frame rates for smoother, more realistic animations. And if the frame rate drops, the number of corresponding loop operations will also decrease. For example, in the state where the mobile H5 game page is out of frame, all operations that rely on the frame rate to do loops, such as game background movement or automatic movement of characters, may cause the number of loop operations per second during game running to decrease due to the decrease of the frame rate. This affects the running speed and rendering effect of the game.
发明内容Summary of the invention
本申请实施例提供一种基于帧率的动画展示方法及终端设备,实现了根据动画页面的当前帧率动态地确定每帧动画页面中循环操作的当前偏移量。The embodiment of the present application provides a frame rate-based animation display method and a terminal device, which dynamically determine a current offset of a loop operation in each frame of an animation page according to a current frame rate of the animation page.
本申请实施例提供一种基于帧率的动画展示方法,包括:An embodiment of the present application provides a frame rate-based animation display method, including:
计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏 移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
本申请实施例还提供一种终端设备,包括:处理器和存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令由所述处理器执行以完成以下操作:The embodiment of the present application further provides a terminal device, including: a processor and a memory, where the computer stores computer readable instructions, where the computer readable instructions are executed by the processor to complete the following operations:
计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
本申请实施例提供了一种基于帧率的动画展示方法,应用于终端设备上,所述方法包括:The embodiment of the present application provides a frame rate-based animation display method, which is applied to a terminal device, and the method includes:
计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
一种非易失性存储介质,其中存储有计算机可读指令,所述计算机可读指令可以由处理器执行以完成如下操作:A non-volatile storage medium having stored therein computer readable instructions executable by a processor to perform the following operations:
计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某 一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
附图简要说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative labor for those skilled in the art.
图1是本申请实施例提供的一种实施环境示意图;1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
图2A是本申请实施例提供的一种基于帧率的动画展示方法的流程图;2A is a flowchart of a frame rate-based animation display method provided by an embodiment of the present application;
图2B是本申请实施例提供的另一种基于帧率的动画展示方法的流程图;2B is a flowchart of another frame rate-based animation display method provided by an embodiment of the present application;
图3是本申请应用实施例中提供的一种基于帧率的动画展示方法的流程图;3 is a flowchart of a frame rate-based animation display method provided in an application embodiment of the present application;
图4是本申请实施例提供的一种终端设备的结构示意图;4 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
图5是本申请实施例提供的另一种终端设备的结构示意图;FIG. 5 is a schematic structural diagram of another terminal device according to an embodiment of the present disclosure;
图6是本申请实施例提供的又一种终端设备的结构示意图。FIG. 6 is a schematic structural diagram of still another terminal device according to an embodiment of the present application.
实施本发明的方式Mode for carrying out the invention
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排它的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必 限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the specification and claims of the present application and the above figures are used to distinguish similar objects without having to use To describe a specific order or order. It is to be understood that the data so used may be interchanged where appropriate, such that the embodiments of the present application described herein can be implemented, for example, in a sequence other than those illustrated or described herein. In addition, the terms "comprises" and "comprises" and "the" and "the" and "the" are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to Those steps or units may include other steps or units not explicitly listed or inherent to such processes, methods, products or devices.
通常情况下,终端设备的显示屏的刷新频率为每秒60次,和游戏动画的帧率是匹配的。在显示屏每次刷新前,终端设备将动画图像的位置沿着一定的方向移动一定的距离,例如1个像素(px)。这样,显示屏每次刷新出来的图像位置会和前一个图像位置相差1px,人们会看到图像在移动。由于人眼的视觉停留效应,当前位置的图像停留在大脑的印象还没消失,紧接着图像又被移到了下一个位置,因此会看到图像在流畅地移动。而如果帧率下降,终端设备显示屏的刷新频率和H5游戏页面的帧率不匹配时,便有可能在显示屏上不能呈现某些帧,出现失帧。失帧一般指由于硬件不足以负荷显示器画面动态显示刷新的频率,从而帧率过低所造成的画面出现停滞(或短时间或长时间)现象。失帧在游戏中就是玩游戏过程中,出现卡这种情况,图像未及时刷新造成,画面粘滞。Normally, the refresh rate of the display of the terminal device is 60 times per second, which matches the frame rate of the game animation. Before each refresh of the display, the terminal device moves the position of the animated image by a certain distance in a certain direction, for example, 1 pixel (px). In this way, the position of the image that is refreshed each time the display is different from the previous image position by 1px, people will see the image moving. Due to the visual pause effect of the human eye, the impression of the image at the current position staying in the brain has not disappeared, and then the image is moved to the next position, so that the image is seen to move smoothly. If the frame rate drops and the refresh rate of the display of the terminal device does not match the frame rate of the H5 game page, it is possible that some frames cannot be presented on the display screen, and a frame loss occurs. Frame loss generally refers to the phenomenon that the frame is slowed down (or short time or long time) due to insufficient hardware to load the dynamic display refresh rate of the display screen. Loss of frame in the game is the process of playing the game, the card appears this situation, the image is not refreshed in time, the picture is sticky.
在一些技术中,在H5游戏页面失帧的状态下,一般采用定时调用函数进行循环操作的方法,使得调用相关函数的循环操作次数固定在每秒30次左右。所调用的函数例如为移动游戏背景的函数、调整游戏中角色血量的函数等。但是,因为这种方法中,循环操作的次数较少,页面刷新次数也较少,可能会出现游戏执行速度缓慢的问题。另外,使用这种方法,普遍的做法是给性能差的手机设定固定的次数,但是不同手机的性能是不相同的,有可能在性能可以达到每秒60次循环操作的手机上设置的仍是每秒30次左右,这样便可能会出现硬件性能浪费的问题。In some techniques, in the state where the H5 game page is out of frame, the method of periodically calling the function to perform the loop operation is generally adopted, so that the number of loop operations for calling the related function is fixed at about 30 times per second. The function called is, for example, a function that moves the background of the game, a function that adjusts the amount of blood in the game, and the like. However, because of this method, the number of loop operations is small, the number of page refreshes is small, and the problem of slow game execution may occur. In addition, using this method, it is common practice to set a fixed number of times for poorly performing mobile phones, but the performance of different mobile phones is different, and it is possible to set the performance on a mobile phone with a performance of 60 cycles per second. It is about 30 times per second, so there may be a problem of wasted hardware performance.
本申请实施例提供了一种基于帧率的动画展示方法及装置。通过该方法和装置,终端设备会实时地计算动画页面的当前帧率,根据预设的正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中循环操作的当前偏移量,其中,根据该当前偏移量计算得到的动画页面中循环操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值,并根据当前偏移量展示当前帧。这样,在动画页面失帧时,动画页面的帧率动态变化的情况下,可以动态地确定依赖帧率的循环操作的当前偏移量,使动画页面中循环操作的速率保持不变,不会因帧率的降低而下降,从而保证了游戏的执行速度,流畅地 呈现游戏画面,避免动画出现卡滞的现象。另外,由于本申请是实时根据帧率自动计算应该进行循环操作的偏移量,可以更好地利用终端设备的硬件性能,适应各种终端设备。The embodiment of the present application provides a frame rate based animation display method and apparatus. Through the method and the device, the terminal device calculates the current frame rate of the animated page in real time, and determines the cyclic operation of the current frame to be displayed according to the product of the preset normal frame rate and the normal offset and the current frame rate. a current offset, wherein a total offset per second of the loop operation in the animation page calculated according to the current offset is a product of the normal frame rate and a normal offset, or a fixed value, and Presents the current frame based on the current offset. In this way, when the frame rate of the animation page changes dynamically when the animation page is out of frame, the current offset of the loop operation that depends on the frame rate can be dynamically determined, so that the rate of the loop operation in the animation page remains unchanged, and It decreases due to the decrease of the frame rate, thus ensuring the execution speed of the game, smoothly presenting the game screen, and avoiding the phenomenon of the animation being stuck. In addition, since the present application automatically calculates the offset that should be cyclically operated according to the frame rate in real time, the hardware performance of the terminal device can be better utilized to adapt to various terminal devices.
图1是本申请实施例提供的一种实施环境示意图。该实施环境包括终端设备10和为终端设备提供服务的服务器20。终端设备10通过无线或者有线网络与服务器20连接。终端设备10可以为能够访问服务器20的电子设备,例如可以为电脑、智能手机、平板电脑或者其他电子设备。服务器20可以为一个或者多个网站服务器、应用程序服务器,还可以是一个云存储中心。用户可以点击终端设备10上应用程序客户端中的相应游戏模块,向服务器请求运行相应的游戏,该游戏例如为H5页面游戏程序。在接收到应用程序客户端的请求之后,服务器向应用程序客户端下发运行所述游戏的所有数据,由应用程序客户端运行所述游戏。所述应用程序客户端例如为即时通信客户端或者游戏客户端等。在终端设备10中包括基于帧率的动画展示装置11和用于存储运行所述游戏所需的各种数据的存储器12。FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. The implementation environment includes a terminal device 10 and a server 20 that provides services to the terminal device. The terminal device 10 is connected to the server 20 via a wireless or wired network. The terminal device 10 can be an electronic device capable of accessing the server 20, and can be, for example, a computer, a smart phone, a tablet, or other electronic device. Server 20 can be one or more web servers, application servers, or a cloud storage center. The user can click on the corresponding game module in the application client on the terminal device 10 to request the server to run the corresponding game, such as the H5 page game program. After receiving the request from the application client, the server issues all data for running the game to the application client, and the game is run by the application client. The application client is, for example, an instant messaging client or a game client. A frame rate based animation display device 11 and a memory 12 for storing various data required to run the game are included in the terminal device 10.
图2A是本申请实施例提供的一种基于帧率的动画展示方法的流程图。其中的基于帧率的动画展示方法可以由支持基于帧率的动画的终端设备(比如游戏终端等)所执行。如图2A所示,所述方法包括:FIG. 2A is a flowchart of a frame rate based animation display method provided by an embodiment of the present application. The frame rate-based animation display method therein can be performed by a terminal device (such as a game terminal or the like) that supports frame rate-based animation. As shown in FIG. 2A, the method includes:
步骤101,计算动画页面的当前帧率,即每秒的动画页面的帧数。Step 101: Calculate a current frame rate of the animated page, that is, a number of frames of the animated page per second.
终端设备在展示基于帧率的动画页面时,需要先生成每帧动画页面然后再显示生成的动画页面。一般情况下,动画页面的帧率是固定不变,即终端设备每秒展示的动画页面的帧数一样,比如每秒60帧。而在动画页面失帧的情况下,帧率是动态变化的,本实施例中,需要实时地计算出动画页面的当前帧率。帧数就是在1秒钟时间里传输的图片的量,也可以理解为处理器每秒钟能够刷新几次,通常用fps(Frames Per Second)表示。When displaying a frame rate-based animated page, the terminal device needs to make each frame of the animated page and then display the generated animated page. In general, the frame rate of an animated page is fixed, that is, the number of frames of an animated page displayed by the terminal device per second is the same, for example, 60 frames per second. In the case that the animation page is out of frame, the frame rate is dynamically changed. In this embodiment, the current frame rate of the animated page needs to be calculated in real time. The number of frames is the amount of pictures transferred in one second. It can also be understood that the processor can be refreshed several times per second, usually expressed in fps (Frames Per Second).
本实施例的方法可以是终端设备以固定的周期触发的流程,固定周期例如为16毫秒;或是当检测到动画页面失帧时,终端设备才触发的流程。其中当终端设备检测到每秒展示的动画页面的帧数变化比较大时,可以确定终端设备的动画页面失帧。终端设备可以在开始生成每一帧动画页面时,记录当前时间 点。如果终端设备判断开始生成前一帧的时间和开始生成当前帧的时间之差大于预设的阈值,例如16毫秒,则判断为每秒展示的动画页面的帧数变化比较大,认为出现失帧。The method in this embodiment may be a process in which the terminal device is triggered by a fixed period, and the fixed period is, for example, 16 milliseconds; or the process triggered by the terminal device when the lost frame of the animation page is detected. When the terminal device detects that the number of frames of the animated page displayed per second is relatively large, it may be determined that the animation page of the terminal device is out of frame. The terminal device can record the current time point when it starts generating each frame of the animation page. If the difference between the time when the terminal device determines to start generating the previous frame and the time when the current frame is started to be generated is greater than a preset threshold, for example, 16 milliseconds, it is determined that the number of frames of the animated page displayed per second is relatively large, and the frame loss is considered to occur. .
步骤102,根据正常帧率与正常偏移量的乘积及上述步骤101计算的当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为上述正常帧率与正常偏移量的乘积,或为某一固定值。Step 102: Determine, according to a product of a normal frame rate and a normal offset, and a current frame rate calculated in the foregoing step 101, a current offset of an operation in the current frame to be displayed relative to a previous frame, so that the current offset is determined according to the current offset. The total offset per second of the operation in the animation page obtained by the shift calculation is the product of the above normal frame rate and the normal offset, or a fixed value.
其中,正常帧率是动画页面未失帧时的帧率,正常偏移量是动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与上述正常帧率与正常偏移量的乘积的差值在预置范围内的值。正常帧率和正常偏移量可以是由用户事先预置在终端设备中的,也可以是在动画页面未失帧时,由终端设备计算并储存在终端设备的。这里的操作可以称为是循环操作,指每帧动画页面中相同的操作,比如游戏画面中背景不断向前移动等操作。例如,终端设备在绘制每一帧动画页面时,会执行一次requestAnimationFrame函数(或称为方法)。在这个requestAnimationFrame函数中,包括在每一帧动画页面中进行具体业务处理的函数。执行这些函数以进行相应的业务处理。例如,其中包括更新地图函数,对游戏中的地图进行更新;更新菜单函数,对游戏中的菜单显示进行更新;碰撞检测函数,检测是否会出现碰撞;舞台更新函数,更新游戏中的舞台等。这些函数在各帧动画页面中的循环执行即为循环操作。在执行有的业务处理函数时,每一帧相对于前一帧会有一个偏移量。例如,舞台更新函数可能会更新舞台的位置,使舞台向后移动一定的偏移量,这样可以使动画中的人物相对于舞台呈现出动态。The normal frame rate is the frame rate when the animation page is not lost. The normal offset is the offset of the operation of the current frame relative to the previous frame when the animation page is not lost. A fixed value is The difference between the above-mentioned product of the normal frame rate and the normal offset is a value within a preset range. The normal frame rate and the normal offset may be preset by the user in the terminal device, or may be calculated by the terminal device and stored in the terminal device when the animation page has not lost frames. The operation here can be called a loop operation, which refers to the same operation in each frame of the animation page, such as the operation of the background moving forward in the game screen. For example, when the terminal device draws each frame of the animated page, it executes a requestAnimationFrame function (or method). In this requestAnimationFrame function, a function that performs specific business processing in each frame of the animation page. Execute these functions for the appropriate business processing. For example, it includes updating the map function to update the map in the game; updating the menu function to update the menu display in the game; collision detection function to detect whether there is a collision; the stage update function, updating the stage in the game, and the like. The loop execution of these functions in each frame of the animation page is a loop operation. When performing a business process function, each frame will have an offset from the previous frame. For example, the Stage Update function might update the position of the Stage, moving the Stage backwards by a certain amount of offset, which will make the characters in the animation appear dynamic relative to the Stage.
一般情况下,每帧动画页面中循环操作的偏移量也是固定不变的,这样终端设备每秒展示的动画页面中循环操作的次数也固定不变,比如每秒60次。而在动画页面失帧的情况下,为了使得循环操作的速率不变,本实施例中,需要实时地根据当前帧率确定相应的当前偏移量,使得根据当前偏移量计算得到的动画页面中循环操作的每秒总偏移量不变,比如与正常情况下动画页面中循环操作的每秒总偏移量(即正常偏移量与正常帧率的乘积)相同,也可以是固定为某一值,在这里不进行限定。In general, the offset of the loop operation in each frame of the animation page is also fixed, so that the number of loop operations in the animation page displayed by the terminal device per second is also fixed, for example, 60 times per second. In the case that the animation page is out of frame, in order to make the rate of the loop operation unchanged, in this embodiment, it is required to determine the corresponding current offset according to the current frame rate in real time, so that the generated animation page is calculated according to the current offset. The total offset per second of the loop operation is unchanged, such as the total offset per second of the loop operation in the animation page under normal conditions (that is, the product of the normal offset and the normal frame rate), or it can be fixed to A certain value is not limited here.
例如,在正常情况下,每帧动画页面中循环操作的正常偏移量为1个像 素,而一秒有60帧,则动画页面中循环操作的每秒总偏移量为60个像素,在本实施例中,可以确定相应的当前偏移量,使得当前帧率与当前偏移量的乘积为60。For example, under normal circumstances, the normal offset of the loop operation in each frame of the animation page is 1 pixel, and 60 frames per second, the total offset per second of the loop operation in the animation page is 60 pixels. In this embodiment, the corresponding current offset may be determined such that the product of the current frame rate and the current offset is 60.
具体地,终端设备在执行本步骤时,在一种情况下,可以直接将正常帧率与正常偏移量的乘积与当前帧率的比值确定为当前偏移量。在另一种情况下,终端设备需要先确定与上述正常帧率与正常偏移量的乘积之间的差值在预置范围的某一值为某一固定值,然后再将某一固定值与当前帧率的比值确定为当前偏移量。Specifically, when the terminal device performs this step, in one case, the ratio of the product of the normal frame rate to the normal offset and the current frame rate may be directly determined as the current offset. In another case, the terminal device needs to determine that the difference between the product of the normal frame rate and the normal offset is a certain fixed value, and then a fixed value. The ratio to the current frame rate is determined as the current offset.
步骤103,根据步骤102中确定的当前偏移量展示所述当前帧。具体地,是在展示的一帧动画页面的基础上,循环操作的对象按照根据该帧动画页面确定的当前偏移量进行偏移后,得到下一帧动画页面,并展示下一帧动画页面,依次类推,展示每帧动画页面。Step 103: Display the current frame according to the current offset determined in step 102. Specifically, on the basis of the displayed one-frame animation page, the object of the loop operation is offset according to the current offset determined according to the frame animation page, and the next frame animation page is obtained, and the next frame animation page is displayed. , and so on, showing each frame of the animation page.
可见,在本实施例的方法中,终端设备会实时地计算动画页面的当前帧率,然后根据动画页面未失帧时的正常帧率与正常偏移量的乘积及当前帧率,确定每帧动画页面中循环操作的当前偏移量,使得动画页面中循环操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值,并根据当前偏移量展示动画页面。这样由于在动画页面失帧时,动画页面的帧率是动态变化的,则需要动态地确定依赖帧率的循环操作的当前偏移量,使得动画页面中循环操作的速率保持不变,不会因帧率的降低而下降。It can be seen that, in the method of the embodiment, the terminal device calculates the current frame rate of the animated page in real time, and then determines each frame according to the product of the normal frame rate and the normal offset amount when the animation page is not lost, and the current frame rate. The current offset of the loop operation in the animation page, such that the total offset per second of the loop operation in the animation page is the product of the normal frame rate and the normal offset, or a fixed value, and based on the current offset The volume shows the animated page. In this way, since the frame rate of the animated page is dynamically changed when the animation page is lost, it is necessary to dynamically determine the current offset of the loop operation that depends on the frame rate, so that the rate of the loop operation in the animation page remains unchanged, and will not Decreased due to a decrease in the frame rate.
在一个具体的实施例中,终端设备在执行上述步骤101时,可以在开始生成每帧动画页面时,记录其对应的开始生成时间,然后根据每帧动画页面的开始生成时间,确定每帧动画页面的平均耗时,根据平均耗时确定当前帧率。比如每帧动画页面的平均耗时为16.7毫秒时,帧率为每秒60帧。其中,在确定每帧动画页面的平均耗时时,可以先得到相邻帧动画页面的开始生成时间的差值,然后将这些差值进行平均得到每帧动画页面的平均耗时,而当前帧率为1秒与平均耗时的比值。In a specific embodiment, when performing the above step 101, the terminal device may record the corresponding start generation time when starting to generate each frame of the animation page, and then determine the animation of each frame according to the start time of each frame of the animation page. The average time of the page, the current frame rate is determined based on the average time. For example, when the average time of each frame of animation is 16.7 milliseconds, the frame rate is 60 frames per second. Wherein, when determining the average time of each frame of the animation page, the difference between the start generation time of the adjacent frame animation page may be obtained first, and then the difference values are averaged to obtain the average time of each frame of the animation page, and the current frame rate is obtained. It is the ratio of 1 second to the average time consuming.
具体地,由于终端设备在生成每帧动画页面时是通过调用动画页面的绘制函数来生成的,因此,本实施例中,可以在每次调用动画页面的绘制函数生成某一帧动画页面时,记录调用时间作为相应帧动画页面的开始生成时间。Specifically, since the terminal device is generated by calling the drawing function of the animation page when generating the animation page of each frame, in this embodiment, each time the animation function page of the animation page is generated, a certain frame animation page may be generated. Record the call time as the start generation time of the corresponding frame animation page.
其中动画页面的绘制函数可以是请求动画帧(requestAnimationFrame)函 数,终端设备在每绘制一帧动画页面时,会执行一次requestAnimationFrame函数。动画页面的绘制函数还可以是设置间距(setInterval)函数,或是设置超时(setTimeout)函数。setInterval函数表示根据指定的事件间隔循环执行一段代码。setTimeout函数表示一定时间间隔之后执行一段代码。The drawing function of the animated page may be a request animation frame (requestAnimationFrame) function, and the terminal device executes the requestAnimationFrame function every time an animation page is drawn. The drawing function of the animated page can also be a set spacing function (setInterval) or a set timeout (setTimeout) function. The setInterval function means that a piece of code is looped according to the specified event interval. The setTimeout function represents a piece of code that executes after a certain time interval.
但是由于requestAnimationFrame函数是与帧率对应的,即每一帧动画页面的绘制都会调用该函数,则本实施例中,可以直接在调用该函数时记录调用时间。However, since the requestAnimationFrame function corresponds to the frame rate, that is, the drawing of each frame of the animation page is called, in this embodiment, the calling time can be recorded directly when the function is called.
而setInterval函数或是setTimeout函数是与帧率不对应的,即在终端设备展示每一帧动画页面时,不一定都需要调用这种类型函数,在这种情况下,这就需要用户通过终端设备事先设定在展示每帧动画页面时都需要调用这种类型函数(setInterval函数或是setTimeout函数),使得这种类型函数与帧率相对应,这样终端设备才能根据调用这种类型函数的调用时间得到每帧动画页面的平均耗时。The setInterval function or the setTimeout function does not correspond to the frame rate. That is, when the terminal device displays each frame of the animation page, it is not necessary to call this type function. In this case, the user needs to pass the terminal device. In advance, you need to call this type function (setInterval function or setTimeout function) when displaying each frame of animation page, so that this type of function corresponds to the frame rate, so that the terminal device can call the call time according to the call of this type function. Get the average time spent on each frame of animated pages.
在一个页面游戏中,通常会在游戏画布上绘制多个对象。每个对象可以有自己独立的行为。这样,在游戏中,循环操作函数来处理这些对象时,可以为每一个对象执行各自需要的偏移量,然后根据统一的失帧率来进行上述方法各步骤中的计算。In a page game, multiple objects are usually drawn on the game canvas. Each object can have its own independent behavior. Thus, in the game, when the loop operation function is used to process these objects, the respective required offsets can be performed for each object, and then the calculations in the respective steps of the above method are performed according to the unified frame loss rate.
通过本申请实施例的基于帧率的动画展示方法,在动画页面失帧时,动画页面的帧率动态变化的情况下,可以动态地确定依赖帧率的循环操作的当前偏移量,使动画页面中循环操作的速率保持不变,不会因帧率的降低而下降,从而保证了游戏的执行速度,流畅地呈现游戏画面,避免动画出现卡滞的现象。另外,由于本申请是实时根据帧率自动计算应该进行循环操作的偏移量,可以更好地利用终端设备的硬件性能,适应各种终端设备。According to the frame rate-based animation display method of the embodiment of the present application, when the frame rate of the animation page is dynamically changed when the animation page is out of frame, the current offset of the loop operation dependent on the frame rate can be dynamically determined, and the animation is made. The rate of the loop operation in the page remains unchanged, and does not decrease due to the decrease of the frame rate, thereby ensuring the execution speed of the game, smoothly presenting the game screen, and avoiding the phenomenon of the animation being stuck. In addition, since the present application automatically calculates the offset that should be cyclically operated according to the frame rate in real time, the hardware performance of the terminal device can be better utilized to adapt to various terminal devices.
参考图2B所示,在另一个具体的实施例中,终端设备在执行上述步骤101之后,可以先执行如下步骤104:Referring to FIG. 2B, in another specific embodiment, after performing the foregoing step 101, the terminal device may perform the following step 104:
步骤104,判断上述步骤101计算的当前帧率与正常帧率是否一致,如果一致,则执行步骤105,如果不一致,才会执行上述步骤102和103。In step 104, it is determined whether the current frame rate calculated in the above step 101 is consistent with the normal frame rate. If they are consistent, step 105 is performed. If not, the above steps 102 and 103 are performed.
步骤105,根据正常偏移量展示所述当前帧。Step 105: Display the current frame according to a normal offset.
本实施例中,终端设备考虑到了如果动画页面的帧率未发生变化时,可以 不用重新确定当前偏移量,而是直接根据正常偏移量展示每帧动画页面。In this embodiment, the terminal device considers that if the frame rate of the animation page does not change, the current offset may not be re-determined, but the animation page of each frame is directly displayed according to the normal offset.
以下以一个具体的实施例来说明本申请实施例的方法,本实施例中的终端设备为游戏终端,终端设备显示的动画页面为游戏页面,参考图3所示,本实施例的方法包括:The method of the embodiment of the present application is described in a specific embodiment. The terminal device in this embodiment is a game terminal, and the animation page displayed by the terminal device is a game page. Referring to FIG. 3, the method in this embodiment includes:
步骤201,游戏终端设定游戏页面在未失帧时,游戏页面的帧率为60,即每秒为60帧,且游戏页面中循环操作(例如,游戏中的背景元素不断向前移动)的正常偏移量为X(px),正常状态下一秒为60帧,则动画页面中循环操作的总运动量为60X(px)。 Step 201, the game terminal sets the game page when the frame is not lost, the frame rate of the game page is 60, that is, 60 frames per second, and the loop operation in the game page (for example, the background element in the game continuously moves forward) The normal offset is X(px), and the normal state is 60 frames in the next second. The total amount of motion for the loop operation in the animation page is 60X (px).
步骤202,在游戏终端启动时,在生成每一帧游戏页面时,会调用requestAnimationFrame函数来生成游戏页面,游戏终端会记录调用该请求动画帧函数的时间,从而根据记录的时间,根据一帧游戏页面的生成时间与下一帧游戏页面的生成时间之差,计算出该帧游戏页面的耗时T,从而得到游戏页面的当前帧率Y为1秒/T。Step 202: When the game terminal is started, when the game page of each frame is generated, the requestAnimationFrame function is called to generate a game page, and the game terminal records the time of calling the requested animation frame function, so that according to the recorded time, according to the one-frame game The difference between the generation time of the page and the generation time of the next frame game page is calculated, and the time T of the game page of the frame is calculated, so that the current frame rate Y of the game page is 1 second/T.
步骤203,计算正常帧率(60帧/秒)与当前帧率Y的比值Z,即Z=60/Y。 Step 203, calculating a ratio Z of the normal frame rate (60 frames/second) to the current frame rate Y, that is, Z=60/Y.
步骤204,将正常偏移量X和上述正常帧率与当前帧率的比值Z的乘积作为游戏页面中循环操作的当前偏移量。 Step 204, the product of the normal offset X and the ratio Z of the normal frame rate to the current frame rate is used as the current offset of the loop operation in the game page.
步骤205,游戏终端根据当前偏移量展示下一帧游戏页面。Step 205: The game terminal displays the next frame of the game page according to the current offset.
在游戏终端的实际操作过程中,游戏终端会循环执行上述步骤202和203,从而确保游戏页面中循环操作(游戏页面中背景向前移动)的每秒总偏移量接近于60X(px)。During the actual operation of the gaming terminal, the gaming terminal loops through the above steps 202 and 203 to ensure that the total offset per second of the looping operation in the game page (the background moving forward in the game page) is close to 60X (px).
例如,在超级马里奥的游戏终端,每帧动画页面中的循环操作为马里奥自动向前跑,在正常状态下每帧游戏页面中马里奥自动向前移动1个像素(px),每秒可以移动60px,而在失帧状态下,游戏页面的帧率可能一秒只有20帧,通过上述方法计算出游戏页面中马里奥需要自动向前移动3个像素,才能使得马里奥的运行速率不变。For example, in Super Mario's game terminal, the loop operation in each frame of the animation page is Mario's automatic forward running. In the normal state, Mario automatically moves forward by 1 pixel (px) per frame of the game page. Can move 60px, and in the frame loss state, the frame rate of the game page may only be 20 frames per second. By the above method, Mario needs to automatically move forward 3 pixels in the game page, so that the running speed of Mario is not change.
本申请实施例还提供一种终端设备,其结构示意图如图4所示,具体可以 包括:The embodiment of the present application further provides a terminal device, and a schematic structural diagram thereof is shown in FIG. 4, and specifically includes:
帧率计算单元10,用于计算动画页面的当前帧率;a frame rate calculation unit 10, configured to calculate a current frame rate of the animation page;
偏移量确定单元11,用于根据正常帧率与正常偏移量的乘积及所述帧率计算单元10计算的当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;具体地,所述偏移量确定单元11,用于将所述正常帧率与正常偏移量的乘积与所述当前帧率的比值确定为所述当前偏移量;或确定与所述正常帧率与正常偏移量的乘积之间的差值在预置范围的某一值为所述某一固定值,将所述某一固定值与所述当前帧率的比值确定为所述当前偏移量。The offset determining unit 11 is configured to determine, according to a product of a normal frame rate and a normal offset and a current frame rate calculated by the frame rate calculating unit 10, an operation of the current frame to be displayed relative to a previous frame thereof. The current offset, such that the total offset per second of the operation in the animated page calculated according to the current offset is the product of the normal frame rate and the normal offset, or a fixed value; The normal frame rate is a frame rate when the animation page has not lost frames, and the normal offset is an offset of an operation of the current frame relative to a previous frame when the animation page is not lost. a fixed value is a value within a preset range of the product of the normal frame rate and the normal offset; specifically, the offset determining unit 11 is configured to compare the normal frame rate with The ratio of the product of the normal offset to the current frame rate is determined as the current offset; or the difference between the product of the normal frame rate and the normal offset is determined to be within a preset range a value of the fixed value, the fixed value and the current frame rate Value is determined as the current offset.
第一展示单元12,用于根据所述偏移量确定单元11确定的当前偏移量展示所述当前帧。The first display unit 12 is configured to display the current frame according to the current offset determined by the offset determining unit 11.
可见,在终端设备中,帧率计算单元10会实时地计算动画页面的当前帧率,然后偏移量确定单元11根据动画页面未失帧时的正常帧率与正常偏移量的乘积及当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为正常帧率与正常偏移量的乘积或为某一固定值,并由第一展示单元12根据当前偏移量展示当前帧。这样由于在动画页面失帧时,动画页面的帧率是动态变化的,则需要动态地确定依赖帧率的循环操作的当前偏移量,使得动画页面中循环操作的速率保持不变,不会因帧率的降低而下降,从而保证了游戏的执行速度,流畅地呈现游戏画面。It can be seen that in the terminal device, the frame rate calculation unit 10 calculates the current frame rate of the animation page in real time, and then the offset amount determining unit 11 compares the normal frame rate with the normal offset amount and the current time when the animation page has not lost the frame. a frame rate, the current offset of the operation in the current frame relative to the previous frame to be displayed, such that the total offset per second of the operation in the animated page calculated according to the current offset is the normal frame rate The product of the normal offset is either a fixed value, and the first display unit 12 presents the current frame based on the current offset. In this way, since the frame rate of the animated page is dynamically changed when the animation page is lost, it is necessary to dynamically determine the current offset of the loop operation that depends on the frame rate, so that the rate of the loop operation in the animation page remains unchanged, and will not The frame rate is lowered due to the decrease in the frame rate, thereby ensuring the execution speed of the game and smoothly presenting the game screen.
参考图5所示,在一个具体的实施例中,终端设备除了可以包括如图4的结构外,还可以包括第二展示单元13和设定单元14,且其中的帧率计算单元10可以通过时间记录单元110和耗时计算单元120来实现,具体地:Referring to FIG. 5, in a specific embodiment, the terminal device may include a second display unit 13 and a setting unit 14 in addition to the structure of FIG. 4, and the frame rate calculation unit 10 may pass The time recording unit 110 and the time consuming computing unit 120 are implemented, specifically:
时间记录单元110,用于在开始生成每帧动画页面时,记录其对应的开始生成时间;其中,如果所述生成每帧动画页面是通过调用动画页面的绘制函数 来生成,则所述时间记录单元110,具体用于在调用所述动画页面的绘制函数生成某一帧动画页面时,记录调用时间作为所述相应帧动画页面的开始生成时间。The time recording unit 110 is configured to record a corresponding start generation time when starting to generate each frame of the animation page; wherein, if the generating each frame of the animation page is generated by calling a drawing function of the animation page, the time recording The unit 110 is specifically configured to record a call time as a start generation time of the corresponding frame animation page when the drawing function of the animation page is generated to generate a certain frame animation page.
具体地,动画页面的绘制函数可以为请求动画帧函数,设置间距函数或设置超时函数等函数,如果所述动画页面的绘制函数为设置间距函数或设置超时函数时,终端设备还需要通过设定单元14来设定在展示每帧动画页面时都需要调用所述设置间距函数或设置超时函数,使得时间记录单元110根据设定单元14的设定记录函数的调用时间。Specifically, the drawing function of the animation page may be a function of requesting an animation frame function, setting a spacing function or setting a timeout function, and if the drawing function of the animation page is setting a spacing function or setting a timeout function, the terminal device also needs to set The unit 14 is configured to call the set pitch function or set the timeout function when displaying each frame of the animation page, so that the time recording unit 110 records the calling time of the function according to the setting of the setting unit 14.
耗时计算单元120,用于根据所述时间记录单元110记录的每帧动画页面的开始生成时间,确定每帧动画页面的平均耗时,根据所述平均耗时确定所述当前帧率。The time consuming calculation unit 120 is configured to determine an average time consumption of each frame of the animation page according to the start generation time of each frame of the animation page recorded by the time recording unit 110, and determine the current frame rate according to the average time consuming.
第二展示单元13,用于如果所述帧率计算单元10中耗时计算单元120计算的当前帧率与所述正常帧率一致,根据所述正常偏移量展示每帧动画页面。The second display unit 13 is configured to display each frame of the animation page according to the normal offset amount if the current frame rate calculated by the time consuming calculation unit 120 in the frame rate calculation unit 10 is consistent with the normal frame rate.
在本实施例中,当帧率计算单元10中耗时计算单元120计算了当前帧率后,如果当前帧率与正常帧率一致,则通过第二展示单元13展示当前帧动画页面。如果所述当前帧率与所述正常帧率不一致,则先通过偏移量确定单元11确定当前偏移量后,由第一展示单元12展示当前帧动画页面。In the present embodiment, after the current frame rate is calculated by the time-consuming calculation unit 120 in the frame rate calculation unit 10, if the current frame rate is consistent with the normal frame rate, the current frame animation page is displayed by the second display unit 13. If the current frame rate does not coincide with the normal frame rate, the current frame animation page is displayed by the first display unit 12 after the offset amount determining unit 11 determines the current offset.
上述各单元的具体操作可以参考方法实施例中的具体描述。Specific operations of the above units may be referred to the specific description in the method embodiments.
通过本申请实施例的基于帧率的动画展示装置,在动画页面失帧时,动画页面的帧率动态变化的情况下,可以动态地确定依赖帧率的循环操作的当前偏移量,使动画页面中循环操作的速率保持不变,不会因帧率的降低而下降,从而保证了游戏的执行速度,流畅地呈现游戏画面,避免动画出现卡滞的现象。另外,由于本申请是实时根据帧率自动计算应该进行循环操作的偏移量,可以更好地利用终端设备的硬件性能,适应各种终端设备。With the frame rate-based animation display device of the embodiment of the present application, when the frame rate of the animation page is dynamically changed when the animation page is lost, the current offset of the loop operation dependent on the frame rate can be dynamically determined, and the animation is made. The rate of the loop operation in the page remains unchanged, and does not decrease due to the decrease of the frame rate, thereby ensuring the execution speed of the game, smoothly presenting the game screen, and avoiding the phenomenon of the animation being stuck. In addition, since the present application automatically calculates the offset that should be cyclically operated according to the frame rate in real time, the hardware performance of the terminal device can be better utilized to adapt to various terminal devices.
本申请实施例还提供一种终端设备,其结构示意图如图6所示,该终端设备可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)20(例如,一个或一个以上处理器)和存储器21,一个或一个以上存储应用程序221或数据222的存储介质22(例如一个或一个以上海量存储设备)。其中,存储器21和存储介质22可以是短暂 存储或持久存储。存储在存储介质22的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对终端设备中的一系列指令操作。更进一步地,中央处理器20可以设置为与存储介质22通信,在终端设备上执行存储介质22中的一系列指令操作。The embodiment of the present application further provides a terminal device, which is shown in FIG. 6. The terminal device may have a large difference due to different configurations or performances, and may include one or more central processing units (central processing units, CPU) 20 (eg, one or more processors) and memory 21, one or more storage media 22 that store application 221 or data 222 (eg, one or one storage device in Shanghai). Among them, the memory 21 and the storage medium 22 may be short-term storage or persistent storage. The program stored on the storage medium 22 may include one or more modules (not shown), each of which may include a series of instruction operations in the terminal device. Still further, central processor 20 may be arranged to communicate with storage medium 22 to perform a series of instruction operations in storage medium 22 on the terminal device.
具体地,在存储介质22中储存的应用程序221包括基于帧率的动画展示的应用程序,且该程序可以包括上述终端设备中的帧率计算单元10,偏移量确定单元11,第一展示单元12,第二展示单元13和设定单元14,在此不进行赘述。更进一步地,中央处理器20可以设置为与存储介质22通信,在终端设备上执行存储介质22中储存的基于帧率的动画展示的应用程序对应的一系列操作。所述基于帧率的动画展示的应用程序也可以包括图2A、2B和图3中描述的操作。Specifically, the application 221 stored in the storage medium 22 includes an application program based on a frame rate-based animation, and the program may include the frame rate calculation unit 10 in the above-described terminal device, the offset determination unit 11, the first display The unit 12, the second display unit 13 and the setting unit 14 are not described herein. Still further, the central processor 20 can be arranged to communicate with the storage medium 22 to perform a series of operations corresponding to the application of the frame rate based animation stored in the storage medium 22 on the terminal device. The application of the frame rate based animation display may also include the operations described in Figures 2A, 2B, and 3.
终端设备还可以包括一个或一个以上电源23,一个或一个以上有线或无线网络接口24,一个或一个以上输入输出接口25,和/或,一个或一个以上操作系统223,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。The terminal device may also include one or more power sources 23, one or more wired or wireless network interfaces 24, one or more input and output interfaces 25, and/or one or more operating systems 223, such as Windows ServerTM, Mac OS. XTM, UnixTM, LinuxTM, FreeBSDTM and more.
上述方法实施例中所述的由终端设备所执行的步骤可以基于该图6所示的终端设备的结构。The steps performed by the terminal device described in the foregoing method embodiments may be based on the structure of the terminal device shown in FIG. 6.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM)、随机存取存储器RAM)、磁盘或光盘等。A person skilled in the art may understand that all or part of the various steps of the foregoing embodiments may be performed by a program to instruct related hardware. The program may be stored in a computer readable storage medium, and the storage medium may include: Read only memory (ROM), random access memory (RAM), magnetic or optical disk, and the like.
以上对本申请实施例所提供的基于帧率的动画展示方法及终端设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The frame rate-based animation display method and the terminal device provided by the embodiments of the present application are described in detail. The principles and implementation manners of the present application are described in the specific examples. The description of the above embodiments is only for helping. The method of the present application and its core idea are understood; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and the scope of application. It should be understood that the limitations of the application.

Claims (19)

  1. 一种基于帧率的动画展示方法,包括:A frame rate based animation display method, including:
    计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
    根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
    根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
  2. 如权利要求1所述的方法,其中,所述计算动画页面的当前帧率,具体包括:The method of claim 1, wherein the calculating the current frame rate of the animated page comprises:
    在开始生成每帧动画页面时,记录对应的开始生成时间;Record the corresponding start generation time when starting to generate each frame of the animation page;
    根据所述每帧动画页面的开始生成时间,确定每帧动画页面的平均耗时,根据所述平均耗时确定所述当前帧率。Determining an average time of each frame of the animation page according to the start generation time of each frame of the animation page, and determining the current frame rate according to the average time consumption.
  3. 如权利要求2所述的方法,其中,所述生成每帧动画页面是通过调用动画页面的绘制函数来生成,则所述在开始生成每帧动画页面时,记录对应的开始生成时间,具体包括:The method of claim 2, wherein the generating each frame of the animation page is generated by calling a drawing function of the animation page, and when the starting of each frame of the animation page is started, recording a corresponding start generation time, specifically including :
    在调用所述动画页面的绘制函数生成某一帧动画页面时,记录调用时间作为所述相应帧动画页面的开始生成时间。When the drawing function of the animation page is called to generate a certain frame of the animation page, the call time is recorded as the start generation time of the corresponding frame animation page.
  4. 如权利要求3所述的方法,其中,所述动画页面的绘制函数为请求动画帧函数,设置间距函数或设置超时函数;The method of claim 3, wherein the rendering function of the animated page is a request animation frame function, setting a spacing function or setting a timeout function;
    其中,如果所述动画页面的绘制函数为设置间距函数或设置超时函数时,所述方法还包括:设定在展示每帧动画页面时都需要调用所述设置间距函数或设置超时函数。Wherein, if the drawing function of the animation page is a setting pitch function or setting a timeout function, the method further comprises: setting the setting spacing function or setting a timeout function when displaying each frame of the animation page.
  5. 如权利要求1所述的方法,其中,所述根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,具体包括:The method of claim 1, wherein said determining a current offset of an operation of a current frame relative to a previous frame thereof to be displayed based on a product of a normal frame rate and a normal offset and said current frame rate The quantity, such that the total offset per second of the operation in the animation page calculated according to the current offset is the product of the normal frame rate and the normal offset, and specifically includes:
    将所述正常帧率与正常偏移量的乘积与所述当前帧率的比值确定为所述当 前偏移量;Determining a ratio of a product of the normal frame rate to a normal offset to the current frame rate as the current offset;
    所述根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中循环操作的每秒总偏移量为某一固定值,具体包括:Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation in a current frame to be displayed relative to a previous frame, such that the current offset is calculated according to the current offset The total offset per second of the loop operation in the animated page is a fixed value, including:
    确定与所述正常帧率与正常偏移量的乘积之间的差值在预置范围的某一值为所述某一固定值,将所述某一固定值与所述当前帧率的比值确定为所述当前偏移量。Determining a difference between the product of the normal frame rate and the normal offset in a preset range as a certain fixed value, and comparing the ratio of the certain fixed value to the current frame rate Determined to be the current offset.
  6. 如权利要求1至5任一项所述的方法,其中,所述计算动画页面的当前帧率之后,所述方法还包括:The method of any one of claims 1 to 5, wherein after the calculating the current frame rate of the animated page, the method further comprises:
    如果所述当前帧率与所述正常帧率一致,根据所述正常偏移量展示所述当前帧;If the current frame rate is consistent with the normal frame rate, displaying the current frame according to the normal offset;
    如果所述当前帧率与所述正常帧率不一致,执行所述确定当前偏移量及根据所述当前偏移量展示当前帧的步骤。If the current frame rate does not coincide with the normal frame rate, performing the step of determining a current offset and presenting a current frame according to the current offset.
  7. 一种终端设备,包括:处理器和存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令由所述处理器执行以完成以下操作:A terminal device comprising: a processor and a memory, the computer having stored thereon computer readable instructions, the computer readable instructions being executed by the processor to:
    计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
    根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
    根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
  8. 如权利要求7所述的终端设备,其中,所述计算动画页面的当前帧率,具体包括:The terminal device of claim 7, wherein the calculating a current frame rate of the animation page comprises:
    在开始生成每帧动画页面时,记录对应的开始生成时间;Record the corresponding start generation time when starting to generate each frame of the animation page;
    根据所述每帧动画页面的开始生成时间,确定每帧动画页面的平均耗时,根据所述平均耗时确定所述当前帧率。Determining an average time of each frame of the animation page according to the start generation time of each frame of the animation page, and determining the current frame rate according to the average time consumption.
  9. 如权利要求8所述的终端设备,其中,所述生成每帧动画页面是通过调用动画页面的绘制函数来生成,则所述在开始生成每帧动画页面时,记录对 应的开始生成时间,具体包括:The terminal device according to claim 8, wherein the generating each frame of the animation page is generated by calling a drawing function of the animation page, and when the starting of each frame of the animation page is started, recording a corresponding start generation time, specifically include:
    在调用所述动画页面的绘制函数生成某一帧动画页面时,记录调用时间作为所述相应帧动画页面的开始生成时间。When the drawing function of the animation page is called to generate a certain frame of the animation page, the call time is recorded as the start generation time of the corresponding frame animation page.
  10. 如权利要求9所述的终端设备,其中,所述动画页面的绘制函数为请求动画帧函数,设置间距函数或设置超时函数;The terminal device according to claim 9, wherein the drawing function of the animation page is a request animation frame function, setting a spacing function or setting a timeout function;
    其中,如果所述动画页面的绘制函数为设置间距函数或设置超时函数时,设定在展示每帧动画页面时都需要调用所述设置间距函数或设置超时函数。Wherein, if the drawing function of the animated page is to set a spacing function or set a timeout function, it is required to call the setting spacing function or setting a timeout function when displaying each frame of the animation page.
  11. 如权利要求7所述的终端设备,其中,所述根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,具体包括:The terminal device according to claim 7, wherein said determining, based on a product of a normal frame rate and a normal offset and said current frame rate, determining a current bias of an operation in a current frame to be displayed relative to a previous frame thereof The shift amount is such that the total offset per second of the operation in the animation page calculated according to the current offset is the product of the normal frame rate and the normal offset, and specifically includes:
    将所述正常帧率与正常偏移量的乘积与所述当前帧率的比值确定为所述当前偏移量;Determining a ratio of a product of the normal frame rate to a normal offset to the current frame rate as the current offset;
    所述根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中循环操作的每秒总偏移量为某一固定值,具体包括:Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation in a current frame to be displayed relative to a previous frame, such that the current offset is calculated according to the current offset The total offset per second of the loop operation in the animated page is a fixed value, including:
    确定与所述正常帧率与正常偏移量的乘积之间的差值在预置范围的某一值为所述某一固定值,将所述某一固定值与所述当前帧率的比值确定为所述当前偏移量。Determining a difference between the product of the normal frame rate and the normal offset in a preset range as a certain fixed value, and comparing the ratio of the certain fixed value to the current frame rate Determined to be the current offset.
  12. 如权利要求7至11任一项所述的终端设备,其中,在所述计算动画页面的当前帧率之后,所述计算机可读指令由所述处理器执行以进一步完成以下操作:A terminal device according to any one of claims 7 to 11, wherein after said calculating a current frame rate of an animated page, said computer readable instructions are executed by said processor to further perform the following operations:
    如果所述当前帧率与所述正常帧率一致,根据所述正常偏移量展示所述当前帧;If the current frame rate is consistent with the normal frame rate, displaying the current frame according to the normal offset;
    如果所述当前帧率与所述正常帧率不一致,执行所述确定当前偏移量及根据所述当前偏移量展示当前帧的步骤。If the current frame rate does not coincide with the normal frame rate, performing the step of determining a current offset and presenting a current frame according to the current offset.
  13. 一种基于帧率的动画展示方法,应用于终端设备上,所述方法包括:A frame rate-based animation display method is applied to a terminal device, and the method includes:
    计算动画页面的当前帧率;Calculate the current frame rate of the animated page;
    根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动 画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,或为某一固定值;其中,所述正常帧率是所述动画页面未失帧时的帧率,所述正常偏移量是所述动画页面未失帧时所述当前帧相对于其前一帧的操作的偏移量,某一固定值为与所述正常帧率与正常偏移量的乘积的差值在预置范围内的值;Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation relative to a previous frame in the current frame to be displayed, such that the animation calculated according to the current offset The total offset per second of the operation in the page is the product of the normal frame rate and the normal offset, or a fixed value; wherein the normal frame rate is the frame when the animation page is not lost. Rate, the normal offset is an offset of the operation of the current frame relative to a previous frame when the animation page is not lost, and a certain fixed value is the normal frame rate and the normal offset The difference between the products of the product within the preset range;
    根据所述确定的当前偏移量展示所述当前帧。Presenting the current frame according to the determined current offset.
  14. 如权利要求13所述的方法,其中,所述计算动画页面的当前帧率,具体包括:The method of claim 13, wherein the calculating the current frame rate of the animated page comprises:
    在开始生成每帧动画页面时,记录对应的开始生成时间;Record the corresponding start generation time when starting to generate each frame of the animation page;
    根据所述每帧动画页面的开始生成时间,确定每帧动画页面的平均耗时,根据所述平均耗时确定所述当前帧率。Determining an average time of each frame of the animation page according to the start generation time of each frame of the animation page, and determining the current frame rate according to the average time consumption.
  15. 如权利要求14所述的方法,其中,所述生成每帧动画页面是通过调用动画页面的绘制函数来生成,则所述在开始生成每帧动画页面时,记录对应的开始生成时间,具体包括:The method of claim 14, wherein the generating each frame of the animation page is generated by calling a drawing function of the animation page, and when the starting of each frame of the animation page is started, recording a corresponding start generation time, specifically including :
    在调用所述动画页面的绘制函数生成某一帧动画页面时,记录调用时间作为所述相应帧动画页面的开始生成时间。When the drawing function of the animation page is called to generate a certain frame of the animation page, the call time is recorded as the start generation time of the corresponding frame animation page.
  16. 如权利要求15所述的方法,其中,所述动画页面的绘制函数为请求动画帧函数,设置间距函数或设置超时函数;The method of claim 15, wherein the rendering function of the animated page is a request animation frame function, setting a spacing function or setting a timeout function;
    其中,如果所述动画页面的绘制函数为设置间距函数或设置超时函数时,所述方法还包括:设定在展示每帧动画页面时都需要调用所述设置间距函数或设置超时函数。Wherein, if the drawing function of the animation page is a setting pitch function or setting a timeout function, the method further comprises: setting the setting spacing function or setting a timeout function when displaying each frame of the animation page.
  17. 如权利要求13所述的方法,其中,The method of claim 13 wherein
    所述根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中的操作的每秒总偏移量为所述正常帧率与正常偏移量的乘积,具体包括:Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation in a current frame to be displayed relative to a previous frame, such that the current offset is calculated according to the current offset The total offset per second of the operation in the animated page is the product of the normal frame rate and the normal offset, and specifically includes:
    将所述正常帧率与正常偏移量的乘积与所述当前帧率的比值确定为所述当前偏移量;Determining a ratio of a product of the normal frame rate to a normal offset to the current frame rate as the current offset;
    所述根据正常帧率与正常偏移量的乘积及所述当前帧率,确定要展示的当前帧中相对于其前一帧的操作的当前偏移量,使得根据该当前偏移量计算得到的动画页面中循环操作的每秒总偏移量为某一固定值,具体包括:Determining, according to a product of a normal frame rate and a normal offset, and the current frame rate, a current offset of an operation in a current frame to be displayed relative to a previous frame, such that the current offset is calculated according to the current offset The total offset per second of the loop operation in the animated page is a fixed value, including:
    确定与所述正常帧率与正常偏移量的乘积之间的差值在预置范围的某一值为所述某一固定值,将所述某一固定值与所述当前帧率的比值确定为所述当前偏移量。Determining a difference between the product of the normal frame rate and the normal offset in a preset range as a certain fixed value, and comparing the ratio of the certain fixed value to the current frame rate Determined to be the current offset.
  18. 如权利要求1至17任一项所述的方法,其中,所述计算动画页面的当前帧率之后,所述方法还包括:The method of any one of claims 1 to 17, wherein after the calculating the current frame rate of the animated page, the method further comprises:
    如果所述当前帧率与所述正常帧率一致,根据所述正常偏移量展示所述当前帧;If the current frame rate is consistent with the normal frame rate, displaying the current frame according to the normal offset;
    如果所述当前帧率与所述正常帧率不一致,执行所述确定当前偏移量及根据所述当前偏移量展示当前帧的步骤。If the current frame rate does not coincide with the normal frame rate, performing the step of determining a current offset and presenting a current frame according to the current offset.
  19. 一种非易失性存储介质,其中存储有计算机可读指令,所述计算机可读指令可以由处理器执行以完成权利要求1至6中任一项权利要求的方法。A non-volatile storage medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to perform the method of any one of claims 1 to 6.
PCT/CN2018/078976 2017-03-17 2018-03-14 Animation display method based on frame rate and terminal device WO2018166470A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710159973.3A CN107038736B (en) 2017-03-17 2017-03-17 Animation display method based on frame rate and terminal equipment
CN201710159973.3 2017-03-17

Publications (1)

Publication Number Publication Date
WO2018166470A1 true WO2018166470A1 (en) 2018-09-20

Family

ID=59534504

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/078976 WO2018166470A1 (en) 2017-03-17 2018-03-14 Animation display method based on frame rate and terminal device

Country Status (2)

Country Link
CN (1) CN107038736B (en)
WO (1) WO2018166470A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407029A (en) * 2021-06-25 2021-09-17 北京光启元数字科技有限公司 Page object state information determination method, device, equipment and readable medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038736B (en) * 2017-03-17 2021-07-06 腾讯科技(深圳)有限公司 Animation display method based on frame rate and terminal equipment
CN108710688B (en) * 2018-05-21 2021-12-21 创新先进技术有限公司 Method and device for generating animation in page and electronic equipment
CN111494942B (en) * 2020-04-16 2022-02-22 腾讯科技(深圳)有限公司 Animation playing method, device, terminal and storage medium
CN117036561A (en) * 2023-03-22 2023-11-10 北京凡米物联科技有限公司 GIS/CAD/three-dimensional three-in-one coal mine production visual scene hybrid rendering technology based on data driving

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080055311A1 (en) * 2006-08-31 2008-03-06 Ati Technologies Inc. Portable device with run-time based rendering quality control and method thereof
US20110096077A1 (en) * 2009-10-27 2011-04-28 Microsoft Corporation Controlling animation frame rate of applications
CN103366391A (en) * 2013-06-26 2013-10-23 广州市动景计算机科技有限公司 Picture rendering method and picture rendering device of dynamic picture
CN103778656A (en) * 2014-02-12 2014-05-07 腾讯科技(深圳)有限公司 Image rendering method and device and electronic equipment
CN104808984A (en) * 2015-03-24 2015-07-29 魅族科技(中国)有限公司 Display interface refresh method and device
CN104811821A (en) * 2015-04-02 2015-07-29 小米科技有限责任公司 Drawing display frame rate adjusting method and device
CN107038736A (en) * 2017-03-17 2017-08-11 腾讯科技(深圳)有限公司 A kind of animated show method and terminal device based on frame per second

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030215011A1 (en) * 2002-05-17 2003-11-20 General Instrument Corporation Method and apparatus for transcoding compressed video bitstreams
US9106787B1 (en) * 2011-05-09 2015-08-11 Google Inc. Apparatus and method for media transmission bandwidth control using bandwidth estimation
CN105594209B (en) * 2013-10-08 2019-08-06 夏普株式会社 Picture decoding apparatus, picture decoding method and picture coding device
US9390464B2 (en) * 2013-12-04 2016-07-12 Nvidia Corporation Stencil buffer data compression
CN104881666B (en) * 2014-02-27 2018-01-16 王磊 A kind of real-time bianry image connected component labeling implementation method based on FPGA
CN105848012A (en) * 2016-03-30 2016-08-10 乐视控股(北京)有限公司 Real-time transcoding rate control method and device
CN106023192B (en) * 2016-05-17 2019-04-09 成都通甲优博科技有限责任公司 A kind of time reference real-time calibration method and system of Image-capturing platform
CN106127843B (en) * 2016-06-16 2019-05-17 福建数博讯信息科技有限公司 The rendering method and device of three-dimensional virtual scene
CN105957121A (en) * 2016-06-29 2016-09-21 努比亚技术有限公司 Animation display system and display method in application

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080055311A1 (en) * 2006-08-31 2008-03-06 Ati Technologies Inc. Portable device with run-time based rendering quality control and method thereof
US20110096077A1 (en) * 2009-10-27 2011-04-28 Microsoft Corporation Controlling animation frame rate of applications
CN103366391A (en) * 2013-06-26 2013-10-23 广州市动景计算机科技有限公司 Picture rendering method and picture rendering device of dynamic picture
CN103778656A (en) * 2014-02-12 2014-05-07 腾讯科技(深圳)有限公司 Image rendering method and device and electronic equipment
CN104808984A (en) * 2015-03-24 2015-07-29 魅族科技(中国)有限公司 Display interface refresh method and device
CN104811821A (en) * 2015-04-02 2015-07-29 小米科技有限责任公司 Drawing display frame rate adjusting method and device
CN107038736A (en) * 2017-03-17 2017-08-11 腾讯科技(深圳)有限公司 A kind of animated show method and terminal device based on frame per second

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407029A (en) * 2021-06-25 2021-09-17 北京光启元数字科技有限公司 Page object state information determination method, device, equipment and readable medium
CN113407029B (en) * 2021-06-25 2024-02-20 腾讯云计算(北京)有限责任公司 Page object state information determining method, device, equipment and readable medium

Also Published As

Publication number Publication date
CN107038736A (en) 2017-08-11
CN107038736B (en) 2021-07-06

Similar Documents

Publication Publication Date Title
WO2018166470A1 (en) Animation display method based on frame rate and terminal device
CN109308469B (en) Method and apparatus for generating information
CN110297996B (en) Animation display method, device, equipment and storage medium based on H5 page
WO2020038167A1 (en) Video image recognition method and apparatus, terminal and storage medium
WO2020083021A1 (en) Video recording method and apparatus, video playback method and apparatus, device, and storage medium
WO2021159792A1 (en) Method and device for interaction with virtual item, computer apparatus, and storage medium
WO2018126899A1 (en) Method and device for displaying video interface
US11475636B2 (en) Augmented reality and virtual reality engine for virtual desktop infrastucture
CN113453073B (en) Image rendering method and device, electronic equipment and storage medium
WO2023197861A1 (en) Game data processing method and apparatus, medium, and electronic device
WO2023226814A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2014036857A1 (en) Animation playing method, device and apparatus
EP4345756A1 (en) Special effect generation method and apparatus, electronic device and storage medium
US8884971B2 (en) Animation engine decoupled from animation catalog
CN113411664A (en) Video processing method and device based on sub-application and computer equipment
CN111107427B (en) Image processing method and related product
US20150189126A1 (en) Controlling content frame rate based on refresh rate of a display
CN111131910A (en) Bullet screen implementation method and device, electronic equipment and readable storage medium
CN113034653A (en) Animation rendering method and device
CN110719493A (en) Barrage display method and device, electronic equipment and readable storage medium
US10621768B2 (en) Augmented reality and virtual reality engine at the object level for virtual desktop infrastucture
CN114697568B (en) Special effect video determining method and device, electronic equipment and storage medium
US20110298816A1 (en) Updating graphical display content
US11095956B2 (en) Method and system for delivering an interactive video
CN116688495A (en) Frame rate adjusting method and related device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18767848

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18767848

Country of ref document: EP

Kind code of ref document: A1