@takram/three-geospatial-effects 0.0.1-alpha.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.
Files changed (60) hide show
  1. package/README.md +15 -0
  2. package/build/index.cjs +1 -0
  3. package/build/index.js +25 -0
  4. package/build/r3f.cjs +748 -0
  5. package/build/r3f.js +1645 -0
  6. package/build/shared.cjs +315 -0
  7. package/build/shared.js +741 -0
  8. package/package.json +52 -0
  9. package/src/DepthEffect.ts +81 -0
  10. package/src/DitheringEffect.ts +28 -0
  11. package/src/DownsampleThresholdMaterial.ts +83 -0
  12. package/src/GeometryEffect.ts +79 -0
  13. package/src/GeometryPass.ts +53 -0
  14. package/src/LensFlareEffect.ts +185 -0
  15. package/src/LensFlareFeaturesMaterial.ts +96 -0
  16. package/src/NormalEffect.ts +135 -0
  17. package/src/createHaldLookupTexture.ts +20 -0
  18. package/src/index.ts +7 -0
  19. package/src/r3f/Depth.tsx +8 -0
  20. package/src/r3f/Dithering.tsx +5 -0
  21. package/src/r3f/EffectComposer.tsx +189 -0
  22. package/src/r3f/Geometry.tsx +45 -0
  23. package/src/r3f/LensFlare.tsx +30 -0
  24. package/src/r3f/Normal.tsx +49 -0
  25. package/src/r3f/SSAO.tsx +123 -0
  26. package/src/r3f/index.ts +8 -0
  27. package/src/r3f/types.ts +12 -0
  28. package/src/setupMaterialsForGeometryPass.ts +131 -0
  29. package/src/shaders/depthEffect.frag +26 -0
  30. package/src/shaders/ditheringEffect.frag +7 -0
  31. package/src/shaders/downsampleThreshold.frag +73 -0
  32. package/src/shaders/downsampleThreshold.vert +34 -0
  33. package/src/shaders/geometryEffect.frag +17 -0
  34. package/src/shaders/lensFlareEffect.frag +12 -0
  35. package/src/shaders/lensFlareFeatures.frag +73 -0
  36. package/src/shaders/lensFlareFeatures.vert +10 -0
  37. package/src/shaders/normalEffect.frag +37 -0
  38. package/src/shaders/ssr.frag +381 -0
  39. package/src/shaders/ssr.vert +6 -0
  40. package/src/shaders/ssrEffect.frag +6 -0
  41. package/types/DepthEffect.d.ts +23 -0
  42. package/types/DitheringEffect.d.ts +11 -0
  43. package/types/DownsampleThresholdMaterial.d.ts +21 -0
  44. package/types/GeometryEffect.d.ts +20 -0
  45. package/types/GeometryPass.d.ts +9 -0
  46. package/types/LensFlareEffect.d.ts +43 -0
  47. package/types/LensFlareFeaturesMaterial.d.ts +26 -0
  48. package/types/NormalEffect.d.ts +27 -0
  49. package/types/createHaldLookupTexture.d.ts +4 -0
  50. package/types/index.d.ts +7 -0
  51. package/types/r3f/Depth.d.ts +8 -0
  52. package/types/r3f/Dithering.d.ts +6 -0
  53. package/types/r3f/EffectComposer.d.ts +25 -0
  54. package/types/r3f/Geometry.d.ts +6 -0
  55. package/types/r3f/LensFlare.d.ts +6 -0
  56. package/types/r3f/Normal.d.ts +6 -0
  57. package/types/r3f/SSAO.d.ts +26 -0
  58. package/types/r3f/index.d.ts +8 -0
  59. package/types/r3f/types.d.ts +8 -0
  60. package/types/setupMaterialsForGeometryPass.d.ts +8 -0
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @takram/three-geospatial-effects
2
+
3
+ A collection of post-processing effects.
4
+
5
+ This library is currently under active development, and its API may change without maintaining backward compatibility.
6
+
7
+ It is part of a project to prototype the rendering aspect of a Web GIS engine. For more details on the background and current status of this project, please refer to the [main README](/README.md).
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ npm install @takram/three-geospatial-effects
13
+ pnpm add @takram/three-geospatial-effects
14
+ yarn add @takram/three-geospatial-effects
15
+ ```
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("postprocessing"),e=require("./shared.cjs");function i(t){const{image:o}=t,{width:s,height:r}=o;if(s!==r)throw new Error("Hald CLUT image must be square.");const f=Math.cbrt(s*r);if(f%1!==0)throw new Error("Hald CLUT image must be cubic.");const{data:c}=n.RawImageData.from(o),a=new n.LookupTexture(c,f);return a.name=t.name,a.type=t.type,t.colorSpace=a.colorSpace,a}exports.DepthEffect=e.DepthEffect;exports.DitheringEffect=e.DitheringEffect;exports.GeometryPass=e.GeometryPass;exports.LensFlareEffect=e.LensFlareEffect;exports.NormalEffect=e.NormalEffect;exports.depthEffectOptionsDefaults=e.depthEffectOptionsDefaults;exports.ditheringOptionsDefaults=e.ditheringOptionsDefaults;exports.lensFlareEffectOptionsDefaults=e.lensFlareEffectOptionsDefaults;exports.normalEffectOptionsDefaults=e.normalEffectOptionsDefaults;exports.setupMaterialsForGeometryPass=e.setupMaterialsForGeometryPass;exports.createHaldLookupTexture=i;
package/build/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import { RawImageData as n, LookupTexture as c } from "postprocessing";
2
+ import { D as u, b as h, G as E, L as d, N as D, d as g, a as w, l as L, n as b, s as y } from "./shared.js";
3
+ function l(e) {
4
+ const { image: a } = e, { width: s, height: o } = a;
5
+ if (s !== o)
6
+ throw new Error("Hald CLUT image must be square.");
7
+ const r = Math.cbrt(s * o);
8
+ if (r % 1 !== 0)
9
+ throw new Error("Hald CLUT image must be cubic.");
10
+ const { data: f } = n.from(a), t = new c(f, r);
11
+ return t.name = e.name, t.type = e.type, e.colorSpace = t.colorSpace, t;
12
+ }
13
+ export {
14
+ u as DepthEffect,
15
+ h as DitheringEffect,
16
+ E as GeometryPass,
17
+ d as LensFlareEffect,
18
+ D as NormalEffect,
19
+ l as createHaldLookupTexture,
20
+ g as depthEffectOptionsDefaults,
21
+ w as ditheringOptionsDefaults,
22
+ L as lensFlareEffectOptionsDefaults,
23
+ b as normalEffectOptionsDefaults,
24
+ y as setupMaterialsForGeometryPass
25
+ };