| "rimraf": "^5.0.1", | "rimraf": "^5.0.1", | ||||
| "rollup-plugin-glsl": "^1.3.0", | "rollup-plugin-glsl": "^1.3.0", | ||||
| "rollup-plugin-license": "^3.0.1", | "rollup-plugin-license": "^3.0.1", | ||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.157.1002/package.tgz", | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.157.1003/package.tgz", | |||||
| "tslib": "^2.5.0", | "tslib": "^2.5.0", | ||||
| "typedoc": "^0.27.5", | "typedoc": "^0.27.5", | ||||
| "typescript": "5.7.2", | "typescript": "5.7.2", | ||||
| "vitepress-plugin-nprogress": "^0.0.4" | "vitepress-plugin-nprogress": "^0.0.4" | ||||
| }, | }, | ||||
| "dependencies": { | "dependencies": { | ||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.157.1002/package.tgz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.157.1003/package.tgz", | |||||
| "@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", | ||||
| "popmotion": "^11.0.5" | "popmotion": "^11.0.5" | ||||
| }, | }, | ||||
| "peerDependencies": { | "peerDependencies": { | ||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.157.1002/package.tgz" | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.157.1003/package.tgz" | |||||
| }, | }, | ||||
| "peerDependenciesMeta": { | "peerDependenciesMeta": { | ||||
| "three": { | "three": { | ||||
| "dependencies": { | "dependencies": { | ||||
| "uiconfig.js": "^0.1.3", | "uiconfig.js": "^0.1.3", | ||||
| "ts-browser-helpers": "^0.16.2", | "ts-browser-helpers": "^0.16.2", | ||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.157.1002/package.tgz", | |||||
| "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.157.1002.tar.gz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.157.1002/package.tgz", | |||||
| "@types/three-f": "https://github.com/repalash/three-ts-types/archive/refs/tags/v0.157.1002.tar.gz", | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.157.1003/package.tgz", | |||||
| "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.157.1003.tar.gz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.157.1003/package.tgz", | |||||
| "@types/three-f": "https://github.com/repalash/three-ts-types/archive/refs/tags/v0.157.1003.tar.gz", | |||||
| "@types/three-pkg": "https://gitpkg.now.sh/repalash/three-ts-types/types/three?modded_three" | "@types/three-pkg": "https://gitpkg.now.sh/repalash/three-ts-types/types/three?modded_three" | ||||
| }, | }, | ||||
| "local_dependencies": { | "local_dependencies": { |
| if (ext.vertexColors !== undefined) o.vertexColors = ext.vertexColors // this is override, it is also set in GLTFLoader if geometry has vertex colors, todo: check how to do this in a better way | if (ext.vertexColors !== undefined) o.vertexColors = ext.vertexColors // this is override, it is also set in GLTFLoader if geometry has vertex colors, todo: check how to do this in a better way | ||||
| if (ext.alphaTest !== undefined) o.alphaTest = ext.alphaTest | if (ext.alphaTest !== undefined) o.alphaTest = ext.alphaTest | ||||
| if (ext.alphaHash !== undefined) o.alphaHash = ext.alphaHash | |||||
| // if (ext.transparent !== undefined) o.transparent = ext.transparent // this is set by GLTFLoader based on alpha mode | // if (ext.transparent !== undefined) o.transparent = ext.transparent // this is set by GLTFLoader based on alpha mode | ||||
| if (material.vertexColors !== undefined) dat.vertexColors = material.vertexColors // this is override, it is also set in GLTFLoader if geometry has vertex colors, todo: check how to do this in a better way | if (material.vertexColors !== undefined) dat.vertexColors = material.vertexColors // this is override, it is also set in GLTFLoader if geometry has vertex colors, todo: check how to do this in a better way | ||||
| if (material.alphaTest !== undefined) dat.alphaTest = material.alphaTest | if (material.alphaTest !== undefined) dat.alphaTest = material.alphaTest | ||||
| if (material.alphaHash !== undefined) dat.alphaHash = material.alphaHash | |||||
| if (material.envMapIntensity !== undefined) dat.envMapIntensity = material.envMapIntensity // for when separateEnvMapIntensity is true | if (material.envMapIntensity !== undefined) dat.envMapIntensity = material.envMapIntensity // for when separateEnvMapIntensity is true | ||||
| // if (material.envMapSlotKey !== undefined) dat.envMapSlotKey = material.envMapSlotKey // in userData | // if (material.envMapSlotKey !== undefined) dat.envMapSlotKey = material.envMapSlotKey // in userData |
| controls.listenToKeyEvents(elem) // optional // todo: make option for this | controls.listenToKeyEvents(elem) // optional // todo: make option for this | ||||
| // controls.enableKeys = true | // controls.enableKeys = true | ||||
| controls.screenSpacePanning = true | controls.screenSpacePanning = true | ||||
| controls.enableZoom = false | |||||
| return controls | return controls | ||||
| }]]) | }]]) | ||||
| setControlsCtor(key: string, ctor: TControlsCtor, replace = false): void { | setControlsCtor(key: string, ctor: TControlsCtor, replace = false): void { |
| stepSize: 0.001, | stepSize: 0.001, | ||||
| property: [material, 'alphaTest'], | property: [material, 'alphaTest'], | ||||
| }, | }, | ||||
| { | |||||
| type: 'checkbox', | |||||
| property: [material, 'alphaHash'], | |||||
| }, | |||||
| { | { | ||||
| type: 'checkbox', | type: 'checkbox', | ||||
| property: [material, 'dithering'], | property: [material, 'dithering'], |
| // wireframeLinecap: 'round', | // wireframeLinecap: 'round', | ||||
| // wireframeLinejoin: 'round', | // wireframeLinejoin: 'round', | ||||
| alphaTest: 0, | alphaTest: 0, | ||||
| alphaHash: false, | |||||
| // fog: true, | // fog: true, | ||||
| } | } | ||||
| export const iMaterialCommons = { | export const iMaterialCommons = { |
| if (material.side !== undefined) this.side = material.side ?? FrontSide | if (material.side !== undefined) this.side = material.side ?? FrontSide | ||||
| if (material.alphaMap !== undefined) this.alphaMap = material.alphaMap | if (material.alphaMap !== undefined) this.alphaMap = material.alphaMap | ||||
| if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest < 1e-4 ? 1e-4 : material.alphaTest | if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest < 1e-4 ? 1e-4 : material.alphaTest | ||||
| if (material.alphaHash !== undefined) this.alphaHash = material.alphaHash | |||||
| if (material.displacementMap !== undefined) this.displacementMap = material.displacementMap | if (material.displacementMap !== undefined) this.displacementMap = material.displacementMap | ||||
| if (material.displacementScale !== undefined) this.displacementScale = material.displacementScale | if (material.displacementScale !== undefined) this.displacementScale = material.displacementScale | ||||
| this.side = DoubleSide | this.side = DoubleSide | ||||
| this.alphaMap = null | this.alphaMap = null | ||||
| this.alphaTest = 0.001 | this.alphaTest = 0.001 | ||||
| this.alphaHash = false | |||||
| this.displacementMap = null | this.displacementMap = null | ||||
| this.displacementScale = 1 | this.displacementScale = 1 |
| if (material.side !== undefined) this.side = material.side ?? DoubleSide | if (material.side !== undefined) this.side = material.side ?? DoubleSide | ||||
| setMap('alphaMap') | setMap('alphaMap') | ||||
| if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest < 1e-4 ? 1e-4 : material.alphaTest | if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest < 1e-4 ? 1e-4 : material.alphaTest | ||||
| if (material.alphaHash !== undefined) this.alphaHash = material.alphaHash | |||||
| setMap('bumpMap') | setMap('bumpMap') | ||||
| if (material.bumpScale !== undefined) this.uniforms.bumpScale.value = material.bumpScale | if (material.bumpScale !== undefined) this.uniforms.bumpScale.value = material.bumpScale | ||||
| this.side = DoubleSide | this.side = DoubleSide | ||||
| this.uniforms.alphaMap.value = null | this.uniforms.alphaMap.value = null | ||||
| this.alphaTest = 0.001 | this.alphaTest = 0.001 | ||||
| this.alphaHash = false | |||||
| this.uniforms.bumpMap.value = null | this.uniforms.bumpMap.value = null | ||||
| this.uniforms.bumpScale.value = 1 | this.uniforms.bumpScale.value = 1 |
| if (material.bumpMap !== undefined) this.bumpMap = material.bumpMap | if (material.bumpMap !== undefined) this.bumpMap = material.bumpMap | ||||
| if (material.bumpScale !== undefined) this.bumpScale = material.bumpScale | if (material.bumpScale !== undefined) this.bumpScale = material.bumpScale | ||||
| // if (material.alphaMap !== undefined) this.alphaMap = material.alphaMap | // if (material.alphaMap !== undefined) this.alphaMap = material.alphaMap | ||||
| if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest | |||||
| if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest < 1e-4 ? 1e-4 : material.alphaTest | |||||
| if (material.alphaHash !== undefined) this.alphaHash = material.alphaHash | |||||
| if (material.normalMap !== undefined) this.normalMap = material.normalMap | if (material.normalMap !== undefined) this.normalMap = material.normalMap | ||||
| if (material.normalMapType !== undefined) this.normalMapType = material.normalMapType | if (material.normalMapType !== undefined) this.normalMapType = material.normalMapType |