Merge branch 'main' into andrew/improve-ux-federated-comments

This commit is contained in:
andrewwallacespeckle
2025-03-13 09:26:50 +00:00
4 changed files with 24 additions and 3 deletions
@@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Speckle.Importers.Ifc" Version="3.1.0-nuget-wip.1" />
<PackageReference Include="Speckle.Importers.Ifc" Version="3.0.2-adam.3-38-gbdabd10b" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>
+5
View File
@@ -474,6 +474,11 @@ const getStream = () => {
// Custom normals
// 'https://latest.speckle.systems/projects/51c449c440/models/08e97226cf'
// A LOT of text objects
// 'https://app.speckle.systems/projects/e771a388b1/models/f5c967dfa9'
// 'https://app.speckle.systems/projects/16cffbc224/models/1e142b07a0'
)
}
@@ -31,8 +31,11 @@ export default class LineBatch implements Batch {
public renderViews: NodeRenderView[]
protected geometry: LineSegmentsGeometry
public batchMaterial: SpeckleLineMaterial
protected batchTransparent: boolean
protected batchOpacity: number
protected mesh: LineSegments2
public colorBuffer!: InstancedInterleavedBuffer
public colorBuffer: InstancedInterleavedBuffer
private static readonly vector4Buffer: Vector4 = new Vector4()
public get bounds(): Box3 {
@@ -94,6 +97,9 @@ export default class LineBatch implements Batch {
public setBatchMaterial(material: SpeckleLineMaterial) {
this.batchMaterial = material
/** Not a fan of this :( */
this.batchTransparent = material.transparent
this.batchOpacity = material.opacity
}
public onUpdate(deltaTime: number) {
@@ -169,6 +175,9 @@ export default class LineBatch implements Batch {
public setBatchBuffers(ranges: BatchUpdateRange[]): void {
const data = this.colorBuffer.array as number[]
/** Reset transparency */
this.batchMaterial.transparent = this.batchTransparent
this.batchMaterial.opacity = this.batchOpacity
for (let i = 0; i < ranges.length; i++) {
const material = ranges[i].material as SpeckleLineMaterial
@@ -179,6 +188,10 @@ export default class LineBatch implements Batch {
: material.color
const alpha: number = material.visible ? material.opacity : 0
this.batchMaterial.transparent ||= material.opacity < 1
this.batchMaterial.opacity = Math.min(
this.batchMaterial.opacity,
material.opacity
)
const start = ranges[i].offset * this.colorBuffer.stride
const len =
ranges[i].offset * this.colorBuffer.stride +
@@ -211,7 +224,8 @@ export default class LineBatch implements Batch {
])
this.mesh.material = this.batchMaterial
this.mesh.visible = true
this.batchMaterial.transparent = false
this.batchMaterial.transparent = this.batchTransparent
this.batchMaterial.opacity = this.batchOpacity
}
public buildBatch() {
@@ -425,6 +425,8 @@ export default class Materials {
;(<SpeckleLineMaterial>this.lineGhostMaterial).pixelThreshold = 0.5
;(<SpeckleLineMaterial>this.lineGhostMaterial).resolution = new Vector2()
;(<SpeckleLineMaterial>this.lineGhostMaterial).toneMapped = false
;(<SpeckleLineMaterial>this.lineGhostMaterial).opacity = 0.1
;(<SpeckleLineMaterial>this.lineGhostMaterial).transparent = true
this.lineColoredMaterial = new SpeckleLineMaterial(
{