如何忽略javafx中的60fps限制? [英] How to ignore the 60fps limit in javafx?

查看:165
本文介绍了如何忽略javafx中的60fps限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个100fps的动画,以显示每秒包含100帧的文件中的3d数据.但是javaFx中的AnimationTimer只允许我获得60fps.如何克服它?

I need to create a 100fps animation that display 3d data from a file that contains 100 frames per second. But the AnimationTimer in javaFx allows me to get 60fps only. How to get over it?

推荐答案

移除JavaFX帧速率上限

您可以通过设置系统属性(例如,

You can remove the 60fps JavaFX frame rate cap by setting a system property, e.g.,

java -Djavafx.animation.fullspeed=true MyApp

哪个是未记录且不受支持的设置.

取消JavaFX帧速率上限可能会使您的应用程序在资源使用方面的效率大大降低(例如,没有帧速率上限的JavaFX应用程序将比设置了帧速率上限的应用程序消耗更多的CPU).

Removing the JavaFX frame rate cap may make your application considerably less efficient in terms of resource usage (e.g. a JavaFX application without a frame rate cap will consume more CPU than an application with the frame rate cap in place).

配置JavaFX帧速率上限

此外,您还可以尝试使用另一个未记录的系统属性:

Additionally, there is another undocumented system property you could try:

javafx.animation.framerate

我还没有尝试过.

调试JavaFX框架(脉冲)

其他设置,例如-Djavafx.pulseLogger=true ,可以启用这些设置来帮助您调试JavaFX架构并验证您的应用程序是否确实以期望的帧速率运行.

There are other settings like -Djavafx.pulseLogger=true which you could enable to help you debug the JavaFX architecture and validate that your application is actually running at the framerate you expect.

JavaFX 8具有Pulse Logger(-Djavafx.pulseLogger=true系统属性),该脉冲记录器(以一种很好的方式)打印了大量有关JavaFX引擎执行的废话".在每个脉冲的基础上有很多提供的信息,包括脉冲数(自动递增的整数),脉冲持续时间以及自最后一个脉冲以来的时间.该信息还包括线程详细信息和事件详细信息.这些数据使开发人员可以查看大部分时间.

JavaFX 8 has a Pulse Logger (-Djavafx.pulseLogger=true system property) that "prints out a lot of crap" (in a good way) about the JavaFX engine's execution. There is a lot of provided information on a per-pulse basis including pulse number (auto-incremented integer), pulse duration, and time since last pulse. The information also includes thread details and events details. This data allows a developer to see what is taking most of the time.

警告

使用未记录功能的常规警告,如JavaFX团队的 Richard Bair 所述:

Normal warnings for using undocumented features apply, as Richard Bair from the JavaFX team notes:

请注意,如果我们没有记录命令行开关,那么对于后续发行版中的删除/修改,它们是公平的游戏:-)

Just a word of caution, if we haven't documented the command line switches, they're fair game for removal / modification in subsequent releases :-)

这篇关于如何忽略javafx中的60fps限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