preact
This commit is contained in:
parent
6acf267d48
commit
b7614eb3f8
4794 changed files with 1280808 additions and 1546 deletions
39
frontend/node_modules/three/examples/jsm/nodes/lighting/IESSpotLightNode.js
generated
vendored
Normal file
39
frontend/node_modules/three/examples/jsm/nodes/lighting/IESSpotLightNode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import SpotLightNode from './SpotLightNode.js';
|
||||
import { addLightNode } from './LightsNode.js';
|
||||
import { texture } from '../accessors/TextureNode.js';
|
||||
import { vec2 } from '../shadernode/ShaderNode.js';
|
||||
import { addNodeClass } from '../core/Node.js';
|
||||
|
||||
import IESSpotLight from '../../lights/IESSpotLight.js';
|
||||
|
||||
class IESSpotLightNode extends SpotLightNode {
|
||||
|
||||
getSpotAttenuation( angleCosine ) {
|
||||
|
||||
const iesMap = this.light.iesMap;
|
||||
|
||||
let spotAttenuation = null;
|
||||
|
||||
if ( iesMap && iesMap.isTexture === true ) {
|
||||
|
||||
const angle = angleCosine.acos().mul( 1.0 / Math.PI );
|
||||
|
||||
spotAttenuation = texture( iesMap, vec2( angle, 0 ), 0 ).r;
|
||||
|
||||
} else {
|
||||
|
||||
spotAttenuation = super.getSpotAttenuation( angleCosine );
|
||||
|
||||
}
|
||||
|
||||
return spotAttenuation;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default IESSpotLightNode;
|
||||
|
||||
addNodeClass( 'IESSpotLightNode', IESSpotLightNode );
|
||||
|
||||
addLightNode( IESSpotLight, IESSpotLightNode );
|
||||
Loading…
Add table
Add a link
Reference in a new issue