为什么 Raspberry Pi 上的 JavaFX (3D) 不起作用,尽管它应该起作用?
Why JavaFX (3D) on Raspberry Pi doesn't work, although it should?
我想我已经阅读了有关 RPi 上 JFx 下 3D 问题的所有可用解决方案,并且以下 none 适合我的需要。我对 2D 应用程序没有任何问题。
但是当我尝试 运行 3D 程序时,所有的 3D 元素都消失了。在这个命令之后:
java -Djavafx.platform=eglfb -Dprism.verbose=true -Dcom.sun.javafx.experimental.embedded.3d=true -Dprism.glDepthSize=24 -Dprism.forceGPU=true -jar Brake_Check.jar
我明白了:
Prism pipeline init order: es2 sw
Using java-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
succeeded.
GLFactory using com.sun.prism.es2.X11GLFactory
GraphicsPipeline.createPipeline failed for com.sun.prism.es2.ES2Pipeline
java.lang.UnsatisfiedLinkError: com.sun.prism.es2.X11GLFactory.nInitialize([I)J
at com.sun.prism.es2.X11GLFactory.nInitialize(Native Method)
at com.sun.prism.es2.X11GLFactory.initialize(X11GLFactory.java:146)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:81)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.lang.Thread.run(Thread.java:748)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
(X) Got class = class com.sun.prism.sw.SWPipeline
Initialized prism pipeline: com.sun.prism.sw.SWPipeline
vsync: true vpipe: false
lip 19, 2019 3:31:53 AM javafx.scene.paint.Material <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.PerspectiveCamera <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.LightBase <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.shape.Mesh <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.paint.Material <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.SubScene <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.SubScene <init>
WARNING: System can't support antiAliasing
预期图像:
实际图像:
我已经安装了armv6hf-sdk-8.60.9
我将不胜感激任何建议。
编辑
经过进一步研究,我还添加了 OpenJFX:
apt-get install openjfx
这总体上做了一些小的改进,但仍然缺少一些东西。
也许我会从头开始。我使用 tutorial 为我的 Raspberry 设置 JavaFX,然后缺少 libprism_es2.so
所以我从 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libprism_es2_eglfb.so
复制并重命名它(我选择了这个,因为我想如果我是使用 -Djavafx.platform=eglfb
参数,这是一个不错的选择),现在我已经添加了 OpenJFX,还应该在那里安装什么?您认为较新版本的 sdk 可能有帮助吗?但另一方面,我担心我在操作方面的知识水平 Linux 太基础了,而不是进步会有灾难,所以我宁愿留在我已经拥有的版本。
现在,我的应用程序看起来像这样:
输出信息:
Prism pipeline init order: es2 sw
Using java-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
succeeded.
GLFactory using com.sun.prism.es2.X11GLFactory
(X) Got class = class com.sun.prism.es2.ES2Pipeline
Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline
Maximum supported texture size: 8192
Maximum texture size clamped to 4096
Non power of two texture support = true
Maximum number of vertex attributes = 16
Maximum number of uniform vertex components = 16384
Maximum number of uniform fragment components = 16384
Maximum number of varying components = 128
Maximum number of texture units usable in a vertex shader = 32
Maximum number of texture units usable in a fragment shader = 32
Graphics Vendor: VMware, Inc.
Renderer: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
Version: 3.0 Mesa 13.0.6
vsync: true vpipe: true
ES2ResourceFactory: Prism - createStockShader: Solid_LinearGradient_REFLECT.frag
lip 19, 2019 13:03:04 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.111
ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag
ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag
PPSRenderer: scenario.effect - createShader: Blend_SRC_IN
new alphas
ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag
QuantumRenderer: shutdown
你还有什么建议吗?
所以我的问题的主要解决方案是安装我之前已经提到过的 apt-get install openjfx
。在那之后,我也不再使用 -Djavafx.platform=eglfb
了。
下一个发生的问题是,一切都是黑色的。问题似乎是在 light (PointLight
) 添加到场景中。在我删除它之后,一切开始看起来好多了,但是......仍然有一些缺陷。箱子上没有阴影,antiAliasing
不工作,虽然只有一个简单的动画,但很卡。
编辑
更新快。
一切正常。我在我的项目中也恢复了光线。
我所做的是更改 RPi 中的高级设置。
sudo raspi-config
然后前进,下一步GL Driver
,下一步GL (Full KMS) OpenGL desktop driver with full KMS
,保存并重启。
目标达成。
我想我已经阅读了有关 RPi 上 JFx 下 3D 问题的所有可用解决方案,并且以下 none 适合我的需要。我对 2D 应用程序没有任何问题。 但是当我尝试 运行 3D 程序时,所有的 3D 元素都消失了。在这个命令之后:
java -Djavafx.platform=eglfb -Dprism.verbose=true -Dcom.sun.javafx.experimental.embedded.3d=true -Dprism.glDepthSize=24 -Dprism.forceGPU=true -jar Brake_Check.jar
我明白了:
Prism pipeline init order: es2 sw
Using java-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
succeeded.
GLFactory using com.sun.prism.es2.X11GLFactory
GraphicsPipeline.createPipeline failed for com.sun.prism.es2.ES2Pipeline
java.lang.UnsatisfiedLinkError: com.sun.prism.es2.X11GLFactory.nInitialize([I)J
at com.sun.prism.es2.X11GLFactory.nInitialize(Native Method)
at com.sun.prism.es2.X11GLFactory.initialize(X11GLFactory.java:146)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:81)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.lang.Thread.run(Thread.java:748)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
(X) Got class = class com.sun.prism.sw.SWPipeline
Initialized prism pipeline: com.sun.prism.sw.SWPipeline
vsync: true vpipe: false
lip 19, 2019 3:31:53 AM javafx.scene.paint.Material <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.PerspectiveCamera <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:53 AM javafx.scene.LightBase <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.shape.Mesh <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.shape.Shape3D <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.paint.Material <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.SubScene <init>
WARNING: System can't support ConditionalFeature.SCENE3D
lip 19, 2019 3:31:54 AM javafx.scene.SubScene <init>
WARNING: System can't support antiAliasing
预期图像:
实际图像:
我已经安装了armv6hf-sdk-8.60.9
我将不胜感激任何建议。
编辑
经过进一步研究,我还添加了 OpenJFX:
apt-get install openjfx
这总体上做了一些小的改进,但仍然缺少一些东西。
也许我会从头开始。我使用 tutorial 为我的 Raspberry 设置 JavaFX,然后缺少 libprism_es2.so
所以我从 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libprism_es2_eglfb.so
复制并重命名它(我选择了这个,因为我想如果我是使用 -Djavafx.platform=eglfb
参数,这是一个不错的选择),现在我已经添加了 OpenJFX,还应该在那里安装什么?您认为较新版本的 sdk 可能有帮助吗?但另一方面,我担心我在操作方面的知识水平 Linux 太基础了,而不是进步会有灾难,所以我宁愿留在我已经拥有的版本。
现在,我的应用程序看起来像这样:
输出信息:
Prism pipeline init order: es2 sw
Using java-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
succeeded.
GLFactory using com.sun.prism.es2.X11GLFactory
(X) Got class = class com.sun.prism.es2.ES2Pipeline
Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline
Maximum supported texture size: 8192
Maximum texture size clamped to 4096
Non power of two texture support = true
Maximum number of vertex attributes = 16
Maximum number of uniform vertex components = 16384
Maximum number of uniform fragment components = 16384
Maximum number of varying components = 128
Maximum number of texture units usable in a vertex shader = 32
Maximum number of texture units usable in a fragment shader = 32
Graphics Vendor: VMware, Inc.
Renderer: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
Version: 3.0 Mesa 13.0.6
vsync: true vpipe: true
ES2ResourceFactory: Prism - createStockShader: Solid_LinearGradient_REFLECT.frag
lip 19, 2019 13:03:04 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.111
ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag
ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag
PPSRenderer: scenario.effect - createShader: Blend_SRC_IN
new alphas
ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag
QuantumRenderer: shutdown
你还有什么建议吗?
所以我的问题的主要解决方案是安装我之前已经提到过的 apt-get install openjfx
。在那之后,我也不再使用 -Djavafx.platform=eglfb
了。
下一个发生的问题是,一切都是黑色的。问题似乎是在 light (PointLight
) 添加到场景中。在我删除它之后,一切开始看起来好多了,但是......仍然有一些缺陷。箱子上没有阴影,antiAliasing
不工作,虽然只有一个简单的动画,但很卡。
编辑
更新快。 一切正常。我在我的项目中也恢复了光线。 我所做的是更改 RPi 中的高级设置。
sudo raspi-config
然后前进,下一步GL Driver
,下一步GL (Full KMS) OpenGL desktop driver with full KMS
,保存并重启。
目标达成。