JDK-8302050 : Common state management for 3D implementation
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: internal
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: generic
  • Submitted: 2023-02-08
  • Updated: 2024-01-05
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Description
State management related to different resources like RenderPassDescriptor, Encoder and resources like textures
Comments
With latest code i can see that with usage of subscene 3D primitives are getting drawn which was not happening previously. But we still have rendering state issues when we mix 2D and 3D primitives. 3D primitive with subscene sample : import javafx.animation.RotateTransition; import javafx.application.Application; import javafx.geometry.Point3D; import javafx.scene.Group; import javafx.scene.Parent; import javafx.scene.PerspectiveCamera; import javafx.scene.Scene; import javafx.scene.SubScene; import javafx.scene.image.Image; import javafx.scene.paint.Color; import javafx.scene.paint.PhongMaterial; import javafx.scene.shape.Box; import javafx.scene.shape.Cylinder; import javafx.scene.shape.DrawMode; import javafx.scene.shape.Rectangle; import javafx.scene.shape.Sphere; import javafx.scene.transform.Rotate; import javafx.scene.transform.Translate; import javafx.stage.Stage; import javafx.util.Duration; public class SubScene_State extends Application { final int SCENE_WIDTH = 600; final int SCENE_HEIGHT = 600; public Parent createContent() throws Exception { // Box Box testBox = new Box(5, 5, 5); testBox.setMaterial(new PhongMaterial(Color.RED)); // Create and position camera PerspectiveCamera camera = new PerspectiveCamera(true); camera.getTransforms().addAll ( new Rotate(-20, Rotate.Y_AXIS), new Rotate(-20, Rotate.X_AXIS), new Translate(0, 0, -15)); // Build the Scene Graph Group root = new Group(); root.getChildren().add(camera); root.getChildren().add(testBox); // Use a SubScene SubScene subScene = new SubScene(root, 300,300); subScene.setFill(Color.ALICEBLUE); subScene.setCamera(camera); Group group = new Group(); group.getChildren().add(subScene); return group; } @Override public void start(Stage primaryStage) throws Exception { Scene scene = new Scene(createContent(), SCENE_WIDTH, SCENE_HEIGHT); primaryStage.setScene(scene); primaryStage.show(); } /** * Java main for when running without JavaFX launcher */ public static void main(String[] args) { launch(args); } }
08-03-2023