fozmo-3d-preview
Advanced tools
Comparing version 1.0.16 to 1.0.18
@@ -13,2 +13,3 @@ import { BaseScene, BaseSceneConfig } from '../Base/BaseScene'; | ||
private _ssaaPass; | ||
private _gtaoPass; | ||
private _lutPass; | ||
@@ -15,0 +16,0 @@ private _bloomPass; |
@@ -20,2 +20,3 @@ import { EEncryptExt, ENormalExt, ResLoaderManager } from './../manager/ResLoaderManager'; | ||
import { SSAARenderPass } from 'three/examples/jsm/postprocessing/SSAARenderPass'; | ||
import { GTAOPass } from 'three/examples/jsm/postprocessing/GTAOPass'; | ||
CameraControls.install({ THREE }); | ||
@@ -98,4 +99,27 @@ /** | ||
SSAAsampleLevel: 4, | ||
SSAAunbiased: true | ||
SSAAunbiased: true, | ||
SSAAClearColor: 0xffffff, | ||
SSAAClearAlpha: 0, | ||
// gtao | ||
AOEnable: true, | ||
AOBlendIntensity: 1 | ||
}; | ||
const aoParameters = { | ||
radius: 0.25, | ||
distanceExponent: 1., | ||
thickness: 1., | ||
scale: 1., | ||
samples: 16, | ||
distanceFallOff: 1., | ||
screenSpaceRadius: false, | ||
}; | ||
const pdParameters = { | ||
lumaPhi: 10., | ||
depthPhi: 2., | ||
normalPhi: 3., | ||
radius: 4., | ||
radiusExponent: 1., | ||
rings: 2., | ||
samples: 16, | ||
}; | ||
const toneMappingOptions = { | ||
@@ -129,2 +153,3 @@ None: THREE.NoToneMapping, | ||
_ssaaPass; | ||
_gtaoPass; | ||
_lutPass; | ||
@@ -158,3 +183,3 @@ _bloomPass; | ||
this._orbitControl = orbitControls; | ||
this._orbitControl.truckSpeed = 0; | ||
// this._orbitControl.truckSpeed = 0; | ||
const padding = 0.05; | ||
@@ -181,2 +206,21 @@ this._orbitControl.fitToBox(this._model, true, { | ||
gui.width = 350; | ||
const ao = gui.addFolder('AO'); | ||
ao.add(params, 'AOEnable').onChange((v) => { | ||
this._gtaoPass.enabled = v; | ||
}); | ||
ao.add(params, 'AOBlendIntensity').min(0).max(1).step(0.01).onChange((v) => this._gtaoPass.blendIntensity = v); | ||
ao.add(aoParameters, 'radius').min(0.01).max(1).step(0.01).onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(aoParameters, 'distanceExponent').min(1).max(4).step(0.01).onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(aoParameters, 'thickness').min(0.01).max(10).step(0.01).onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(aoParameters, 'distanceFallOff').min(0).max(1).step(0.01).onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(aoParameters, 'scale').min(0.01).max(2.0).step(0.01).onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(aoParameters, 'samples').min(2).max(32).step(1).onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(aoParameters, 'screenSpaceRadius').onChange(() => this._gtaoPass.updateGtaoMaterial(aoParameters)); | ||
ao.add(pdParameters, 'lumaPhi').min(0).max(20).step(0.01).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
ao.add(pdParameters, 'depthPhi').min(0.01).max(20).step(0.01).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
ao.add(pdParameters, 'normalPhi').min(0.01).max(20).step(0.01).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
ao.add(pdParameters, 'radius').min(0).max(32).step(1).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
ao.add(pdParameters, 'radiusExponent').min(0.1).max(4.).step(0.1).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
ao.add(pdParameters, 'rings').min(1).max(16).step(0.125).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
ao.add(pdParameters, 'samples').min(2).max(32).step(1).onChange(() => this._gtaoPass.updatePdMaterial(pdParameters)); | ||
const aa = gui.addFolder('抗锯齿'); | ||
@@ -388,2 +432,7 @@ const smaa = aa.addFolder('SMAA Mobile'); | ||
this._bloomPass.enabled = params.bloomEnabled; | ||
this._gtaoPass = new GTAOPass(this.scene, this.camera, this.container.clientWidth, this.container.clientHeight); | ||
this._gtaoPass.output = GTAOPass.OUTPUT.Default; | ||
composer.addPass(this._gtaoPass); | ||
this._gtaoPass.updateGtaoMaterial(aoParameters); | ||
this._gtaoPass.updatePdMaterial(pdParameters); | ||
composer.addPass(new OutputPass()); | ||
@@ -390,0 +439,0 @@ const lutPass = new LUTPass({}); |
{ | ||
"name": "fozmo-3d-preview", | ||
"version": "1.0.16", | ||
"version": "1.0.18", | ||
"description": "风之末 作品预览", | ||
@@ -5,0 +5,0 @@ "main": "lib/Fozmo3DPreview.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159075
4870