Function GetPartIndexVaryingDeclaration
-
Parameters
- shaderLanguage: ShaderLanguage
The shader language the host material is compiling.
Returns string
The guarded
vPartIndexvarying declaration. - shaderLanguage: ShaderLanguage
The shader language the host material is compiling.
The guarded vPartIndex varying declaration.
Returns an include-guarded declaration of the
vPartIndexvarying shared by the Gaussian Splatting material plugins (debug, solid-color, GPU picking). More than one of these plugins can be attached to the same material at once; each needsvPartIndexto carrysplat.partIndexfrom the vertex to the fragment stage. Without a guard each plugin injects its ownvarying vPartIndex, which is a duplicate declaration — fatal under WGSL ("redefinition of 'vPartIndex'"). The guard makes the declaration idempotent so exactly one survives regardless of how many plugins inject it. Inject the result at a CUSTOM_VERTEX_DEFINITIONS / CUSTOM_FRAGMENT_DEFINITIONS point.