Capítulo 100 de 859
Base class for analytic light nodes.
colorNode of the light source, if set. Otherwise it creates a uniform node based on [AnalyticLightNode#…Constructor
| Signature |
|---|
new AnalyticLightNode( light : Light ) |
Properties
| Property | Description |
|---|---|
.baseColorNode : Node | This 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 : 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#color. |
.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. |
Methods
| Method | Description |
|---|---|
.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 ) : Object | undefined (abstract)` |
| `.setupDirectRectArea( builder : NodeBuilder ) : Object | undefined (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() : ShadowNode | Setups 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. |