UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

90 lines (89 loc) 3.4 kB
import { NodeMaterialBlock } from "../../nodeMaterialBlock.js"; import type { NodeMaterialBuildState } from "../../nodeMaterialBuildState.js"; import type { NodeMaterialConnectionPoint } from "../../nodeMaterialBlockConnectionPoint.js"; import type { AbstractMesh } from "../../../../Meshes/abstractMesh.js"; import type { NodeMaterial, NodeMaterialDefines } from "../../nodeMaterial.js"; import type { Effect } from "../../../effect.js"; import type { Mesh } from "../../../../Meshes/mesh.js"; import type { Light } from "../../../../Lights/light.js"; import type { Nullable } from "../../../../types.js"; import type { Scene } from "../../../../scene.js"; /** * Block used to add light in the fragment shader */ export declare class LightBlock extends NodeMaterialBlock { private _lightId; /** * Gets or sets the light associated with this block */ light: Nullable<Light>; /** Indicates that no code should be generated in the vertex shader. Can be useful in some specific circumstances (like when doing ray marching for eg) */ generateOnlyFragmentCode: boolean; private static _OnGenerateOnlyFragmentCodeChanged; private _setTarget; /** * Create a new LightBlock * @param name defines the block name */ constructor(name: string); /** * Gets the current class name * @returns the class name */ getClassName(): string; /** * Gets the world position input component */ get worldPosition(): NodeMaterialConnectionPoint; /** * Gets the world normal input component */ get worldNormal(): NodeMaterialConnectionPoint; /** * Gets the camera (or eye) position component */ get cameraPosition(): NodeMaterialConnectionPoint; /** * Gets the glossiness component */ get glossiness(): NodeMaterialConnectionPoint; /** * Gets the glossiness power component */ get glossPower(): NodeMaterialConnectionPoint; /** * Gets the diffuse color component */ get diffuseColor(): NodeMaterialConnectionPoint; /** * Gets the specular color component */ get specularColor(): NodeMaterialConnectionPoint; /** * Gets the view matrix component */ get view(): NodeMaterialConnectionPoint; /** * Gets the diffuse output component */ get diffuseOutput(): NodeMaterialConnectionPoint; /** * Gets the specular output component */ get specularOutput(): NodeMaterialConnectionPoint; /** * Gets the shadow output component */ get shadow(): NodeMaterialConnectionPoint; initialize(state: NodeMaterialBuildState): void; private _initShaderSourceAsync; autoConfigure(material: NodeMaterial, additionalFilteringInfo?: (node: NodeMaterialBlock) => boolean): void; prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void; updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, uniformBuffers: string[]): void; bind(effect: Effect, nodeMaterial: NodeMaterial, mesh?: Mesh): void; private _injectVertexCode; private _injectUBODeclaration; protected _buildBlock(state: NodeMaterialBuildState): this | undefined; serialize(): any; _deserialize(serializationObject: any, scene: Scene, rootUrl: string): void; }