Constructs a scene consisting of a root, with a dimension of width and height, specifies whether a depth buffer is created for this scene and specifies whether scene anti-aliasing is requested.
A scene with only 2D shapes and without any 3D transforms does not need a
depth buffer nor scene anti-aliasing support. A scene containing 3D
shapes or 2D shapes with 3D transforms may use depth buffer support for
proper depth sorted rendering; to avoid depth fighting (also known as Z
fighting), disable depth testing on 2D shapes that have no 3D transforms.
See depthTest for more information. A
scene with 3D shapes may enable scene anti-aliasing to improve its
rendering quality.
A Scene can be created and modified on any thread until it is attached to a Window that is showing
(javafx.stage.Window.isShowing(). This does not mean the Scene is thread-safe,
so manipulation from multiple threads at the same time is illegal, may lead to unexpected results and must be avoided.
root | The root node of the scene graph | |
width | The width of the scene | |
height | The height of the scene | |
depthBuffer | The depth buffer flag | |
antiAliasing | The scene anti-aliasing attribute. A value of
null is treated as DISABLED.
The depthBuffer and antiAliasing are conditional features. With the
respective default values of: false and |
NullPointerException | if root is null |
javafx.scene.Node.setDepthTest(DepthTest)
Diagram: Scene