about gsplatCommonVS

Hi,guys

I’m currently doing a deeper dive into the supersplat source code and trying to extend the GSplat rendering pipeline. During this process, I noticed that many vertex shaders contain statements like:

#include "gsplatCommonVS"

However, I couldn’t find a corresponding gsplatCommonVS.glsl (or similar) file in the repository. It seems that gsplatCommonVS is injected or expanded during a build / preprocessing step (possibly as a shader chunk stored in TypeScript), rather than being a native GLSL include.

Because of this, I’m having difficulty understanding:

  • What exactly is defined inside gsplatCommonVS
  • What structs, uniforms, varyings, and helper functions it provides
  • Which parts are expected to be used or overridden by downstream shaders

For developers who want to do deeper or custom GSplat development (e.g. adding new per-splat attributes, extending to dynamic / 4D Gaussians, or modifying the projection and shading logic), this makes it hard to reason about the shader interface and data flow.

My questions are:

  1. Is there an official or recommended way to inspect the full expanded source of gsplatCommonVS?
  2. Is there any documentation or API reference describing the contents and intended usage of gsplatCommonVS (its structs, uniforms, and assumptions)?
  3. Are there plans to expose or document these shader chunks more explicitly for advanced users who want to extend GSplat?

Any guidance or pointers would be greatly appreciated.
Thanks a lot for the great work on supersplat.

This is the source code of that specific chunks (you can find all other chunks in the same folder or so):

  • Which parts are expected to be used or overridden by downstream shaders

At the moment, all these chunks are internal, and the only public customization is described here: Custom Shaders | PlayCanvas Developer Site

adding new per-splat attributes

Regarding this, and further flexibility, there is work happening here which is planned to be released with the next minor engine release in a few weeks, together with documentation and examples. That will handle extra streams, easy to provide shader chunks to interpret those and many other things.

For example: GsplatProcessor and extra data streams for gaussian splats by mvaligursky · Pull Request #8395 · playcanvas/engine · GitHub
GSplat Work Buffer Custom Streams Support by mvaligursky · Pull Request #8396 · playcanvas/engine · GitHub

By the way, a lot of refactoring on those chunks is taking place at the moment, for the next engine release. If you need to go low level, I’d suggest you to use main branch, and try and use the new APIs for extra streams / processing shaders. I know there is no documentation yet. Ping me with question if needed, no problem there.

1 Like