Skip to content

Commit 095caea

Browse files
committed
feat(WebGPU): add MSAA (multi-sample anti-aliasing) support
1 parent d16118f commit 095caea

File tree

1 file changed

+28
-3
lines changed
  • Sources/Rendering/WebGPU/RenderWindow

1 file changed

+28
-3
lines changed
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
WebGPU rendering window
1+
# WebGPU RenderWindow
22

3-
vtkWebGPURenderWindow is designed to view/render a vkRenderWindow
4-
using the WebGPU API
3+
vtkWebGPURenderWindow is designed to view/render a vtkRenderWindow
4+
using the WebGPU API.
5+
6+
## Multi-Sample Anti-Aliasing (MSAA)
7+
8+
MSAA can be enabled to improve image quality by reducing aliasing
9+
artifacts on geometry edges. When active, both opaque and translucent
10+
rendering passes use multisampled textures and resolve them before
11+
compositing.
12+
13+
### sampleCount (set/get)
14+
15+
Controls the number of MSAA samples per pixel.
16+
17+
- **Default:** `1` (no anti-aliasing)
18+
- **Valid values:** `1` or `4`
19+
- Setting any other value is ignored and logs an error.
20+
- Changing `sampleCount` at runtime automatically recreates the
21+
internal render encoders and textures on the next frame.
22+
23+
**Usage:**
24+
25+
```js
26+
const renderWindow = vtkWebGPURenderWindow.newInstance();
27+
renderWindow.setSampleCount(4); // enable 4× MSAA
28+
renderWindow.setSampleCount(1); // disable MSAA
29+
```

0 commit comments

Comments
 (0)