Skip to content

Commit

Permalink
fix(material): fix crop poitn when transparency (to sqaush)
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Dec 20, 2024
1 parent 8622f8a commit fdafc57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/Layer/PointCloudLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,14 @@ class PointCloudLayer extends GeometryLayer {
if (this.material) {
this.material.visible = this.visible;
this.material.opacity = this.opacity;
this.material.transparent = this.opacity < 1 || this.material.userData.needTransparency[this.material.mode];
this.material.transparent = this.material.userData.needTransparency[this.material.mode] || this.opacity < 1 || this.material.userData.needTransparency.classTransparency;
this.material.depthWrite = !this.material.userData.needTransparency.classTransparency;
this.material.size = this.pointSize;
this.material.scale = context.camera.preSSE;
if (this.material.updateUniforms) {
this.material.updateUniforms();
}
this.material.needsUpdate = true;
}

// lookup lowest common ancestor of changeSources
Expand Down
6 changes: 1 addition & 5 deletions src/Renderer/PointsMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,7 @@ class PointsMaterial extends THREE.ShaderMaterial {
}
texture.needsUpdate = true;

this.userData.needTransparency[PNTS_MODE.CLASSIFICATION] = needTransparency;
this.userData.needTransparency[PNTS_MODE.RETURN_NUMBER] = needTransparency;
this.userData.needTransparency[PNTS_MODE.RETURN_TYPE] = needTransparency;
this.userData.needTransparency[PNTS_MODE.RETURN_COUNT] = needTransparency;
this.userData.needTransparency[PNTS_MODE.POINT_SOURCE_ID] = needTransparency;
this.userData.needTransparency.classTransparency = needTransparency;

this.dispatchEvent({
type: 'material_property_changed',
Expand Down

0 comments on commit fdafc57

Please sign in to comment.