Phong color shading style.

Phong shading supports ambient and specular lighting, greatly increasing depth perception capabilities.

With Phong shading enabled, the color of each pixel is affected by angle to camera, as well as the various available Phong shading properties, like light colors and reflection values.

 // Example syntax, use default Phong shading.
pointSeries3D.setColorShadingStyle(new ColorShadingStyles.Phong())
 // Example syntax, use Phong shading with specific configuration.
pointSeries3D.setColorShadingStyle(new ColorShadingStyles.Phong({
// Add specular reflection for "highlight" effect.
specularReflection: 0.5,
specularColor: ColorRGBA(255, 255, 255),
}))

Color shading style is specified with setColorShadingStyle method.

Hierarchy

  • PhongShadingStyle

Implements

Constructors

Properties

ambientColor: Color = ...

Ambient light color.

Describes light that is present at all points of the surface, kind of like a background light.

The impact of ambient color on a surface is also affected by ambientReflection property.

The default setting is black.

 // Example, white ambient light.
ambientColor: ColorRGBA(255, 255, 255)
ambientReflection: number = 1

Controls how much ambient light affects the color.

Value ranges from 0 to 1, where higher values correspond to reflecting more.

The impact of ambient color on a surface is also affected by ambientColor property.

The default value is 1.0.

diffuseReflection: number = 1

Controls how strongly the diffuse color is. Diffuse color is the color defined by user.

Value ranges from 0 to 1, where higher values correspond to reflecting more.

The default value is 1.0.

shininess: number = 32

Specular highlight shininess.

Describes how shiny the material surface is.

The impact of specular color on a surface is also affected by specularReflection and specularColor properties.

Value ranges from 1 to 64, where higher values correspond to being exponentially less shiny.

The default value is 32.

specularColor: Color = ...

Specular highlight color.

Describes light that is reflected from a shiny surface. Can be used to get a "shine" effect on surfaces.

The impact of specular color on a surface is also affected by specularReflection and shininess properties.

The default setting is white.

 // Example, red specular light.
specularColor: ColorRGBA(255, 0, 0)
specularReflection: number = 0.1

Controls specular reflection strength.

Describes how much the material reflects specular light.

The impact of specular color on a surface is also affected by shininess and specularColor properties.

Value ranges from 0 to 1, where higher values correspond to reflecting more.

The default value is 0.1.

type: "phong" = 'phong'