Skip to content

⬅️ Back to Table of Contents

📄 LightingModel.js

📊 Analysis Summary

Metric Count
🔧 Functions 6
🧱 Classes 1

📚 Table of Contents

🛠️ File Location:

📂 src/nodes/core/LightingModel.js

Functions

LightingModel.start(builder: NodeBuilder): void

JSDoc:

/**
     * This method is intended for setting up lighting model and context data
     * which are later used in the evaluation process.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */

Parameters:

  • builder NodeBuilder

Returns: void

Calls:

  • builder.lightsNode.setupLights
  • builder.lightsNode.getLightNodes
  • this.indirect

Internal Comments:

// lights ( direct ) (x5)
// indirect (x4)

Code
start( builder ) {

        // lights ( direct )

        builder.lightsNode.setupLights( builder, builder.lightsNode.getLightNodes( builder ) );

        // indirect

        this.indirect( builder );

    }

LightingModel.finish(): void

JSDoc:

/**
     * This method is intended for executing final tasks like final updates
     * to the outgoing light.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */

Returns: void

Code
finish( /*builder*/ ) { }

LightingModel.direct(): void

JSDoc:

/**
     * This method is intended for implementing the direct light term and
     * executed during the build process of directional, point and spot light nodes.
     *
     * @abstract
     * @param {Object} lightData - The light data.
     * @param {NodeBuilder} builder - The current node builder.
     */

Returns: void

Code
direct( /*lightData, builder*/ ) { }

LightingModel.directRectArea(): void

JSDoc:

/**
     * This method is intended for implementing the direct light term for
     * rect area light nodes.
     *
     * @abstract
     * @param {Object} lightData - The light data.
     * @param {NodeBuilder} builder - The current node builder.
     */

Returns: void

Code
directRectArea( /*lightData, builder*/ ) {}

LightingModel.indirect(): void

JSDoc:

/**
     * This method is intended for implementing the indirect light term.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */

Returns: void

Code
indirect( /*builder*/ ) { }

LightingModel.ambientOcclusion(): void

JSDoc:

/**
     * This method is intended for implementing the ambient occlusion term.
     * Unlike other methods, this method must be called manually by the lighting
     * model in its indirect term.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */

Returns: void

Code
ambientOcclusion( /*input, stack, builder*/ ) { }

Classes

LightingModel

Class Code
class LightingModel {

    /**
     * This method is intended for setting up lighting model and context data
     * which are later used in the evaluation process.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */
    start( builder ) {

        // lights ( direct )

        builder.lightsNode.setupLights( builder, builder.lightsNode.getLightNodes( builder ) );

        // indirect

        this.indirect( builder );

    }

    /**
     * This method is intended for executing final tasks like final updates
     * to the outgoing light.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */
    finish( /*builder*/ ) { }

    /**
     * This method is intended for implementing the direct light term and
     * executed during the build process of directional, point and spot light nodes.
     *
     * @abstract
     * @param {Object} lightData - The light data.
     * @param {NodeBuilder} builder - The current node builder.
     */
    direct( /*lightData, builder*/ ) { }

    /**
     * This method is intended for implementing the direct light term for
     * rect area light nodes.
     *
     * @abstract
     * @param {Object} lightData - The light data.
     * @param {NodeBuilder} builder - The current node builder.
     */
    directRectArea( /*lightData, builder*/ ) {}

    /**
     * This method is intended for implementing the indirect light term.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */
    indirect( /*builder*/ ) { }

    /**
     * This method is intended for implementing the ambient occlusion term.
     * Unlike other methods, this method must be called manually by the lighting
     * model in its indirect term.
     *
     * @abstract
     * @param {NodeBuilder} builder - The current node builder.
     */
    ambientOcclusion( /*input, stack, builder*/ ) { }

}

Methods

start(builder: NodeBuilder): void
Code
start( builder ) {

        // lights ( direct )

        builder.lightsNode.setupLights( builder, builder.lightsNode.getLightNodes( builder ) );

        // indirect

        this.indirect( builder );

    }
finish(): void
Code
finish( /*builder*/ ) { }
direct(): void
Code
direct( /*lightData, builder*/ ) { }
directRectArea(): void
Code
directRectArea( /*lightData, builder*/ ) {}
indirect(): void
Code
indirect( /*builder*/ ) { }
ambientOcclusion(): void
Code
ambientOcclusion( /*input, stack, builder*/ ) { }