@flighthq/lighting 0.5.1-next.973.788d3d7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/.tsbuildinfo.contract +1 -0
- package/dist/.tsbuildinfo.runtime +1 -0
- package/dist/ambientLight.d.ts +2 -1
- package/dist/ambientLight.d.ts.map +1 -1
- package/dist/ambientLight.js +3 -3
- package/dist/ambientLight.js.map +1 -1
- package/dist/areaLight.d.ts +3 -1
- package/dist/areaLight.d.ts.map +1 -1
- package/dist/areaLight.js +4 -4
- package/dist/areaLight.js.map +1 -1
- package/dist/contract.d.ts +20 -17
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +20 -17
- package/dist/contract.js.map +1 -1
- package/dist/contract.lighting-types.d.ts +2 -0
- package/dist/contract.lighting-types.d.ts.map +1 -0
- package/dist/contract.lighting-types.js +4 -0
- package/dist/contract.lighting-types.js.map +1 -0
- package/dist/directionalLight.d.ts +2 -1
- package/dist/directionalLight.d.ts.map +1 -1
- package/dist/directionalLight.js +3 -3
- package/dist/directionalLight.js.map +1 -1
- package/dist/environment.d.ts +2 -1
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +3 -3
- package/dist/environment.js.map +1 -1
- package/dist/hemisphereLight.d.ts +2 -1
- package/dist/hemisphereLight.d.ts.map +1 -1
- package/dist/hemisphereLight.js +3 -3
- package/dist/hemisphereLight.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lightAnalysis.d.ts +2 -1
- package/dist/lightAnalysis.d.ts.map +1 -1
- package/dist/lightAnalysis.js +1 -1
- package/dist/lightAnalysis.js.map +1 -1
- package/dist/lightIntensity.d.ts +3 -1
- package/dist/lightIntensity.d.ts.map +1 -1
- package/dist/lightIntensity.js +19 -1
- package/dist/lightIntensity.js.map +1 -1
- package/dist/lightProbe.d.ts +69 -0
- package/dist/lightProbe.d.ts.map +1 -0
- package/dist/lightProbe.js +229 -0
- package/dist/lightProbe.js.map +1 -0
- package/dist/pointLight.d.ts +2 -1
- package/dist/pointLight.d.ts.map +1 -1
- package/dist/pointLight.js +8 -4
- package/dist/pointLight.js.map +1 -1
- package/dist/sceneForwardLights.d.ts +3 -2
- package/dist/sceneForwardLights.d.ts.map +1 -1
- package/dist/sceneForwardLights.js +25 -9
- package/dist/sceneForwardLights.js.map +1 -1
- package/dist/sceneLights.d.ts +2 -1
- package/dist/sceneLights.d.ts.map +1 -1
- package/dist/sceneLights.js +2 -2
- package/dist/sceneLights.js.map +1 -1
- package/dist/spotLight.d.ts +2 -1
- package/dist/spotLight.d.ts.map +1 -1
- package/dist/spotLight.js +7 -3
- package/dist/spotLight.js.map +1 -1
- package/dist/types.d.ts +312 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +59 -0
- package/dist/types.js.map +1 -0
- package/package.json +8 -6
- package/src/ambientLight.test.ts +2 -3
- package/src/areaLight.test.ts +2 -2
- package/src/directionalLight.test.ts +2 -2
- package/src/environment.test.ts +7 -7
- package/src/hemisphereLight.test.ts +2 -3
- package/src/lightAnalysis.test.ts +21 -21
- package/src/lightIntensity.test.ts +50 -3
- package/src/lightProbe.test.ts +362 -0
- package/src/pointLight.test.ts +2 -2
- package/src/sceneForwardLights.test.ts +59 -4
- package/src/sceneLights.test.ts +5 -5
- package/src/spotLight.test.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hemisphereLight.d.ts","sourceRoot":"","sources":["../src/hemisphereLight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"hemisphereLight.d.ts","sourceRoot":"","sources":["../src/hemisphereLight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAI1E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,eAAe,CAQvF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,eAAe,CAIjG;AAKD,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,kBAAkB,CAAC,eAAe,CAAC,EACxC,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GACzC,IAAI,CAON"}
|
package/dist/hemisphereLight.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { allocateEntity
|
|
2
|
-
import { HemisphereLightKind, UnitlessLightUnit } from '
|
|
1
|
+
import { allocateEntity } from '@flighthq/entity/contract';
|
|
2
|
+
import { HemisphereLightKind, UnitlessLightUnit } from './types.js';
|
|
3
3
|
// Independent copy of a hemisphere light's data. The `kind` discriminant is carried over.
|
|
4
4
|
export function cloneHemisphereLight(source) {
|
|
5
5
|
return createHemisphereLight({
|
|
@@ -13,7 +13,7 @@ export function cloneHemisphereLight(source) {
|
|
|
13
13
|
export function createHemisphereLight(options) {
|
|
14
14
|
const out = allocateEntity();
|
|
15
15
|
initializeHemisphereLight(out, options);
|
|
16
|
-
return
|
|
16
|
+
return out;
|
|
17
17
|
}
|
|
18
18
|
// Gradient ambient: `skyColor` from above, `groundColor` from below, blended by the surface
|
|
19
19
|
// normal's vertical component. Colors are packed sRgb-albedo RGBA (0xrrggbbaa); both default to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hemisphereLight.js","sourceRoot":"","sources":["../src/hemisphereLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"hemisphereLight.js","sourceRoot":"","sources":["../src/hemisphereLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpE,0FAA0F;AAC1F,MAAM,UAAU,oBAAoB,CAAC,MAAiC;IACpE,OAAO,qBAAqB,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAA0C;IAC9E,MAAM,GAAG,GAAG,cAAc,EAAmB,CAAC;IAC9C,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,4FAA4F;AAC5F,gGAAgG;AAChG,yEAAyE;AACzE,MAAM,UAAU,yBAAyB,CACvC,GAAwC,EACxC,OAA0C;IAE1C,GAAG,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC;IACvC,GAAG,CAAC,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,UAAU,CAAC;IACrD,GAAG,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,CAAC,CAAC;IACxC,GAAG,CAAC,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,iBAAiB,CAAC;IAChE,GAAG,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAC/B,GAAG,CAAC,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,UAAU,CAAC;AACjD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { applyLightExposure, cloneAmbientLight, cloneAreaLight, cloneDirectionalLight, cloneEnvironment, cloneHemisphereLight, clonePointLight, cloneSpotLight, convertLightIntensity, createAmbientLight, createAreaLight, createDirectionalLight, createEnvironment, createHemisphereLight, createPointLight, createScene3DLights, createSpotLight, getLightContributionAtBoundingSphere, getLightInfluenceBounds, getLightLinearIntensity, getLightLuminance, getSpotLightConeDegrees, hasLightInfluenceOnBounds, isLightCastingShadow, selectScene3DForwardLights, setAreaLightOrientation, setDirectionalLightDirection, setDirectionalLightTarget, setSpotLightBlend, setSpotLightCone, setSpotLightDirection, setSpotLightTarget, } from './contract';
|
|
1
|
+
export { applyLightExposure, cloneAmbientLight, cloneAreaLight, cloneDirectionalLight, cloneEnvironment, cloneHemisphereLight, clonePointLight, cloneSpotLight, convertLightIntensity, createAmbientLight, createAreaLight, createDirectionalLight, createEnvironment, createHemisphereLight, createLightProbe, createLightProbeGrid, createPointLight, createScene3DLights, createSpotLight, evaluateLightProbeSh, getLightContributionAtBoundingSphere, getLightInfluenceBounds, getLightLinearIntensity, getLightPhotometricIntensity, getLightLuminance, getSpotLightConeDegrees, hasLightInfluenceOnBounds, isLightCastingShadow, sampleLightProbeGrid, selectScene3DForwardLights, setAreaLightOrientation, setLightPhotometricIntensity, setLightProbeShFromColors, setDirectionalLightDirection, setDirectionalLightTarget, setSpotLightBlend, setSpotLightCone, setSpotLightDirection, setSpotLightTarget, } from './contract.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,oCAAoC,EACpC,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,oCAAoC,EACpC,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { applyLightExposure, cloneAmbientLight, cloneAreaLight, cloneDirectionalLight, cloneEnvironment, cloneHemisphereLight, clonePointLight, cloneSpotLight, convertLightIntensity, createAmbientLight, createAreaLight, createDirectionalLight, createEnvironment, createHemisphereLight, createPointLight, createScene3DLights, createSpotLight, getLightContributionAtBoundingSphere, getLightInfluenceBounds, getLightLinearIntensity, getLightLuminance, getSpotLightConeDegrees, hasLightInfluenceOnBounds, isLightCastingShadow, selectScene3DForwardLights, setAreaLightOrientation, setDirectionalLightDirection, setDirectionalLightTarget, setSpotLightBlend, setSpotLightCone, setSpotLightDirection, setSpotLightTarget, } from './contract';
|
|
1
|
+
export { applyLightExposure, cloneAmbientLight, cloneAreaLight, cloneDirectionalLight, cloneEnvironment, cloneHemisphereLight, clonePointLight, cloneSpotLight, convertLightIntensity, createAmbientLight, createAreaLight, createDirectionalLight, createEnvironment, createHemisphereLight, createLightProbe, createLightProbeGrid, createPointLight, createScene3DLights, createSpotLight, evaluateLightProbeSh, getLightContributionAtBoundingSphere, getLightInfluenceBounds, getLightLinearIntensity, getLightPhotometricIntensity, getLightLuminance, getSpotLightConeDegrees, hasLightInfluenceOnBounds, isLightCastingShadow, sampleLightProbeGrid, selectScene3DForwardLights, setAreaLightOrientation, setLightPhotometricIntensity, setLightProbeShFromColors, setDirectionalLightDirection, setDirectionalLightTarget, setSpotLightBlend, setSpotLightCone, setSpotLightDirection, setSpotLightTarget, } from './contract.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,oCAAoC,EACpC,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,oCAAoC,EACpC,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
package/dist/lightAnalysis.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BoundingSphereLike
|
|
1
|
+
import type { BoundingSphereLike } from '@flighthq/geometry/contract';
|
|
2
|
+
import type { Light, PointLight, SpotLight } from './types.ts';
|
|
2
3
|
export declare function getLightContributionAtBoundingSphere(light: Readonly<PointLight | SpotLight>, bounds: Readonly<BoundingSphereLike>): number;
|
|
3
4
|
export declare function getLightInfluenceBounds(out: BoundingSphereLike, light: Readonly<Light>): void;
|
|
4
5
|
export declare function getLightLuminance(light: Readonly<Light>): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightAnalysis.d.ts","sourceRoot":"","sources":["../src/lightAnalysis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"lightAnalysis.d.ts","sourceRoot":"","sources":["../src/lightAnalysis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAKV,KAAK,EACL,UAAU,EACV,SAAS,EACV,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,QAAQ,CAAC,UAAU,GAAG,SAAS,CAAC,EACvC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GACnC,MAAM,CAgCR;AAOD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CA4C7F;AAOD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,MAAM,CAmChE;AAMD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,OAAO,CA2B/G;AASD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,OAAO,CAOpE"}
|
package/dist/lightAnalysis.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getColorLuminance } from '@flighthq/color/contract';
|
|
2
|
-
import { AmbientLightKind, AreaLightKind, DirectionalLightKind, EnvironmentKind, HemisphereLightKind, PointLightKind, SpotLightKind, } from '
|
|
2
|
+
import { AmbientLightKind, AreaLightKind, DirectionalLightKind, EnvironmentKind, HemisphereLightKind, PointLightKind, SpotLightKind, } from './types.js';
|
|
3
3
|
// Estimates the radiance contribution of one punctual light at a world-space bounding sphere.
|
|
4
4
|
// Distance uses the nearest sphere surface (`centerDistance - radius`) so large objects receive
|
|
5
5
|
// radius slack instead of being ranked only at their centre. The attenuation matches the forward
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightAnalysis.js","sourceRoot":"","sources":["../src/lightAnalysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"lightAnalysis.js","sourceRoot":"","sources":["../src/lightAn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AI,CAAC;AAC9D,CAAC;AAED,6FAA6F;AAC7F,0FAA0F;AAC1F,SAAS,cAAc,CAAC,KAAsB;IAC5C,OAAO,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC;AAC1D,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,KAAa,EAAE,KAAa;IAC7D,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/lightIntensity.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { LightUnit } from '
|
|
1
|
+
import type { LightUnit, PhotometricLightLike } from './types.ts';
|
|
2
2
|
export declare function applyLightExposure(intensity: number, ev: number): number;
|
|
3
3
|
export declare function convertLightIntensity(fromUnit: LightUnit, toUnit: LightUnit, value: number): number;
|
|
4
4
|
export declare function getLightLinearIntensity(unit: LightUnit, value: number): number;
|
|
5
|
+
export declare function getLightPhotometricIntensity(light: Readonly<PhotometricLightLike>): number;
|
|
6
|
+
export declare function setLightPhotometricIntensity(out: PhotometricLightLike, value: number): void;
|
|
5
7
|
//# sourceMappingURL=lightIntensity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightIntensity.d.ts","sourceRoot":"","sources":["../src/lightIntensity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"lightIntensity.d.ts","sourceRoot":"","sources":["../src/lightIntensity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AASlE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExE;AAOD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnG;AAgBD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9E;AAQD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAE1F;AAOD,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAG3F"}
|
package/dist/lightIntensity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CandelaLightUnit, LumenLightUnit, LuxLightUnit, UnitlessLightUnit } from '
|
|
1
|
+
import { CandelaLightUnit, LumenLightUnit, LuxLightUnit, UnitlessLightUnit } from './types.js';
|
|
2
2
|
// Scales a light intensity by an exposure value in photographic stops: each +1 EV doubles the
|
|
3
3
|
// intensity, each -1 halves it (`intensity * 2**ev`). This is the porting dial for the linear-HDR
|
|
4
4
|
// contract described in this package's status.md: scene-gl multiplies LINEAR radiance and defers
|
|
@@ -33,6 +33,24 @@ export function convertLightIntensity(fromUnit, toUnit, value) {
|
|
|
33
33
|
export function getLightLinearIntensity(unit, value) {
|
|
34
34
|
return value * LINEAR_PER_UNIT[unit];
|
|
35
35
|
}
|
|
36
|
+
// Reads a light's intensity back in the photometric unit it was authored in. This is the accessor that
|
|
37
|
+
// connects `intensityUnit` to the light carrying it: without it, a descriptor's unit is a label nothing
|
|
38
|
+
// consumes, and a caller wanting "how many lux is this sun" has to remember the anchor and divide by
|
|
39
|
+
// hand. A `Unitless` light returns its linear intensity unchanged, because that IS its authored reading.
|
|
40
|
+
//
|
|
41
|
+
// Exact inverse of setLightPhotometricIntensity, so a round trip returns the original value.
|
|
42
|
+
export function getLightPhotometricIntensity(light) {
|
|
43
|
+
return convertLightIntensity(UnitlessLightUnit, light.intensityUnit, light.intensity);
|
|
44
|
+
}
|
|
45
|
+
// Writes a light's intensity from a reading in the unit the light declares. The stored `intensity` stays
|
|
46
|
+
// the dimensionless multiplier the shaders consume — this converts on the way in rather than teaching
|
|
47
|
+
// the render path about units, which is the same split getLightLinearIntensity already draws.
|
|
48
|
+
//
|
|
49
|
+
// Reads `intensityUnit` before writing `intensity`, so passing the light as its own source is safe.
|
|
50
|
+
export function setLightPhotometricIntensity(out, value) {
|
|
51
|
+
const unit = out.intensityUnit;
|
|
52
|
+
out.intensity = getLightLinearIntensity(unit, value);
|
|
53
|
+
}
|
|
36
54
|
// The renderer-linear multiplier produced by one unit of each LightUnit. Unitless is the native
|
|
37
55
|
// scale (1:1). Lux and Candela anchor at 1 / 100000 (100000 physical units == linear 1.0). Lumen
|
|
38
56
|
// follows Candela through the isotropic-point-source identity lumen = candela * 4*PI, so one lumen is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightIntensity.js","sourceRoot":"","sources":["../src/lightIntensity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"lightIntensity.js","sourceRoot":"","sources":["../src/lightIntensity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/F,8FAA8F;AAC9F,kGAAkG;AAClG,iGAAiG;AACjG,gGAAgG;AAChG,mGAAmG;AACnG,2FAA2F;AAC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G,MAAM,CAAC;AAC3C,MAAM,eAAe,GAAwC;IAC3D,CAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,2BAA2B;IACnD,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,2BAA2B,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IACjE,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,2BAA2B;IAC/C,CAAC,iBAAiB,CAAC,EAAE,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { EntityConstruction } from '@flighthq/entity/contract';
|
|
2
|
+
import type { AabbLike, Vector3Like } from '@flighthq/geometry/contract';
|
|
3
|
+
import type { LightProbe, LightProbeGrid } from './types.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Allocates a probe at `position`. `shCoefficients` defaults to all zeros — a probe that contributes
|
|
6
|
+
* no light — and when supplied is COPIED, so the caller keeps ownership of its buffer and a later
|
|
7
|
+
* mutation of it cannot reach into the probe.
|
|
8
|
+
*
|
|
9
|
+
* Throws when `shCoefficients` is not exactly `LIGHT_PROBE_SH_FLOATS` long: a short buffer would leave
|
|
10
|
+
* whole SH bands silently zero, which reads as a plausible dim probe rather than as the mistake it is.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createLightProbe(position: Readonly<Vector3Like>, shCoefficients?: Readonly<Float32Array>): LightProbe;
|
|
13
|
+
/**
|
|
14
|
+
* Allocates a grid of probes over `bounds`. `probes` is stored by reference (it is the caller's array,
|
|
15
|
+
* shared not copied) while `resolution` and `bounds` are copied into owned values.
|
|
16
|
+
*
|
|
17
|
+
* Throws when `probes.length` does not equal `resolution.x * resolution.y * resolution.z`. This is a
|
|
18
|
+
* precondition, not a runtime failure: every index the sampler computes is derived from `resolution`,
|
|
19
|
+
* so a mismatched array makes reads either out of range or silently off-by-a-plane, and no sentinel a
|
|
20
|
+
* caller could check afterwards would localize the mistake as well as failing here does.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createLightProbeGrid(probes: readonly LightProbe[], bounds: Readonly<AabbLike>, resolution: Readonly<Vector3Like>): LightProbeGrid;
|
|
23
|
+
/**
|
|
24
|
+
* Evaluates the nine L2 SH coefficients in direction `normal`, writing the RGB result into `out`
|
|
25
|
+
* (3 floats). `normal` is normalized internally, so a caller need not pre-normalize; a zero-length
|
|
26
|
+
* normal writes zeros.
|
|
27
|
+
*
|
|
28
|
+
* This is the plain SH reconstruction — the sum of each coefficient times its basis function — and is
|
|
29
|
+
* the reconstruction half of the pair whose projection half is `setLightProbeShFromColors`. The two
|
|
30
|
+
* round-trip EXACTLY only for a signal that already lies inside the L2 band and was sampled well
|
|
31
|
+
* enough to integrate it; anything of higher frequency comes back as its L2 projection, because nine
|
|
32
|
+
* coefficients cannot carry more. It deliberately does NOT apply the cosine-lobe convolution (the
|
|
33
|
+
* per-band factors pi, 2pi/3, pi/4) that converts projected radiance into diffuse irradiance: that
|
|
34
|
+
* convolution belongs to whoever shades with the result, and folding it in here would make the pair
|
|
35
|
+
* no longer reconstruct what was projected.
|
|
36
|
+
*
|
|
37
|
+
* Alias-safe: `out` may be the same buffer as `shCoefficients`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function evaluateLightProbeSh(out: Float32Array, normal: Readonly<Vector3Like>, shCoefficients: Readonly<Float32Array>): void;
|
|
40
|
+
export declare function initializeLightProbe(out: EntityConstruction<LightProbe>, position: Readonly<Vector3Like>, shCoefficients?: Readonly<Float32Array>): void;
|
|
41
|
+
export declare function initializeLightProbeGrid(out: EntityConstruction<LightProbeGrid>, probes: readonly LightProbe[], bounds: Readonly<AabbLike>, resolution: Readonly<Vector3Like>): void;
|
|
42
|
+
/**
|
|
43
|
+
* Writes the trilinearly interpolated SH coefficients at world-space `position` into `out`
|
|
44
|
+
* (`LIGHT_PROBE_SH_FLOATS` floats). Returns false — leaving `out` untouched — when the grid is
|
|
45
|
+
* disabled, has no probes, or has no ENABLED probe among the eight corners around `position`.
|
|
46
|
+
*
|
|
47
|
+
* A position outside the bounds clamps to the boundary rather than missing, so a surface just outside
|
|
48
|
+
* a baked volume keeps the nearest lighting instead of going black. Disabled corners are dropped and
|
|
49
|
+
* the remaining weights renormalized, so switching one probe off dims nothing around it; it just stops
|
|
50
|
+
* voting. An axis whose resolution is 1 contributes no interpolation along that axis.
|
|
51
|
+
*
|
|
52
|
+
* Alias-safe: accumulation happens in a scratch buffer, so `out` may be a probe's own `shCoefficients`.
|
|
53
|
+
*/
|
|
54
|
+
export declare function sampleLightProbeGrid(out: Float32Array, position: Readonly<Vector3Like>, grid: Readonly<LightProbeGrid>): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Projects directional radiance samples into `target`'s nine L2 SH coefficients, replacing whatever
|
|
57
|
+
* was there. `colors` holds linear RGB triplets and `directions` the matching unit vectors, both as
|
|
58
|
+
* flat 3-float-per-sample arrays; the shorter of the two bounds how many samples are read.
|
|
59
|
+
*
|
|
60
|
+
* The samples are assumed to be distributed uniformly over the sphere, which is what lets each one
|
|
61
|
+
* carry an equal solid angle of `4*PI / sampleCount`. Samples that are NOT uniform (a hemisphere, a
|
|
62
|
+
* cube face, anything denser in one direction) will project with that bias baked in — this helper does
|
|
63
|
+
* not weight by solid angle. Fewer than nine samples cannot determine nine coefficients; the result is
|
|
64
|
+
* still the least-biased projection of what was given, not a fit.
|
|
65
|
+
*
|
|
66
|
+
* Zero samples leaves `target` all zeros, matching a fresh probe.
|
|
67
|
+
*/
|
|
68
|
+
export declare function setLightProbeShFromColors(target: LightProbe, colors: Readonly<Float32Array>, directions: Readonly<Float32Array>): void;
|
|
69
|
+
//# sourceMappingURL=lightProbe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightProbe.d.ts","sourceRoot":"","sources":["../src/lightProbe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,6B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,UAAU,EAClB,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC9B,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,GACjC,IAAI,CA2BN"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { allocateEntity } from '@flighthq/entity/contract';
|
|
2
|
+
import { createVector3 } from '@flighthq/geometry/contract';
|
|
3
|
+
import { LIGHT_PROBE_SH_FLOATS } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Allocates a probe at `position`. `shCoefficients` defaults to all zeros — a probe that contributes
|
|
6
|
+
* no light — and when supplied is COPIED, so the caller keeps ownership of its buffer and a later
|
|
7
|
+
* mutation of it cannot reach into the probe.
|
|
8
|
+
*
|
|
9
|
+
* Throws when `shCoefficients` is not exactly `LIGHT_PROBE_SH_FLOATS` long: a short buffer would leave
|
|
10
|
+
* whole SH bands silently zero, which reads as a plausible dim probe rather than as the mistake it is.
|
|
11
|
+
*/
|
|
12
|
+
export function createLightProbe(position, shCoefficients) {
|
|
13
|
+
const out = allocateEntity();
|
|
14
|
+
initializeLightProbe(out, position, shCoefficients);
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Allocates a grid of probes over `bounds`. `probes` is stored by reference (it is the caller's array,
|
|
19
|
+
* shared not copied) while `resolution` and `bounds` are copied into owned values.
|
|
20
|
+
*
|
|
21
|
+
* Throws when `probes.length` does not equal `resolution.x * resolution.y * resolution.z`. This is a
|
|
22
|
+
* precondition, not a runtime failure: every index the sampler computes is derived from `resolution`,
|
|
23
|
+
* so a mismatched array makes reads either out of range or silently off-by-a-plane, and no sentinel a
|
|
24
|
+
* caller could check afterwards would localize the mistake as well as failing here does.
|
|
25
|
+
*/
|
|
26
|
+
export function createLightProbeGrid(probes, bounds, resolution) {
|
|
27
|
+
const out = allocateEntity();
|
|
28
|
+
initializeLightProbeGrid(out, probes, bounds, resolution);
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Evaluates the nine L2 SH coefficients in direction `normal`, writing the RGB result into `out`
|
|
33
|
+
* (3 floats). `normal` is normalized internally, so a caller need not pre-normalize; a zero-length
|
|
34
|
+
* normal writes zeros.
|
|
35
|
+
*
|
|
36
|
+
* This is the plain SH reconstruction — the sum of each coefficient times its basis function — and is
|
|
37
|
+
* the reconstruction half of the pair whose projection half is `setLightProbeShFromColors`. The two
|
|
38
|
+
* round-trip EXACTLY only for a signal that already lies inside the L2 band and was sampled well
|
|
39
|
+
* enough to integrate it; anything of higher frequency comes back as its L2 projection, because nine
|
|
40
|
+
* coefficients cannot carry more. It deliberately does NOT apply the cosine-lobe convolution (the
|
|
41
|
+
* per-band factors pi, 2pi/3, pi/4) that converts projected radiance into diffuse irradiance: that
|
|
42
|
+
* convolution belongs to whoever shades with the result, and folding it in here would make the pair
|
|
43
|
+
* no longer reconstruct what was projected.
|
|
44
|
+
*
|
|
45
|
+
* Alias-safe: `out` may be the same buffer as `shCoefficients`.
|
|
46
|
+
*/
|
|
47
|
+
export function evaluateLightProbeSh(out, normal, shCoefficients) {
|
|
48
|
+
const length = Math.hypot(normal.x, normal.y, normal.z);
|
|
49
|
+
if (length === 0) {
|
|
50
|
+
out[0] = 0;
|
|
51
|
+
out[1] = 0;
|
|
52
|
+
out[2] = 0;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const inverseLength = 1 / length;
|
|
56
|
+
const x = normal.x * inverseLength;
|
|
57
|
+
const y = normal.y * inverseLength;
|
|
58
|
+
const z = normal.z * inverseLength;
|
|
59
|
+
writeShBasis(shBasisScratch, x, y, z);
|
|
60
|
+
// Accumulated in locals, so writing `out` last is safe even when it aliases `shCoefficients`.
|
|
61
|
+
let r = 0;
|
|
62
|
+
let g = 0;
|
|
63
|
+
let b = 0;
|
|
64
|
+
for (let i = 0; i < SH_COEFFICIENT_COUNT; i++) {
|
|
65
|
+
const basis = shBasisScratch[i];
|
|
66
|
+
const offset = i * 3;
|
|
67
|
+
r += shCoefficients[offset] * basis;
|
|
68
|
+
g += shCoefficients[offset + 1] * basis;
|
|
69
|
+
b += shCoefficients[offset + 2] * basis;
|
|
70
|
+
}
|
|
71
|
+
out[0] = r;
|
|
72
|
+
out[1] = g;
|
|
73
|
+
out[2] = b;
|
|
74
|
+
}
|
|
75
|
+
export function initializeLightProbe(out, position, shCoefficients) {
|
|
76
|
+
if (shCoefficients !== undefined && shCoefficients.length !== LIGHT_PROBE_SH_FLOATS) {
|
|
77
|
+
throw new Error(`LightProbe.shCoefficients must be ${LIGHT_PROBE_SH_FLOATS} floats, got ${shCoefficients.length}`);
|
|
78
|
+
}
|
|
79
|
+
out.enabled = true;
|
|
80
|
+
out.position = createVector3(position.x, position.y, position.z);
|
|
81
|
+
out.shCoefficients = new Float32Array(LIGHT_PROBE_SH_FLOATS);
|
|
82
|
+
if (shCoefficients !== undefined)
|
|
83
|
+
out.shCoefficients.set(shCoefficients);
|
|
84
|
+
}
|
|
85
|
+
export function initializeLightProbeGrid(out, probes, bounds, resolution) {
|
|
86
|
+
const expected = resolution.x * resolution.y * resolution.z;
|
|
87
|
+
if (probes.length !== expected) {
|
|
88
|
+
throw new Error(`LightProbeGrid.probes must hold ${expected} probes for resolution ` +
|
|
89
|
+
`${resolution.x}x${resolution.y}x${resolution.z}, got ${probes.length}`);
|
|
90
|
+
}
|
|
91
|
+
out.bounds = {
|
|
92
|
+
max: createVector3(bounds.max.x, bounds.max.y, bounds.max.z),
|
|
93
|
+
min: createVector3(bounds.min.x, bounds.min.y, bounds.min.z),
|
|
94
|
+
};
|
|
95
|
+
out.enabled = true;
|
|
96
|
+
out.probes = probes;
|
|
97
|
+
out.resolution = createVector3(resolution.x, resolution.y, resolution.z);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Writes the trilinearly interpolated SH coefficients at world-space `position` into `out`
|
|
101
|
+
* (`LIGHT_PROBE_SH_FLOATS` floats). Returns false — leaving `out` untouched — when the grid is
|
|
102
|
+
* disabled, has no probes, or has no ENABLED probe among the eight corners around `position`.
|
|
103
|
+
*
|
|
104
|
+
* A position outside the bounds clamps to the boundary rather than missing, so a surface just outside
|
|
105
|
+
* a baked volume keeps the nearest lighting instead of going black. Disabled corners are dropped and
|
|
106
|
+
* the remaining weights renormalized, so switching one probe off dims nothing around it; it just stops
|
|
107
|
+
* voting. An axis whose resolution is 1 contributes no interpolation along that axis.
|
|
108
|
+
*
|
|
109
|
+
* Alias-safe: accumulation happens in a scratch buffer, so `out` may be a probe's own `shCoefficients`.
|
|
110
|
+
*/
|
|
111
|
+
export function sampleLightProbeGrid(out, position, grid) {
|
|
112
|
+
if (!grid.enabled || grid.probes.length === 0)
|
|
113
|
+
return false;
|
|
114
|
+
const nx = grid.resolution.x;
|
|
115
|
+
const ny = grid.resolution.y;
|
|
116
|
+
const nz = grid.resolution.z;
|
|
117
|
+
const x = axisCoordinate(position.x, grid.bounds.min.x, grid.bounds.max.x, nx);
|
|
118
|
+
const y = axisCoordinate(position.y, grid.bounds.min.y, grid.bounds.max.y, ny);
|
|
119
|
+
const z = axisCoordinate(position.z, grid.bounds.min.z, grid.bounds.max.z, nz);
|
|
120
|
+
// At the very top of an axis the floor IS the last probe index and the fraction is exactly 0, so the
|
|
121
|
+
// far corner at +1 can be past the end. That index is formed but never dereferenced into a value:
|
|
122
|
+
// the `probe === undefined` test below is what keeps an out-of-range corner harmless.
|
|
123
|
+
const x0 = Math.floor(x);
|
|
124
|
+
const y0 = Math.floor(y);
|
|
125
|
+
const z0 = Math.floor(z);
|
|
126
|
+
const fx = x - x0;
|
|
127
|
+
const fy = y - y0;
|
|
128
|
+
const fz = z - z0;
|
|
129
|
+
shSampleScratch.fill(0);
|
|
130
|
+
let totalWeight = 0;
|
|
131
|
+
for (let corner = 0; corner < 8; corner++) {
|
|
132
|
+
const cx = corner & 1;
|
|
133
|
+
const cy = (corner >> 1) & 1;
|
|
134
|
+
const cz = (corner >> 2) & 1;
|
|
135
|
+
const weight = (cx === 1 ? fx : 1 - fx) * (cy === 1 ? fy : 1 - fy) * (cz === 1 ? fz : 1 - fz);
|
|
136
|
+
// A fast path, not a correctness guard. On an axis of resolution 1 — or exactly at a corner —
|
|
137
|
+
// most of the eight corners weigh nothing, and on a DEGENERATE INNER axis the +1 corner is not
|
|
138
|
+
// even out of range: with that axis contributing a stride of its own, the index names a real
|
|
139
|
+
// probe in the neighbouring plane. Reading it anyway would still be harmless, because a zero
|
|
140
|
+
// weight adds zero and leaves `totalWeight` alone; skipping just avoids the work.
|
|
141
|
+
if (weight === 0)
|
|
142
|
+
continue;
|
|
143
|
+
const probe = grid.probes[x0 + cx + (y0 + cy) * nx + (z0 + cz) * nx * ny];
|
|
144
|
+
if (probe === undefined || !probe.enabled)
|
|
145
|
+
continue;
|
|
146
|
+
for (let i = 0; i < LIGHT_PROBE_SH_FLOATS; i++)
|
|
147
|
+
shSampleScratch[i] += probe.shCoefficients[i] * weight;
|
|
148
|
+
totalWeight += weight;
|
|
149
|
+
}
|
|
150
|
+
if (totalWeight === 0)
|
|
151
|
+
return false;
|
|
152
|
+
const inverseWeight = 1 / totalWeight;
|
|
153
|
+
for (let i = 0; i < LIGHT_PROBE_SH_FLOATS; i++)
|
|
154
|
+
out[i] = shSampleScratch[i] * inverseWeight;
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Projects directional radiance samples into `target`'s nine L2 SH coefficients, replacing whatever
|
|
159
|
+
* was there. `colors` holds linear RGB triplets and `directions` the matching unit vectors, both as
|
|
160
|
+
* flat 3-float-per-sample arrays; the shorter of the two bounds how many samples are read.
|
|
161
|
+
*
|
|
162
|
+
* The samples are assumed to be distributed uniformly over the sphere, which is what lets each one
|
|
163
|
+
* carry an equal solid angle of `4*PI / sampleCount`. Samples that are NOT uniform (a hemisphere, a
|
|
164
|
+
* cube face, anything denser in one direction) will project with that bias baked in — this helper does
|
|
165
|
+
* not weight by solid angle. Fewer than nine samples cannot determine nine coefficients; the result is
|
|
166
|
+
* still the least-biased projection of what was given, not a fit.
|
|
167
|
+
*
|
|
168
|
+
* Zero samples leaves `target` all zeros, matching a fresh probe.
|
|
169
|
+
*/
|
|
170
|
+
export function setLightProbeShFromColors(target, colors, directions) {
|
|
171
|
+
target.shCoefficients.fill(0);
|
|
172
|
+
const sampleCount = (Math.min(colors.length, directions.length) / 3) | 0;
|
|
173
|
+
if (sampleCount === 0)
|
|
174
|
+
return;
|
|
175
|
+
const solidAngle = (4 * Math.PI) / sampleCount;
|
|
176
|
+
for (let sample = 0; sample < sampleCount; sample++) {
|
|
177
|
+
const offset = sample * 3;
|
|
178
|
+
const dx = directions[offset];
|
|
179
|
+
const dy = directions[offset + 1];
|
|
180
|
+
const dz = directions[offset + 2];
|
|
181
|
+
const length = Math.hypot(dx, dy, dz);
|
|
182
|
+
if (length === 0)
|
|
183
|
+
continue;
|
|
184
|
+
const inverseLength = 1 / length;
|
|
185
|
+
writeShBasis(shBasisScratch, dx * inverseLength, dy * inverseLength, dz * inverseLength);
|
|
186
|
+
const r = colors[offset] * solidAngle;
|
|
187
|
+
const g = colors[offset + 1] * solidAngle;
|
|
188
|
+
const b = colors[offset + 2] * solidAngle;
|
|
189
|
+
for (let i = 0; i < SH_COEFFICIENT_COUNT; i++) {
|
|
190
|
+
const basis = shBasisScratch[i];
|
|
191
|
+
const target3 = i * 3;
|
|
192
|
+
target.shCoefficients[target3] += r * basis;
|
|
193
|
+
target.shCoefficients[target3 + 1] += g * basis;
|
|
194
|
+
target.shCoefficients[target3 + 2] += b * basis;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Maps a world coordinate onto the grid's probe-index axis, clamped so a position outside the bounds
|
|
199
|
+
// lands on the boundary. The result is in [0, n-1]; the caller turns it into a corner pair. A
|
|
200
|
+
// degenerate axis (min === max, or a single probe) collapses to 0. The `!(scaled > 0)` form also
|
|
201
|
+
// catches NaN, which a caller can produce with a NaN position and which would otherwise index nothing.
|
|
202
|
+
function axisCoordinate(value, min, max, count) {
|
|
203
|
+
if (count <= 1 || max <= min)
|
|
204
|
+
return 0;
|
|
205
|
+
const t = (value - min) / (max - min);
|
|
206
|
+
const scaled = t * (count - 1);
|
|
207
|
+
if (!(scaled > 0))
|
|
208
|
+
return 0;
|
|
209
|
+
return Math.min(scaled, count - 1);
|
|
210
|
+
}
|
|
211
|
+
// The real (not complex) L2 spherical-harmonic basis evaluated for a unit direction, in the band order
|
|
212
|
+
// the coefficients are stored in. These constants are the standard normalization factors: sqrt(1/(4pi))
|
|
213
|
+
// for l=0, sqrt(3/(4pi)) for l=1, and the sqrt(15/(4pi)) / sqrt(5/(16pi)) / sqrt(15/(16pi)) family for
|
|
214
|
+
// l=2. `out` must hold at least SH_COEFFICIENT_COUNT floats.
|
|
215
|
+
function writeShBasis(out, x, y, z) {
|
|
216
|
+
out[0] = 0.28209479177387814;
|
|
217
|
+
out[1] = 0.4886025119029199 * y;
|
|
218
|
+
out[2] = 0.4886025119029199 * z;
|
|
219
|
+
out[3] = 0.4886025119029199 * x;
|
|
220
|
+
out[4] = 1.0925484305920792 * x * y;
|
|
221
|
+
out[5] = 1.0925484305920792 * y * z;
|
|
222
|
+
out[6] = 0.31539156525252005 * (3 * z * z - 1);
|
|
223
|
+
out[7] = 1.0925484305920792 * x * z;
|
|
224
|
+
out[8] = 0.5462742152960396 * (x * x - y * y);
|
|
225
|
+
}
|
|
226
|
+
const SH_COEFFICIENT_COUNT = 9;
|
|
227
|
+
const shBasisScratch = new Float32Array(SH_COEFFICIENT_COUNT);
|
|
228
|
+
const shSampleScratch = new Float32Array(LIGHT_PROBE_SH_FLOATS);
|
|
229
|
+
//# sourceMappingURL=lightProbe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightProbe.js","sourceRoot":"","sources":["../src/lightProbe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAA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ACrC,CAAC;AAED,uGAAuG;AACvG,wGAAwG;AACxG,uGAAuG;AACvG,6DAA6D;AAC7D,SAAS,YAAY,CAAC,GAAiB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACtE,GAAG,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC;IAC7B,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,CAAC;IAChC,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,CAAC;IAChC,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,CAAC;IAChC,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,CAAC,CAAC,GAAG,mBAAmB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,cAAc,GAAG,IAAI,YAAY,CAAC,oBAAoB,CAAC,CAAC;AAC9D,MAAM,eAAe,GAAG,IAAI,YAAY,CAAC,qBAAqB,CAAC,CAAC"}
|
package/dist/pointLight.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EntityConstruction } from '@flighthq/entity/contract';
|
|
2
|
+
import type { PointLight, PointLightOptions } from './types.ts';
|
|
2
3
|
export declare function clonePointLight(source: Readonly<PointLight>): PointLight;
|
|
3
4
|
export declare function createPointLight(options?: Readonly<PointLightOptions>): PointLight;
|
|
4
5
|
export declare function initializePointLight(out: EntityConstruction<PointLight>, options?: Readonly<PointLightOptions>): void;
|
package/dist/pointLight.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointLight.d.ts","sourceRoot":"","sources":["../src/pointLight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pointLight.d.ts","sourceRoot":"","sources":["../src/pointLight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIhE,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU,CAqBxE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAIlF;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAoBrH"}
|
package/dist/pointLight.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { allocateEntity
|
|
1
|
+
import { allocateEntity } from '@flighthq/entity/contract';
|
|
2
2
|
import { cloneVector3, createVector3 } from '@flighthq/geometry/contract';
|
|
3
|
-
import { PointLightKind, UnitlessLightUnit } from '
|
|
3
|
+
import { ALL_LIGHT_LAYERS, PointLightKind, UnitlessLightUnit } from './types.js';
|
|
4
4
|
// Independent copy of a point light's data, including a fresh `position` vector.
|
|
5
5
|
export function clonePointLight(source) {
|
|
6
6
|
const out = allocateEntity();
|
|
@@ -10,6 +10,8 @@ export function clonePointLight(source) {
|
|
|
10
10
|
out.enabled = source.enabled;
|
|
11
11
|
out.intensity = source.intensity;
|
|
12
12
|
out.intensityUnit = source.intensityUnit;
|
|
13
|
+
out.layerMask = source.layerMask;
|
|
14
|
+
out.priority = source.priority;
|
|
13
15
|
out.kind = PointLightKind;
|
|
14
16
|
out.normalBias = source.normalBias;
|
|
15
17
|
out.pcfRadius = source.pcfRadius;
|
|
@@ -20,12 +22,12 @@ export function clonePointLight(source) {
|
|
|
20
22
|
out.shadowMapSize = source.shadowMapSize;
|
|
21
23
|
out.shadowNear = source.shadowNear;
|
|
22
24
|
out.shadowStrength = source.shadowStrength;
|
|
23
|
-
return
|
|
25
|
+
return out;
|
|
24
26
|
}
|
|
25
27
|
export function createPointLight(options) {
|
|
26
28
|
const out = allocateEntity();
|
|
27
29
|
initializePointLight(out, options);
|
|
28
|
-
return
|
|
30
|
+
return out;
|
|
29
31
|
}
|
|
30
32
|
// Omnidirectional point light. `position` is world-space; intensity falls off with distance up
|
|
31
33
|
// to `range` (-1 = infinite). Color is packed sRgb-albedo RGBA (0xrrggbbaa); defaults to opaque
|
|
@@ -38,6 +40,8 @@ export function initializePointLight(out, options) {
|
|
|
38
40
|
out.enabled = options?.enabled ?? true;
|
|
39
41
|
out.intensity = options?.intensity ?? 1;
|
|
40
42
|
out.intensityUnit = options?.intensityUnit ?? UnitlessLightUnit;
|
|
43
|
+
out.layerMask = options?.layerMask ?? ALL_LIGHT_LAYERS;
|
|
44
|
+
out.priority = options?.priority ?? 0;
|
|
41
45
|
out.kind = PointLightKind;
|
|
42
46
|
out.normalBias = options?.normalBias ?? 0;
|
|
43
47
|
out.pcfRadius = options?.pcfRadius ?? 0;
|
package/dist/pointLight.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointLight.js","sourceRoot":"","sources":["../src/pointLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"pointLight.js","sourceRoot":"","sources":["../src/pointLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE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AK,GAAG,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IACjC,GAAG,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,CAAC,CAAC;IAC1C,GAAG,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,GAAG,CAAC;IAC1C,GAAG,CAAC,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,IAAI,CAAC;IACnD,GAAG,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,GAAG,CAAC;IAC5C,GAAG,CAAC,cAAc,GAAG,OAAO,EAAE,cAAc,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { BoundingSphereLike
|
|
2
|
-
|
|
1
|
+
import type { BoundingSphereLike } from '@flighthq/geometry/contract';
|
|
2
|
+
import type { Scene3DForwardLightSelection, Scene3DLightsLike } from './types.ts';
|
|
3
|
+
export declare function selectScene3DForwardLights(out: Scene3DForwardLightSelection, lights: Readonly<Scene3DLightsLike>, bounds: Readonly<BoundingSphereLike>, receiverLayerMask?: number): void;
|
|
3
4
|
//# sourceMappingURL=sceneForwardLights.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sceneForwardLights.d.ts","sourceRoot":"","sources":["../src/sceneForwardLights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sceneForwardLights.d.ts","sourceRoot":"","sources":["../src/sceneForwardLights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,KAAK,EAAc,4BAA4B,EAAE,iBAAiB,EAAa,MAAM,YAAY,CAAC;AAWzG,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,4BAA4B,EACjC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EACnC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EACpC,iBAAiB,GAAE,MAAyB,GAC3C,IAAI,CAsCN"}
|