changeset 6531:e07207914384

RT-36235: Zero specular power can lead to rendering artifacts. Reviewed-by: kcr, ckyang Summary: clamp specular power to 0.001 internally.
author vadim
date Fri, 21 Mar 2014 14:11:00 +0400
parents c8f3fda9ec22
children 74b46ab976e2
files modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGPhongMaterial.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGPhongMaterial.java	Thu Mar 20 18:57:39 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGPhongMaterial.java	Fri Mar 21 14:11:00 2014 +0400
@@ -115,6 +115,10 @@
     }
 
     public void setSpecularPower(float specularPower) {
+        // prevent undefined behavior in GLSL pow(0, 0), see RT-36235
+        if (specularPower < 0.001f) {
+            specularPower = 0.001f;
+        }
         this.specularPower = specularPower;
         specularPowerDirty = true;
     }