JDK-8103379 : Need to specify the resulting specular component in the PhongMaterial
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-08-08
  • Updated: 2015-06-16
  • Resolved: 2013-12-11
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.
JDK 8
8Fixed
Related Reports
Blocks :  
Blocks :  
Relates :  
Relates :  
Description
It is unclear what will happen when both SpecularMap and SpecularColor are set in a PhongMaterial. Mathematically we would expect the Specular component is the vector multiplication of SpecularMap and SpecularColor. We also need to specify how SpecularPower interact with a 3 or 4 components map.
Comments
Please do not reopen this JIRA as the specular component specification is completed. File new JIRA if the rendering doesn't produce result as specified.
11-12-2013

The javadoc was pushed today as part of fix to RT-26385. Here is the javadoc as a record: The PhongMaterial class provides definitions of properties that represent a Phong shaded material. It describes the interaction of light with the surface of the Mesh it is applied to. The PhongMaterial reflects light in terms of a diffuse and specular component together with an ambient and a self illumination term. The color of a point on a geometric surface is mathematical function of these four components. The color is computed by the following equation: for each ambient light source i { ambient += lightColor[i] } for each point light source i { diffuse += (L[i] . N) * lightColor[i] specular += ((R[i] . V) ^ (specularPower * intensity(specularMap))) * lightColor[i] } color = (ambient + diffuse) * diffuseColor * diffuseMap + specular * specularColor * specularMap + selfIlluminationMap where lightColor[i] is the color of light source i, L[i] is the vector from the surface to light source i, N is the normal vector (taking into the account the bumpMap if present), R[i] is the normalized reflection vector for L[i] about the surface normal, and V is the normalized view vector.
11-12-2013

BTW, should it be read like this where power is applied only two R and V multiplication? specular component = specularColor * specularMap * (( R . V ) ^ specularPower )
11-12-2013

Nothing in the javadoc yet.
11-12-2013

Will add this specification into the javadoc for PhongMaterial.
22-10-2013

The mathematical equation for the specular component is defined as followed: specular component = specularColor * specularMap * ( R . V ) ^ specularPower where R is the normalized reflection vector and V is the normalized viewer vector. If the specularMap is null it implies no contribution for map, and similarly if the specularColor is null it implies no contribution for color. Only the RGB values are used and the alpha value is discarded in the computation. The specularPower is the exponent of the material's shininess property. The larger the shininess value, the faster the rate of decrease.
22-10-2013