Przeglądaj źródła

Add alphaHash, three ref update for orbit ortho zoom fix.

master
Palash Bansal 1 rok temu
rodzic
commit
b3bb9e589d
No account linked to committer's email address

+ 7
- 7
package.json Wyświetl plik

@@ -108,7 +108,7 @@
"rimraf": "^5.0.1",
"rollup-plugin-glsl": "^1.3.0",
"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",
"typedoc": "^0.27.5",
"typescript": "5.7.2",
@@ -119,7 +119,7 @@
"vitepress-plugin-nprogress": "^0.0.4"
},
"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/wicg-file-system-access": "^2020.9.5",
"stats.js": "^0.17.0",
@@ -128,7 +128,7 @@
"popmotion": "^11.0.5"
},
"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": {
"three": {
@@ -139,10 +139,10 @@
"dependencies": {
"uiconfig.js": "^0.1.3",
"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"
},
"local_dependencies": {

+ 2
- 0
src/assetmanager/gltf/GLTFMaterialExtrasExtension.ts Wyświetl plik

@@ -45,6 +45,7 @@ export class GLTFMaterialExtrasExtension {

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.alphaHash !== undefined) o.alphaHash = ext.alphaHash

// if (ext.transparent !== undefined) o.transparent = ext.transparent // this is set by GLTFLoader based on alpha mode

@@ -158,6 +159,7 @@ export class GLTFMaterialExtrasExtension {

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.alphaHash !== undefined) dat.alphaHash = material.alphaHash

if (material.envMapIntensity !== undefined) dat.envMapIntensity = material.envMapIntensity // for when separateEnvMapIntensity is true
// if (material.envMapSlotKey !== undefined) dat.envMapSlotKey = material.envMapSlotKey // in userData

+ 0
- 1
src/core/camera/OrthographicCamera2.ts Wyświetl plik

@@ -290,7 +290,6 @@ export class OrthographicCamera2<TE extends ICameraEventMap = ICameraEventMap> e
controls.listenToKeyEvents(elem) // optional // todo: make option for this
// controls.enableKeys = true
controls.screenSpacePanning = true
controls.enableZoom = false
return controls
}]])
setControlsCtor(key: string, ctor: TControlsCtor, replace = false): void {

+ 4
- 0
src/core/material/IMaterialUi.ts Wyświetl plik

@@ -122,6 +122,10 @@ export const iMaterialUI = {
stepSize: 0.001,
property: [material, 'alphaTest'],
},
{
type: 'checkbox',
property: [material, 'alphaHash'],
},
{
type: 'checkbox',
property: [material, 'dithering'],

+ 1
- 0
src/core/material/iMaterialCommons.ts Wyświetl plik

@@ -70,6 +70,7 @@ export const threeMaterialPropList = {
// wireframeLinecap: 'round',
// wireframeLinejoin: 'round',
alphaTest: 0,
alphaHash: false,
// fog: true,
}
export const iMaterialCommons = {

+ 2
- 0
src/plugins/pipeline/DepthBufferPlugin.ts Wyświetl plik

@@ -196,6 +196,7 @@ class MeshDepthMaterialOverride extends MeshDepthMaterial {
if (material.side !== undefined) this.side = material.side ?? FrontSide
if (material.alphaMap !== undefined) this.alphaMap = material.alphaMap
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.displacementScale !== undefined) this.displacementScale = material.displacementScale
@@ -219,6 +220,7 @@ class MeshDepthMaterialOverride extends MeshDepthMaterial {
this.side = DoubleSide
this.alphaMap = null
this.alphaTest = 0.001
this.alphaHash = false

this.displacementMap = null
this.displacementScale = 1

+ 2
- 0
src/plugins/pipeline/GBufferPlugin.ts Wyświetl plik

@@ -383,6 +383,7 @@ export class GBufferMaterial extends ShaderMaterial2 {
if (material.side !== undefined) this.side = material.side ?? DoubleSide
setMap('alphaMap')
if (material.alphaTest !== undefined) this.alphaTest = material.alphaTest < 1e-4 ? 1e-4 : material.alphaTest
if (material.alphaHash !== undefined) this.alphaHash = material.alphaHash

setMap('bumpMap')
if (material.bumpScale !== undefined) this.uniforms.bumpScale.value = material.bumpScale
@@ -464,6 +465,7 @@ export class GBufferMaterial extends ShaderMaterial2 {
this.side = DoubleSide
this.uniforms.alphaMap.value = null
this.alphaTest = 0.001
this.alphaHash = false

this.uniforms.bumpMap.value = null
this.uniforms.bumpScale.value = 1

+ 2
- 1
src/plugins/pipeline/NormalBufferPlugin.ts Wyświetl plik

@@ -124,7 +124,8 @@ class MeshNormalMaterialOverride extends MeshNormalMaterial {
if (material.bumpMap !== undefined) this.bumpMap = material.bumpMap
if (material.bumpScale !== undefined) this.bumpScale = material.bumpScale
// 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.normalMapType !== undefined) this.normalMapType = material.normalMapType

Ładowanie…
Anuluj
Zapisz