Constructor
new PhongMaterial(webglContext, optionsopt)
Creates a new `PhongMaterial`.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
webglContext |
WebGL2RenderingContext | WebGL2 rendering context, used to compile shaders. | |
options |
PhongMaterialOptions |
<optional> |
Material options. |
- Source:
Classes
Members
shininess
- Source:
specularColor
Returns the internal specular color buffer.
- Source:
specularStrength
- Source:
Methods
(protected) applyAdditionalUniforms(worldMatrix, cameraPosition)
Uploads Phong-specific uniforms (world matrix, camera position and specular settings).
Parameters:
| Name | Type | Description |
|---|---|---|
worldMatrix |
Float32Array | World matrix. |
cameraPosition |
Float32Array | Camera position, world space. |
- Source:
setShininess(value)
Sets shininess exponent for the specular highlight.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Shininess exponent. |
- Source:
setSpecularColor(color)
Sets the specular RGB-color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Float32Array | Array.<number> | [red, green, blue] in [0..1] range. |
- Source:
setSpecularStrength(value)
Sets specular strength multiplier.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Specular multiplier. |
- Source: