@luma.gl/shadertools 9.3.0-alpha.4 → 9.3.0-alpha.8

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 (157) hide show
  1. package/dist/dist.dev.js +4657 -523
  2. package/dist/dist.min.js +1952 -301
  3. package/dist/index.cjs +2804 -406
  4. package/dist/index.cjs.map +4 -4
  5. package/dist/index.d.ts +10 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/preprocessor/preprocessor.d.ts.map +1 -1
  10. package/dist/lib/preprocessor/preprocessor.js +35 -8
  11. package/dist/lib/preprocessor/preprocessor.js.map +1 -1
  12. package/dist/lib/shader-assembler.d.ts +10 -0
  13. package/dist/lib/shader-assembler.d.ts.map +1 -1
  14. package/dist/lib/shader-assembler.js +20 -3
  15. package/dist/lib/shader-assembler.js.map +1 -1
  16. package/dist/lib/shader-assembly/assemble-shaders.d.ts +23 -2
  17. package/dist/lib/shader-assembly/assemble-shaders.d.ts.map +1 -1
  18. package/dist/lib/shader-assembly/assemble-shaders.js +211 -11
  19. package/dist/lib/shader-assembly/assemble-shaders.js.map +1 -1
  20. package/dist/lib/shader-assembly/wgsl-binding-debug.d.ts +37 -0
  21. package/dist/lib/shader-assembly/wgsl-binding-debug.d.ts.map +1 -0
  22. package/dist/lib/shader-assembly/wgsl-binding-debug.js +140 -0
  23. package/dist/lib/shader-assembly/wgsl-binding-debug.js.map +1 -0
  24. package/dist/lib/shader-generator/glsl/generate-glsl.js +3 -0
  25. package/dist/lib/shader-generator/glsl/generate-glsl.js.map +1 -1
  26. package/dist/lib/shader-generator/wgsl/generate-wgsl.d.ts.map +1 -1
  27. package/dist/lib/shader-generator/wgsl/generate-wgsl.js +3 -0
  28. package/dist/lib/shader-generator/wgsl/generate-wgsl.js.map +1 -1
  29. package/dist/lib/shader-module/shader-module-uniform-layout.d.ts +22 -0
  30. package/dist/lib/shader-module/shader-module-uniform-layout.d.ts.map +1 -0
  31. package/dist/lib/shader-module/shader-module-uniform-layout.js +112 -0
  32. package/dist/lib/shader-module/shader-module-uniform-layout.js.map +1 -0
  33. package/dist/lib/shader-module/shader-module.d.ts +12 -6
  34. package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
  35. package/dist/lib/shader-module/shader-module.js.map +1 -1
  36. package/dist/lib/utils/uniform-types.d.ts +11 -7
  37. package/dist/lib/utils/uniform-types.d.ts.map +1 -1
  38. package/dist/modules/engine/picking/picking.d.ts +3 -0
  39. package/dist/modules/engine/picking/picking.d.ts.map +1 -1
  40. package/dist/modules/engine/picking/picking.js +3 -0
  41. package/dist/modules/engine/picking/picking.js.map +1 -1
  42. package/dist/modules/engine/skin/skin.d.ts +30 -0
  43. package/dist/modules/engine/skin/skin.d.ts.map +1 -0
  44. package/dist/modules/engine/skin/skin.js +86 -0
  45. package/dist/modules/engine/skin/skin.js.map +1 -0
  46. package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts +1 -0
  47. package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts.map +1 -1
  48. package/dist/modules/lighting/gouraud-material/gouraud-material.js +3 -0
  49. package/dist/modules/lighting/gouraud-material/gouraud-material.js.map +1 -1
  50. package/dist/modules/lighting/ibl/ibl.d.ts +26 -0
  51. package/dist/modules/lighting/ibl/ibl.d.ts.map +1 -0
  52. package/dist/modules/lighting/ibl/ibl.js +33 -0
  53. package/dist/modules/lighting/ibl/ibl.js.map +1 -0
  54. package/dist/modules/lighting/lambert-material/lambert-material.d.ts +10 -0
  55. package/dist/modules/lighting/lambert-material/lambert-material.d.ts.map +1 -0
  56. package/dist/modules/lighting/lambert-material/lambert-material.js +33 -0
  57. package/dist/modules/lighting/lambert-material/lambert-material.js.map +1 -0
  58. package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.d.ts +3 -0
  59. package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.d.ts.map +1 -0
  60. package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.js +60 -0
  61. package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.js.map +1 -0
  62. package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.d.ts +2 -0
  63. package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.d.ts.map +1 -0
  64. package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.js +73 -0
  65. package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.js.map +1 -0
  66. package/dist/modules/lighting/lights/lighting-glsl.d.ts +1 -1
  67. package/dist/modules/lighting/lights/lighting-glsl.d.ts.map +1 -1
  68. package/dist/modules/lighting/lights/lighting-glsl.js +43 -37
  69. package/dist/modules/lighting/lights/lighting-glsl.js.map +1 -1
  70. package/dist/modules/lighting/lights/lighting-wgsl.d.ts +1 -1
  71. package/dist/modules/lighting/lights/lighting-wgsl.d.ts.map +1 -1
  72. package/dist/modules/lighting/lights/lighting-wgsl.js +46 -18
  73. package/dist/modules/lighting/lights/lighting-wgsl.js.map +1 -1
  74. package/dist/modules/lighting/lights/lighting.d.ts +104 -62
  75. package/dist/modules/lighting/lights/lighting.d.ts.map +1 -1
  76. package/dist/modules/lighting/lights/lighting.js +107 -68
  77. package/dist/modules/lighting/lights/lighting.js.map +1 -1
  78. package/dist/modules/lighting/no-material/dirlight.d.ts +7 -2
  79. package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -1
  80. package/dist/modules/lighting/no-material/dirlight.js +3 -1
  81. package/dist/modules/lighting/no-material/dirlight.js.map +1 -1
  82. package/dist/modules/lighting/pbr-material/pbr-material-glsl.d.ts +1 -1
  83. package/dist/modules/lighting/pbr-material/pbr-material-glsl.d.ts.map +1 -1
  84. package/dist/modules/lighting/pbr-material/pbr-material-glsl.js +524 -28
  85. package/dist/modules/lighting/pbr-material/pbr-material-glsl.js.map +1 -1
  86. package/dist/modules/lighting/pbr-material/pbr-material-wgsl.d.ts +2 -2
  87. package/dist/modules/lighting/pbr-material/pbr-material-wgsl.d.ts.map +1 -1
  88. package/dist/modules/lighting/pbr-material/pbr-material-wgsl.js +784 -101
  89. package/dist/modules/lighting/pbr-material/pbr-material-wgsl.js.map +1 -1
  90. package/dist/modules/lighting/pbr-material/pbr-material.d.ts +110 -45
  91. package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -1
  92. package/dist/modules/lighting/pbr-material/pbr-material.js +85 -9
  93. package/dist/modules/lighting/pbr-material/pbr-material.js.map +1 -1
  94. package/dist/modules/lighting/pbr-material/pbr-projection.d.ts.map +1 -1
  95. package/dist/modules/lighting/pbr-material/pbr-projection.js +13 -1
  96. package/dist/modules/lighting/pbr-material/pbr-projection.js.map +1 -1
  97. package/dist/modules/lighting/phong-material/phong-material.d.ts +1 -0
  98. package/dist/modules/lighting/phong-material/phong-material.d.ts.map +1 -1
  99. package/dist/modules/lighting/phong-material/phong-material.js +4 -0
  100. package/dist/modules/lighting/phong-material/phong-material.js.map +1 -1
  101. package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts +2 -2
  102. package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts.map +1 -1
  103. package/dist/modules/lighting/phong-material/phong-shaders-glsl.js +15 -4
  104. package/dist/modules/lighting/phong-material/phong-shaders-glsl.js.map +1 -1
  105. package/dist/modules/lighting/phong-material/phong-shaders-wgsl.d.ts +1 -40
  106. package/dist/modules/lighting/phong-material/phong-shaders-wgsl.d.ts.map +1 -1
  107. package/dist/modules/lighting/phong-material/phong-shaders-wgsl.js +71 -76
  108. package/dist/modules/lighting/phong-material/phong-shaders-wgsl.js.map +1 -1
  109. package/dist/modules/math/fp64/fp64-arithmetic-glsl.d.ts +1 -1
  110. package/dist/modules/math/fp64/fp64-arithmetic-glsl.d.ts.map +1 -1
  111. package/dist/modules/math/fp64/fp64-arithmetic-glsl.js +41 -10
  112. package/dist/modules/math/fp64/fp64-arithmetic-glsl.js.map +1 -1
  113. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts +2 -0
  114. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts.map +1 -0
  115. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js +212 -0
  116. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js.map +1 -0
  117. package/dist/modules/math/fp64/fp64.d.ts +1 -0
  118. package/dist/modules/math/fp64/fp64.d.ts.map +1 -1
  119. package/dist/modules/math/fp64/fp64.js +8 -2
  120. package/dist/modules/math/fp64/fp64.js.map +1 -1
  121. package/dist/modules/math/random/random.d.ts +1 -1
  122. package/dist/modules/math/random/random.d.ts.map +1 -1
  123. package/dist/modules/math/random/random.js +2 -3
  124. package/dist/modules/math/random/random.js.map +1 -1
  125. package/package.json +3 -3
  126. package/src/index.ts +20 -2
  127. package/src/lib/preprocessor/preprocessor.ts +44 -8
  128. package/src/lib/shader-assembler.ts +25 -3
  129. package/src/lib/shader-assembly/assemble-shaders.ts +377 -12
  130. package/src/lib/shader-assembly/wgsl-binding-debug.ts +216 -0
  131. package/src/lib/shader-generator/glsl/generate-glsl.ts +7 -1
  132. package/src/lib/shader-generator/wgsl/generate-wgsl.ts +6 -0
  133. package/src/lib/shader-module/shader-module-uniform-layout.ts +194 -0
  134. package/src/lib/shader-module/shader-module.ts +17 -7
  135. package/src/lib/utils/uniform-types.ts +24 -9
  136. package/src/modules/engine/picking/picking.ts +3 -0
  137. package/src/modules/engine/skin/skin.ts +114 -0
  138. package/src/modules/lighting/gouraud-material/gouraud-material.ts +4 -0
  139. package/src/modules/lighting/ibl/ibl.ts +44 -0
  140. package/src/modules/lighting/lambert-material/lambert-material.ts +42 -0
  141. package/src/modules/lighting/lambert-material/lambert-shaders-glsl.ts +61 -0
  142. package/src/modules/lighting/lambert-material/lambert-shaders-wgsl.ts +73 -0
  143. package/src/modules/lighting/lights/lighting-glsl.ts +43 -37
  144. package/src/modules/lighting/lights/lighting-wgsl.ts +46 -18
  145. package/src/modules/lighting/lights/lighting.ts +198 -99
  146. package/src/modules/lighting/no-material/dirlight.ts +3 -1
  147. package/src/modules/lighting/pbr-material/pbr-material-glsl.ts +524 -28
  148. package/src/modules/lighting/pbr-material/pbr-material-wgsl.ts +784 -101
  149. package/src/modules/lighting/pbr-material/pbr-material.ts +111 -18
  150. package/src/modules/lighting/pbr-material/pbr-projection.ts +14 -1
  151. package/src/modules/lighting/phong-material/phong-material.ts +5 -0
  152. package/src/modules/lighting/phong-material/phong-shaders-glsl.ts +15 -4
  153. package/src/modules/lighting/phong-material/phong-shaders-wgsl.ts +71 -77
  154. package/src/modules/math/fp64/fp64-arithmetic-glsl.ts +41 -10
  155. package/src/modules/math/fp64/fp64-arithmetic-wgsl.ts +212 -0
  156. package/src/modules/math/fp64/fp64.ts +9 -3
  157. package/src/modules/math/random/random.ts +2 -3
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { lighting } from "../lights/lighting.js";
5
+ import { ibl } from "../ibl/ibl.js";
5
6
  import { vs, fs } from "./pbr-material-glsl.js";
