fix: improve ceiling handle feedback and WebGPU placeholders

This commit is contained in:
Aymeric Rabot
2026-06-09 14:49:42 -04:00
parent 8ce26154d9
commit 265acdb2be
11 changed files with 661 additions and 55 deletions
@@ -131,6 +131,8 @@ export function generateCeilingGeometry(
// the whole command encoder.
const degenerate = new THREE.BufferGeometry()
degenerate.setAttribute('position', new THREE.Float32BufferAttribute(new Float32Array(9), 3))
degenerate.setAttribute('normal', new THREE.Float32BufferAttribute(new Float32Array(9), 3))
degenerate.setAttribute('uv', new THREE.Float32BufferAttribute(new Float32Array(6), 2))
return degenerate
}
@@ -152,6 +152,14 @@ export const RoofSystem = () => {
'position',
new THREE.Float32BufferAttribute(new Float32Array(9), 3),
)
placeholder.setAttribute(
'normal',
new THREE.Float32BufferAttribute(new Float32Array(9), 3),
)
placeholder.setAttribute(
'uv',
new THREE.Float32BufferAttribute(new Float32Array(6), 2),
)
computeGeometryBoundsTree(placeholder)
mesh.geometry = placeholder
}
@@ -531,6 +531,8 @@ function createEmptyGeometry(): THREE.BufferGeometry {
// unbound and the draw is rejected ("Vertex buffer slot 0 … was not set"),
// poisoning the command encoder. The count-0 groups keep nothing drawn.
geometry.setAttribute('position', new THREE.Float32BufferAttribute(new Float32Array(9), 3))
geometry.setAttribute('normal', new THREE.Float32BufferAttribute(new Float32Array(9), 3))
geometry.setAttribute('uv', new THREE.Float32BufferAttribute(new Float32Array(6), 2))
geometry.addGroup(0, 0, STAIR_TREAD_MATERIAL_INDEX)
geometry.addGroup(0, 0, STAIR_SIDE_MATERIAL_INDEX)
return geometry