Skip to content

Commit

Permalink
fix: sector parser test now properly computes color data override tex…
Browse files Browse the repository at this point in the history
  • Loading branch information
christjt authored Aug 30, 2022
1 parent f6a9817 commit 306cb77
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 337 deletions.
22 changes: 2 additions & 20 deletions viewer/packages/sector-parser/app/SectorParser.VisualTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export default class SectorParserVisualTestFixture extends SimpleVisualTestFixtu

const group = this.initializeGroup(scene);

const materialMap = this.setMaterialMap();

const loader = new GltfSectorParser();

const gltfOutput = (await modelMetadataProvider.getModelOutputs(modelIdentifier)).find(
Expand All @@ -26,6 +24,8 @@ export default class SectorParserVisualTestFixture extends SimpleVisualTestFixtu
const modelUri = await modelMetadataProvider.getModelUri(modelIdentifier, gltfOutput);
const sceneJson = await modelDataProvider.getJsonFile(modelUri, 'scene.json');

const materialMap = TestMaterials.getMaterialsMap((sceneJson.maxTreeIndex as number) + 1);

const sectors = sceneJson.sectors as [
{
sectorFileName: string;
Expand Down Expand Up @@ -75,24 +75,6 @@ export default class SectorParserVisualTestFixture extends SimpleVisualTestFixtu
);
}

private setMaterialMap(): Map<RevealGeometryCollectionType, THREE.RawShaderMaterial> {
return new Map([
[RevealGeometryCollectionType.BoxCollection, TestMaterials.createBoxMaterial()],
[RevealGeometryCollectionType.CircleCollection, TestMaterials.createCircleMaterial()],
[RevealGeometryCollectionType.ConeCollection, TestMaterials.createConeMaterial()],
[RevealGeometryCollectionType.EccentricConeCollection, TestMaterials.createEccentricConeMaterial()],
[RevealGeometryCollectionType.EllipsoidSegmentCollection, TestMaterials.createEllipsoidSegmentMaterial()],
[RevealGeometryCollectionType.GeneralCylinderCollection, TestMaterials.createGeneralCylinderMaterial()],
[RevealGeometryCollectionType.GeneralRingCollection, TestMaterials.createGeneralRingMaterial()],
[RevealGeometryCollectionType.QuadCollection, TestMaterials.createQuadMaterial()],
[RevealGeometryCollectionType.TorusSegmentCollection, TestMaterials.createTorusSegmentMaterial()],
[RevealGeometryCollectionType.TrapeziumCollection, TestMaterials.createTrapeziumMaterial()],
[RevealGeometryCollectionType.NutCollection, TestMaterials.createNutMaterial()],
[RevealGeometryCollectionType.TriangleMesh, TestMaterials.createTriangleMeshMaterial()],
[RevealGeometryCollectionType.InstanceMesh, TestMaterials.createInstancedMeshMaterial()]
]);
}

private initializeGroup(scene: THREE.Scene) {
const group = new THREE.Group();
group.frustumCulled = false;
Expand Down
Loading

0 comments on commit 306cb77

Please sign in to comment.