- java.lang.Object
- 
- javafx.scene.paint.Material
- 
- javafx.scene.paint.PhongMaterial
 
 
- 
 
 public class PhongMaterial extends Material ThePhongMaterialclass provides definitions of properties that represent a Phong shaded material. It describes the interaction of light with the surface of theMeshit is applied to. ThePhongMaterialreflects 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: 
 wherefor 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 + selfIlluminationMaplightColor[i]is the color of light source i,
 L[i]is the vector from the surface to light source i,
 Nis 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,
 andVis the normalized view vector.- Since:
- JavaFX 8.0
- See Also:
- AmbientLight,- PointLight
 
- 
- 
Property SummaryProperties Type Property Description ObjectProperty<Image>bumpMapThe bump map of thisPhongMaterial, which is a normal map stored as a RGBImage.ObjectProperty<Color>diffuseColorThe diffuse color of thisPhongMaterial.ObjectProperty<Image>diffuseMapThe diffuse map of thisPhongMaterial.ObjectProperty<Image>selfIlluminationMapThe self illumination map of thisPhongMaterial.ObjectProperty<Color>specularColorThe specular color of thisPhongMaterial.ObjectProperty<Image>specularMapThe specular map of thisPhongMaterial.DoublePropertyspecularPowerThe specular power of thisPhongMaterial.
 - 
Constructor SummaryConstructors Constructor Description PhongMaterial()Creates a new instance ofPhongMaterialclass with a default Color.WHITEdiffuseColorproperty.PhongMaterial(Color diffuseColor)Creates a new instance ofPhongMaterialclass using the specified color for itsdiffuseColorproperty.PhongMaterial(Color diffuseColor, Image diffuseMap, Image specularMap, Image bumpMap, Image selfIlluminationMap)Creates a new instance ofPhongMaterialclass using the specified colors and images for itsdiffuseColorproperties.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectProperty<Image>bumpMapProperty()The bump map of thisPhongMaterial, which is a normal map stored as a RGBImage.ObjectProperty<Color>diffuseColorProperty()The diffuse color of thisPhongMaterial.ObjectProperty<Image>diffuseMapProperty()The diffuse map of thisPhongMaterial.ImagegetBumpMap()Gets the value of the property bumpMap.ColorgetDiffuseColor()Gets the value of the property diffuseColor.ImagegetDiffuseMap()Gets the value of the property diffuseMap.ImagegetSelfIlluminationMap()Gets the value of the property selfIlluminationMap.ColorgetSpecularColor()Gets the value of the property specularColor.ImagegetSpecularMap()Gets the value of the property specularMap.doublegetSpecularPower()Gets the value of the property specularPower.ObjectProperty<Image>selfIlluminationMapProperty()The self illumination map of thisPhongMaterial.voidsetBumpMap(Image value)Sets the value of the property bumpMap.voidsetDiffuseColor(Color value)Sets the value of the property diffuseColor.voidsetDiffuseMap(Image value)Sets the value of the property diffuseMap.voidsetSelfIlluminationMap(Image value)Sets the value of the property selfIlluminationMap.voidsetSpecularColor(Color value)Sets the value of the property specularColor.voidsetSpecularMap(Image value)Sets the value of the property specularMap.voidsetSpecularPower(double value)Sets the value of the property specularPower.ObjectProperty<Color>specularColorProperty()The specular color of thisPhongMaterial.ObjectProperty<Image>specularMapProperty()The specular map of thisPhongMaterial.DoublePropertyspecularPowerProperty()The specular power of thisPhongMaterial.StringtoString()Returns a string representation of the object.
 
- 
- 
- 
Property Detail- 
diffuseColorpublic final ObjectProperty<Color> diffuseColorProperty The diffuse color of thisPhongMaterial.- Default value:
- Color.WHITE
- See Also:
- getDiffuseColor(),- setDiffuseColor(Color)
 
 - 
specularColorpublic final ObjectProperty<Color> specularColorProperty The specular color of thisPhongMaterial.- Default value:
- null
- See Also:
- getSpecularColor(),- setSpecularColor(Color)
 
 - 
specularPowerpublic final DoubleProperty specularPowerProperty The specular power of thisPhongMaterial.- Default value:
- 32.0
- See Also:
- getSpecularPower(),- setSpecularPower(double)
 
 - 
diffuseMappublic final ObjectProperty<Image> diffuseMapProperty The diffuse map of thisPhongMaterial.- Default value:
- null
- See Also:
- getDiffuseMap(),- setDiffuseMap(Image)
 
 - 
specularMappublic final ObjectProperty<Image> specularMapProperty The specular map of thisPhongMaterial.- Default value:
- null
- See Also:
- getSpecularMap(),- setSpecularMap(Image)
 
 - 
bumpMappublic final ObjectProperty<Image> bumpMapProperty The bump map of thisPhongMaterial, which is a normal map stored as a RGBImage.- Default value:
- null
- See Also:
- getBumpMap(),- setBumpMap(Image)
 
 - 
selfIlluminationMappublic final ObjectProperty<Image> selfIlluminationMapProperty The self illumination map of thisPhongMaterial.- Default value:
- null
- See Also:
- getSelfIlluminationMap(),- setSelfIlluminationMap(Image)
 
 
- 
 - 
Constructor Detail- 
PhongMaterialpublic PhongMaterial() Creates a new instance ofPhongMaterialclass with a default Color.WHITEdiffuseColorproperty.
 - 
