UNPKG

playcanvas

Version:

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

46 lines (39 loc) 1.44 kB
var gsplatStructs_default = ( /* glsl */ ` // Shared splat identification (index, uv) and setSplat() helper #include "gsplatSplatVS" // stores the render order and corner for this vertex struct SplatSource { uint order; // render order vec2 cornerUV; // 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 { vec3 view; // center in view space vec4 proj; // center in clip space mat4 modelView; // model-view matrix float projMat00; // element [0][0] of the projection matrix vec3 modelCenterOriginal; // original model center before modification vec3 modelCenterModified; // model center after modification #ifdef GSPLAT_FISHEYE float fisheyeSinTK; // sin(theta / k), shared with corner shader float fisheyeCosTK; // cos(theta / k), shared with corner shader float fisheyeRxy; // length(v.xy), shared with corner shader #endif }; // stores the offset from center for the current gaussian struct SplatCorner { vec3 offset; // corner offset (clip XY for 3DGS, model XYZ for 2DGS) vec2 uv; // corner uv #if GSPLAT_AA float aaFactor; // for scenes generated with antialiasing #endif vec2 v; float dlen; }; ` ); export { gsplatStructs_default as default };