| <excludeFolder url="file://$MODULE_DIR$/tmp" /> | <excludeFolder url="file://$MODULE_DIR$/tmp" /> | ||||
| <excludeFolder url="file://$MODULE_DIR$/docs" /> | <excludeFolder url="file://$MODULE_DIR$/docs" /> | ||||
| <excludeFolder url="file://$MODULE_DIR$/dist" /> | <excludeFolder url="file://$MODULE_DIR$/dist" /> | ||||
| <excludeFolder url="file://$MODULE_DIR$/lib" /> | |||||
| <excludeFolder url="file://$MODULE_DIR$/plugins/extra-importers/docs" /> | |||||
| <excludeFolder url="file://$MODULE_DIR$/plugins/blueprintjs/docs" /> | |||||
| <excludeFolder url="file://$MODULE_DIR$/plugins/tweakpane/docs" /> | |||||
| <excludeFolder url="file://$MODULE_DIR$/website/.vitepress/cache" /> | |||||
| </content> | </content> | ||||
| <orderEntry type="inheritedJdk" /> | <orderEntry type="inheritedJdk" /> | ||||
| <orderEntry type="sourceFolder" forTests="false" /> | <orderEntry type="sourceFolder" forTests="false" /> |
| import {MaterialConfiguratorPlugin, SwitchNodePlugin} from '@threepipe/plugin-configurator' | import {MaterialConfiguratorPlugin, SwitchNodePlugin} from '@threepipe/plugin-configurator' | ||||
| import {AWSClientPlugin, TransfrSharePlugin} from '@threepipe/plugin-network' | import {AWSClientPlugin, TransfrSharePlugin} from '@threepipe/plugin-network' | ||||
| import {GLTFDracoExportPlugin} from '@threepipe/plugin-gltf-transform' | import {GLTFDracoExportPlugin} from '@threepipe/plugin-gltf-transform' | ||||
| // @ts-expect-error todo fix | |||||
| // @ts-expect-error todo fix import | |||||
| import {BloomPlugin, DepthOfFieldPlugin, SSContactShadowsPlugin, SSReflectionPlugin, TemporalAAPlugin, VelocityBufferPlugin} from '@threepipe/webgi-plugins' | import {BloomPlugin, DepthOfFieldPlugin, SSContactShadowsPlugin, SSReflectionPlugin, TemporalAAPlugin, VelocityBufferPlugin} from '@threepipe/webgi-plugins' | ||||
| function checkQuery(key: string, def = true) { | function checkQuery(key: string, def = true) { | ||||
| // set it to true if you only have opaque objects in the scene to get better performance. | // set it to true if you only have opaque objects in the scene to get better performance. | ||||
| zPrepass: checkQuery('depthPrepass', checkQuery('zPrepass', false)), | zPrepass: checkQuery('depthPrepass', checkQuery('zPrepass', false)), | ||||
| dropzone: { | dropzone: { | ||||
| autoImport: true, | |||||
| autoAdd: true, | |||||
| addOptions: { | addOptions: { | ||||
| clearSceneObjects: false, // clear the scene before adding new objects on drop. | clearSceneObjects: false, // clear the scene before adding new objects on drop. | ||||
| }, | }, | ||||
| // disable fading on update | // disable fading on update | ||||
| viewer.getPlugin(FrameFadePlugin)!.isEditor = true | viewer.getPlugin(FrameFadePlugin)!.isEditor = true | ||||
| viewer.getPlugin(TemporalAAPlugin)!.stableNoise = true | viewer.getPlugin(TemporalAAPlugin)!.stableNoise = true | ||||
| const rt = viewer.getOrAddPluginSync(RenderTargetPreviewPlugin) | const rt = viewer.getOrAddPluginSync(RenderTargetPreviewPlugin) |
| { | { | ||||
| "name": "threepipe", | "name": "threepipe", | ||||
| "version": "0.0.34", | |||||
| "version": "0.0.35-dev", | |||||
| "lockfileVersion": 3, | "lockfileVersion": 3, | ||||
| "requires": true, | "requires": true, | ||||
| "packages": { | "packages": { | ||||
| "": { | "": { | ||||
| "name": "threepipe", | "name": "threepipe", | ||||
| "version": "0.0.34", | |||||
| "version": "0.0.35-dev", | |||||
| "license": "Apache-2.0", | "license": "Apache-2.0", | ||||
| "dependencies": { | "dependencies": { | ||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.153.1002/package.tgz", | "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.153.1002/package.tgz", | ||||
| "@types/wicg-file-system-access": "^2020.9.5", | "@types/wicg-file-system-access": "^2020.9.5", | ||||
| "popmotion": "^11.0.5", | "popmotion": "^11.0.5", | ||||
| "stats.js": "^0.17.0", | "stats.js": "^0.17.0", | ||||
| "ts-browser-helpers": "^0.16.1", | |||||
| "ts-browser-helpers": "^0.16.2", | |||||
| "uiconfig.js": "^0.1.2" | "uiconfig.js": "^0.1.2" | ||||
| }, | }, | ||||
| "devDependencies": { | "devDependencies": { | ||||
| }, | }, | ||||
| "optionalDependencies": { | "optionalDependencies": { | ||||
| "win-node-env": "^0.6.1" | "win-node-env": "^0.6.1" | ||||
| }, | |||||
| "peerDependencies": { | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.153.1006/package.tgz" | |||||
| }, | |||||
| "peerDependenciesMeta": { | |||||
| "three": { | |||||
| "optional": true | |||||
| } | |||||
| } | } | ||||
| }, | }, | ||||
| "node_modules/@75lb/deep-merge": { | "node_modules/@75lb/deep-merge": { | ||||
| } | } | ||||
| }, | }, | ||||
| "node_modules/ts-browser-helpers": { | "node_modules/ts-browser-helpers": { | ||||
| "version": "0.16.1", | |||||
| "resolved": "https://registry.npmjs.org/ts-browser-helpers/-/ts-browser-helpers-0.16.1.tgz", | |||||
| "integrity": "sha512-2IWya+H8ahKfrMVNrtu2fjjbCh/Y0NdddOnkuX4lGUc/xF7tFXZfM1eR/XKbGsC8/2VnL7LDj06Agl37EloBLQ==", | |||||
| "version": "0.16.2", | |||||
| "resolved": "https://registry.npmjs.org/ts-browser-helpers/-/ts-browser-helpers-0.16.2.tgz", | |||||
| "integrity": "sha512-4HHBBSML8e8Jve4Gba21gmgu6ARCVTKCnfjf01nV4V/ZEjExW9X5aJiHSyqlV2JWNlD7PQScljgMT0XyamnESA==", | |||||
| "license": "MIT", | "license": "MIT", | ||||
| "dependencies": { | "dependencies": { | ||||
| "@types/wicg-file-system-access": "^2020.9.5" | "@types/wicg-file-system-access": "^2020.9.5" |
| { | { | ||||
| "name": "threepipe", | "name": "threepipe", | ||||
| "version": "0.0.35-dev", | |||||
| "version": "0.0.35", | |||||
| "description": "A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.", | "description": "A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.", | ||||
| "main": "dist/index.js", | "main": "dist/index.js", | ||||
| "module": "dist/index.mjs", | "module": "dist/index.mjs", | ||||
| "./dist/": { | "./dist/": { | ||||
| "import": "./dist/", | "import": "./dist/", | ||||
| "require": "./dist/" | "require": "./dist/" | ||||
| }, | |||||
| "./lib": { | |||||
| "import": "./lib/index.js", | |||||
| "types": "./lib/index.d.ts" | |||||
| }, | |||||
| "./lib/": { | |||||
| "import": "./lib/", | |||||
| "require": "./lib/" | |||||
| } | } | ||||
| }, | }, | ||||
| "type": "module", | "type": "module", | ||||
| "@types/webxr": "^0.5.1", | "@types/webxr": "^0.5.1", | ||||
| "@types/wicg-file-system-access": "^2020.9.5", | "@types/wicg-file-system-access": "^2020.9.5", | ||||
| "stats.js": "^0.17.0", | "stats.js": "^0.17.0", | ||||
| "ts-browser-helpers": "^0.16.1", | |||||
| "ts-browser-helpers": "^0.16.2", | |||||
| "uiconfig.js": "^0.1.2", | "uiconfig.js": "^0.1.2", | ||||
| "popmotion": "^11.0.5" | "popmotion": "^11.0.5" | ||||
| }, | }, | ||||
| "//": { | "//": { | ||||
| "dependencies": { | "dependencies": { | ||||
| "uiconfig.js": "^0.1.2", | "uiconfig.js": "^0.1.2", | ||||
| "ts-browser-helpers": "^0.16.1", | |||||
| "ts-browser-helpers": "^0.16.2", | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.153.1006/package.tgz", | "three": "https://github.com/repalash/three.js-modded/releases/download/v0.153.1006/package.tgz", | ||||
| "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.153.1006.tar.gz", | "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.153.1006.tar.gz", | ||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.153.1002/package.tgz", | "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.153.1002/package.tgz", |
| "threepipe": "file:./../../src/" | "threepipe": "file:./../../src/" | ||||
| }, | }, | ||||
| "devDependencies": { | "devDependencies": { | ||||
| "uiconfig-blueprint": "0.1.0-dev.4" | |||||
| "uiconfig-blueprint": "0.1.0-dev.5" | |||||
| } | } | ||||
| }, | }, | ||||
| "../../src": {}, | "../../src": {}, | ||||
| "node": ">=0.10.0" | "node": ">=0.10.0" | ||||
| } | } | ||||
| }, | }, | ||||
| "node_modules/react-colorful": { | |||||
| "version": "5.6.1", | |||||
| "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.6.1.tgz", | |||||
| "integrity": "sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==", | |||||
| "dev": true, | |||||
| "license": "MIT", | |||||
| "peerDependencies": { | |||||
| "react": ">=16.8.0", | |||||
| "react-dom": ">=16.8.0" | |||||
| } | |||||
| }, | |||||
| "node_modules/react-dom": { | "node_modules/react-dom": { | ||||
| "version": "18.3.1", | "version": "18.3.1", | ||||
| "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", | "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", | ||||
| "link": true | "link": true | ||||
| }, | }, | ||||
| "node_modules/ts-browser-helpers": { | "node_modules/ts-browser-helpers": { | ||||
| "version": "0.16.1", | |||||
| "resolved": "https://registry.npmjs.org/ts-browser-helpers/-/ts-browser-helpers-0.16.1.tgz", | |||||
| "integrity": "sha512-2IWya+H8ahKfrMVNrtu2fjjbCh/Y0NdddOnkuX4lGUc/xF7tFXZfM1eR/XKbGsC8/2VnL7LDj06Agl37EloBLQ==", | |||||
| "version": "0.16.2", | |||||
| "resolved": "https://registry.npmjs.org/ts-browser-helpers/-/ts-browser-helpers-0.16.2.tgz", | |||||
| "integrity": "sha512-4HHBBSML8e8Jve4Gba21gmgu6ARCVTKCnfjf01nV4V/ZEjExW9X5aJiHSyqlV2JWNlD7PQScljgMT0XyamnESA==", | |||||
| "dev": true, | "dev": true, | ||||
| "license": "MIT", | "license": "MIT", | ||||
| "dependencies": { | "dependencies": { | ||||
| "license": "0BSD" | "license": "0BSD" | ||||
| }, | }, | ||||
| "node_modules/uiconfig-blueprint": { | "node_modules/uiconfig-blueprint": { | ||||
| "version": "0.1.0-dev.4", | |||||
| "resolved": "https://registry.npmjs.org/uiconfig-blueprint/-/uiconfig-blueprint-0.1.0-dev.4.tgz", | |||||
| "integrity": "sha512-ugXTrrLbkCkWoI7DLBXDZl4JrmIQwPRe7zfEYov126OOTe8+fpea5okIrl7NtXnUwYlGJ3DRSrF1zrQvzF1Bag==", | |||||
| "version": "0.1.0-dev.5", | |||||
| "resolved": "https://registry.npmjs.org/uiconfig-blueprint/-/uiconfig-blueprint-0.1.0-dev.5.tgz", | |||||
| "integrity": "sha512-ERj0t4MIPa/77ktWxRjar8z9Ke51RlLlR94QftBB009DOm9Hx5BCYaAhrVJVjM3wolLlfCcFbPIbiw0MxyLkWw==", | |||||
| "dev": true, | "dev": true, | ||||
| "license": "Apache-2.0", | "license": "Apache-2.0", | ||||
| "dependencies": { | "dependencies": { | ||||
| "@blueprintjs/icons": "^5.11.0", | "@blueprintjs/icons": "^5.11.0", | ||||
| "@blueprintjs/select": "^5.2.2", | "@blueprintjs/select": "^5.2.2", | ||||
| "blueprint-styler": "^5.0.2", | "blueprint-styler": "^5.0.2", | ||||
| "ts-browser-helpers": "^0.16.1", | |||||
| "react-colorful": "^5.6.1", | |||||
| "ts-browser-helpers": "^0.16.2", | |||||
| "uiconfig.js": "^0.1.2" | "uiconfig.js": "^0.1.2" | ||||
| }, | }, | ||||
| "peerDependencies": { | "peerDependencies": { | ||||
| "@types/three": "^0.152.1", | "@types/three": "^0.152.1", | ||||
| "@types/webxr": "^0.5.10", | "@types/webxr": "^0.5.10", | ||||
| "react": "^18.2.0", | "react": "^18.2.0", | ||||
| "react-colorful": "^5.6.1", | |||||
| "react-dom": "^18.2.0" | "react-dom": "^18.2.0" | ||||
| }, | }, | ||||
| "peerDependenciesMeta": { | "peerDependenciesMeta": { | ||||
| "react": { | "react": { | ||||
| "optional": true | "optional": true | ||||
| }, | }, | ||||
| "react-colorful": { | |||||
| "optional": true | |||||
| }, | |||||
| "react-dom": { | "react-dom": { | ||||
| "optional": true | "optional": true | ||||
| } | } |
| "description": "Blueprint.js UI Plugin for ThreePipe", | "description": "Blueprint.js UI Plugin for ThreePipe", | ||||
| "version": "0.3.0", | "version": "0.3.0", | ||||
| "devDependencies": { | "devDependencies": { | ||||
| "uiconfig-blueprint": "0.1.0-dev.4" | |||||
| "uiconfig-blueprint": "0.1.0-dev.5" | |||||
| }, | }, | ||||
| "dependencies": { | "dependencies": { | ||||
| "threepipe": "file:./../../src/" | "threepipe": "file:./../../src/" | ||||
| "replace": { | "replace": { | ||||
| "dependencies": {}, | "dependencies": {}, | ||||
| "peerDependencies": { | "peerDependencies": { | ||||
| "threepipe": "^0.0.34" | |||||
| "threepipe": "^0.0.35" | |||||
| } | } | ||||
| } | } | ||||
| }, | }, |
| protected _viewer?: ThreeViewer | protected _viewer?: ThreeViewer | ||||
| private _lastManager?: UndoManagerPlugin['undoManager'] | |||||
| private _lastManager?: BlueprintJsUiPlugin['undoManager'] | |||||
| onAdded(viewer: ThreeViewer): void { | onAdded(viewer: ThreeViewer): void { | ||||
| this._viewer = viewer | this._viewer = viewer | ||||
| viewer.addEventListener('preFrame', this._preFrame) | viewer.addEventListener('preFrame', this._preFrame) | ||||
| viewer.addEventListener('postFrame', this._postFrame) | viewer.addEventListener('postFrame', this._postFrame) | ||||
| const undo = viewer.getOrAddPluginSync(UndoManagerPlugin) // yes, manual dependency | const undo = viewer.getOrAddPluginSync(UndoManagerPlugin) // yes, manual dependency | ||||
| if (undo?.undoManager) { | |||||
| const manager = undo?.undoManager | |||||
| if (manager) { | |||||
| this._lastManager?.dispose() | this._lastManager?.dispose() | ||||
| this._lastManager = this.undoManager | this._lastManager = this.undoManager | ||||
| this.undoManager = undo.undoManager | |||||
| if (this._lastManager) Object.assign(this.undoManager.presets, this._lastManager.presets) | |||||
| this.undoManager = manager | |||||
| if (this._lastManager) Object.assign(manager.presets, this._lastManager.presets) | |||||
| } | } | ||||
| } | } | ||||
| onRemove(viewer: ThreeViewer): void { | onRemove(viewer: ThreeViewer): void { |
| { | { | ||||
| "name": "@threepipe/plugin-gaussian-splatting", | "name": "@threepipe/plugin-gaussian-splatting", | ||||
| "description": "Gaussian Splatting for Threepipe", | "description": "Gaussian Splatting for Threepipe", | ||||
| "version": "0.2.2", | |||||
| "version": "0.2.3", | |||||
| "devDependencies": { | "devDependencies": { | ||||
| "comlink": "^4.4.1", | "comlink": "^4.4.1", | ||||
| "@types/emscripten": "^1.39.10" | "@types/emscripten": "^1.39.10" | ||||
| "replace": { | "replace": { | ||||
| "dependencies": {}, | "dependencies": {}, | ||||
| "peerDependencies": { | "peerDependencies": { | ||||
| "threepipe": "^0.0.23" | |||||
| "threepipe": "^0.0.35" | |||||
| } | } | ||||
| } | } | ||||
| }, | }, |
| readonly isGaussianSplatGeometry = true | readonly isGaussianSplatGeometry = true | ||||
| assetType: 'geometry' // dont set the value here since its checked in upgradeGeometry | assetType: 'geometry' // dont set the value here since its checked in upgradeGeometry | ||||
| center2 = iGeometryCommons.center2 | |||||
| setDirty = iGeometryCommons.setDirty | setDirty = iGeometryCommons.setDirty | ||||
| refreshUi = iGeometryCommons.refreshUi | refreshUi = iGeometryCommons.refreshUi | ||||
| appliedMeshes = new Set<IObject3D>() | appliedMeshes = new Set<IObject3D>() |
| } | } | ||||
| export interface LoadFileOptions { | export interface LoadFileOptions { | ||||
| fileHandler?: any, // custom {@link ILoader} for the file | |||||
| /** | |||||
| * The custom {@link ILoader} to use for the file. If not specified, the importer will try to determine the loader from the file extension. | |||||
| */ | |||||
| fileHandler?: any, | |||||
| /** | /** | ||||
| * Query string to add to the url. Default = undefined | * Query string to add to the url. Default = undefined | ||||
| */ | */ | ||||
| queryString?: string, | queryString?: string, | ||||
| rootPath?: string, // internal use | |||||
| /** | |||||
| * for internal use | |||||
| */ | |||||
| rootPath?: string, | |||||
| } | } | ||||
| export interface ImportFilesOptions extends ProcessRawOptions, LoadFileOptions {allowedExtensions?: string[]} | |||||
| export interface ImportFilesOptions extends ProcessRawOptions, LoadFileOptions { | |||||
| /** | |||||
| * Allowed file extensions. If undefined, all files are allowed. | |||||
| */ | |||||
| allowedExtensions?: string[] | |||||
| } | |||||
| export interface ImportAssetOptions extends ProcessRawOptions, LoadFileOptions { | export interface ImportAssetOptions extends ProcessRawOptions, LoadFileOptions { | ||||
| /** | /** |
| export class BufferGeometry2<Attributes extends NormalOrGLBufferAttributes = NormalBufferAttributes> extends BufferGeometry<Attributes, IGeometryEvent, IGeometryEventTypes> implements IGeometry<Attributes> { | export class BufferGeometry2<Attributes extends NormalOrGLBufferAttributes = NormalBufferAttributes> extends BufferGeometry<Attributes, IGeometryEvent, IGeometryEventTypes> implements IGeometry<Attributes> { | ||||
| assetType: 'geometry' // dont set the value here since its checked in upgradeGeometry | assetType: 'geometry' // dont set the value here since its checked in upgradeGeometry | ||||
| center2 = iGeometryCommons.center2 | |||||
| setDirty = iGeometryCommons.setDirty | setDirty = iGeometryCommons.setDirty | ||||
| refreshUi = iGeometryCommons.refreshUi | refreshUi = iGeometryCommons.refreshUi | ||||
| appliedMeshes = new Set<IObject3D>() | appliedMeshes = new Set<IObject3D>() |
| return material | return material | ||||
| } | } | ||||
| protected _refreshMaterial(): boolean { | |||||
| if (!this._viewer) return false | |||||
| if (this.isDisabled()) return false | |||||
| const mat = this._material ?? this._createMaterial() | |||||
| const isNewMaterial = this._mesh.material !== this._material | |||||
| if (isNewMaterial) { // new material | |||||
| protected _refreshMaterial() { | |||||
| if (!this._viewer) return | |||||
| if (this.isDisabled()) return | |||||
| if (!this._material) { // new material | |||||
| // this._removeMaterial() | // this._removeMaterial() | ||||
| this._material = mat | |||||
| this._material = this._createMaterial() | |||||
| // const id = this._material?.uuid | // const id = this._material?.uuid | ||||
| // if (!id) console.warn('No material found for ground') | // if (!id) console.warn('No material found for ground') | ||||
| this._viewer.scene.setDirty() | this._viewer.scene.setDirty() | ||||
| // } | // } | ||||
| } | } | ||||
| this._viewer.setDirty(this) // todo: something else also? | this._viewer.setDirty(this) // todo: something else also? | ||||
| return isNewMaterial | |||||
| return | |||||
| } | } | ||||
| get material() { | get material() { |
| import {onChange, serialize} from 'ts-browser-helpers' | |||||
| import {getOrCall, onChange, serialize} from 'ts-browser-helpers' | |||||
| import { | import { | ||||
| BasicDepthPacking, | BasicDepthPacking, | ||||
| Color, | Color, | ||||
| import {uiPanelContainer, uiSlider, uiToggle} from 'uiconfig.js' | import {uiPanelContainer, uiSlider, uiToggle} from 'uiconfig.js' | ||||
| import {HVBlurHelper} from '../../three/utils/HVBlurHelper' | import {HVBlurHelper} from '../../three/utils/HVBlurHelper' | ||||
| import {shaderReplaceString} from '../../utils' | import {shaderReplaceString} from '../../utils' | ||||
| import {PhysicalMaterial} from '../../core' | |||||
| @uiPanelContainer('Contact Shadow Ground') | @uiPanelContainer('Contact Shadow Ground') | ||||
| export class ContactShadowGroundPlugin extends BaseGroundPlugin { | export class ContactShadowGroundPlugin extends BaseGroundPlugin { | ||||
| } | } | ||||
| onRemove(viewer: ThreeViewer): void { | onRemove(viewer: ThreeViewer): void { | ||||
| const target = this._depthPass?.target | |||||
| const target = getOrCall(this._depthPass?.target) | |||||
| if (target) this._viewer?.renderManager.disposeTarget(target) | if (target) this._viewer?.renderManager.disposeTarget(target) | ||||
| this._depthPass?.dispose() | this._depthPass?.dispose() | ||||
| this._depthPass = undefined | this._depthPass = undefined | ||||
| this._depthPass.camera = this.shadowCamera | this._depthPass.camera = this.shadowCamera | ||||
| this._depthPass.render(this._viewer.renderManager.renderer, null) | this._depthPass.render(this._viewer.renderManager.renderer, null) | ||||
| const blurTarget = this._viewer.renderManager.getTempTarget<IRenderTarget&WebGLRenderTarget>({ | |||||
| const target = getOrCall(this._depthPass.target) | |||||
| if (!target) return | |||||
| const blurTarget = this._viewer.renderManager.getTempTarget<IRenderTarget & WebGLRenderTarget>({ | |||||
| type: UnsignedByteType, | type: UnsignedByteType, | ||||
| format: RGBAFormat, | format: RGBAFormat, | ||||
| colorSpace: NoColorSpace, | colorSpace: NoColorSpace, | ||||
| magFilter: LinearFilter, | magFilter: LinearFilter, | ||||
| // isAntialiased: this._viewer.isAntialiased, | // isAntialiased: this._viewer.isAntialiased, | ||||
| }) | }) | ||||
| this._blurHelper.blur(this._depthPass.target.texture, this._depthPass.target, blurTarget, this.blurAmount / 256) | |||||
| this._blurHelper.blur(this._depthPass.target.texture, this._depthPass.target, blurTarget, 0.4 * this.blurAmount / 256) | |||||
| this._blurHelper.blur(target.texture, target, blurTarget, this.blurAmount / 256) | |||||
| this._blurHelper.blur(target.texture, target, blurTarget, 0.4 * this.blurAmount / 256) | |||||
| this._viewer.renderManager.releaseTempTarget(blurTarget) | this._viewer.renderManager.releaseTempTarget(blurTarget) | ||||
| } | } | ||||
| protected _refreshTransform() { | protected _refreshTransform() { | ||||
| protected _removeMaterial() { | protected _removeMaterial() { | ||||
| if (!this._material) return | if (!this._material) return | ||||
| // todo: remove map or render target thats assigned | |||||
| this._material.alphaMap = null | |||||
| if (this._material.userData.ssreflDisabled) delete this._material.userData.ssreflDisabled | |||||
| if (this._material.userData.ssreflNonPhysical) delete this._material.userData.ssreflNonPhysical | |||||
| super._removeMaterial() | super._removeMaterial() | ||||
| } | } | ||||
| super.refresh() | super.refresh() | ||||
| } | } | ||||
| protected _refreshMaterial(): boolean { | |||||
| protected _createMaterial(material?: PhysicalMaterial): PhysicalMaterial { | |||||
| const mat = super._createMaterial(material) | |||||
| mat.roughness = 1 | |||||
| mat.metalness = 0 | |||||
| mat.color.set(0x111111) | |||||
| mat.transparent = true | |||||
| mat.userData.ssreflDisabled = true | |||||
| mat.userData.ssreflNonPhysical = false | |||||
| // mat.userData.inverseAlphaMap = false // this must be false, if getting inverted colors, check clear color of gbuffer render pass. | |||||
| return mat | |||||
| } | |||||
| protected _refreshMaterial() { | |||||
| if (!this._viewer) return false | if (!this._viewer) return false | ||||
| const isNewMaterial = super._refreshMaterial() | const isNewMaterial = super._refreshMaterial() | ||||
| if (!this._material) return isNewMaterial | if (!this._material) return isNewMaterial | ||||
| this._material.alphaMap = this._depthPass?.target.texture || null | |||||
| if (isNewMaterial) { | |||||
| this._material.roughness = 1 | |||||
| this._material.metalness = 0 | |||||
| this._material.color.set(0x111111) | |||||
| this._material.transparent = true | |||||
| this._material.userData.ssreflDisabled = true // todo: unset this in remove material. | |||||
| this._material.userData.ssreflNonPhysical = false | |||||
| // this._material.materialObject.userData.inverseAlphaMap = false // this must be false, if getting inverted colors, check clear color of gbuffer render pass. | |||||
| } | |||||
| this._material.alphaMap = getOrCall(this._depthPass?.target)?.texture || null | |||||
| return isNewMaterial | return isNewMaterial | ||||
| } | } | ||||
| } | } |
| import {serialize} from 'ts-browser-helpers' | import {serialize} from 'ts-browser-helpers' | ||||
| export interface DropzonePluginOptions { | export interface DropzonePluginOptions { | ||||
| /** | |||||
| * The DOM element to attach the dropzone to. | |||||
| */ | |||||
| domElement?: HTMLElement | domElement?: HTMLElement | ||||
| /** | |||||
| * Allowed file extensions. If undefined, all files are allowed. | |||||
| */ | |||||
| allowedExtensions?: string[] | allowedExtensions?: string[] | ||||
| /** | |||||
| * Automatically import assets when dropped. | |||||
| * @default true | |||||
| */ | |||||
| autoImport?: boolean | autoImport?: boolean | ||||
| /** | |||||
| * Automatically add dropped and imported assets to the scene. | |||||
| * Works only if {@link autoImport} is true. | |||||
| * @default true | |||||
| */ | |||||
| autoAdd?: boolean | autoAdd?: boolean | ||||
| /** | |||||
| * Import options for the {@link AssetImporter.importFiles}, used when importing files. | |||||
| */ | |||||
| importOptions?: ImportFilesOptions | importOptions?: ImportFilesOptions | ||||
| /** | |||||
| * Add options for the {@link RootScene.addObject}, used when adding assets to the scene. | |||||
| */ | |||||
| addOptions?: AddAssetOptions | addOptions?: AddAssetOptions | ||||
| } | } | ||||
| export const VERSION = '0.0.34' | |||||
| export const VERSION = '0.0.35-dev' |