JDK-8303439 : Implement single point light feature in Metal
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: internal
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2023-03-01
  • Updated: 2023-06-15
  • Resolved: 2023-03-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
internalFixed
Related Reports
Blocks :  
Description
Currently after https://bugs.openjdk.org/browse/JDK-8295485 and https://bugs.openjdk.org/browse/JDK-8301597 we can see 3D primitives getting drawn. But since we dont have any light support we can't see 3D constructs of the primitve.

By default JavaFX adds single point light as default light. Implement the same as first step in 3D lightning support in Metal.
Comments
Single point light implementation commit : https://github.com/openjdk/jfx-sandbox/commit/c62a5bd2a273e9994dc20ca15fdacf7b7d66c488
01-03-2023

Sample Program to verify single point light implementation : import javafx.application.Application; import javafx.geometry.Point3D; import javafx.scene.Group; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.paint.Color; import javafx.scene.paint.PhongMaterial; import javafx.scene.shape.Box; import javafx.scene.shape.Cylinder; import javafx.stage.Stage; public class SingleLight_3D extends Application { final int SCENE_WIDTH = 600; final int SCENE_HEIGHT = 600; public Parent createContent() throws Exception { int denom = 4; Box testBox = new Box(SCENE_WIDTH/denom, SCENE_HEIGHT/denom, SCENE_WIDTH/denom); testBox.setLayoutX(SCENE_HEIGHT/2 + 100); testBox.setLayoutY(SCENE_HEIGHT/2); testBox.setRotationAxis(new Point3D(1,1,1)); testBox.setRotate(45); testBox.setMaterial(new PhongMaterial(Color.RED)); Cylinder testCylinder = new Cylinder(100.0, 200.0); testCylinder.setLayoutX(SCENE_WIDTH/4); testCylinder.setLayoutY(SCENE_HEIGHT/2); testCylinder.setRotationAxis(new Point3D(1,1,1)); testCylinder.setRotate(45); Group root = new Group(); root.getChildren().add(testBox); root.getChildren().add(testCylinder); return root; } @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); } }
01-03-2023

Changeset: 043d1749 Author: Jayathirth D V <jdv@openjdk.org> Committer: Kevin Rushforth <kcr@openjdk.org> Date: 2023-03-01 16:02:10 +0000 URL: https://git.openjdk.org/jfx-sandbox/commit/043d1749649d424679ae75ae76e3e06d211882aa
01-03-2023