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,V is the normalized view vector.
AmbientLight, PointLight
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | |
| private boolean | |
| private ObjectProperty | diffuseColor
The diffuse color of this |
| private boolean | |
| private ObjectProperty | diffuseMap
The diffuse map of this |
| private boolean | |
| private Image | |
| private Image | |
| private Image | |
| private Image | |
| private NGPhongMaterial | peer
The peer node created by the graphics Toolkit/Pipeline implementation |
| private final AbstractNotifyListener | |
| private ObjectProperty | selfIlluminationMap
The self illumination map of this |
| private boolean | |
| private ObjectProperty | specularColor
The specular color of this |
| private boolean | |
| private ObjectProperty | specularMap
The specular map of this |
| private boolean | |
| private DoubleProperty | specularPower
The specular power of this |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | PhongMaterial()
Creates a new instance of |
| public | PhongMaterial(Color
the color of the diffuseColor property diffuseColor)Creates a new instance of |
| public | PhongMaterial(Color
the color of the diffuseColor property diffuseColor, Image the image of the diffuseMap property diffuseMap, Image the image of the specularMap property specularMap, Image the image of the bumpMap property bumpMap, Image the image of the selfIlluminationMap property selfIlluminationMap)Creates a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | |
| public final ObjectProperty | |
| public final ObjectProperty | |
| public final Image | |
| public final Color | |
| public final Image | |
| pack-priv NGPhongMaterial | |
| public final Image | |
| public final Color | |
| public final Image | |
| public final double | |
| public final ObjectProperty | |
| public final void | |
| public final void | |
| public final void | |
| pack-priv void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final ObjectProperty | |
| public final ObjectProperty | |
| public final DoubleProperty | |
| public String | |
| pack-priv void |
| bumpMap | back to summary |
|---|---|
| private ObjectProperty<Image> bumpMap The bump map of this
| |
| bumpMapDirty | back to summary |
|---|---|
| private boolean bumpMapDirty | |
| diffuseColor | back to summary |
|---|---|
| private ObjectProperty<Color> diffuseColor The diffuse color of this
| |
| diffuseColorDirty | back to summary |
|---|---|
| private boolean diffuseColorDirty | |
| diffuseMap | back to summary |
|---|---|
| private ObjectProperty<Image> diffuseMap The diffuse map of this
| |
| diffuseMapDirty | back to summary |
|---|---|
| private boolean diffuseMapDirty | |
| oldBumpMap | back to summary |
|---|---|
| private Image oldBumpMap | |
| oldDiffuseMap | back to summary |
|---|---|
| private Image oldDiffuseMap | |
| oldSelfIlluminationMap | back to summary |
|---|---|
| private Image oldSelfIlluminationMap | |
| oldSpecularMap | back to summary |
|---|---|
| private Image oldSpecularMap | |
| peer | back to summary |
|---|---|
| private NGPhongMaterial peer The peer node created by the graphics Toolkit/Pipeline implementation | |
| platformImageChangeListener | back to summary |
|---|---|
| private final AbstractNotifyListener platformImageChangeListener | |
| selfIlluminationMap | back to summary |
|---|---|
| private ObjectProperty<Image> selfIlluminationMap The self illumination map of this
| |
| selfIlluminationMapDirty | back to summary |
|---|---|
| private boolean selfIlluminationMapDirty | |
| specularColor | back to summary |
|---|---|
| private ObjectProperty<Color> specularColor The specular color of this
| |
| specularColorDirty | back to summary |
|---|---|
| private boolean specularColorDirty | |
| specularMap | back to summary |
|---|---|
| private ObjectProperty<Image> specularMap The specular map of this
| |
| specularMapDirty | back to summary |
|---|---|
| private boolean specularMapDirty | |
| specularPower | back to summary |
|---|---|
| private DoubleProperty specularPower The specular power of this
| |
| specularPowerDirty | back to summary |
|---|---|
| private boolean specularPowerDirty | |
| PhongMaterial | back to summary |
|---|---|
| public PhongMaterial() Creates a new instance of | |
| PhongMaterial | back to summary |
|---|---|
| public PhongMaterial(Color diffuseColor) Creates a new instance of
| |
| PhongMaterial | back to summary |
|---|---|
| public PhongMaterial(Color diffuseColor, Image diffuseMap, Image specularMap, Image bumpMap, Image selfIlluminationMap) Creates a new instance of | |
| bumpMapProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| diffuseColorProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| diffuseMapProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| getBumpMap | back to summary |
|---|---|
| public final Image getBumpMap() | |
| getDiffuseColor | back to summary |
|---|---|
| public final Color getDiffuseColor() | |
| getDiffuseMap | back to summary |
|---|---|
| public final Image getDiffuseMap() | |
| getNGMaterial | back to summary |
|---|---|
| pack-priv NGPhongMaterial getNGMaterial() Implements abstract javafx.
| |
| getSelfIlluminationMap | back to summary |
|---|---|
| public final Image getSelfIlluminationMap() | |
| getSpecularColor | back to summary |
|---|---|
| public final Color getSpecularColor() | |
| getSpecularMap | back to summary |
|---|---|
| public final Image getSpecularMap() | |
| getSpecularPower | back to summary |
|---|---|
| public final double getSpecularPower() | |
| selfIlluminationMapProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| setBumpMap | back to summary |
|---|---|
| public final void setBumpMap(Image value) | |
| setDiffuseColor | back to summary |
|---|---|
| public final void setDiffuseColor(Color value) | |
| setDiffuseMap | back to summary |
|---|---|
| public final void setDiffuseMap(Image value) | |
| setDirty | back to summary |
|---|---|
| pack-priv void setDirty(boolean value) Overrides javafx.
| |
| setSelfIlluminationMap | back to summary |
|---|---|
| public final void setSelfIlluminationMap(Image value) | |
| setSpecularColor | back to summary |
|---|---|
| public final void setSpecularColor(Color value) | |
| setSpecularMap | back to summary |
|---|---|
| public final void setSpecularMap(Image value) | |
| setSpecularPower | back to summary |
|---|---|
| public final void setSpecularPower(double value) | |
| specularColorProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| specularMapProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| specularPowerProperty | back to summary |
|---|---|
| public final DoubleProperty specularPowerProperty() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| updatePG | back to summary |
|---|---|
| pack-priv void updatePG() Implements abstract javafx.
| |