Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PhongShadingStyle

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 Series3D.setColorShadingStyle method.

Index

Constructors

constructor

Properties

Readonly ambientColor

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)

Readonly ambientReflection

ambientReflection : number

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.

Readonly diffuseReflection

diffuseReflection : number

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.

Readonly shininess

shininess : number

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.

Readonly specularColor

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)

Readonly specularReflection

specularReflection : number

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.

Readonly type

type : "phong"