@plasius/gpu-shared 0.1.10 → 0.1.11
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/CHANGELOG.md +17 -0
- package/README.md +4 -1
- package/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{showcase-runtime-55OVDYWT.js → showcase-runtime-2ZNPKD7D.js} +11 -3
- package/dist/{showcase-runtime-55OVDYWT.js.map → showcase-runtime-2ZNPKD7D.js.map} +1 -1
- package/package.json +1 -1
- package/src/showcase-runtime.js +12 -2
package/package.json
CHANGED
package/src/showcase-runtime.js
CHANGED
|
@@ -1215,6 +1215,14 @@ function sampleWave(state, x, z, time) {
|
|
|
1215
1215
|
);
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
1218
|
+
function resolveFluidBandContinuity(continuity, band) {
|
|
1219
|
+
if (continuity?.bands && continuity.bands[band]) {
|
|
1220
|
+
return continuity.bands[band];
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
return continuity ?? { amplitudeFloor: 1, frequencyFloor: 1 };
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1218
1226
|
function buildWaterMotionEffects(state) {
|
|
1219
1227
|
const wakeTrails = [];
|
|
1220
1228
|
const rippleRings = state.waveImpulses.map((impulse) => {
|
|
@@ -1297,6 +1305,7 @@ function buildWaterBands(state, fluidDetail, visuals) {
|
|
|
1297
1305
|
fluidPlan.representations.find((entry) => entry.band === bandSpec.band) ??
|
|
1298
1306
|
fluidPlan.representations[0];
|
|
1299
1307
|
const continuity = createFluidContinuityEnvelope({ fluidBodyId: "harbor" });
|
|
1308
|
+
const bandContinuity = resolveFluidBandContinuity(continuity, bandSpec.band);
|
|
1300
1309
|
const bandResolution =
|
|
1301
1310
|
bandSpec.band === "near"
|
|
1302
1311
|
? fluidDetail.nearResolution
|
|
@@ -1320,7 +1329,7 @@ function buildWaterBands(state, fluidDetail, visuals) {
|
|
|
1320
1329
|
const y =
|
|
1321
1330
|
bandSpec.y +
|
|
1322
1331
|
sampleWave(state, x, z, state.time) *
|
|
1323
|
-
|
|
1332
|
+
bandContinuity.amplitudeFloor *
|
|
1324
1333
|
(bandSpec.band === "near" ? 0.9 : bandSpec.band === "mid" ? 0.55 : 0.3);
|
|
1325
1334
|
positions.push(vec3(x, y, z));
|
|
1326
1335
|
}
|
|
@@ -1338,7 +1347,7 @@ function buildWaterBands(state, fluidDetail, visuals) {
|
|
|
1338
1347
|
bandMeshes.push({
|
|
1339
1348
|
band: bandSpec.band,
|
|
1340
1349
|
representation,
|
|
1341
|
-
continuity,
|
|
1350
|
+
continuity: bandContinuity,
|
|
1342
1351
|
rows,
|
|
1343
1352
|
cols,
|
|
1344
1353
|
positions,
|
|
@@ -2784,6 +2793,7 @@ function updatePhysicsSnapshot(state, shipModel) {
|
|
|
2784
2793
|
|
|
2785
2794
|
export {
|
|
2786
2795
|
advanceShowcaseClothSimulationState as __testOnlyAdvanceShowcaseClothSimulationState,
|
|
2796
|
+
buildWaterBands as __testOnlyBuildWaterBands,
|
|
2787
2797
|
buildWaterMotionEffects as __testOnlyBuildWaterMotionEffects,
|
|
2788
2798
|
collectSceneLightSources as __testOnlyCollectSceneLightSources,
|
|
2789
2799
|
createShowcaseClothSimulationState as __testOnlyCreateShowcaseClothSimulationState,
|