Capítulo 68 de 859

Chapter 68: MeshBasicNodeMaterial

Core Idea

Node material version of MeshBasicMaterial.

Key Concepts

  • isMeshBasicNodeMaterial : boolean (readonly): This flag can be used for type testing.
  • lights : boolean: Although the basic material is by definition unlit, we set this property to true since we use a lighting model to compute the outgoing li…

Reference Tables

Constructor

Signature
new MeshBasicNodeMaterial( parameters : Object )

Properties

PropertyDescription
.isMeshBasicNodeMaterial : boolean (readonly)This flag can be used for type testing.
.lights : booleanAlthough the basic material is by definition unlit, we set this property to true since we use a lighting model to compute the outgoing light of the fragment shader.

Methods

MethodDescription
.setupEnvironment( builder : NodeBuilder ) : BasicEnvironmentNode.<vec3>Overwritten since this type of material uses BasicEnvironmentNode to implement the default environment mapping.
.setupLightMap( builder : NodeBuilder ) : BasicLightMapNode.<vec3>This method must be overwritten since light maps are evaluated with a special scaling factor for basic materials.
.setupLightingModel() : BasicLightingModelSetups the lighting model.
.setupNormal() : Node.<vec3>Basic materials are not affected by normal and bump maps so we return by default normalViewGeometry.
.setupOutgoingLight() : Node.<vec3>The material overwrites this method because lights is set to true but we still want to return the diffuse color as the outgoing light.

Key Takeaways

  1. MeshBasicNodeMaterial extends: EventDispatcher → Material → NodeMaterial
  2. Most relevant properties: isMeshBasicNodeMaterial, lights.
  3. Key methods: setupEnvironment, setupLightMap, setupLightingModel, setupNormal.

Connects To