Skip to content

Commit

Permalink
Custom polygon material (#168)
Browse files Browse the repository at this point in the history
* Bumb BabylonJS version to 7.24
Remove material plugins and add custom material for polygon meshes

* Replace number literals with named constants, remove commented code
  • Loading branch information
XanthosXanthopoulos authored Sep 25, 2024
1 parent 930c165 commit 593ef2b
Show file tree
Hide file tree
Showing 23 changed files with 425 additions and 441 deletions.
8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@
"typescript": "4.7.4",
"vite-plugin-dts": "^3.3.1"
},
"dependenciesMeta": {
"@babylonjs/core@5.42.0": {
"unplugged": true
},
"@babylonjs/materials@5.42.0": {
"unplugged": true
}
},
"dependencies": {
"node-sass": "^9.0.0",
"svelte-preprocess": "^5.0.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"lint:fix": "yarn g:eslint './src/**/*.{ts,tsx}' --fix"
},
"dependencies": {
"@babylonjs/core": "7.0.0",
"@babylonjs/core": "^7.26.0",
"@tiledb-inc/tiledb-cloud": "1.0.15-alpha.1"
},
"devDependencies": {
Expand Down
18 changes: 9 additions & 9 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
"lint:fix": "yarn g:eslint './src/**/*.{ts,tsx}' --fix"
},
"dependencies": {
"@babylonjs/core": "7.0.0",
"@babylonjs/gui": "7.0.0",
"@babylonjs/gui-editor": "7.0.0",
"@babylonjs/inspector": "7.0.0",
"@babylonjs/loaders": "7.0.0",
"@babylonjs/materials": "7.0.0",
"@babylonjs/serializers": "7.0.0",
"@babylonjs/core": "^7.26.0",
"@babylonjs/gui": "^7.26.0",
"@babylonjs/gui-editor": "^7.26.0",
"@babylonjs/inspector": "^7.26.0",
"@babylonjs/loaders": "^7.26.0",
"@babylonjs/materials": "^7.26.0",
"@babylonjs/serializers": "^7.26.0",
"@tiledb-inc/tiledb-cloud": "1.0.15-alpha.1",
"@tiledb-inc/viz-common": "workspace:packages/common",
"@tiledb-inc/viz-components": "workspace:packages/components",
"@tiledb-inc/wkx": "https://github.com/TileDB-Inc/wkx",
"axios": "^0.21.1",
"babylonjs-gui": "7.0.0",
"babylonjs-materials": "7.0.0",
"babylonjs-gui": "^7.26.0",
"babylonjs-materials": "^7.26.0",
"earcut": "2.2.4",
"geometry-extrude": "0.2.1",
"idb": "^7.0.2",
Expand Down
10 changes: 8 additions & 2 deletions packages/core/src/base/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Engine, Scene, SceneLoader, WebGPUEngine } from '@babylonjs/core';
import {
AbstractEngine,
Engine,
Scene,
SceneLoader,
WebGPUEngine
} from '@babylonjs/core';
import '@babylonjs/loaders/glTF';
import '@babylonjs/core/Debug/debugLayer';
import '@babylonjs/inspector';
Expand Down Expand Up @@ -39,7 +45,7 @@ export class TileDBVisualization {
width: string;
height: string;
canvas?: HTMLCanvasElement;
engine?: Engine;
engine?: AbstractEngine;
wheelPrecision: number;
moveSpeed: number;
inspector?: boolean;
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/point-cloud/pipelines/high-quality-splats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class SPSHighQualitySplats {
const depthRenderTarget = new RenderTargetTexture(
'LinearDepthRenderTarget',
{
width: this.scene.getEngine()._gl.canvas.width,
height: this.scene.getEngine()._gl.canvas.height
width: this.scene.getEngine().getRenderWidth(),
height: this.scene.getEngine().getRenderHeight()
},
this.scene,
{
Expand All @@ -41,8 +41,8 @@ export class SPSHighQualitySplats {
const additiveColorRenderTarget = new RenderTargetTexture(
'additiveColorRenderTarget',
{
width: this.scene.getEngine()._gl.canvas.width,
height: this.scene.getEngine()._gl.canvas.height
width: this.scene.getEngine().getRenderWidth(),
height: this.scene.getEngine().getRenderHeight()
},
this.scene,
{
Expand All @@ -63,7 +63,7 @@ export class SPSHighQualitySplats {
throw new Error('Render target initialization failed');
}

depthRenderTarget.renderTarget._shareDepth(
depthRenderTarget.renderTarget.shareDepth(
additiveColorRenderTarget.renderTarget
);

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/point-cloud/utils/particle-shader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AbstractEngine,
Effect,
Engine,
PostProcess,
Scene,
ShaderMaterial
Expand Down Expand Up @@ -155,7 +155,7 @@ class ParticleShaderMaterial {
scene: Scene,
model: ArrayModel,
options: TileDBPointCloudOptions,
engine?: Engine
engine?: AbstractEngine
) {
if (scene.activeCameras) {
if (engine) {
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/tile/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const HIGHLIGHTED_STATE = 1;
export const SELECTED_STATE = 2;
export const COLOR_GROUPS = 32;
export const MAX_CATEGORIES = 192;
165 changes: 0 additions & 165 deletions packages/core/src/tile/materials/plugins/categoricalPlugin.ts

This file was deleted.

78 changes: 0 additions & 78 deletions packages/core/src/tile/materials/plugins/selectionPlugin.ts

This file was deleted.

Loading

0 comments on commit 593ef2b

Please sign in to comment.