diff --git a/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthRenderer.js b/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthRenderer.js index c558bb72c6..5c30624245 100644 --- a/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthRenderer.js +++ b/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthRenderer.js @@ -281,6 +281,7 @@ export class SnapBatchingDepthRenderer { src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));"); } src.push("gl_Position = clipPos;"); + src.push("gl_PointSize = 1.0;"); // Windows needs this? src.push(" }"); src.push("}"); return src; diff --git a/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js b/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js index d923f24922..0d3144bc59 100644 --- a/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js +++ b/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js @@ -212,7 +212,7 @@ class SnapInstancingDepthBufInitRenderer { const clipping = sectionPlanesState.sectionPlanes.length > 0; const src = []; src.push ('#version 300 es'); - src.push("// Points instancing snap vertex shader"); + src.push("// SnapInstancingDepthBufInitRenderer vertex shader"); src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH"); src.push("precision highp float;"); src.push("precision highp int;"); diff --git a/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthRenderer.js b/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthRenderer.js index c28ef5a960..9d213eb7a2 100644 --- a/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthRenderer.js +++ b/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthRenderer.js @@ -224,7 +224,7 @@ class SnapInstancingDepthRenderer { const clipping = sectionPlanesState.sectionPlanes.length > 0; const src = []; src.push ('#version 300 es'); - src.push("// Points instancing snap vertex shader"); + src.push("// SnapInstancingDepthRenderer vertex shader"); src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH"); src.push("precision highp float;"); src.push("precision highp int;"); @@ -301,6 +301,7 @@ class SnapInstancingDepthRenderer { src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));"); } src.push("gl_Position = clipPos;"); + src.push("gl_PointSize = 1.0;"); // Windows needs this? src.push("}"); src.push("}"); return src; @@ -312,7 +313,7 @@ class SnapInstancingDepthRenderer { const clipping = sectionPlanesState.sectionPlanes.length > 0; const src = []; src.push ('#version 300 es'); - src.push("// Points instancing pick depth fragment shader"); + src.push("// SnapInstancingDepthRenderer fragment shader"); src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH"); src.push("precision highp float;"); src.push("precision highp int;"); @@ -352,7 +353,7 @@ class SnapInstancingDepthRenderer { src.push("}"); } if (scene.logarithmicDepthBufferEnabled) { - src.push("gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;"); + src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;"); } src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);") src.push("}");