Skip to content

Commit

Permalink
Add gl_PointSize=1.0 to vertex snap shaders for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Sep 7, 2023
1 parent a0817ad commit 8926d34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;");
Expand Down Expand Up @@ -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;
Expand All @@ -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;");
Expand Down Expand Up @@ -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("}");
Expand Down

0 comments on commit 8926d34

Please sign in to comment.