Buckets:
| import LightingNode from './LightingNode.js'; | |
| import { float } from '../tsl/TSLBase.js'; | |
| /** | |
| * A specific version of {@link IrradianceNode} that is only relevant | |
| * for {@link MeshBasicNodeMaterial}. Since the material is unlit, it | |
| * requires a special scaling factor for the light map. | |
| * | |
| * @augments LightingNode | |
| */ | |
| class BasicLightMapNode extends LightingNode { | |
| static get type() { | |
| return 'BasicLightMapNode'; | |
| } | |
| /** | |
| * Constructs a new basic light map node. | |
| * | |
| * @param {?Node<vec3>} [lightMapNode=null] - The light map node. | |
| */ | |
| constructor( lightMapNode = null ) { | |
| super(); | |
| /** | |
| * The light map node. | |
| * | |
| * @type {?Node<vec3>} | |
| */ | |
| this.lightMapNode = lightMapNode; | |
| } | |
| setup( builder ) { | |
| // irradianceLightMap property is used in the indirectDiffuse() method of BasicLightingModel | |
| const RECIPROCAL_PI = float( 1 / Math.PI ); | |
| builder.context.irradianceLightMap = this.lightMapNode.mul( RECIPROCAL_PI ); | |
| } | |
| } | |
| export default BasicLightMapNode; | |
Xet Storage Details
- Size:
- 996 Bytes
- Xet hash:
- 8af5a53848cb9b5c0a0f5b701dd58389f11e4b4433d2702c6892391e73b1ee84
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.