FULL PRODUCT VERSION :
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
When a 3D shape such as an open cylinder is rendered, we might use the option cullFace="NONE" to see the inside walls when we look into the cylinder from the holes at the top or bottom. Unfortuantely, when a 3D shape is rendered in JavaFX with cullFace="NONE" or "FRONT", the diffuse color or diffuse map is not rendered correctly on the back of the faces which are visible to the user. They are rendered with the color which would apply at the other side which is not visible to the user. Interestingly, the specular part is rendered correctly at the back faces. The combination of wrong diffuse and correct specular part makes the diffuse error even more obvious.
ADDITIONAL REGRESSION INFORMATION:
I think it was never correct. It is related to bug 8091531. I think with the addition of the specular behaviour and a better real world example, this entry might put some more emphasis on the bug.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Load the FXML file below with your demo\javafx_samples\3DViewer\3DViewer.jar and have a look at the rendering of a red open cylinder with a light from the left side.
ACTUAL -
While the outside of the cylinder is rendered correctly, the inside is correct only with respect to the white specular part. The diffuse red shows up at the wrong side, where the inner part would not be touched by the light source.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright/License : unknown -->
<!-- FXML specification : JRE/JavaFX 8.0 early access build b128 -->
<?import javafx.scene.*?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.Group?>
<?import javafx.scene.paint.Color?>
<?import javafx.scene.paint.PhongMaterial?>
<Group xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8">
<children>
<PerspectiveCamera />
<PointLight translateX="-100.0" translateY="-100.0" translateZ="-100.0"/>
<MeshView cullFace="NONE" rotate="45.0">
<rotationAxis>
<Point3D x="1.0" y="1.0" z="1.0" />
</rotationAxis>
<material>
<PhongMaterial specularPower="1.0">
<diffuseColor>
<Color red="1.0" green="0.3" blue="0.3" opacity="1.0"/>
</diffuseColor>
<specularColor>
<Color red="1.0" green="1.0" blue="1.0" opacity="1.0"/>
</specularColor>
</PhongMaterial>
</material>
<mesh>
<TriangleMesh>
<points>0.0 0.0 1.0 2.0E-6 -2.0 1.0 0.195092 -2.0 0.980785 0.19509 0.0 0.980785 0.382685 -2.0 0.923879 0.382683 0.0 0.92388 0.555572 -2.0 0.831469 0.55557 0.0 0.83147 0.707108 -2.0 0.707105 0.707107 0.0 0.707107 0.831471 -2.0 0.555569 0.83147 0.0 0.55557 0.92388 -2.0 0.382682 0.92388 0.0 0.382683 0.980786 -2.0 0.195088 0.980785 0.0 0.19509 1.0 -2.0 -2.0E-6 1.0 0.0 0.0 0.980785 -2.0 -0.195092 0.980785 0.0 -0.19509 0.923879 -2.0 -0.382685 0.92388 0.0 -0.382683 0.831469 -2.0 -0.555571 0.83147 0.0 -0.55557 0.707106 -2.0 -0.707107 0.707107 0.0 -0.707107 0.55557 -2.0 -0.83147 0.55557 0.0 -0.83147 0.382684 -2.0 -0.923879 0.382683 0.0 -0.92388 0.195091 -2.0 -0.980785 0.19509 0.0 -0.980785 1.0E-6 -2.0 -1.0 0.0 0.0 -1.0 -0.195089 -2.0 -0.980785 -0.195091 0.0 -0.980785 -0.382682 -2.0 -0.92388 -0.382684 0.0 -0.923879 -0.555568 -2.0 -0.831471 -0.555571 0.0 -0.831469 -0.707105 -2.0 -0.707108 -0.707107 0.0 -0.707106 -0.831468 -2.0 -0.555573 -0.83147 0.0 -0.55557 -0.923878 -2.0 -0.382686 -0.92388 0.0 -0.382683 -0.980785 -2.0 -0.195094 -0.980785 0.0 -0.195089 -1.0 -2.0 -4.0E-6 -1.0 0.0 1.0E-6 -0.980786 -2.0 0.195086 -0.980785 0.0 0.195091 -0.923881 -2.0 0.382679 -0.923879 0.0 0.382684 -0.831473 -2.0 0.555566 -0.831469 0.0 0.555571 -0.707111 -2.0 0.707103 -0.707106 0.0 0.707108 -0.555575 -2.0 0.831466 -0.555569 0.0 0.83147 -0.382689 -2.0 0.923877 -0.382682 0.0 0.92388 -0.195097 -2.0 0.980784 -0.195089 0.0 0.980786</points>
<texCoords>2.240672 1.000043 2.240671 4.297495E-5 2.124629 4.297495E-5 2.12463 1.000043 2.008586 4.297495E-5 2.008587 1.000043 1.892544 4.297495E-5 1.892545 1.000043 1.776502 4.297495E-5 1.776503 1.000043 1.660459 4.297495E-5 1.66046 1.000043 1.544417 4.297495E-5 1.544418 1.000043 1.428374 4.297495E-5 1.428375 1.000043 1.312332 4.297495E-5 1.312333 1.000043 1.19629 4.2021275E-5 1.19629 1.000043 1.080248 4.2021275E-5 1.080248 1.000043 0.964206 4.2021275E-5 0.964206 1.000043 0.848163 4.2021275E-5 0.848163 1.000043 0.732121 4.2021275E-5 0.732121 1.000043 0.616079 4.2021275E-5 0.616079 1.000043 0.500037 4.2021275E-5 0.500036 1.000043 0.383995 4.2021275E-5 0.383994 1.000043 0.267953 4.2021275E-5 0.267952 1.000043 0.151911 4.2021275E-5 0.151909 1.000043 0.035868 4.2021275E-5 0.035867 1.000043 -0.080174 4.2021275E-5 -0.080175 1.000043 -0.196216 4.2021275E-5 -0.196218 1.000043 -0.312258 4.2021275E-5 -0.31226 1.000043 -0.4283 4.2021275E-5 -0.428302 1.000043 -0.544343 4.2021275E-5 -0.544345 1.000043 -0.660385 4.2021275E-5 -0.660388 1.000043 -0.776427 4.297495E-5 -0.77643 1.000043 -0.892469 4.297495E-5 -0.892473 1.000043 -1.008511 4.297495E-5 -1.008515 1.000043 -1.124553 4.297495E-5 -1.124557 1.000043 -1.240595 4.297495E-5 -1.2406 1.000043 -1.356637 4.297495E-5 -1.356642 1.000043 2.356714 1.000043 2.356719 4.297495E-5</texCoords>
<faces>0 0 1 1 2 2 0 0 2 2 3 3 3 3 2 2 4 4 3 3 4 4 5 5 5 5 4 4 6 6 5 5 6 6 7 7 7 7 6 6 8 8 7 7 8 8 9 9 9 9 8 8 10 10 9 9 10 10 11 11 11 11 10 10 12 12 11 11 12 12 13 13 13 13 12 12 14 14 13 13 14 14 15 15 15 15 14 14 16 16 15 15 16 16 17 17 17 17 16 16 18 18 17 17 18 18 19 19 19 19 18 18 20 20 19 19 20 20 21 21 21 21 20 20 22 22 21 21 22 22 23 23 23 23 22 22 24 24 23 23 24 24 25 25 25 25 24 24 26 26 25 25 26 26 27 27 27 27 26 26 28 28 27 27 28 28 29 29 29 29 28 28 30 30 29 29 30 30 31 31 31 31 30 30 32 32 31 31 32 32 33 33 33 33 32 32 34 34 33 33 34 34 35 35 35 35 34 34 36 36 35 35 36 36 37 37 37 37 36 36 38 38 37 37 38 38 39 39 39 39 38 38 40 40 39 39 40 40 41 41 41 41 40 40 42 42 41 41 42 42 43 43 43 43 42 42 44 44 43 43 44 44 45 45 45 45 44 44 46 46 45 45 46 46 47 47 47 47 46 46 48 48 47 47 48 48 49 49 49 49 48 48 50 50 49 49 50 50 51 51 51 51 50 50 52 52 51 51 52 52 53 53 53 53 52 52 54 54 53 53 54 54 55 55 55 55 54 54 56 56 55 55 56 56 57 57 57 57 56 56 58 58 57 57 58 58 59 59 59 59 58 58 60 60 59 59 60 60 61 61 61 61 60 60 62 62 61 61 62 62 63 63 1 1 0 0 63 64 1 1 63 64 62 65</faces>
</TriangleMesh>
</mesh>
</MeshView>
</children>
</Group>
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No workaround - this is a major 3D rendering bug!
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
When a 3D shape such as an open cylinder is rendered, we might use the option cullFace="NONE" to see the inside walls when we look into the cylinder from the holes at the top or bottom. Unfortuantely, when a 3D shape is rendered in JavaFX with cullFace="NONE" or "FRONT", the diffuse color or diffuse map is not rendered correctly on the back of the faces which are visible to the user. They are rendered with the color which would apply at the other side which is not visible to the user. Interestingly, the specular part is rendered correctly at the back faces. The combination of wrong diffuse and correct specular part makes the diffuse error even more obvious.
ADDITIONAL REGRESSION INFORMATION:
I think it was never correct. It is related to bug 8091531. I think with the addition of the specular behaviour and a better real world example, this entry might put some more emphasis on the bug.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Load the FXML file below with your demo\javafx_samples\3DViewer\3DViewer.jar and have a look at the rendering of a red open cylinder with a light from the left side.
ACTUAL -
While the outside of the cylinder is rendered correctly, the inside is correct only with respect to the white specular part. The diffuse red shows up at the wrong side, where the inner part would not be touched by the light source.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright/License : unknown -->
<!-- FXML specification : JRE/JavaFX 8.0 early access build b128 -->
<?import javafx.scene.*?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.Group?>
<?import javafx.scene.paint.Color?>
<?import javafx.scene.paint.PhongMaterial?>
<Group xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8">
<children>
<PerspectiveCamera />
<PointLight translateX="-100.0" translateY="-100.0" translateZ="-100.0"/>
<MeshView cullFace="NONE" rotate="45.0">
<rotationAxis>
<Point3D x="1.0" y="1.0" z="1.0" />
</rotationAxis>
<material>
<PhongMaterial specularPower="1.0">
<diffuseColor>
<Color red="1.0" green="0.3" blue="0.3" opacity="1.0"/>
</diffuseColor>
<specularColor>
<Color red="1.0" green="1.0" blue="1.0" opacity="1.0"/>
</specularColor>
</PhongMaterial>
</material>
<mesh>
<TriangleMesh>
<points>0.0 0.0 1.0 2.0E-6 -2.0 1.0 0.195092 -2.0 0.980785 0.19509 0.0 0.980785 0.382685 -2.0 0.923879 0.382683 0.0 0.92388 0.555572 -2.0 0.831469 0.55557 0.0 0.83147 0.707108 -2.0 0.707105 0.707107 0.0 0.707107 0.831471 -2.0 0.555569 0.83147 0.0 0.55557 0.92388 -2.0 0.382682 0.92388 0.0 0.382683 0.980786 -2.0 0.195088 0.980785 0.0 0.19509 1.0 -2.0 -2.0E-6 1.0 0.0 0.0 0.980785 -2.0 -0.195092 0.980785 0.0 -0.19509 0.923879 -2.0 -0.382685 0.92388 0.0 -0.382683 0.831469 -2.0 -0.555571 0.83147 0.0 -0.55557 0.707106 -2.0 -0.707107 0.707107 0.0 -0.707107 0.55557 -2.0 -0.83147 0.55557 0.0 -0.83147 0.382684 -2.0 -0.923879 0.382683 0.0 -0.92388 0.195091 -2.0 -0.980785 0.19509 0.0 -0.980785 1.0E-6 -2.0 -1.0 0.0 0.0 -1.0 -0.195089 -2.0 -0.980785 -0.195091 0.0 -0.980785 -0.382682 -2.0 -0.92388 -0.382684 0.0 -0.923879 -0.555568 -2.0 -0.831471 -0.555571 0.0 -0.831469 -0.707105 -2.0 -0.707108 -0.707107 0.0 -0.707106 -0.831468 -2.0 -0.555573 -0.83147 0.0 -0.55557 -0.923878 -2.0 -0.382686 -0.92388 0.0 -0.382683 -0.980785 -2.0 -0.195094 -0.980785 0.0 -0.195089 -1.0 -2.0 -4.0E-6 -1.0 0.0 1.0E-6 -0.980786 -2.0 0.195086 -0.980785 0.0 0.195091 -0.923881 -2.0 0.382679 -0.923879 0.0 0.382684 -0.831473 -2.0 0.555566 -0.831469 0.0 0.555571 -0.707111 -2.0 0.707103 -0.707106 0.0 0.707108 -0.555575 -2.0 0.831466 -0.555569 0.0 0.83147 -0.382689 -2.0 0.923877 -0.382682 0.0 0.92388 -0.195097 -2.0 0.980784 -0.195089 0.0 0.980786</points>
<texCoords>2.240672 1.000043 2.240671 4.297495E-5 2.124629 4.297495E-5 2.12463 1.000043 2.008586 4.297495E-5 2.008587 1.000043 1.892544 4.297495E-5 1.892545 1.000043 1.776502 4.297495E-5 1.776503 1.000043 1.660459 4.297495E-5 1.66046 1.000043 1.544417 4.297495E-5 1.544418 1.000043 1.428374 4.297495E-5 1.428375 1.000043 1.312332 4.297495E-5 1.312333 1.000043 1.19629 4.2021275E-5 1.19629 1.000043 1.080248 4.2021275E-5 1.080248 1.000043 0.964206 4.2021275E-5 0.964206 1.000043 0.848163 4.2021275E-5 0.848163 1.000043 0.732121 4.2021275E-5 0.732121 1.000043 0.616079 4.2021275E-5 0.616079 1.000043 0.500037 4.2021275E-5 0.500036 1.000043 0.383995 4.2021275E-5 0.383994 1.000043 0.267953 4.2021275E-5 0.267952 1.000043 0.151911 4.2021275E-5 0.151909 1.000043 0.035868 4.2021275E-5 0.035867 1.000043 -0.080174 4.2021275E-5 -0.080175 1.000043 -0.196216 4.2021275E-5 -0.196218 1.000043 -0.312258 4.2021275E-5 -0.31226 1.000043 -0.4283 4.2021275E-5 -0.428302 1.000043 -0.544343 4.2021275E-5 -0.544345 1.000043 -0.660385 4.2021275E-5 -0.660388 1.000043 -0.776427 4.297495E-5 -0.77643 1.000043 -0.892469 4.297495E-5 -0.892473 1.000043 -1.008511 4.297495E-5 -1.008515 1.000043 -1.124553 4.297495E-5 -1.124557 1.000043 -1.240595 4.297495E-5 -1.2406 1.000043 -1.356637 4.297495E-5 -1.356642 1.000043 2.356714 1.000043 2.356719 4.297495E-5</texCoords>
<faces>0 0 1 1 2 2 0 0 2 2 3 3 3 3 2 2 4 4 3 3 4 4 5 5 5 5 4 4 6 6 5 5 6 6 7 7 7 7 6 6 8 8 7 7 8 8 9 9 9 9 8 8 10 10 9 9 10 10 11 11 11 11 10 10 12 12 11 11 12 12 13 13 13 13 12 12 14 14 13 13 14 14 15 15 15 15 14 14 16 16 15 15 16 16 17 17 17 17 16 16 18 18 17 17 18 18 19 19 19 19 18 18 20 20 19 19 20 20 21 21 21 21 20 20 22 22 21 21 22 22 23 23 23 23 22 22 24 24 23 23 24 24 25 25 25 25 24 24 26 26 25 25 26 26 27 27 27 27 26 26 28 28 27 27 28 28 29 29 29 29 28 28 30 30 29 29 30 30 31 31 31 31 30 30 32 32 31 31 32 32 33 33 33 33 32 32 34 34 33 33 34 34 35 35 35 35 34 34 36 36 35 35 36 36 37 37 37 37 36 36 38 38 37 37 38 38 39 39 39 39 38 38 40 40 39 39 40 40 41 41 41 41 40 40 42 42 41 41 42 42 43 43 43 43 42 42 44 44 43 43 44 44 45 45 45 45 44 44 46 46 45 45 46 46 47 47 47 47 46 46 48 48 47 47 48 48 49 49 49 49 48 48 50 50 49 49 50 50 51 51 51 51 50 50 52 52 51 51 52 52 53 53 53 53 52 52 54 54 53 53 54 54 55 55 55 55 54 54 56 56 55 55 56 56 57 57 57 57 56 56 58 58 57 57 58 58 59 59 59 59 58 58 60 60 59 59 60 60 61 61 61 61 60 60 62 62 61 61 62 62 63 63 1 1 0 0 63 64 1 1 63 64 62 65</faces>
</TriangleMesh>
</mesh>
</MeshView>
</children>
</Group>
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No workaround - this is a major 3D rendering bug!
- relates to
-
JDK-8091531 Support rendering of triangles with flipped normals when seen from the outside
-
- Open
-
-
JDK-8145171 Specular glow is seen on the inner side of cylinder
-
- Open
-