UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

43 lines (37 loc) 1.42 kB
var gsplatStructs_default = ( /* wgsl */ ` // Shared splat identification (index, uv) and setSplat() helper #include "gsplatSplatVS" // stores the render order and corner for this vertex struct SplatSource { order: u32, // render order cornerUV: half2 // corner coordinates for this vertex of the gaussian (-1, -1)..(1, 1) } // stores the camera and clip space position of the gaussian center struct SplatCenter { view: vec3f, // center in view space proj: vec4f, // center in clip space modelView: mat4x4f, // model-view matrix projMat00: f32, // element [0][0] of the projection matrix modelCenterOriginal: vec3f, // original model center before modification modelCenterModified: vec3f, // model center after modification #ifdef GSPLAT_FISHEYE fisheyeSinTK: f32, // sin(theta / k), shared with corner shader fisheyeCosTK: f32, // cos(theta / k), shared with corner shader fisheyeRxy: f32, // length(v.xy), shared with corner shader #endif } // stores the offset from center for the current gaussian struct SplatCorner { offset: vec3f, // corner offset (clip XY for 3DGS, model XYZ for 2DGS) uv: half2, // corner uv #if GSPLAT_AA aaFactor: half, // for scenes generated with antialiasing #endif } ` ); export { gsplatStructs_default as default };