UNPKG

playcanvas

Version:

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

39 lines (36 loc) 1.12 kB
var gsplatCommon_default = ( /* wgsl */ ` #include "gsplatHelpersVS" #include "gsplatFormatVS" #include "gsplatStructsVS" #include "gsplatDeclarationsVS" #include "gsplatModifyVS" #include "gsplatEvalSHVS" #include "gsplatQuatToMat3VS" #include "gsplatReadVS" #include "gsplatSourceVS" #include "gsplatCenterVS" #include "gsplatCornerVS" #include "gsplatOutputVS" #if defined(SHADOW_PASS) || defined(PICK_PASS) || defined(PREPASS_PASS) uniform alphaClip: f32; #else uniform alphaClipForward: f32; #endif // modify the gaussian corner; uses alphaClip (non-forward) or alphaClipForward (forward) to match frag fn clipCorner(corner: ptr<function, SplatCorner>, alpha: half) { #if defined(SHADOW_PASS) || defined(PICK_PASS) || defined(PREPASS_PASS) let alphaClipValue = half(uniform.alphaClip); #else let alphaClipValue = half(uniform.alphaClipForward); #endif let clip = min(half(1.0), sqrt(max(half(0.0), log(alpha / alphaClipValue))) * half(0.5)); corner.offset = corner.offset * f32(clip); corner.uv = corner.uv * clip; } ` ); export { gsplatCommon_default as default };