Complete 3D metaverse platform with: - Three.js 3D rendering - Cannon.js physics engine - Pointer lock controls - Procedural cityscape - Floating islands - Portal system - Particle effects - WebXR/VR support ready - Multiplayer ready (Socket.io) Features: - First-person controls (WASD + mouse) - Jump and run mechanics - Chat system - Real-time HUD - Loading screen - Responsive design Built with Vite for fast builds and hot reload. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
40 lines
886 B
JavaScript
40 lines
886 B
JavaScript
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 );
|