UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

55 lines (53 loc) 1.05 kB
var gsplatCommonVS = ` struct SplatSource { uint order; uint id; ivec2 uv; vec2 cornerUV; }; struct SplatCenter { vec3 view; vec4 proj; mat4 modelView; float projMat00; }; struct SplatCorner { vec2 offset; vec2 uv; #if GSPLAT_AA float aaFactor; #endif vec2 v; float dlen; }; #include "gsplatEvalSHVS" #include "gsplatQuatToMat3VS" #if GSPLAT_COMPRESSED_DATA == true #include "gsplatCompressedDataVS" #if SH_COEFFS > 0 #include "gsplatCompressedSHVS" #endif #elif GSPLAT_SOGS_DATA == true #include "gsplatSogsDataVS" #include "gsplatSogsColorVS" #if SH_COEFFS > 0 #include "gsplatSogsSHVS" #endif #else #include "gsplatDataVS" #include "gsplatColorVS" #if SH_COEFFS > 0 #include "gsplatSHVS" #endif #endif #include "gsplatSourceVS" #include "gsplatCenterVS" #include "gsplatCornerVS" #include "gsplatOutputVS" void clipCorner(inout SplatCorner corner, float alpha) { float clip = min(1.0, sqrt(-log(1.0 / 255.0 / alpha)) / 2.0); corner.offset *= clip; corner.uv *= clip; } `; export { gsplatCommonVS as default };