@woosh/meep-engine 2.119.77 → 2.119.78
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sh3_dering_optimize_positive.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sh3_dering_optimize_positive.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js"],"names":[],"mappings":"AA0SA;;;;;;;GAOG;AACH,qDANW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,oBAClC,MAAM,oBACN,MAAM,QAIhB"}
|
|
@@ -266,24 +266,34 @@ function windowSH(
|
|
|
266
266
|
|
|
267
267
|
array_copy(input, input_offset, output, output_offset, numBands * numBands * channel_count);
|
|
268
268
|
|
|
269
|
-
|
|
270
269
|
for (let l = 0; l < numBands; l++) {
|
|
271
270
|
// scale each band individually
|
|
272
271
|
const w = sinc_window(l, cutoff);
|
|
273
272
|
|
|
274
273
|
// write zonal harmonic
|
|
275
274
|
for (let i = 0; i < channel_count; i++) {
|
|
276
|
-
|
|
275
|
+
|
|
276
|
+
const j = sh_index(0, l);
|
|
277
|
+
|
|
278
|
+
output[output_offset + j * channel_count + i] *= w;
|
|
277
279
|
}
|
|
278
280
|
|
|
279
281
|
// write the rest of the band
|
|
280
282
|
for (let m = 1; m <= l; m++) {
|
|
281
283
|
for (let i = 0; i < channel_count; i++) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
+
|
|
285
|
+
const j0 = sh_index(-m, l);
|
|
286
|
+
|
|
287
|
+
output[output_offset + j0 * channel_count + i] *= w;
|
|
288
|
+
|
|
289
|
+
const j1 = sh_index(m, l);
|
|
290
|
+
|
|
291
|
+
output[output_offset + j1 * channel_count + i] *= w;
|
|
292
|
+
|
|
284
293
|
}
|
|
285
294
|
}
|
|
286
295
|
}
|
|
296
|
+
|
|
287
297
|
}
|
|
288
298
|
|
|
289
299
|
/**
|
|
@@ -36,15 +36,15 @@ export function sh3_sample_irradiance_by_direction(
|
|
|
36
36
|
channel_value = harmonics[harmonics_offset + i] * 0.88622692545275801364908374167057;
|
|
37
37
|
|
|
38
38
|
// band 1
|
|
39
|
-
channel_value
|
|
39
|
+
channel_value -= harmonics[harmonics_offset + dimension_count + i] * 2.0 * 0.51166335397324424423977581244463 * y;
|
|
40
40
|
channel_value += harmonics[harmonics_offset + dimension_count * 2 + i] * 2.0 * 0.51166335397324424423977581244463 * z;
|
|
41
|
-
channel_value
|
|
41
|
+
channel_value -= harmonics[harmonics_offset + dimension_count * 3 + i] * 2.0 * 0.51166335397324424423977581244463 * x;
|
|
42
42
|
|
|
43
43
|
// band 2
|
|
44
44
|
channel_value += harmonics[harmonics_offset + dimension_count * 4 + i] * 2.0 * 0.42904276540489171563379376569857 * x * y;
|
|
45
|
-
channel_value
|
|
45
|
+
channel_value -= harmonics[harmonics_offset + dimension_count * 5 + i] * 2.0 * 0.42904276540489171563379376569857 * y * z;
|
|
46
46
|
channel_value += harmonics[harmonics_offset + dimension_count * 6 + i] * (3 * z * z - 1) * 0.24770795610037568833406429782001;
|
|
47
|
-
channel_value
|
|
47
|
+
channel_value -= harmonics[harmonics_offset + dimension_count * 7 + i] * 2.0 * 0.42904276540489171563379376569857 * x * z;
|
|
48
48
|
channel_value += harmonics[harmonics_offset + dimension_count * 8 + i] * 0.42904276540489171563379376569857 * (x * x - y * y);
|
|
49
49
|
|
|
50
50
|
// write out
|