Length measurement labels and endpoint markers appear in the WebGPU viewer, but the dimension lines are missing. The console reports:
THREE.NodeBuilder: Material "LineMaterial" is not compatible.
Versions
@thatopen-platform/components-beta: 3.5.18
@thatopen-platform/components-front-beta: 3.5.16
@thatopen-platform/fragments-beta: 3.5.9
three: 0.185.0
- Linux, Chromium, hardware WebGPU on AMD RDNA 3 (no WebGL fallback)
Reproduction
In an initialized beta world using the WebGPU PostproductionRenderer, create a stock LengthMeasurement and add a line within the camera view:
import * as THREE from "three/webgpu";
import * as OBCF from "@thatopen-platform/components-front-beta";
const measurement = components.get(OBCF.LengthMeasurement);
measurement.world = world;
measurement.list.add(new OBCF.Line(
new THREE.Vector3(-2, -2, 0),
new THREE.Vector3(2, 2, 2),
));
// Camera looking at the origin from approximately (8, 7, 10).
console.log(measurement.linesMaterial.type); // "LineMaterial"
console.log(measurement.linesMaterial.isShaderMaterial); // true
Expected: a visible colored dimension line joining the endpoints, alongside its label.
Actual: labels/endpoints render, but the line does not; the material compatibility warning appears. The equivalent measurement works in a WebGL viewer.
Source-level cause
The beta Measurement base class creates a NearPlaneLineMaterial, which extends the GLSL LineMaterial from three/examples/jsm/lines/LineMaterial.js. DimensionLine.createLine() also constructs the WebGL LineSegments2. The WebGPU path needs the node-material equivalents.
Locally verified workaround
In the WebGPU build only:
- Replace the default measurement line material with
Line2NodeMaterial, preserving the color and 2 px width, with depthTest: false and depthWrite: false.
- Give this adapter material an
isLineMaterial flag so the current DimensionLine factory creates segment geometry instead of a plain THREE.Line.
- Replace the dimension's line object with
three/examples/jsm/lines/webgpu/LineSegments2.js, reusing its LineSegmentsGeometry and material. Keep it under the same parent and update dimension.lineElement, so geometry updates, visibility, and disposal continue to work.
This restored the lines without modifying the beta packages. A guard leaves an upstream node material untouched when one becomes available.
Validation
- Reproduced using the stock beta
LengthMeasurement class, independently of a custom measurement subclass.
- On the same hardware WebGPU backend, a 9×9 pixel region around a point one-quarter along the stock dimension had 0 blue pixels before and 21 after applying the adapter; the compatibility warning disappeared.
- Verified preview and committed lines in free and edge modes, plus a local orthogonal mode built on
createLineElement(); checked resize, hide/show, and deletion.
- Verified both the minimal FXAA pipeline and enabled postproduction; no new browser rendering errors.
- The stable WebGL viewer's measurements still pass the same checks.
Could the beta measurement factory select the appropriate line material and line object for the renderer? The shared Measurement base suggests other measurement tools using its fat-line material may also need the same adaptation; those tools were not tested here.
Length measurement labels and endpoint markers appear in the WebGPU viewer, but the dimension lines are missing. The console reports:
Versions
@thatopen-platform/components-beta: 3.5.18@thatopen-platform/components-front-beta: 3.5.16@thatopen-platform/fragments-beta: 3.5.9three: 0.185.0Reproduction
In an initialized beta world using the WebGPU
PostproductionRenderer, create a stockLengthMeasurementand add a line within the camera view:Expected: a visible colored dimension line joining the endpoints, alongside its label.
Actual: labels/endpoints render, but the line does not; the material compatibility warning appears. The equivalent measurement works in a WebGL viewer.
Source-level cause
The beta
Measurementbase class creates aNearPlaneLineMaterial, which extends the GLSLLineMaterialfromthree/examples/jsm/lines/LineMaterial.js.DimensionLine.createLine()also constructs the WebGLLineSegments2. The WebGPU path needs the node-material equivalents.Locally verified workaround
In the WebGPU build only:
Line2NodeMaterial, preserving the color and 2 px width, withdepthTest: falseanddepthWrite: false.isLineMaterialflag so the currentDimensionLinefactory creates segment geometry instead of a plainTHREE.Line.three/examples/jsm/lines/webgpu/LineSegments2.js, reusing itsLineSegmentsGeometryand material. Keep it under the same parent and updatedimension.lineElement, so geometry updates, visibility, and disposal continue to work.This restored the lines without modifying the beta packages. A guard leaves an upstream node material untouched when one becomes available.
Validation
LengthMeasurementclass, independently of a custom measurement subclass.createLineElement(); checked resize, hide/show, and deletion.Could the beta measurement factory select the appropriate line material and line object for the renderer? The shared
Measurementbase suggests other measurement tools using its fat-line material may also need the same adaptation; those tools were not tested here.