[x3d-public] Render optimizations
Andreas Plesch
andreasplesch at gmail.com
Tue Aug 13 14:11:10 PDT 2024
I think there may be an opportunity for some relatively simple tools
to achieve meaningful rendering improvements using the declarative
nature of X3D.
The idea is that it is much more efficient for (at least for GL based)
rendering to send a single draw call with a large object compared to
many draw calls with smaller objects. In effect, if it is possible to
combine multiple Shapes into a single larger Shape, it can have huge
effects on rendering speeds. For example, it is possible to easily
render hundreds of thousands of points in a single cloud while it may
be nearly impossible to render hundreds of thousands of Shapes with a
few points each.
StaticGroup is designed to help a browser with such optimizations and
I was wondering if there are existing tools which already do this,
perhaps in a preprocessing step.
The simplest, while useful tool I can think of is this:
Inside a StaticGroup, it should be possible to identify Shapes which
use the same Appearance (by DEF/USE). We group these Shapes by the
drawing primitive they would use (points, lines, triangles). Combining
the geometries into a single geometry would be most involved but only
considering IndexedFace and TriangleSets should be already useful.
Transforms and TextureTransforms would need to be flattened but this
can be neatly separated. Finally, a single Shape with the shared
Appearance and the combined geometry can replace multiple Shapes.
The underlying reason for such a tool is that (machine and human)
generators and editors tend to produce many Shapes because it is a bit
harder to keep track of them and organize them into single, larger
objects.
So any thoughts or pointers to existing X3D optimization tools will be
very welcome,
Andreas
--
Andreas Plesch
Waltham, MA 02453
More information about the x3d-public
mailing list