diff --git a/src/PointCloudOctree.js b/src/PointCloudOctree.js index 95cbb380..efd7d9c9 100644 --- a/src/PointCloudOctree.js +++ b/src/PointCloudOctree.js @@ -768,6 +768,11 @@ Potree.PointCloudOctree = class extends Potree.PointCloudTree{ gl.uniform1f(uniforms["maxSize"], this.material.maxSize); gl.uniform1f(uniforms["octreeSize"], this.pcoGeometry.boundingBox.getSize().x); + if(uniforms["clipBoxes[0]"]){ + gl.uniform1f(uniforms["clipBoxCount"], pickMaterial.uniforms.clipBoxCount.value); + gl.uniformMatrix4fv(uniforms["clipBoxes[0]"], false, pickMaterial.uniforms.clipBoxes.value); + } + { let apPosition = gl.getAttribLocation(program, "position"); let apNormal = gl.getAttribLocation(program, "normal"); diff --git a/src/exporter/LASExporter.js b/src/exporter/LASExporter.js index 0b9df2b5..f3565ebb 100644 --- a/src/exporter/LASExporter.js +++ b/src/exporter/LASExporter.js @@ -35,7 +35,7 @@ Potree.LASExporter = class LASExporter{ // system identifier o:26 l:32 // generating software o:58 l:32 - setString("potree 1.4", 58, buffer); + setString("Potree 1.5", 58, buffer); // file creation day of year o:90 l:2 // file creation year o:92 l:2 diff --git a/src/materials/PointCloudMaterial.js b/src/materials/PointCloudMaterial.js index 85151239..e6a2ee01 100644 --- a/src/materials/PointCloudMaterial.js +++ b/src/materials/PointCloudMaterial.js @@ -153,7 +153,6 @@ Potree.PointCloudMaterial = class PointCloudMaterial extends THREE.RawShaderMate gradient: { type: "t", value: this.gradientTexture }, classificationLUT: { type: "t", value: this.classificationTexture }, clipBoxes: { type: "Matrix4fv", value: [] }, - clipBoxPositions: { type: "fv", value: null }, depthMap: { type: "t", value: null }, diffuse: { type: "fv", value: [1,1,1]}, transition: { type: "f", value: 0.5 }, @@ -311,16 +310,11 @@ Potree.PointCloudMaterial = class PointCloudMaterial extends THREE.RawShaderMate } this.uniforms.clipBoxes.value = new Float32Array(this.numClipBoxes * 16); - this.uniforms.clipBoxPositions.value = new Float32Array(this.numClipBoxes * 3); for(let i = 0; i < this.numClipBoxes; i++){ let box = clipBoxes[i]; this.uniforms.clipBoxes.value.set(box.inverse.elements, 16*i); - - this.uniforms.clipBoxPositions.value[3*i+0] = box.position.x; - this.uniforms.clipBoxPositions.value[3*i+1] = box.position.y; - this.uniforms.clipBoxPositions.value[3*i+2] = box.position.z; } } @@ -669,17 +663,19 @@ Potree.PointCloudMaterial = class PointCloudMaterial extends THREE.RawShaderMate } set intensityRange(value){ - this.uniforms.intensityRange.value = value; - if(value.length !== 2){ - return; - }else if(this.uniforms.heightMax.value[0] !== value[0]){ - return; - }else if(this.uniforms.heightMax.value[1] !== value[1]){ + if(!(value instanceof Array && value.length === 2)){ return; } - this.uniforms.heightMax.value = value; + if(value[0] === this.uniforms.intensityRange.value[0] && + value[1] === this.uniforms.intensityRange.value[1]){ + + return; + } + + this.uniforms.intensityRange.value = value; + this.dispatchEvent({ type: "material_property_changed", target: this diff --git a/src/materials/shaders/pointcloud.vs b/src/materials/shaders/pointcloud.vs index bc6f2d41..07ef9a99 100644 --- a/src/materials/shaders/pointcloud.vs +++ b/src/materials/shaders/pointcloud.vs @@ -33,7 +33,6 @@ uniform float far; #if defined use_clip_box uniform mat4 clipBoxes[max_clip_boxes]; - uniform vec3 clipBoxPositions[max_clip_boxes]; #endif diff --git a/src/viewer/profile.html b/src/viewer/profile.html index 16d02de6..82b3c7ef 100644 --- a/src/viewer/profile.html +++ b/src/viewer/profile.html @@ -1,7 +1,7 @@