Both Point and Spot light are not correctly applied to Mesh when number of faces is increased to more than 60.
Following are steps to reproduce with Point light with existing source without the fix forJDK-8234920.
1. Apply this patch current repo, to change the LightSample to use less number of quads. The diff may not apply afterJDK-8234920 is integrated. The diff is small and can be done manually too.
--- a/tests/performance/3DLighting/attenuation/LightingSample.java
+++ b/tests/performance/3DLighting/attenuation/LightingSample.java
@@ -69,8 +69,8 @@ public class LightingSample extends Application {
var sphere = new Button("Sphere");
sphere.setOnAction(e -> switchTo(environment.createSphere((int) subdivisionSlider.getValue())));
- var quadSlider = new Slider(500, 10_000, 1000);
- quadSlider.setMajorTickUnit(500);
+ var quadSlider = new Slider(10, 200, 60);
+ quadSlider.setMajorTickUnit(10);
setupSlier(quadSlider);
var quadLabel = new Label();
2. Compile and run AttenLightingSample
3. Turn on Magenta light and click Mesh button. Observe that light is proper. Check attached screenshot_1.
4. Increase the number of quads to 70 and observe that light is not proper. Check attached screenshot_2.
Following are steps to reproduce with Point light with existing source without the fix for
1. Apply this patch current repo, to change the LightSample to use less number of quads. The diff may not apply after
--- a/tests/performance/3DLighting/attenuation/LightingSample.java
+++ b/tests/performance/3DLighting/attenuation/LightingSample.java
@@ -69,8 +69,8 @@ public class LightingSample extends Application {
var sphere = new Button("Sphere");
sphere.setOnAction(e -> switchTo(environment.createSphere((int) subdivisionSlider.getValue())));
- var quadSlider = new Slider(500, 10_000, 1000);
- quadSlider.setMajorTickUnit(500);
+ var quadSlider = new Slider(10, 200, 60);
+ quadSlider.setMajorTickUnit(10);
setupSlier(quadSlider);
var quadLabel = new Label();
2. Compile and run AttenLightingSample
3. Turn on Magenta light and click Mesh button. Observe that light is proper. Check attached screenshot_1.
4. Increase the number of quads to 70 and observe that light is not proper. Check attached screenshot_2.
- relates to
-
JDK-8234920 Add SpotLight to the selection of 3D light types
-
- Resolved
-