[x3d-public] GPU APIs and X3D

Andreas Plesch andreasplesch at gmail.com
Fri Jul 14 20:34:26 PDT 2023


Although X3D is a high level scene graph, it is influenced by OpenGL
and many, perhaps all X3D browsers use OpenGL or the similar WebGL as
an API to draw pixels.

OpenGL is not updated anymore and other APIs are now dominant: Metal,
Vulcan, Direct3D12 and now WebGPU. It is already available in most web
browsers as an alternative to WebGL2. WebGPU is cross-platform, close
to GPU instructions and can be very performant.

Did anybody think about or actually try to use something other than
OpenGL for X3D rendering ?

It is time to start speculating and mind mapping how one would go
about designing a new X3D browser which uses another low-level API.
Ideally, X3D is abstract enough that the choice of graphics API does
not matter much. But there are certainly many aspects that an
implementation has to consider which depend on the low-level API, from
the design stage to actual coding.

https://webgpufundamentals.org/webgpu/lessons/webgpu-from-webgl.html
has a detailed comparison between WebGL and WebGPU.

WebGPU is lower level. One example mentioned above is ImageTexture.
With WebGL it is possible to just change the source image for the
texture, and everything else in the rendering process can stay the
same. With WebGPU it is necessary to destroy the old texture, and
rebuild a pipeline in case the ImageTexture is changed.

A Shape corresponds to a draw call in WebGL. For WebGPU a Shape
presumably still could correspond to a draw call but it is also
possible to bundle all draw calls for a Scene and submit those in one
call. That seems interesting but it is unclear how event flow may
affect this option.

Any experience with nonGL APIs may be insightful.

Andreas

-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list