admin管理员组文章数量:1023764
I am trying to develop a car race game using JavaFX. I am using perspective camera. I am using PointLight as well. The road gets blurred where the camera is far. How can I avoid this blurring? My camera settings are below:
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.setNearClip(5);
camera.setFarClip(1000);
camera.setFieldOfView(20);
PointLight pointLight = new PointLight(Color.WHITE);
pointLight.setTranslateY(-500);
root3D.getChildren().add(pointLight);
pointLight.translateXProperty().bind(cameraPosition.xProperty());
pointLight.translateZProperty().bind(cameraPosition.zProperty());
SubScene subScene = new SubScene(root3D, 1920, 1080, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
I am trying to develop a car race game using JavaFX. I am using perspective camera. I am using PointLight as well. The road gets blurred where the camera is far. How can I avoid this blurring? My camera settings are below:
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.setNearClip(5);
camera.setFarClip(1000);
camera.setFieldOfView(20);
PointLight pointLight = new PointLight(Color.WHITE);
pointLight.setTranslateY(-500);
root3D.getChildren().add(pointLight);
pointLight.translateXProperty().bind(cameraPosition.xProperty());
pointLight.translateZProperty().bind(cameraPosition.zProperty());
SubScene subScene = new SubScene(root3D, 1920, 1080, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
Share
Improve this question
asked Nov 18, 2024 at 18:53
Nebi SarikayaNebi Sarikaya
675 bronze badges
2
- 1 The image looks like poor quality (or no) Anisotropic filtering. I don't have a suggestion on how you fix that for your application. – jewelsea Commented Nov 18, 2024 at 21:45
- Default field of view is 30 try to tweak that value – Giovanni Contreras Commented Nov 20, 2024 at 4:20
2 Answers
Reset to default 0In order to debug the visual artifact you are seeing (the blurring at distance) we would need to see how you are adding the landscape, road and road lines to the scene. I am assuming you are achieving a road animation effect using a material animation but we need to see that mechanic too.
If your road or lines are separate 3D shapes with semi transparent materials then the order they are added to the scene will determine some transparency effects. Just guessing here. Need much more info.
Ok, when I disabled Anti-aliasing using:
SubScene subScene = new SubScene(root3D, 1920, 1080, true, SceneAntialiasing.DISABLED);
I am trying to develop a car race game using JavaFX. I am using perspective camera. I am using PointLight as well. The road gets blurred where the camera is far. How can I avoid this blurring? My camera settings are below:
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.setNearClip(5);
camera.setFarClip(1000);
camera.setFieldOfView(20);
PointLight pointLight = new PointLight(Color.WHITE);
pointLight.setTranslateY(-500);
root3D.getChildren().add(pointLight);
pointLight.translateXProperty().bind(cameraPosition.xProperty());
pointLight.translateZProperty().bind(cameraPosition.zProperty());
SubScene subScene = new SubScene(root3D, 1920, 1080, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
I am trying to develop a car race game using JavaFX. I am using perspective camera. I am using PointLight as well. The road gets blurred where the camera is far. How can I avoid this blurring? My camera settings are below:
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.setNearClip(5);
camera.setFarClip(1000);
camera.setFieldOfView(20);
PointLight pointLight = new PointLight(Color.WHITE);
pointLight.setTranslateY(-500);
root3D.getChildren().add(pointLight);
pointLight.translateXProperty().bind(cameraPosition.xProperty());
pointLight.translateZProperty().bind(cameraPosition.zProperty());
SubScene subScene = new SubScene(root3D, 1920, 1080, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
Share
Improve this question
asked Nov 18, 2024 at 18:53
Nebi SarikayaNebi Sarikaya
675 bronze badges
2
- 1 The image looks like poor quality (or no) Anisotropic filtering. I don't have a suggestion on how you fix that for your application. – jewelsea Commented Nov 18, 2024 at 21:45
- Default field of view is 30 try to tweak that value – Giovanni Contreras Commented Nov 20, 2024 at 4:20
2 Answers
Reset to default 0In order to debug the visual artifact you are seeing (the blurring at distance) we would need to see how you are adding the landscape, road and road lines to the scene. I am assuming you are achieving a road animation effect using a material animation but we need to see that mechanic too.
If your road or lines are separate 3D shapes with semi transparent materials then the order they are added to the scene will determine some transparency effects. Just guessing here. Need much more info.
Ok, when I disabled Anti-aliasing using:
SubScene subScene = new SubScene(root3D, 1920, 1080, true, SceneAntialiasing.DISABLED);
本文标签: javafxRoad texture is blurred where camera is farStack Overflow
版权声明:本文标题:javafx - Road texture is blurred where camera is far - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745600511a2158428.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论