From 41c96745b3ad001359fba9a406e41f4f09976a21 Mon Sep 17 00:00:00 2001 From: mschuetz Date: Fri, 7 Nov 2014 12:47:52 +0100 Subject: [PATCH] slight change to lod, comments for fog in interpolation shader --- src/PointCloudOctree.js | 21 ++++++++++--------- .../PointCloudRGBInterpolationMaterial.js | 10 +++++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/PointCloudOctree.js b/src/PointCloudOctree.js index de87c1c8..2244458f 100644 --- a/src/PointCloudOctree.js +++ b/src/PointCloudOctree.js @@ -167,16 +167,17 @@ Potree.PointCloudOctree.prototype.update = function(camera){ }else if(this.numVisiblePoints > this.visiblePointsTarget*1.1){ // decrease to value at which point count target is met - var n = 0; - for(var i = 0; i < visibleNodes.length; i++){ - var element = visibleNodes[i]; - n += element.node.numPoints; - - if(n >= this.visiblePointsTarget){ - this.LOD = 1 / element.lod; - break; - } - } + //var n = 0; + //for(var i = 0; i < visibleNodes.length; i++){ + // var element = visibleNodes[i]; + // n += element.node.numPoints; + // + // if(n >= this.visiblePointsTarget){ + // this.LOD = 1 / element.lod; + // break; + // } + //} + this.LOD *= 0.95; } diff --git a/src/materials/PointCloudRGBInterpolationMaterial.js b/src/materials/PointCloudRGBInterpolationMaterial.js index cd70a732..a602577b 100644 --- a/src/materials/PointCloudRGBInterpolationMaterial.js +++ b/src/materials/PointCloudRGBInterpolationMaterial.js @@ -100,6 +100,12 @@ Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb = [ " ", " gl_FragColor = vec4(vColor, 1.0); ", " gl_FragDepthEXT = gl_FragCoord.z + blendDepth*(1.0-pow(c, 1.0)) * gl_FragCoord.w ; ", + " ", + " //float dist = gl_FragCoord.z / gl_FragCoord.w; ", + " //float fog = clamp(dist / 2000.0, 0.0, 1.0); ", + " //fog = min(fog, 0.6); ", + " //gl_FragColor = gl_FragColor * (1.0-fog) + vec4(170.0, 180.0, 190, 1.0) * fog / 256.0; ", + " //gl_FragColor.a = 1.0; ", "} "]; @@ -111,7 +117,3 @@ Potree.PointCloudRGBInterpolationMaterial.fs_points_rgb = [ - - - -