I've created sub scene to display 3D objects and I've got some issue with depth buffer presented below.

Spheres are same size of course.
In fxml file I've got
<SubScene fx:id="subScene" depthBuffer="true">
and subScene.isDepthBuffer() returns true.
I event tried creating SubScene with
subScene = new SubScene(root, 800, 800, true, SceneAntialiasing.BALANCED);
pane.getChildren().set(0, subScene);
with no luck.
Would be grateful for any help. I also would like to know is it just some JavaFX bug or I'm doing, or understanding, something wrongly.
Thanks in advance.
Finally I solved this problem. Depth buffer didn't work because I had
camera.setNearClip(Double.MIN_VALUE);
which was not my best idea. Changing it to
camera.setNearClip(0.01);
solved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With