@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
22 lines (21 loc) • 627 B
JavaScript
;
import {
updateUserDataPenumbra,
updateUserDataShadowBias
} from "./_Base";
export function _createPointLightUniform() {
return {
penumbra: 0,
shadowBiasAngle: 0,
shadowBiasDistance: 0
};
}
let pointLightIndex = 0;
export const _updateUniformsWithPointLight = (object, pointLightsRayMarching) => {
updateUserDataPenumbra(object, pointLightsRayMarching, pointLightIndex, _createPointLightUniform);
updateUserDataShadowBias(object, pointLightsRayMarching, pointLightIndex, _createPointLightUniform);
pointLightIndex++;
};
export function _resetPointLightIndex() {
pointLightIndex = 0;
}