6
7
  import { source } from "./pbr-material-wgsl.js";
7
8
  import { pbrProjection } from "./pbr-projection.js";
@@ -12,8 +13,75 @@ import { pbrProjection } from "./pbr-projection.js";
12
13
  export const pbrMaterial = {
13
14
  props: {},
14
15
  uniforms: {},
16
+ defaultUniforms: {
17
+ unlit: false,
18
+ baseColorMapEnabled: false,
19
+ baseColorFactor: [1, 1, 1, 1],
20
+ normalMapEnabled: false,
21
+ normalScale: 1,
22
+ emissiveMapEnabled: false,
23
+ emissiveFactor: [0, 0, 0],
24
+ metallicRoughnessValues: [1, 1],
25
+ metallicRoughnessMapEnabled: false,
26
+ occlusionMapEnabled: false,
27
+ occlusionStrength: 1,
28
+ alphaCutoffEnabled: false,
29
+ alphaCutoff: 0.5,
30
+ IBLenabled: false,
31
+ scaleIBLAmbient: [1, 1],
32
+ scaleDiffBaseMR: [0, 0, 0, 0],
33
+ scaleFGDSpec: [0, 0, 0, 0],
34
+ specularColorFactor: [1, 1, 1],
35
+ specularIntensityFactor: 1,
36
+ specularColorMapEnabled: false,
37
+ specularIntensityMapEnabled: false,
38
+ ior: 1.5,
39
+ transmissionFactor: 0,
40
+ transmissionMapEnabled: false,
41
+ thicknessFactor: 0,
42
+ attenuationDistance: 1e9,
43
+ attenuationColor: [1, 1, 1],
44
+ clearcoatFactor: 0,
45
+ clearcoatRoughnessFactor: 0,
46
+ clearcoatMapEnabled: false,
47
+ clearcoatRoughnessMapEnabled: false,
48
+ sheenColorFactor: [0, 0, 0],
49
+ sheenRoughnessFactor: 0,
50
+ sheenColorMapEnabled: false,
51
+ sheenRoughnessMapEnabled: false,
52
+ iridescenceFactor: 0,
53
+ iridescenceIor: 1.3,
54
+ iridescenceThicknessRange: [100, 400],
55
+ iridescenceMapEnabled: false,
56
+ anisotropyStrength: 0,
57
+ anisotropyRotation: 0,
58
+ anisotropyDirection: [1, 0],
59
+ anisotropyMapEnabled: false,
60
+ emissiveStrength: 1
61
+ },
15
62
  name: 'pbrMaterial',
16
- dependencies: [lighting, pbrProjection],
63
+ firstBindingSlot: 0,
64
+ bindingLayout: [
65
+ { name: 'pbrMaterial', group: 3 },
66
+ { name: 'pbr_baseColorSampler', group: 3 },
67
+ { name: 'pbr_normalSampler', group: 3 },
68
+ { name: 'pbr_emissiveSampler', group: 3 },
69
+ { name: 'pbr_metallicRoughnessSampler', group: 3 },
70
+ { name: 'pbr_occlusionSampler', group: 3 },
71
+ { name: 'pbr_specularColorSampler', group: 3 },
72
+ { name: 'pbr_specularIntensitySampler', group: 3 },
73
+ { name: 'pbr_transmissionSampler', group: 3 },
74
+ { name: 'pbr_thicknessSampler', group: 3 },
75
+ { name: 'pbr_clearcoatSampler', group: 3 },
76
+ { name: 'pbr_clearcoatRoughnessSampler', group: 3 },
77
+ { name: 'pbr_clearcoatNormalSampler', group: 3 },
78
+ { name: 'pbr_sheenColorSampler', group: 3 },
79
+ { name: 'pbr_sheenRoughnessSampler', group: 3 },
80
+ { name: 'pbr_iridescenceSampler', group: 3 },
81
+ { name: 'pbr_iridescenceThicknessSampler', group: 3 },
82
+ { name: 'pbr_anisotropySampler', group: 3 }
83
+ ],
84
+ dependencies: [lighting, ibl, pbrProjection],
17
85
  source,
18
86
  vs,
19
87
  fs,
@@ -27,10 +95,16 @@ export const pbrMaterial = {
27
95
  HAS_SPECULARCOLORMAP: false,
28
96
  HAS_SPECULARINTENSITYMAP: false,
29
97
  HAS_TRANSMISSIONMAP: false,
98
+ HAS_THICKNESSMAP: false,
30
99
  HAS_CLEARCOATMAP: false,
100
+ HAS_CLEARCOATROUGHNESSMAP: false,
101
+ HAS_CLEARCOATNORMALMAP: false,
31
102
  HAS_SHEENCOLORMAP: false,
103
+ HAS_SHEENROUGHNESSMAP: false,
32
104
  HAS_IRIDESCENCEMAP: false,
105
+ HAS_IRIDESCENCETHICKNESSMAP: false,
33
106
  HAS_ANISOTROPYMAP: false,
107
+ USE_MATERIAL_EXTENSIONS: false,
34
108
  ALPHA_CUTOFF: false,
35
109
  USE_IBL: false,
36
110
  PBR_DEBUG: false
@@ -52,13 +126,6 @@ export const pbrMaterial = {
52
126
  occlusionStrength: 'f32', // #ifdef HAS_OCCLUSIONMAP
53
127
  alphaCutoffEnabled: 'i32',
54
128
  alphaCutoff: 'f32', // #ifdef ALPHA_CUTOFF
55
- // IBL
56
- IBLenabled: 'i32',
57
- scaleIBLAmbient: 'vec2<f32>', // #ifdef USE_IBL
58
- // debugging flags used for shader output of intermediate PBR variables
59
- // #ifdef PBR_DEBUG
60
- scaleDiffBaseMR: 'vec4<f32>',
61
- scaleFGDSpec: 'vec4<f32>',
62
129
  specularColorFactor: 'vec3<f32>',
63
130
  specularIntensityFactor: 'f32',
64
131
  specularColorMapEnabled: 'i32',
@@ -72,9 +139,11 @@ export const pbrMaterial = {
72
139
  clearcoatFactor: 'f32',
73
140
  clearcoatRoughnessFactor: 'f32',
74
141
  clearcoatMapEnabled: 'i32',
142
+ clearcoatRoughnessMapEnabled: 'i32',
75
143
  sheenColorFactor: 'vec3<f32>',
76
144
  sheenRoughnessFactor: 'f32',
77
145
  sheenColorMapEnabled: 'i32',
146
+ sheenRoughnessMapEnabled: 'i32',
78
147
  iridescenceFactor: 'f32',
79
148
  iridescenceIor: 'f32',
80
149
  iridescenceThicknessRange: 'vec2<f32>',
@@ -83,7 +152,14 @@ export const pbrMaterial = {
83
152
  anisotropyRotation: 'f32',
84
153
  anisotropyDirection: 'vec2<f32>',
85
154
  anisotropyMapEnabled: 'i32',
86
- emissiveStrength: 'f32'
155
+ emissiveStrength: 'f32',
156
+ // IBL
157
+ IBLenabled: 'i32',
158
+ scaleIBLAmbient: 'vec2<f32>', // #ifdef USE_IBL
159
+ // debugging flags used for shader output of intermediate PBR variables
160
+ // #ifdef PBR_DEBUG
161
+ scaleDiffBaseMR: 'vec4<f32>',
162
+ scaleFGDSpec: 'vec4<f32>'
87
163
  }
88
164
  };
89
165
  //# sourceMappingURL=pbr-material.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pbr-material.js","sourceRoot":"","sources":["../../../../src/modules/lighting/pbr-material/pbr-material.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAepC,OAAO,EAAC,QAAQ,EAAC,8BAA2B;AAE5C,OAAO,EAAC,EAAE,EAAE,EAAE,EAAC,+BAA4B;AAC3C,OAAO,EAAC,MAAM,EAAC,+BAA4B;AAC3C,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAiG/C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,EAAsB;IAC7B,QAAQ,EAAE,EAAyB;IAEnC,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;IACvC,MAAM;IACN,EAAE;IACF,EAAE;IAEF,OAAO,EAAE;QACP,iBAAiB,EAAE,IAAI;QACvB,aAAa,EAAE,KAAK;QACpB,eAAe,EAAE,KAAK;QACtB,gBAAgB,EAAE,KAAK;QACvB,gB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kB,CAY1D,CAAC"}
1
+ {"version":3,"file":"pbr-projection.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/pbr-material/pbr-projection.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAsBtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yBAAyB,EAAE,aAAa,CAAC;IACzC,WAAW,EAAE,aAAa,CAAC;IAC3B,YAAY,EAAE,aAAa,CAAC;IAC5B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,kBAAkB,CAc1D,CAAC"}
@@ -9,8 +9,20 @@ uniform pbrProjectionUniforms {
9
9
  vec3 camera;
10
10
  } pbrProjection;
11
11
  `;
12
+ const wgslUniformBlock = /* wgsl */ `\
13
+ struct pbrProjectionUniforms {
14
+ modelViewProjectionMatrix: mat4x4<f32>,
15
+ modelMatrix: mat4x4<f32>,
16
+ normalMatrix: mat4x4<f32>,
17
+ camera: vec3<f32>
18
+ };
19
+
20
+ @group(0) @binding(auto) var<uniform> pbrProjection: pbrProjectionUniforms;
21
+ `;
12
22
  export const pbrProjection = {
13
23
  name: 'pbrProjection',
24
+ bindingLayout: [{ name: 'pbrProjection', group: 0 }],
25
+ source: wgslUniformBlock,
14
26
  vs: uniformBlock,
15
27
  fs: uniformBlock,
16
28
  // TODO why is this needed?
@@ -19,7 +31,7 @@ export const pbrProjection = {
19
31
  modelViewProjectionMatrix: 'mat4x4<f32>',
20
32
  modelMatrix: 'mat4x4<f32>',
21
33
  normalMatrix: 'mat4x4<f32>',
22
- camera: 'vec3<i32>'
34
+ camera: 'vec3<f32>'
23
35
  }
24
36
  };
25
37
  //# sourceMappingURL=pbr-projection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pbr-projection.js","sourceRoot":"","sources":["../../../../src/modules/lighting/pbr-material/pbr-projection.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAMpC,MAAM,YAAY,GAAG,UAAU,CAAC;;;;;;;CAO/B,CAAC;AASF,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC7D,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,YAAY;IAChB,2BAA2B;IAC3B,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK;IAC3B,YAAY,EAAE;QACZ,yBAAyB,EAAE,aAAa;QACxC,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE,WAAW;KACpB;CACF,CAAC"}
1
+ {"version":3,"file":"pbr-projection.js","sourceRoot":"","sources":["../../../../src/modules/lighting/pbr-material/pbr-projection.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAMpC,MAAM,YAAY,GAAG,UAAU,CAAC;;;;;;;CAO/B,CAAC;AAEF,MAAM,gBAAgB,GAAG,UAAU,CAAC;;;;;;;;;CASnC,CAAC;AASF,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC7D,IAAI,EAAE,eAAe;IACrB,aAAa,EAAE,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC;IAClD,MAAM,EAAE,gBAAgB;IACxB,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,YAAY;IAChB,2BAA2B;IAC3B,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK;IAC3B,YAAY,EAAE;QACZ,yBAAyB,EAAE,aAAa;QACxC,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE,WAAW;KACpB;CACF,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { NumberArray3 } from '@math.gl/types';
2
2
  import { ShaderModule } from "../../../lib/shader-module/shader-module.js";
3
3
  export type PhongMaterialProps = {
4
+ unlit?: boolean;
4
5
  ambient?: number;
5
6
  diffuse?: number;
6
7
  /** Specularity exponent */
@@ -1 +1 @@
1
- {"version":3,"file":"phong-material.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-material.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAKtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC;AAEF,wIAAwI;AACxI,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,kBAAkB,CA6B1D,CAAC"}
1
+ {"version":3,"file":"phong-material.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-material.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAKtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC;AAEF,wIAAwI;AACxI,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,kBAAkB,CAiC1D,CAAC"}
@@ -7,6 +7,8 @@ import { PHONG_VS, PHONG_FS } from "./phong-shaders-glsl.js";
7
7
  /** In Phong shading, the normal vector is linearly interpolated across the surface of the polygon from the polygon's vertex normals. */
8
8
  export const phongMaterial = {
9
9
  name: 'phongMaterial',
10
+ firstBindingSlot: 0,
11
+ bindingLayout: [{ name: 'phongMaterial', group: 3 }],
10
12
  dependencies: [lighting],
11
13
  // Note these are switched between phong and gouraud
12
14
  source: PHONG_WGSL,
@@ -16,12 +18,14 @@ export const phongMaterial = {
16
18
  LIGHTING_FRAGMENT: true
17
19
  },
18
20
  uniformTypes: {
21
+ unlit: 'i32',
19
22
  ambient: 'f32',
20
23
  diffuse: 'f32',
21
24
  shininess: 'f32',
22
25
  specularColor: 'vec3<f32>'
23
26
  },
24
27
  defaultUniforms: {
28
+ unlit: false,
25
29
  ambient: 0.35,
26
30
  diffuse: 0.6,
27
31
  shininess: 32,
@@ -1 +1 @@
1
- {"version":3,"file":"phong-material.js","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-material.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,QAAQ,EAAC,8BAA2B;AAC5C,OAAO,EAAC,UAAU,EAAC,gCAA6B;AAChD,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,gCAA6B;AAUxD,wIAAwI;AACxI,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC7D,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,CAAC,QAAQ,CAAC;IACxB,oDAAoD;IACpD,MAAM,EAAE,UAAU;IAClB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE;QACP,iBAAiB,EAAE,IAAI;KACxB;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,WAAW;KAC3B;IACD,eAAe,EAAE;QACf,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KAClC;IACD,WAAW,CAAC,KAA0B;QACpC,MAAM,QAAQ,GAAG,EAAC,GAAG,KAAK,EAAC,CAAC;QAC5B,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC3B,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAiB,CAAC;QACpF,CAAC;QACD,OAAO,EAAC,GAAG,aAAa,CAAC,eAAe,EAAE,GAAG,QAAQ,EAAC,CAAC;IACzD,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"phong-material.js","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-material.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,QAAQ,EAAC,8BAA2B;AAC5C,OAAO,EAAC,UAAU,EAAC,gCAA6B;AAChD,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,gCAA6B;AAWxD,wIAAwI;AACxI,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC7D,IAAI,EAAE,eAAe;IACrB,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC;IAClD,YAAY,EAAE,CAAC,QAAQ,CAAC;IACxB,oDAAoD;IACpD,MAAM,EAAE,UAAU;IAClB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE;QACP,iBAAiB,EAAE,IAAI;KACxB;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,WAAW;KAC3B;IACD,eAAe,EAAE;QACf,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KAClC;IACD,WAAW,CAAC,KAA0B;QACpC,MAAM,QAAQ,GAAG,EAAC,GAAG,KAAK,EAAC,CAAC;QAC5B,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC3B,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAiB,CAAC;QACpF,CAAC;QACD,OAAO,EAAC,GAAG,aAAa,CAAC,eAAe,EAAE,GAAG,QAAQ,EAAC,CAAC;IACzD,CAAC;CACF,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const PHONG_VS = "uniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n";
2
- export declare const PHONG_FS = "#define MAX_LIGHTS 3\n\nuniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, material.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = material.ambient * surfaceColor * lighting.ambientColor;\n\n for (int i = 0; i < lighting.pointLightCount; i++) {\n PointLight pointLight = lighting_getPointLight(i);\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);\n }\n\n int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);\n for (int i = lighting.pointLightCount; i < totalLights; i++) {\n DirectionalLight directionalLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n \n return lightColor;\n}\n";
1
+ export declare const PHONG_VS = "uniform phongMaterialUniforms {\n uniform bool unlit;\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n";
2
+ export declare const PHONG_FS = "uniform phongMaterialUniforms {\n uniform bool unlit;\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, material.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (material.unlit) {\n return surfaceColor;\n }\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = material.ambient * surfaceColor * lighting.ambientColor;\n\n for (int i = 0; i < lighting.pointLightCount; i++) {\n PointLight pointLight = lighting_getPointLight(i);\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);\n }\n\n for (int i = 0; i < lighting.spotLightCount; i++) {\n SpotLight spotLight = lighting_getSpotLight(i);\n vec3 light_position_worldspace = spotLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n float light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, spotLight.color / light_attenuation);\n }\n\n for (int i = 0; i < lighting.directionalLightCount; i++) {\n DirectionalLight directionalLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n \n return lightColor;\n}\n";
3
3
  //# sourceMappingURL=phong-shaders-glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phong-shaders-glsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-glsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,mKAOpB,CAAC;AAEF,eAAO,MAAM,QAAQ,wkEAgDpB,CAAC"}
1
+ {"version":3,"file":"phong-shaders-glsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-glsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,0LAQpB,CAAC;AAEF,eAAO,MAAM,QAAQ,2gFA0DpB,CAAC"}
@@ -3,6 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  export const PHONG_VS = /* glsl */ `\
5
5
  uniform phongMaterialUniforms {
6
+ uniform bool unlit;
6
7
  uniform float ambient;
7
8
  uniform float diffuse;
8
9
  uniform float shininess;
@@ -10,9 +11,8 @@ uniform phongMaterialUniforms {
10
11
  } material;
11
12
  `;
12
13
  export const PHONG_FS = /* glsl */ `\
13
- #define MAX_LIGHTS 3
14
-
15
14
  uniform phongMaterialUniforms {
15
+ uniform bool unlit;
16
16
  uniform float ambient;
17
17
  uniform float diffuse;
18
18
  uniform float shininess;
@@ -34,6 +34,10 @@ vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_d
34
34
  vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
35
35
  vec3 lightColor = surfaceColor;
36
36
 
37
+ if (material.unlit) {
38
+ return surfaceColor;
39
+ }
40
+
37
41
  if (lighting.enabled == 0) {
38
42
  return lightColor;
39
43
  }
@@ -49,8 +53,15 @@ vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 positio
49
53
  lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);
50
54
  }
51
55
 
52
- int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);
53
- for (int i = lighting.pointLightCount; i < totalLights; i++) {
56
+ for (int i = 0; i < lighting.spotLightCount; i++) {
57
+ SpotLight spotLight = lighting_getSpotLight(i);
58
+ vec3 light_position_worldspace = spotLight.position;
59
+ vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
60
+ float light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace);
61
+ lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, spotLight.color / light_attenuation);
62
+ }
63
+
64
+ for (int i = 0; i < lighting.directionalLightCount; i++) {
54
65
  DirectionalLight directionalLight = lighting_getDirectionalLight(i);
55
66
  lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
56
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"phong-shaders-glsl.js","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-glsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;;;;;;;CAOlC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDlC,CAAC"}
1
+ {"version":3,"file":"phong-shaders-glsl.js","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-glsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;;;;;;;;CAQlC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DlC,CAAC"}
@@ -1,41 +1,2 @@
1
- export declare const PHONG_WGSL = "struct phongMaterialUniforms {\n ambient: f32,\n diffuse: f32,\n shininess: f32,\n specularColor: vec3<f32>,\n};\n\n@binding(2) @group(0) var<uniform> phongMaterial : phongMaterialUniforms;\n\nfn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {\n let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);\n var lambertian: f32 = dot(light_direction, normal_worldspace);\n var specular: f32 = 0.0;\n if (lambertian > 0.0) {\n let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, phongMaterial.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * phongMaterial.diffuse * surfaceColor + specular * phongMaterial.specularColor) * color;\n}\n\nfn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {\n var lightColor: vec3<f32> = surfaceColor;\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);\n lightColor = phongMaterial.ambient * surfaceColor * lighting.ambientColor;\n\n if (lighting.lightType == 0) {\n let pointLight: PointLight = lighting_getPointLight(0);\n let light_position_worldspace: vec3<f32> = pointLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n } else if (lighting.lightType == 1) {\n var directionalLight: DirectionalLight = lighting_getDirectionalLight(0);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n \n return lightColor;\n /*\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.pointLightCount) {\n break;\n }\n PointLight pointLight = lighting.pointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.directionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting.directionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n */\n}\n\nfn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{\n var lightColor = vec3<f32>(0, 0, 0);\n let surfaceColor = vec3<f32>(0, 0, 0);\n\n if (lighting.enabled == 0) {\n let view_direction = normalize(cameraPosition - position_worldspace);\n\n switch (lighting.lightType) {\n case 0, default: {\n let pointLight: PointLight = lighting_getPointLight(0);\n let light_position_worldspace: vec3<f32> = pointLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n case 1: {\n let directionalLight: DirectionalLight = lighting_getDirectionalLight(0);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n }\n return lightColor;\n}\n";
2
- /**
3
- for (int i = 0; i < MAX_LIGHTS; i++) {
4
- if (i >= lighting.pointLightCount) {
5
- break;
6
- }
7
- PointLight pointLight = lighting_getPointLight(i);
8
- vec3 light_position_worldspace = pointLight.position;
9
- vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
10
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
11
- }
12
-
13
- for (int i = 0; i < MAX_LIGHTS; i++) {
14
- if (i >= lighting.directionalLightCount) {
15
- break;
16
- }
17
- PointLight pointLight = lighting_getDirectionalLight(i);
18
- lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
19
- }
20
- }
21
- /**
22
- for (int i = 0; i < MAX_LIGHTS; i++) {
23
- if (i >= lighting.pointLightCount) {
24
- break;
25
- }
26
- PointLight pointLight = lighting_getPointLight(i);
27
- vec3 light_position_worldspace = pointLight.position;
28
- vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
29
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
30
- }
31
-
32
- for (int i = 0; i < MAX_LIGHTS; i++) {
33
- if (i >= lighting.directionalLightCount) {
34
- break;
35
- }
36
- PointLight pointLight = lighting_getDirectionalLight(i);
37
- lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
38
- }
39
- }
40
- */
1
+ export declare const PHONG_WGSL = "struct phongMaterialUniforms {\n unlit: u32,\n ambient: f32,\n diffuse: f32,\n shininess: f32,\n specularColor: vec3<f32>,\n};\n\n@group(3) @binding(auto) var<uniform> phongMaterial : phongMaterialUniforms;\n\nfn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {\n let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);\n var lambertian: f32 = dot(light_direction, normal_worldspace);\n var specular: f32 = 0.0;\n if (lambertian > 0.0) {\n let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, phongMaterial.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * phongMaterial.diffuse * surfaceColor + specular * phongMaterial.specularColor) * color;\n}\n\nfn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {\n var lightColor: vec3<f32> = surfaceColor;\n\n if (phongMaterial.unlit != 0u) {\n return surfaceColor;\n }\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);\n lightColor = phongMaterial.ambient * surfaceColor * lighting.ambientColor;\n\n for (var i: i32 = 0; i < lighting.pointLightCount; i++) {\n let pointLight: PointLight = lighting_getPointLight(i);\n let light_position_worldspace: vec3<f32> = pointLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n let light_attenuation = getPointLightAttenuation(\n pointLight,\n distance(light_position_worldspace, position_worldspace)\n );\n lightColor += lighting_getLightColor(\n surfaceColor,\n light_direction,\n view_direction,\n normal_worldspace,\n pointLight.color / light_attenuation\n );\n }\n\n for (var i: i32 = 0; i < lighting.spotLightCount; i++) {\n let spotLight: SpotLight = lighting_getSpotLight(i);\n let light_position_worldspace: vec3<f32> = spotLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n let light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace);\n lightColor += lighting_getLightColor(\n surfaceColor,\n light_direction,\n view_direction,\n normal_worldspace,\n spotLight.color / light_attenuation\n );\n }\n\n for (var i: i32 = 0; i < lighting.directionalLightCount; i++) {\n let directionalLight: DirectionalLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n } \n \n return lightColor;\n}\n\nfn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{\n var lightColor = vec3<f32>(0, 0, 0);\n let surfaceColor = vec3<f32>(0, 0, 0);\n\n if (lighting.enabled != 0) {\n let view_direction = normalize(cameraPosition - position_worldspace);\n\n for (var i: i32 = 0; i < lighting.pointLightCount; i++) {\n let pointLight: PointLight = lighting_getPointLight(i);\n let light_position_worldspace: vec3<f32> = pointLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n let light_attenuation = getPointLightAttenuation(\n pointLight,\n distance(light_position_worldspace, position_worldspace)\n );\n lightColor += lighting_getLightColor(\n surfaceColor,\n light_direction,\n view_direction,\n normal_worldspace,\n pointLight.color / light_attenuation\n );\n }\n\n for (var i: i32 = 0; i < lighting.spotLightCount; i++) {\n let spotLight: SpotLight = lighting_getSpotLight(i);\n let light_position_worldspace: vec3<f32> = spotLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n let light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace);\n lightColor += lighting_getLightColor(\n surfaceColor,\n light_direction,\n view_direction,\n normal_worldspace,\n spotLight.color / light_attenuation\n );\n }\n\n for (var i: i32 = 0; i < lighting.directionalLightCount; i++) {\n let directionalLight: DirectionalLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";
41
2
  //# sourceMappingURL=phong-shaders-wgsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phong-shaders-wgsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-wgsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,ywHAsFtB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsCI"}
1
+ {"version":3,"file":"phong-shaders-wgsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-wgsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,2uJAyHtB,CAAC"}
@@ -3,13 +3,14 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  export const PHONG_WGSL = /* wgsl */ `\
5
5
  struct phongMaterialUniforms {
6
+ unlit: u32,
6
7
  ambient: f32,
7
8
  diffuse: f32,
8
9
  shininess: f32,
9
10
  specularColor: vec3<f32>,
10
11
  };
11
12
 
12
- @binding(2) @group(0) var<uniform> phongMaterial : phongMaterialUniforms;
13
+ @group(3) @binding(auto) var<uniform> phongMaterial : phongMaterialUniforms;
13
14
 
14
15
  fn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {
15
16
  let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);
@@ -26,6 +27,10 @@ fn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, v
26
27
  fn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {
27
28
  var lightColor: vec3<f32> = surfaceColor;
28
29
 
30
+ if (phongMaterial.unlit != 0u) {
31
+ return surfaceColor;
32
+ }
33
+
29
34
  if (lighting.enabled == 0) {
30
35
  return lightColor;
31
36
  }
@@ -33,99 +38,89 @@ fn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, p
33
38
  let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);
34
39
  lightColor = phongMaterial.ambient * surfaceColor * lighting.ambientColor;
35
40
 
36
- if (lighting.lightType == 0) {
37
- let pointLight: PointLight = lighting_getPointLight(0);
41
+ for (var i: i32 = 0; i < lighting.pointLightCount; i++) {
42
+ let pointLight: PointLight = lighting_getPointLight(i);
38
43
  let light_position_worldspace: vec3<f32> = pointLight.position;
39
44
  let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
40
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
41
- } else if (lighting.lightType == 1) {
42
- var directionalLight: DirectionalLight = lighting_getDirectionalLight(0);
43
- lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
45
+ let light_attenuation = getPointLightAttenuation(
46
+ pointLight,
47
+ distance(light_position_worldspace, position_worldspace)
48
+ );
49
+ lightColor += lighting_getLightColor(
50
+ surfaceColor,
51
+ light_direction,
52
+ view_direction,
53
+ normal_worldspace,
54
+ pointLight.color / light_attenuation
55
+ );
44
56
  }
45
-
46
- return lightColor;
47
- /*
48
- for (int i = 0; i < MAX_LIGHTS; i++) {
49
- if (i >= lighting.pointLightCount) {
50
- break;
51
- }
52
- PointLight pointLight = lighting.pointLight[i];
53
- vec3 light_position_worldspace = pointLight.position;
54
- vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
55
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
57
+
58
+ for (var i: i32 = 0; i < lighting.spotLightCount; i++) {
59
+ let spotLight: SpotLight = lighting_getSpotLight(i);
60
+ let light_position_worldspace: vec3<f32> = spotLight.position;
61
+ let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
62
+ let light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace);
63
+ lightColor += lighting_getLightColor(
64
+ surfaceColor,
65
+ light_direction,
66
+ view_direction,
67
+ normal_worldspace,
68
+ spotLight.color / light_attenuation
69
+ );
56
70
  }
57
71
 
58
- for (int i = 0; i < MAX_LIGHTS; i++) {
59
- if (i >= lighting.directionalLightCount) {
60
- break;
61
- }
62
- DirectionalLight directionalLight = lighting.directionalLight[i];
72
+ for (var i: i32 = 0; i < lighting.directionalLightCount; i++) {
73
+ let directionalLight: DirectionalLight = lighting_getDirectionalLight(i);
63
74
  lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
64
- }
65
- */
75
+ }
76
+
77
+ return lightColor;
66
78
  }
67
79
 
68
80
  fn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{
69
81
  var lightColor = vec3<f32>(0, 0, 0);
70
82
  let surfaceColor = vec3<f32>(0, 0, 0);
71
83
 
72
- if (lighting.enabled == 0) {
84
+ if (lighting.enabled != 0) {
73
85
  let view_direction = normalize(cameraPosition - position_worldspace);
74
86
 
75
- switch (lighting.lightType) {
76
- case 0, default: {
77
- let pointLight: PointLight = lighting_getPointLight(0);
78
- let light_position_worldspace: vec3<f32> = pointLight.position;
79
- let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
80
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
81
- }
82
- case 1: {
83
- let directionalLight: DirectionalLight = lighting_getDirectionalLight(0);
84
- lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
85
- }
86
- }
87
- }
88
- return lightColor;
89
- }
90
- `;
91
- // TODO - handle multiple lights
92
- /**
93
- for (int i = 0; i < MAX_LIGHTS; i++) {
94
- if (i >= lighting.pointLightCount) {
95
- break;
96
- }
97
- PointLight pointLight = lighting_getPointLight(i);
98
- vec3 light_position_worldspace = pointLight.position;
99
- vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
100
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
87
+ for (var i: i32 = 0; i < lighting.pointLightCount; i++) {
88
+ let pointLight: PointLight = lighting_getPointLight(i);
89
+ let light_position_worldspace: vec3<f32> = pointLight.position;
90
+ let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
91
+ let light_attenuation = getPointLightAttenuation(
92
+ pointLight,
93
+ distance(light_position_worldspace, position_worldspace)
94
+ );
95
+ lightColor += lighting_getLightColor(
96
+ surfaceColor,
97
+ light_direction,
98
+ view_direction,
99
+ normal_worldspace,
100
+ pointLight.color / light_attenuation
101
+ );
101
102
  }
102
103
 
103
- for (int i = 0; i < MAX_LIGHTS; i++) {
104
- if (i >= lighting.directionalLightCount) {
105
- break;
106
- }
107
- PointLight pointLight = lighting_getDirectionalLight(i);
108
- lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
109
- }
110
- }
111
- /**
112
- for (int i = 0; i < MAX_LIGHTS; i++) {
113
- if (i >= lighting.pointLightCount) {
114
- break;
115
- }
116
- PointLight pointLight = lighting_getPointLight(i);
117
- vec3 light_position_worldspace = pointLight.position;
118
- vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
119
- lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
104
+ for (var i: i32 = 0; i < lighting.spotLightCount; i++) {
105
+ let spotLight: SpotLight = lighting_getSpotLight(i);
106
+ let light_position_worldspace: vec3<f32> = spotLight.position;
107
+ let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
108
+ let light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace);
109
+ lightColor += lighting_getLightColor(
110
+ surfaceColor,
111
+ light_direction,
112
+ view_direction,
113
+ normal_worldspace,
114
+ spotLight.color / light_attenuation
115
+ );
120
116
  }
121
117
 
122
- for (int i = 0; i < MAX_LIGHTS; i++) {
123
- if (i >= lighting.directionalLightCount) {
124
- break;
125
- }
126
- PointLight pointLight = lighting_getDirectionalLight(i);
127
- lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
118
+ for (var i: i32 = 0; i < lighting.directionalLightCount; i++) {
119
+ let directionalLight: DirectionalLight = lighting_getDirectionalLight(i);
120
+ lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
128
121
  }
129
122
  }
130
- */
123
+ return lightColor;
124
+ }
125
+ `;
131
126
  //# sourceMappingURL=phong-shaders-wgsl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"phong-shaders-wgsl.js","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-wgsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFpC,CAAC;AAEF,gCAAgC;AAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsCI"}
1
+ {"version":3,"file":"phong-shaders-wgsl.js","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-wgsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHpC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const fp64arithmeticShader = "\nuniform fp64arithmeticUniforms {\n uniform float ONE;\n} fp64;\n\n/*\nAbout LUMA_FP64_CODE_ELIMINATION_WORKAROUND\n\nThe purpose of this workaround is to prevent shader compilers from\noptimizing away necessary arithmetic operations by swapping their sequences\nor transform the equation to some 'equivalent' form.\n\nThe method is to multiply an artifical variable, ONE, which will be known to\nthe compiler to be 1 only at runtime. The whole expression is then represented\nas a polynomial with respective to ONE. In the coefficients of all terms, only one a\nand one b should appear\n\nerr = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE\n*/\n\n// Divide float number to high and low floats to extend fraction bits\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * fp64.ONE - (t - a);\n float a_lo = a * fp64.ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\n\n// Divide float number again when high float uses too many fraction bits\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\n\n// Special sum operation when a > b\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * fp64.ONE;\n float err = b - (sum - a) * fp64.ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\n\n// General sum operation\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * fp64.ONE - a) * fp64.ONE;\n float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * fp64.ONE - a) * fp64.ONE;\n float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x *\n a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n // y component is for the error\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * fp64.ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n";
1
+ export declare const fp64arithmeticShader = "\nuniform fp64arithmeticUniforms {\n uniform float ONE;\n uniform float SPLIT;\n} fp64;\n\n/*\nAbout LUMA_FP64_CODE_ELIMINATION_WORKAROUND\n\nThe purpose of this workaround is to prevent shader compilers from\noptimizing away necessary arithmetic operations by swapping their sequences\nor transform the equation to some 'equivalent' form.\n\nThese helpers implement Dekker/Veltkamp-style error tracking. If the compiler\nfolds constants or reassociates the arithmetic, the high/low split can stop\ntracking the rounding error correctly. That failure mode tends to look fine in\nsimple coordinate setup, but then breaks down inside iterative arithmetic such\nas fp64 Mandelbrot loops.\n\nThe method is to multiply an artifical variable, ONE, which will be known to\nthe compiler to be 1 only at runtime. The whole expression is then represented\nas a polynomial with respective to ONE. In the coefficients of all terms, only one a\nand one b should appear\n\nerr = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE\n*/\n\nfloat prevent_fp64_optimization(float value) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n return value + fp64.ONE * 0.0;\n#else\n return value;\n#endif\n}\n\n// Divide float number to high and low floats to extend fraction bits\nvec2 split(float a) {\n // Keep SPLIT as a runtime uniform so the compiler cannot fold the Dekker\n // split into a constant expression and reassociate the recovery steps.\n float split = prevent_fp64_optimization(fp64.SPLIT);\n float t = prevent_fp64_optimization(a * split);\n float temp = t - a;\n float a_hi = t - temp;\n float a_lo = a - a_hi;\n return vec2(a_hi, a_lo);\n}\n\n// Divide float number again when high float uses too many fraction bits\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\n\n// Special sum operation when a > b\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * fp64.ONE;\n float err = b - (sum - a) * fp64.ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\n\n// General sum operation\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * fp64.ONE - a) * fp64.ONE;\n float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * fp64.ONE - a) * fp64.ONE;\n float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x *\n a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n // twoProd is especially sensitive because mul_fp64 and div_fp64 both depend\n // on the split terms and cross terms staying in the original evaluation\n // order. If the compiler folds or reassociates them, the low part tends to\n // collapse to zero or NaN on some drivers.\n float highProduct = prevent_fp64_optimization(a_fp64.x * b_fp64.x);\n float crossProduct1 = prevent_fp64_optimization(a_fp64.x * b_fp64.y);\n float crossProduct2 = prevent_fp64_optimization(a_fp64.y * b_fp64.x);\n float lowProduct = prevent_fp64_optimization(a_fp64.y * b_fp64.y);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err1 = (highProduct - prod) * fp64.ONE;\n float err2 = crossProduct1 * fp64.ONE * fp64.ONE;\n float err3 = crossProduct2 * fp64.ONE * fp64.ONE * fp64.ONE;\n float err4 = lowProduct * fp64.ONE * fp64.ONE * fp64.ONE * fp64.ONE;\n#else\n float err1 = highProduct - prod;\n float err2 = crossProduct1;\n float err3 = crossProduct2;\n float err4 = lowProduct;\n#endif\n float err = ((err1 + err2) + err3) + err4;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n // y component is for the error\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * fp64.ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n";
2
2
  //# sourceMappingURL=fp64-arithmetic-glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fp64-arithmetic-glsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/math/fp64/fp64-arithmetic-glsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,shJAyKhC,CAAC"}
1
+ {"version":3,"file":"fp64-arithmetic-glsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/math/fp64/fp64-arithmetic-glsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,kiMAwMhC,CAAC"}