@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
22 lines (21 loc) • 614 B
JavaScript
;
import {
updateUserDataPenumbra,
updateUserDataShadowBias
} from "./_Base";
export function _createSpotLightUniform() {
return {
penumbra: 0,
shadowBiasAngle: 0,
shadowBiasDistance: 0
};
}
let spotLightIndex = 0;
export const _updateUniformsWithSpotLight = (object, spotLightsRayMarching) => {
updateUserDataPenumbra(object, spotLightsRayMarching, spotLightIndex, _createSpotLightUniform);
updateUserDataShadowBias(object, spotLightsRayMarching, spotLightIndex, _createSpotLightUniform);
spotLightIndex++;
};
export function _resetSpotLightIndex() {
spotLightIndex = 0;
}