UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

12 lines (10 loc) 386 B
import {SpotLight} from 'three'; export function monkeyPatchSpotLight(spotLight: SpotLight) { const previousCopy = spotLight.copy.bind(spotLight); spotLight.copy = function (source: SpotLight, recursive: boolean) { const clonedSpotLight = previousCopy(source, recursive); clonedSpotLight.map = source.map; monkeyPatchSpotLight(clonedSpotLight); return clonedSpotLight; }; }