Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/shaders/splatFragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ precision highp float;
precision highp int;

#include <splatDefines>
#include <logdepthbuf_pars_fragment>

uniform float near;
uniform float far;
Expand Down Expand Up @@ -93,4 +94,5 @@ void main() {
fragColor = rgba;
#endif
}
#include <logdepthbuf_fragment>
}
8 changes: 8 additions & 0 deletions src/shaders/splatVertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ precision highp int;
precision highp usampler2DArray;

#include <splatDefines>
#include <logdepthbuf_pars_vertex>

attribute uint splatIndex;

Expand Down Expand Up @@ -35,6 +36,12 @@ uniform float focalAdjustment;
uniform usampler2DArray packedSplats;
uniform vec4 rgbMinMaxLnScaleMinMax;

#ifdef USE_LOGDEPTHBUF
bool isPerspectiveMatrix( mat4 m ) {
return m[ 2 ][ 3 ] == - 1.0;
}
#endif

void main() {
// Default to outside the frustum so it's discarded if we return early
gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
Expand Down Expand Up @@ -215,4 +222,5 @@ void main() {
vSplatUv = position.xy * maxStdDev;
vNdc = ndc;
gl_Position = vec4(ndc.xy * clipCenter.w, clipCenter.zw);
#include <logdepthbuf_vertex>
}