PhongMaterialpublic PhongMaterial(Color diffuseColor) Creates a new instance ofPhongMaterialclass using the specified color for itsdiffuseColorproperty.- Parameters:
- diffuseColor- the color of the diffuseColor property
 
 - 
PhongMaterialpublic PhongMaterial(Color diffuseColor, Image diffuseMap, Image specularMap, Image bumpMap, Image selfIlluminationMap) Creates a new instance ofPhongMaterialclass using the specified colors and images for itsdiffuseColorproperties.- Parameters:
- diffuseColor- the color of the diffuseColor property
- diffuseMap- the image of the diffuseMap property
- specularMap- the image of the specularMap property
- bumpMap- the image of the bumpMap property
- selfIlluminationMap- the image of the selfIlluminationMap property
 
 
- 
 - 
Method Detail- 
setDiffuseColorpublic final void setDiffuseColor(Color value) Sets the value of the property diffuseColor.- Property description:
- The diffuse color of this PhongMaterial.
- Default value:
- Color.WHITE
 
 - 
getDiffuseColorpublic final Color getDiffuseColor() Gets the value of the property diffuseColor.- Property description:
- The diffuse color of this PhongMaterial.
- Default value:
- Color.WHITE
 
 - 
diffuseColorPropertypublic final ObjectProperty<Color> diffuseColorProperty() The diffuse color of thisPhongMaterial.- Default value:
- Color.WHITE
- See Also:
- getDiffuseColor(),- setDiffuseColor(Color)
 
 - 
setSpecularColorpublic final void setSpecularColor(Color value) Sets the value of the property specularColor.- Property description:
- The specular color of this PhongMaterial.
- Default value:
- null
 
 - 
getSpecularColorpublic final Color getSpecularColor() Gets the value of the property specularColor.- Property description:
- The specular color of this PhongMaterial.
- Default value:
- null
 
 - 
specularColorPropertypublic final ObjectProperty<Color> specularColorProperty() The specular color of thisPhongMaterial.- Default value:
- null
- See Also:
- getSpecularColor(),- setSpecularColor(Color)
 
 - 
setSpecularPowerpublic final void setSpecularPower(double value) Sets the value of the property specularPower.- Property description:
- The specular power of this PhongMaterial.
- Default value:
- 32.0
 
 - 
getSpecularPowerpublic final double getSpecularPower() Gets the value of the property specularPower.- Property description:
- The specular power of this PhongMaterial.
- Default value:
- 32.0
 
 - 
specularPowerPropertypublic final DoubleProperty specularPowerProperty() The specular power of thisPhongMaterial.- Default value:
- 32.0
- See Also:
- getSpecularPower(),- setSpecularPower(double)
 
 - 
setDiffuseMappublic final void setDiffuseMap(Image value) Sets the value of the property diffuseMap.- Property description:
- The diffuse map of this PhongMaterial.
- Default value:
- null
 
 - 
getDiffuseMappublic final Image getDiffuseMap() Gets the value of the property diffuseMap.- Property description:
- The diffuse map of this PhongMaterial.
- Default value:
- null
 
 - 
diffuseMapPropertypublic final ObjectProperty<Image> diffuseMapProperty() The diffuse map of thisPhongMaterial.- Default value:
- null
- See Also:
- getDiffuseMap(),- setDiffuseMap(Image)
 
 - 
setSpecularMappublic final void setSpecularMap(Image value) Sets the value of the property specularMap.- Property description:
- The specular map of this PhongMaterial.
- Default value:
- null
 
 - 
getSpecularMappublic final Image getSpecularMap() Gets the value of the property specularMap.- Property description:
- The specular map of this PhongMaterial.
- Default value:
- null
 
 - 
specularMapPropertypublic final ObjectProperty<Image> specularMapProperty() The specular map of thisPhongMaterial.- Default value:
- null
- See Also:
- getSpecularMap(),- setSpecularMap(Image)
 
 - 
setBumpMappublic final void setBumpMap(Image value) Sets the value of the property bumpMap.- Property description:
- The bump map of this PhongMaterial, which is a normal map stored as a RGBImage.
- Default value:
- null
 
 - 
getBumpMappublic final Image getBumpMap() Gets the value of the property bumpMap.- Property description:
- The bump map of this PhongMaterial, which is a normal map stored as a RGBImage.
- Default value:
- null
 
 - 
bumpMapPropertypublic final ObjectProperty<Image> bumpMapProperty() The bump map of thisPhongMaterial, which is a normal map stored as a RGBImage.- Default value:
- null
- See Also:
- getBumpMap(),- setBumpMap(Image)
 
 - 
setSelfIlluminationMappublic final void setSelfIlluminationMap(Image value) Sets the value of the property selfIlluminationMap.- Property description:
- The self illumination map of this PhongMaterial.
- Default value:
- null
 
 - 
getSelfIlluminationMappublic final Image getSelfIlluminationMap() Gets the value of the property selfIlluminationMap.- Property description:
- The self illumination map of this PhongMaterial.
- Default value:
- null
 
 - 
selfIlluminationMapPropertypublic final ObjectProperty<Image> selfIlluminationMapProperty() The self illumination map of thisPhongMaterial.- Default value:
- null
- See Also:
- getSelfIlluminationMap(),- setSelfIlluminationMap(Image)
 
 - 
toStringpublic String toString() Description copied from class:ObjectReturns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The toStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode()) 
 
- 
 
-