Capítulo 78 de 859

Chapter 78: MeshPhongNodeMaterial

Core Idea

Node material version of MeshPhongMaterial.

Key Concepts

  • isMeshPhongNodeMaterial : boolean (readonly): This flag can be used for type testing.
  • lights : boolean: Set to true because phong materials react on lights.
  • shininessNode : Node.<float>: The shininess of phong materials is by default inferred from the shininess property. This node property allows to overwrite the default a…
  • specularNode : Node.<vec3>: The specular color of phong materials is by default inferred from the specular property. This node property allows to overwrite the defau…

Reference Tables

Constructor

Signature
new MeshPhongNodeMaterial( parameters : Object )

Properties

PropertyDescription
.isMeshPhongNodeMaterial : boolean (readonly)This flag can be used for type testing.
.lights : booleanSet to true because phong materials react on lights.
.shininessNode : Node.<float>The shininess of phong materials is by default inferred from the shininess property. This node property allows to overwrite the default and define the shininess with a node instead.
.specularNode : Node.<vec3>The specular color of phong materials is by default inferred from the specular property. This node property allows to overwrite the default and define the specular color with a node instead.

Methods

MethodDescription
.setupEnvironment( builder : NodeBuilder ) : BasicEnvironmentNode.<vec3>Overwritten since this type of material uses BasicEnvironmentNode to implement the default environment mapping.
.setupLightingModel() : PhongLightingModelSetups the lighting model.
.setupVariants( builder : NodeBuilder )Setups the phong specific node variables.

Key Takeaways

  1. MeshPhongNodeMaterial extends: EventDispatcher → Material → NodeMaterial
  2. Most relevant properties: isMeshPhongNodeMaterial, lights, shininessNode, specularNode.
  3. Key methods: setupEnvironment, setupLightingModel, setupVariants.

Connects To