Capítulo 100 de 859

Chapter 100: AnalyticLightNode

Core Idea

Base class for analytic light nodes.

Key Concepts

  • baseColorNode : Node: This property is used to retain a reference to the original value of AnalyticLightNode#colorNode. The f…
  • color : Color: The light's color value.
  • colorNode : Node: The light's color node. Points to colorNode of the light source, if set. Otherwise it creates a uniform node based on [AnalyticLightNode#…
  • isAnalyticLightNode : boolean (readonly): This flag can be used for type testing.
  • light : Light: The light source.
  • shadowColorNode : Node: Represents the light's shadow color.
  • shadowNode : ShadowNode: Represents the light's shadow.
  • updateType : string: Overwritten since analytic light nodes are updated once per frame.

Reference Tables

Constructor

Signature
new AnalyticLightNode( light : Light )

Properties

PropertyDescription
.baseColorNode : NodeThis property is used to retain a reference to the original value of AnalyticLightNode#colorNode. The final color node is represented by a different node when usin…
.color : ColorThe light's color value.
.colorNode : NodeThe light's color node. Points to colorNode of the light source, if set. Otherwise it creates a uniform node based on AnalyticLightNode#color.
.isAnalyticLightNode : boolean (readonly)This flag can be used for type testing.
.light : LightThe light source.
.shadowColorNode : NodeRepresents the light's shadow color.
.shadowNode : ShadowNodeRepresents the light's shadow.
.updateType : stringOverwritten since analytic light nodes are updated once per frame.

Methods

MethodDescription
.disposeShadow()Frees internal resources related to shadows.
.getLightVector( builder : NodeBuilder ) : Node.<vec3>Returns a node representing a direction vector which points from the current position in view space to the light's position in view space.
.setup( builder : NodeBuilder )Unlike most other nodes, lighting nodes do not return a output node in Node#setup. The main purpose of lighting nodes is to configure the current [LightingModel](LightingModel.html…
`.setupDirect( builder : NodeBuilder ) : Objectundefined (abstract)`
`.setupDirectRectArea( builder : NodeBuilder ) : Objectundefined (abstract)`
.setupShadow( builder : NodeBuilder )Setups the shadow for this light. This method is only executed if the light cast shadows and the current build object receives shadows. It incorporates shadows into the lighting computation.
.setupShadowNode() : ShadowNodeSetups the shadow node for this light. The method exists so concrete light classes can setup different types of shadow nodes.
.update( frame : NodeFrame )The update method is used to update light uniforms per frame. Potentially overwritten in concrete light nodes to update light specific uniforms.

Key Takeaways

  1. AnalyticLightNode extends: EventDispatcher → Node → LightingNode
  2. Most relevant properties: baseColorNode, color, colorNode, isAnalyticLightNode.
  3. Key methods: disposeShadow, getLightVector, setup, setupDirect.

Connects To