@driftengine/splats 4.7.0 → 4.7.2

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/dist/splatGpu.js CHANGED
@@ -1,4 +1,5 @@
1
1
  /** The WebGPU half of the splat pass: the same two integer textures, one pipeline, no vertex state. */
2
+ import { DEPTH_COMPARE } from '@driftengine/core';
2
3
  import { SPLAT_BINDINGS, SPLAT_FRAG_WGSL, SPLAT_VERT_WGSL, } from './shaders/generated/splat.wgsl.js';
3
4
  import { SPLAT_STRIDE, splatRowSource, splatRows, splatTexels } from './splatLayout.js';
4
5
  /*
@@ -126,9 +127,18 @@ export function createGpuSplats(device, format, depthFormat, samples, splats, la
126
127
  },
127
128
  primitive: { topology: 'triangle-list' },
128
129
  multisample: { count: samples },
129
- /* Tested, never written: a wall in front occludes the capture, and a Gaussian has no surface
130
- to occlude with, so a cloud that wrote depth would cull its own tail. */
131
- depthStencil: { format: depthFormat, depthWriteEnabled: false, depthCompare: 'less' },
130
+ /*
131
+ * Tested, never written: a wall in front occludes the capture, and a Gaussian has no surface
132
+ * to occlude with, so a cloud that wrote depth would cull its own tail.
133
+ *
134
+ * **The compare is the frame's, from `depthConvention.ts`, and was a literal `'less'`.** The
135
+ * scene's depth is reversed on both backends, cleared to 0 and tested `greater`, so a `less`
136
+ * test passed only where a mesh had already written depth and the capture behind it was drawn
137
+ * through it: on WebGPU a scene showed its splats inside the silhouette of whatever geometry
138
+ * stood in it and nowhere else. The WebGL2 half sets no depth function of its own and inherits
139
+ * the renderer's, which is why only this half was wrong.
140
+ */
141
+ depthStencil: { format: depthFormat, depthWriteEnabled: false, depthCompare: DEPTH_COMPARE },
132
142
  });
133
143
  const vertexScratch = new ArrayBuffer(VERT.uniformSize);
134
144
  const fragmentScratch = new ArrayBuffer(FRAG.uniformSize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driftengine/splats",
3
- "version": "4.7.0",
3
+ "version": "4.7.2",
4
4
  "description": "Gaussian splat captures: readers, an off-frame sort, and a pass that composes into the scene",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "sideEffects": false,
29
29
  "peerDependencies": {
30
- "@driftengine/core": "4.7.0"
30
+ "@driftengine/core": "4.7.2"
31
31
  },
32
32
  "author": "Drift Technologies",
33
33
  "repository": {
package/src/splatGpu.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  /** The WebGPU half of the splat pass: the same two integer textures, one pipeline, no vertex state. */
2
2
 
3
+ import { DEPTH_COMPARE } from '@driftengine/core';
4
+
3
5
  import {
4
6
  SPLAT_BINDINGS,
5
7
  SPLAT_FRAG_WGSL,
@@ -180,9 +182,18 @@ export function createGpuSplats(
180
182
  },
181
183
  primitive: { topology: 'triangle-list' },
182
184
  multisample: { count: samples },
183
- /* Tested, never written: a wall in front occludes the capture, and a Gaussian has no surface
184
- to occlude with, so a cloud that wrote depth would cull its own tail. */
185
- depthStencil: { format: depthFormat, depthWriteEnabled: false, depthCompare: 'less' },
185
+ /*
186
+ * Tested, never written: a wall in front occludes the capture, and a Gaussian has no surface
187
+ * to occlude with, so a cloud that wrote depth would cull its own tail.
188
+ *
189
+ * **The compare is the frame's, from `depthConvention.ts`, and was a literal `'less'`.** The
190
+ * scene's depth is reversed on both backends, cleared to 0 and tested `greater`, so a `less`
191
+ * test passed only where a mesh had already written depth and the capture behind it was drawn
192
+ * through it: on WebGPU a scene showed its splats inside the silhouette of whatever geometry
193
+ * stood in it and nowhere else. The WebGL2 half sets no depth function of its own and inherits
194
+ * the renderer's, which is why only this half was wrong.
195
+ */
196
+ depthStencil: { format: depthFormat, depthWriteEnabled: false, depthCompare: DEPTH_COMPARE },
186
197
  });
187
198
 
188
199
  const vertexScratch = new ArrayBuffer(VERT.uniformSize);