hn.today

Experimenting with Bindless Textures in WebGPU

toji.dev4 points0 comments
Screenshot of Experimenting with Bindless Textures in WebGPU

WebGPU’s emerging bindless texture feature lets shaders retrieve textures and samplers from a shared resource table using numeric indices, rather than requiring each texture to be attached directly to a bind group. Traditional binding can create setup and management overhead, especially when many objects use different textures. Bindless access can simplify some renderers and enable algorithms where the needed texture cannot be predicted in advance, such as ray tracing. It does not automatically eliminate bind groups: the example still uses per-mesh groups, and conventional bindings can coexist with resource tables. The feature is experimental and currently testable in Chrome on Windows, Linux, and Android with “Unsafe WebGPU Support” enabled; macOS support is planned.

A live demonstration, Emoji Graffiti, shows why this flexibility matters. Users spray emoji onto a gallery’s surfaces, where each decal is projected onto scene geometry rather than drawn as a separate mesh. This lets decals conform to surfaces, avoids z-fighting even when layered, and does not require hardware alpha blending. Since surfaces may need to sample any of nearly 2,000 emoji textures, binding every possibility per mesh would be impractical. When bindless support is unavailable, the demo instead stores decals in layers of a large 2D texture array and uses the decal index to select a layer. This fallback requires more careful texture uploads but keeps shader changes small and allows the demo to render without enabling the experimental feature.

Read on toji.dev0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.