public class PhongMaterial extends Material
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 + selfIlluminationMapwhere
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,V
is the normalized view vector.AmbientLight
,
PointLight
Constructor and Description |
---|
PhongMaterial()
Creates a new instance of
PhongMaterial class with a default
Color.WHITE diffuseColor property. |
PhongMaterial(Color diffuseColor)
Creates a new instance of
PhongMaterial class using the specified
color for its diffuseColor property. |
PhongMaterial(Color diffuseColor,
Image diffuseMap,
Image specularMap,
Image bumpMap,
Image selfIlluminationMap)
Creates a new instance of
PhongMaterial class using the specified
colors and images for its diffuseColor properties. |
impl_dirtyProperty
public PhongMaterial()
PhongMaterial
class with a default
Color.WHITE diffuseColor
property.public PhongMaterial(Color diffuseColor)
PhongMaterial
class using the specified
color for its diffuseColor
property.diffuseColor
- the color of the diffuseColor propertypublic PhongMaterial(Color diffuseColor, Image diffuseMap, Image specularMap, Image bumpMap, Image selfIlluminationMap)
PhongMaterial
class using the specified
colors and images for its diffuseColor
properties.diffuseColor
- the color of the diffuseColor propertydiffuseMap
- the image of the diffuseMap propertyspecularMap
- the image of the specularMap propertybumpMap
- the image of the bumpMap propertyselfIlluminationMap
- the image of the selfIlluminationMap propertypublic final void setDiffuseColor(Color value)
public final Color getDiffuseColor()
public final ObjectProperty<Color> diffuseColorProperty()
public final void setSpecularColor(Color value)
public final Color getSpecularColor()
public final ObjectProperty<Color> specularColorProperty()
public final void setSpecularPower(double value)
public final double getSpecularPower()
public final DoubleProperty specularPowerProperty()
public final void setDiffuseMap(Image value)
public final Image getDiffuseMap()
public final ObjectProperty<Image> diffuseMapProperty()
public final void setSpecularMap(Image value)
public final Image getSpecularMap()
public final ObjectProperty<Image> specularMapProperty()
public final void setBumpMap(Image value)
public final Image getBumpMap()
public final ObjectProperty<Image> bumpMapProperty()
public final void setSelfIlluminationMap(Image value)
public final Image getSelfIlluminationMap()
public final ObjectProperty<Image> selfIlluminationMapProperty()
@Deprecated public NGPhongMaterial impl_getNGMaterial()
impl_getNGMaterial
in class Material
@Deprecated public void impl_updatePG()
impl_updatePG
in class Material
Copyright © 2020. All rights reserved.