@xviewer.js/postprocessing 1.0.0-alpha.11 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +9 -76
- package/dist/main.js.map +1 -1
- package/dist/module.js +11 -78
- package/dist/module.js.map +1 -1
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Plugin
|
|
2
|
-
import { RenderPass, EffectPass, EffectComposer,
|
|
1
|
+
import { Plugin } from '@xviewer.js/core';
|
|
2
|
+
import { RenderPass, EffectPass, EffectComposer, ToneMappingEffect, BloomEffect, BlendFunction, FXAAEffect, SMAAPreset, SMAAEffect, Pass, Effect, Selection, NormalPass } from 'postprocessing';
|
|
3
3
|
import { HalfFloatType, ShaderChunk, ShaderLib, UniformsUtils, ShaderMaterial, Uniform, Vector2, Matrix4, Vector3, NoBlending, GLSL3, FramebufferTexture, LinearFilter, Clock, Quaternion, WebGLRenderTarget, NearestFilter, DataTexture, RGBAFormat, FloatType, ClampToEdgeWrapping, LinearMipMapLinearFilter, EquirectangularReflectionMapping, TextureLoader, RepeatWrapping, NoColorSpace, MeshPhysicalMaterial, Color, DepthTexture, RedFormat, Matrix3, WebGLMultipleRenderTargets, SRGBColorSpace } from 'three';
|
|
4
4
|
|
|
5
5
|
class EffectComposerPlugin extends Plugin {
|
|
@@ -64,36 +64,8 @@ class EffectComposerPlugin extends Plugin {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
/******************************************************************************
|
|
68
|
-
Copyright (c) Microsoft Corporation.
|
|
69
|
-
|
|
70
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
71
|
-
purpose with or without fee is hereby granted.
|
|
72
|
-
|
|
73
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
74
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
75
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
76
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
77
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
78
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
79
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
80
|
-
***************************************************************************** */
|
|
81
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
function __decorate(decorators, target, key, desc) {
|
|
85
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
86
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
87
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
88
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
92
|
-
var e = new Error(message);
|
|
93
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
67
|
class PassPlugin extends Plugin {
|
|
68
|
+
// @property
|
|
97
69
|
get enable() {
|
|
98
70
|
return this.pass.enabled;
|
|
99
71
|
}
|
|
@@ -107,11 +79,9 @@ class PassPlugin extends Plugin {
|
|
|
107
79
|
this.composer.activePass(this.pass, v);
|
|
108
80
|
}
|
|
109
81
|
}
|
|
110
|
-
__decorate([
|
|
111
|
-
property
|
|
112
|
-
], PassPlugin.prototype, "enable", null);
|
|
113
82
|
|
|
114
83
|
class ToneMappingPlugin extends PassPlugin {
|
|
84
|
+
// @property({ value: ToneMappingMode })
|
|
115
85
|
get mode() {
|
|
116
86
|
return this.effect.mode;
|
|
117
87
|
}
|
|
@@ -129,25 +99,23 @@ class ToneMappingPlugin extends PassPlugin {
|
|
|
129
99
|
};
|
|
130
100
|
}
|
|
131
101
|
}
|
|
132
|
-
__decorate([
|
|
133
|
-
property({
|
|
134
|
-
value: ToneMappingMode
|
|
135
|
-
})
|
|
136
|
-
], ToneMappingPlugin.prototype, "mode", null);
|
|
137
102
|
|
|
138
103
|
class BloomPlugin extends PassPlugin {
|
|
104
|
+
// @property({ min: 0, max: 2, step: 0.01 })
|
|
139
105
|
get intensity() {
|
|
140
106
|
return this.effect.intensity;
|
|
141
107
|
}
|
|
142
108
|
set intensity(v) {
|
|
143
109
|
this.effect.intensity = v;
|
|
144
110
|
}
|
|
111
|
+
// @property({ min: 0, max: 10, step: 0.01 })
|
|
145
112
|
get luminanceThreshold() {
|
|
146
113
|
return this.effect.luminanceMaterial.threshold;
|
|
147
114
|
}
|
|
148
115
|
set luminanceThreshold(v) {
|
|
149
116
|
this.effect.luminanceMaterial.threshold = v;
|
|
150
117
|
}
|
|
118
|
+
// @property({ min: 0, max: 10, step: 0.01 })
|
|
151
119
|
get luminanceSmoothing() {
|
|
152
120
|
return this.effect.luminanceMaterial.smoothing;
|
|
153
121
|
}
|
|
@@ -168,27 +136,6 @@ class BloomPlugin extends PassPlugin {
|
|
|
168
136
|
};
|
|
169
137
|
}
|
|
170
138
|
}
|
|
171
|
-
__decorate([
|
|
172
|
-
property({
|
|
173
|
-
min: 0,
|
|
174
|
-
max: 2,
|
|
175
|
-
step: 0.01
|
|
176
|
-
})
|
|
177
|
-
], BloomPlugin.prototype, "intensity", null);
|
|
178
|
-
__decorate([
|
|
179
|
-
property({
|
|
180
|
-
min: 0,
|
|
181
|
-
max: 10,
|
|
182
|
-
step: 0.01
|
|
183
|
-
})
|
|
184
|
-
], BloomPlugin.prototype, "luminanceThreshold", null);
|
|
185
|
-
__decorate([
|
|
186
|
-
property({
|
|
187
|
-
min: 0,
|
|
188
|
-
max: 10,
|
|
189
|
-
step: 0.01
|
|
190
|
-
})
|
|
191
|
-
], BloomPlugin.prototype, "luminanceSmoothing", null);
|
|
192
139
|
|
|
193
140
|
class FXAAPlugin extends PassPlugin {
|
|
194
141
|
constructor(){
|
|
@@ -203,6 +150,7 @@ class FXAAPlugin extends PassPlugin {
|
|
|
203
150
|
}
|
|
204
151
|
|
|
205
152
|
class SMAAPlugin extends PassPlugin {
|
|
153
|
+
// @property({ value: SMAAPreset })
|
|
206
154
|
get preset() {
|
|
207
155
|
return this._preset;
|
|
208
156
|
}
|
|
@@ -212,12 +160,14 @@ class SMAAPlugin extends PassPlugin {
|
|
|
212
160
|
this.effect.applyPreset(v);
|
|
213
161
|
}
|
|
214
162
|
}
|
|
163
|
+
// @property({ value: EdgeDetectionMode })
|
|
215
164
|
get edgeDetectionMode() {
|
|
216
165
|
return this.effect.edgeDetectionMaterial.edgeDetectionMode;
|
|
217
166
|
}
|
|
218
167
|
set edgeDetectionMode(v) {
|
|
219
168
|
this.effect.edgeDetectionMaterial.edgeDetectionMode = v;
|
|
220
169
|
}
|
|
170
|
+
// @property({ value: PredicationMode })
|
|
221
171
|
get predicationMode() {
|
|
222
172
|
return this.effect.edgeDetectionMaterial.predicationMode;
|
|
223
173
|
}
|
|
@@ -236,23 +186,9 @@ class SMAAPlugin extends PassPlugin {
|
|
|
236
186
|
};
|
|
237
187
|
}
|
|
238
188
|
}
|
|
239
|
-
__decorate([
|
|
240
|
-
property({
|
|
241
|
-
value: SMAAPreset
|
|
242
|
-
})
|
|
243
|
-
], SMAAPlugin.prototype, "preset", null);
|
|
244
|
-
__decorate([
|
|
245
|
-
property({
|
|
246
|
-
value: EdgeDetectionMode
|
|
247
|
-
})
|
|
248
|
-
], SMAAPlugin.prototype, "edgeDetectionMode", null);
|
|
249
|
-
__decorate([
|
|
250
|
-
property({
|
|
251
|
-
value: PredicationMode
|
|
252
|
-
})
|
|
253
|
-
], SMAAPlugin.prototype, "predicationMode", null);
|
|
254
189
|
|
|
255
190
|
class MSAAPlugin extends Plugin {
|
|
191
|
+
// @property
|
|
256
192
|
get enable() {
|
|
257
193
|
return this.composer.multisampling > 0;
|
|
258
194
|
}
|
|
@@ -275,9 +211,6 @@ class MSAAPlugin extends Plugin {
|
|
|
275
211
|
};
|
|
276
212
|
}
|
|
277
213
|
}
|
|
278
|
-
__decorate([
|
|
279
|
-
property
|
|
280
|
-
], MSAAPlugin.prototype, "enable", null);
|
|
281
214
|
|
|
282
215
|
// from: https://news.ycombinator.com/item?id=17876741
|
|
283
216
|
// reference: http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
|