three-stdlib 2.8.11 → 2.8.12
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/index.cjs.js +1 -1
- package/index.d.ts +1 -52
- package/index.js +52 -52
- package/lines/LineMaterial.d.ts +7 -6
- package/modifiers/CurveModifier.cjs.js +1 -1
- package/modifiers/CurveModifier.d.ts +13 -9
- package/modifiers/CurveModifier.js +27 -30
- package/objects/Lensflare.cjs.js +1 -1
- package/objects/Lensflare.js +11 -3
- package/package.json +2 -2
- package/postprocessing/AfterimagePass.d.ts +2 -30
- package/shaders/ACESFilmicToneMappingShader.cjs.js +1 -1
- package/shaders/ACESFilmicToneMappingShader.d.ts +9 -0
- package/shaders/ACESFilmicToneMappingShader.js +1 -1
- package/shaders/AfterimageShader.d.ts +9 -15
- package/shaders/BasicShader.cjs.js +1 -1
- package/shaders/BasicShader.d.ts +5 -5
- package/shaders/BasicShader.js +1 -1
- package/shaders/BleachBypassShader.cjs.js +1 -1
- package/shaders/BleachBypassShader.d.ts +8 -9
- package/shaders/BleachBypassShader.js +1 -1
- package/shaders/BlendShader.cjs.js +1 -1
- package/shaders/BlendShader.d.ts +13 -7
- package/shaders/BlendShader.js +1 -1
- package/shaders/BokehShader.cjs.js +1 -1
- package/shaders/BokehShader.d.ts +18 -19
- package/shaders/BokehShader.js +1 -1
- package/shaders/BokehShader2.cjs.js +1 -1
- package/shaders/BokehShader2.d.ts +80 -34
- package/shaders/BokehShader2.js +2 -2
- package/shaders/BrightnessContrastShader.cjs.js +1 -1
- package/shaders/BrightnessContrastShader.d.ts +10 -6
- package/shaders/BrightnessContrastShader.js +1 -1
- package/shaders/ColorCorrectionShader.cjs.js +1 -1
- package/shaders/ColorCorrectionShader.d.ts +14 -7
- package/shaders/ColorCorrectionShader.js +1 -1
- package/shaders/ColorifyShader.cjs.js +1 -1
- package/shaders/ColorifyShader.d.ts +8 -5
- package/shaders/ColorifyShader.js +1 -1
- package/shaders/ConvolutionShader.cjs.js +1 -1
- package/shaders/ConvolutionShader.d.ts +15 -16
- package/shaders/ConvolutionShader.js +9 -14
- package/shaders/CopyShader.d.ts +8 -12
- package/shaders/DOFMipMapShader.cjs.js +1 -1
- package/shaders/DOFMipMapShader.d.ts +13 -7
- package/shaders/DOFMipMapShader.js +1 -1
- package/shaders/DepthLimitedBlurShader.cjs.js +1 -1
- package/shaders/DepthLimitedBlurShader.d.ts +26 -25
- package/shaders/DepthLimitedBlurShader.js +12 -16
- package/shaders/DigitalGlitch.cjs.js +1 -1
- package/shaders/DigitalGlitch.d.ts +34 -14
- package/shaders/DigitalGlitch.js +1 -10
- package/shaders/DotScreenShader.cjs.js +1 -1
- package/shaders/DotScreenShader.d.ts +17 -8
- package/shaders/DotScreenShader.js +1 -1
- package/shaders/FXAAShader.cjs.js +1 -1
- package/shaders/FXAAShader.d.ts +8 -5
- package/shaders/FXAAShader.js +1 -1
- package/shaders/FilmShader.cjs.js +1 -1
- package/shaders/FilmShader.d.ts +19 -9
- package/shaders/FilmShader.js +1 -1
- package/shaders/FocusShader.cjs.js +1 -1
- package/shaders/FocusShader.d.ts +16 -8
- package/shaders/FocusShader.js +1 -1
- package/shaders/FreiChenShader.cjs.js +1 -1
- package/shaders/FreiChenShader.d.ts +8 -5
- package/shaders/FreiChenShader.js +1 -1
- package/shaders/FresnelShader.cjs.js +1 -1
- package/shaders/FresnelShader.d.ts +21 -0
- package/shaders/FresnelShader.js +1 -1
- package/shaders/GammaCorrectionShader.d.ts +7 -7
- package/shaders/GodRaysShader.cjs.js +1 -1
- package/shaders/GodRaysShader.d.ts +38 -20
- package/shaders/GodRaysShader.js +4 -4
- package/shaders/HalftoneShader.cjs.js +1 -1
- package/shaders/HalftoneShader.d.ts +40 -16
- package/shaders/HalftoneShader.js +1 -1
- package/shaders/HorizontalBlurShader.d.ts +8 -8
- package/shaders/HorizontalTiltShiftShader.cjs.js +1 -1
- package/shaders/HorizontalTiltShiftShader.d.ts +10 -6
- package/shaders/HorizontalTiltShiftShader.js +1 -1
- package/shaders/HueSaturationShader.cjs.js +1 -1
- package/shaders/HueSaturationShader.d.ts +10 -6
- package/shaders/HueSaturationShader.js +1 -1
- package/shaders/KaleidoShader.cjs.js +1 -1
- package/shaders/KaleidoShader.d.ts +10 -6
- package/shaders/KaleidoShader.js +1 -1
- package/shaders/LuminosityHighPassShader.cjs.js +1 -1
- package/shaders/LuminosityHighPassShader.d.ts +17 -8
- package/shaders/LuminosityHighPassShader.js +1 -1
- package/shaders/LuminosityShader.cjs.js +1 -1
- package/shaders/LuminosityShader.d.ts +4 -4
- package/shaders/LuminosityShader.js +1 -1
- package/shaders/MirrorShader.cjs.js +1 -1
- package/shaders/MirrorShader.d.ts +7 -5
- package/shaders/MirrorShader.js +1 -1
- package/shaders/NormalMapShader.cjs.js +1 -1
- package/shaders/NormalMapShader.d.ts +14 -7
- package/shaders/NormalMapShader.js +1 -1
- package/shaders/ParallaxShader.cjs.js +1 -1
- package/shaders/ParallaxShader.d.ts +28 -0
- package/shaders/ParallaxShader.js +1 -1
- package/shaders/PixelShader.cjs.js +1 -1
- package/shaders/PixelShader.d.ts +10 -6
- package/shaders/PixelShader.js +1 -1
- package/shaders/RGBShiftShader.cjs.js +1 -1
- package/shaders/RGBShiftShader.d.ts +10 -6
- package/shaders/RGBShiftShader.js +1 -1
- package/shaders/SAOShader.cjs.js +1 -1
- package/shaders/SAOShader.d.ts +24 -29
- package/shaders/SAOShader.js +1 -5
- package/shaders/SMAAShader.cjs.js +1 -1
- package/shaders/SMAAShader.d.ts +31 -16
- package/shaders/SMAAShader.js +3 -3
- package/shaders/SSAOShader.cjs.js +1 -1
- package/shaders/SSAOShader.d.ts +58 -25
- package/shaders/SSAOShader.js +3 -3
- package/shaders/SSRShader.cjs.js +1 -1
- package/shaders/SSRShader.d.ts +67 -36
- package/shaders/SSRShader.js +3 -3
- package/shaders/SepiaShader.cjs.js +1 -1
- package/shaders/SepiaShader.d.ts +7 -5
- package/shaders/SepiaShader.js +1 -1
- package/shaders/SobelOperatorShader.cjs.js +1 -1
- package/shaders/SobelOperatorShader.d.ts +8 -5
- package/shaders/SobelOperatorShader.js +1 -1
- package/shaders/SubsurfaceScatteringShader.cjs.js +1 -1
- package/shaders/SubsurfaceScatteringShader.d.ts +2 -34
- package/shaders/SubsurfaceScatteringShader.js +3 -3
- package/shaders/TechnicolorShader.cjs.js +1 -1
- package/shaders/TechnicolorShader.d.ts +4 -4
- package/shaders/TechnicolorShader.js +1 -1
- package/shaders/ToneMapShader.cjs.js +1 -1
- package/shaders/ToneMapShader.d.ts +19 -9
- package/shaders/ToneMapShader.js +1 -1
- package/shaders/ToonShader.cjs.js +1 -1
- package/shaders/ToonShader.d.ts +80 -34
- package/shaders/ToonShader.js +4 -4
- package/shaders/TriangleBlurShader.cjs.js +1 -1
- package/shaders/TriangleBlurShader.d.ts +8 -5
- package/shaders/TriangleBlurShader.js +1 -1
- package/shaders/UnpackDepthRGBAShader.cjs.js +1 -1
- package/shaders/UnpackDepthRGBAShader.d.ts +7 -5
- package/shaders/UnpackDepthRGBAShader.js +1 -1
- package/shaders/VerticalBlurShader.cjs.js +1 -1
- package/shaders/VerticalBlurShader.d.ts +8 -8
- package/shaders/VerticalBlurShader.js +1 -1
- package/shaders/VerticalTiltShiftShader.cjs.js +1 -1
- package/shaders/VerticalTiltShiftShader.d.ts +10 -6
- package/shaders/VerticalTiltShiftShader.js +1 -1
- package/shaders/VignetteShader.cjs.js +1 -1
- package/shaders/VignetteShader.d.ts +10 -6
- package/shaders/VignetteShader.js +1 -1
- package/shaders/VolumeShader.cjs.js +1 -1
- package/shaders/VolumeShader.d.ts +20 -9
- package/shaders/VolumeShader.js +1 -1
- package/shaders/WaterRefractionShader.cjs.js +1 -1
- package/shaders/WaterRefractionShader.d.ts +16 -8
- package/shaders/WaterRefractionShader.js +1 -1
- package/shaders/index.cjs.js +1 -0
- package/shaders/index.d.ts +53 -0
- package/shaders/index.js +53 -0
- package/shaders/types.cjs.js +1 -0
- package/shaders/types.d.ts +14 -0
- package/shaders/types.js +1 -0
- package/types/shared.d.ts +0 -20
package/index.d.ts
CHANGED
@@ -180,58 +180,7 @@ export * from './csm/CSM';
|
|
180
180
|
export * from './csm/Shader';
|
181
181
|
export * from './csm/CSMHelper';
|
182
182
|
export * from './csm/Frustum';
|
183
|
-
export * from './shaders
|
184
|
-
export * from './shaders/HalftoneShader';
|
185
|
-
export * from './shaders/ConvolutionShader';
|
186
|
-
export * from './shaders/SAOShader';
|
187
|
-
export * from './shaders/GodRaysShader';
|
188
|
-
export * from './shaders/LuminosityShader';
|
189
|
-
export * from './shaders/MirrorShader';
|
190
|
-
export * from './shaders/ToneMapShader';
|
191
|
-
export * from './shaders/BleachBypassShader';
|
192
|
-
export * from './shaders/BlendShader';
|
193
|
-
export * from './shaders/KaleidoShader';
|
194
|
-
export * from './shaders/ACESFilmicToneMappingShader';
|
195
|
-
export * from './shaders/ParallaxShader';
|
196
|
-
export * from './shaders/VerticalBlurShader';
|
197
|
-
export * from './shaders/ColorCorrectionShader';
|
198
|
-
export * from './shaders/PixelShader';
|
199
|
-
export * from './shaders/BokehShader2';
|
200
|
-
export * from './shaders/FocusShader';
|
201
|
-
export * from './shaders/WaterRefractionShader';
|
202
|
-
export * from './shaders/RGBShiftShader';
|
203
|
-
export * from './shaders/TriangleBlurShader';
|
204
|
-
export * from './shaders/FilmShader';
|
205
|
-
export * from './shaders/SepiaShader';
|
206
|
-
export * from './shaders/BokehShader';
|
207
|
-
export * from './shaders/FXAAShader';
|
208
|
-
export * from './shaders/AfterimageShader';
|
209
|
-
export * from './shaders/DotScreenShader';
|
210
|
-
export * from './shaders/SubsurfaceScatteringShader';
|
211
|
-
export * from './shaders/ToonShader';
|
212
|
-
export * from './shaders/DepthLimitedBlurShader';
|
213
|
-
export * from './shaders/NormalMapShader';
|
214
|
-
export * from './shaders/FreiChenShader';
|
215
|
-
export * from './shaders/VolumeShader';
|
216
|
-
export * from './shaders/HorizontalTiltShiftShader';
|
217
|
-
export * from './shaders/VerticalTiltShiftShader';
|
218
|
-
export * from './shaders/BrightnessContrastShader';
|
219
|
-
export * from './shaders/SobelOperatorShader';
|
220
|
-
export * from './shaders/SSAOShader';
|
221
|
-
export * from './shaders/GammaCorrectionShader';
|
222
|
-
export * from './shaders/VignetteShader';
|
223
|
-
export * from './shaders/HorizontalBlurShader';
|
224
|
-
export * from './shaders/UnpackDepthRGBAShader';
|
225
|
-
export * from './shaders/FresnelShader';
|
226
|
-
export * from './shaders/HueSaturationShader';
|
227
|
-
export * from './shaders/DigitalGlitch';
|
228
|
-
export * from './shaders/BasicShader';
|
229
|
-
export * from './shaders/CopyShader';
|
230
|
-
export * from './shaders/LuminosityHighPassShader';
|
231
|
-
export * from './shaders/DOFMipMapShader';
|
232
|
-
export * from './shaders/SSRShader';
|
233
|
-
export * from './shaders/TechnicolorShader';
|
234
|
-
export * from './shaders/ColorifyShader';
|
183
|
+
export * from './shaders';
|
235
184
|
export * from './interactive/SelectionHelper';
|
236
185
|
export * from './interactive/SelectionBox';
|
237
186
|
export * from './physics/AmmoPhysics';
|
package/index.js
CHANGED
@@ -124,58 +124,6 @@ export { TeapotGeometry } from './geometries/TeapotGeometry.js';
|
|
124
124
|
export { TextGeometry as TextBufferGeometry, TextGeometry } from './geometries/TextGeometry.js';
|
125
125
|
export { CSM } from './csm/CSM.js';
|
126
126
|
export { CSMHelper } from './csm/CSMHelper.js';
|
127
|
-
export { SMAABlendShader, SMAAEdgesShader, SMAAWeightsShader } from './shaders/SMAAShader.js';
|
128
|
-
export { HalftoneShader } from './shaders/HalftoneShader.js';
|
129
|
-
export { ConvolutionShader } from './shaders/ConvolutionShader.js';
|
130
|
-
export { SAOShader } from './shaders/SAOShader.js';
|
131
|
-
export { GodRaysCombineShader, GodRaysDepthMaskShader, GodRaysFakeSunShader, GodRaysGenerateShader } from './shaders/GodRaysShader.js';
|
132
|
-
export { LuminosityShader } from './shaders/LuminosityShader.js';
|
133
|
-
export { MirrorShader } from './shaders/MirrorShader.js';
|
134
|
-
export { ToneMapShader } from './shaders/ToneMapShader.js';
|
135
|
-
export { BleachBypassShader } from './shaders/BleachBypassShader.js';
|
136
|
-
export { BlendShader } from './shaders/BlendShader.js';
|
137
|
-
export { KaleidoShader } from './shaders/KaleidoShader.js';
|
138
|
-
export { ACESFilmicToneMappingShader } from './shaders/ACESFilmicToneMappingShader.js';
|
139
|
-
export { ParallaxShader } from './shaders/ParallaxShader.js';
|
140
|
-
export { VerticalBlurShader } from './shaders/VerticalBlurShader.js';
|
141
|
-
export { ColorCorrectionShader } from './shaders/ColorCorrectionShader.js';
|
142
|
-
export { PixelShader } from './shaders/PixelShader.js';
|
143
|
-
export { BokehDepthShader, BokehShader2 } from './shaders/BokehShader2.js';
|
144
|
-
export { FocusShader } from './shaders/FocusShader.js';
|
145
|
-
export { WaterRefractionShader } from './shaders/WaterRefractionShader.js';
|
146
|
-
export { RGBShiftShader } from './shaders/RGBShiftShader.js';
|
147
|
-
export { TriangleBlurShader } from './shaders/TriangleBlurShader.js';
|
148
|
-
export { FilmShader } from './shaders/FilmShader.js';
|
149
|
-
export { SepiaShader } from './shaders/SepiaShader.js';
|
150
|
-
export { BokehShader } from './shaders/BokehShader.js';
|
151
|
-
export { FXAAShader } from './shaders/FXAAShader.js';
|
152
|
-
export { AfterimageShader } from './shaders/AfterimageShader.js';
|
153
|
-
export { DotScreenShader } from './shaders/DotScreenShader.js';
|
154
|
-
export { SubsurfaceScatteringShader } from './shaders/SubsurfaceScatteringShader.js';
|
155
|
-
export { ToonShader1, ToonShader2, ToonShaderDotted, ToonShaderHatching } from './shaders/ToonShader.js';
|
156
|
-
export { BlurShaderUtils, DepthLimitedBlurShader } from './shaders/DepthLimitedBlurShader.js';
|
157
|
-
export { NormalMapShader } from './shaders/NormalMapShader.js';
|
158
|
-
export { FreiChenShader } from './shaders/FreiChenShader.js';
|
159
|
-
export { VolumeRenderShader1 } from './shaders/VolumeShader.js';
|
160
|
-
export { HorizontalTiltShiftShader } from './shaders/HorizontalTiltShiftShader.js';
|
161
|
-
export { VerticalTiltShiftShader } from './shaders/VerticalTiltShiftShader.js';
|
162
|
-
export { BrightnessContrastShader } from './shaders/BrightnessContrastShader.js';
|
163
|
-
export { SobelOperatorShader } from './shaders/SobelOperatorShader.js';
|
164
|
-
export { SSAOBlurShader, SSAODepthShader, SSAOShader } from './shaders/SSAOShader.js';
|
165
|
-
export { GammaCorrectionShader } from './shaders/GammaCorrectionShader.js';
|
166
|
-
export { VignetteShader } from './shaders/VignetteShader.js';
|
167
|
-
export { HorizontalBlurShader } from './shaders/HorizontalBlurShader.js';
|
168
|
-
export { UnpackDepthRGBAShader } from './shaders/UnpackDepthRGBAShader.js';
|
169
|
-
export { FresnelShader } from './shaders/FresnelShader.js';
|
170
|
-
export { HueSaturationShader } from './shaders/HueSaturationShader.js';
|
171
|
-
export { DigitalGlitch } from './shaders/DigitalGlitch.js';
|
172
|
-
export { BasicShader } from './shaders/BasicShader.js';
|
173
|
-
export { CopyShader } from './shaders/CopyShader.js';
|
174
|
-
export { LuminosityHighPassShader } from './shaders/LuminosityHighPassShader.js';
|
175
|
-
export { DOFMipMapShader } from './shaders/DOFMipMapShader.js';
|
176
|
-
export { SSRBlurShader, SSRDepthShader, SSRShader } from './shaders/SSRShader.js';
|
177
|
-
export { TechnicolorShader } from './shaders/TechnicolorShader.js';
|
178
|
-
export { ColorifyShader } from './shaders/ColorifyShader.js';
|
179
127
|
export { SelectionHelper } from './interactive/SelectionHelper.js';
|
180
128
|
export { SelectionBox } from './interactive/SelectionBox.js';
|
181
129
|
export { AmmoPhysics } from './physics/AmmoPhysics.js';
|
@@ -326,3 +274,55 @@ export { default as NodeObjectLoader } from './nodes/loaders/NodeObjectLoader.js
|
|
326
274
|
export { default as NodeMaterialLoader } from './nodes/loaders/NodeMaterialLoader.js';
|
327
275
|
export { BRDF_GGX, BRDF_Lambert, D_GGX, F_Schlick, PhysicalLightingModel, RE_Direct_Physical, V_GGX_SmithCorrelated, getDistanceAttenuation } from './nodes/functions/BSDFs.js';
|
328
276
|
export { EPSILON, INFINITY, ShaderNode, abs, acos, add, addTo, alphaTest, and, asin, assign, atan, attribute, bitAnd, bitOr, bitXor, bmat3, bmat4, bool, buffer, bvec2, bvec3, bvec4, cameraPosition, ceil, clamp, color, cond, cos, cross, dFdx, dFdy, degrees, diffuseColor, distance, div, dot, element, equal, exp, exp2, faceforward, float, floor, fract, greaterThan, greaterThanEqual, imat3, imat4, int, inversesqrt, invert, ivec2, ivec3, ivec4, join, label, length, lessThan, lessThanEqual, log, log2, mat3, mat4, max, metalness, min, mix, mod, mul, negate, nodeObject, normalGeometry, normalLocal, normalView, normalWorld, normalize, or, positionLocal, positionView, positionViewDirection, positionWorld, pow, pow2, pow3, pow4, radians, reflect, refract, remainder, roughness, round, sampler, saturate, shiftLeft, shiftRight, sign, sin, smoothstep, specularColor, sqrt, step, sub, tan, temp, texture, transformDirection, transformedNormalView, uint, umat3, umat4, uniform, uv, uvec2, uvec3, uvec4, vec2, vec3, vec4, viewMatrix, xor } from './nodes/ShaderNode.js';
|
277
|
+
export { ACESFilmicToneMappingShader } from './shaders/ACESFilmicToneMappingShader.js';
|
278
|
+
export { AfterimageShader } from './shaders/AfterimageShader.js';
|
279
|
+
export { BasicShader } from './shaders/BasicShader.js';
|
280
|
+
export { BleachBypassShader } from './shaders/BleachBypassShader.js';
|
281
|
+
export { BlendShader } from './shaders/BlendShader.js';
|
282
|
+
export { BokehShader } from './shaders/BokehShader.js';
|
283
|
+
export { BokehDepthShader, BokehShader2 } from './shaders/BokehShader2.js';
|
284
|
+
export { BrightnessContrastShader } from './shaders/BrightnessContrastShader.js';
|
285
|
+
export { ColorCorrectionShader } from './shaders/ColorCorrectionShader.js';
|
286
|
+
export { ColorifyShader } from './shaders/ColorifyShader.js';
|
287
|
+
export { ConvolutionShader } from './shaders/ConvolutionShader.js';
|
288
|
+
export { CopyShader } from './shaders/CopyShader.js';
|
289
|
+
export { DOFMipMapShader } from './shaders/DOFMipMapShader.js';
|
290
|
+
export { BlurShaderUtils, DepthLimitedBlurShader } from './shaders/DepthLimitedBlurShader.js';
|
291
|
+
export { DigitalGlitch } from './shaders/DigitalGlitch.js';
|
292
|
+
export { DotScreenShader } from './shaders/DotScreenShader.js';
|
293
|
+
export { FXAAShader } from './shaders/FXAAShader.js';
|
294
|
+
export { FilmShader } from './shaders/FilmShader.js';
|
295
|
+
export { FocusShader } from './shaders/FocusShader.js';
|
296
|
+
export { FreiChenShader } from './shaders/FreiChenShader.js';
|
297
|
+
export { FresnelShader } from './shaders/FresnelShader.js';
|
298
|
+
export { GammaCorrectionShader } from './shaders/GammaCorrectionShader.js';
|
299
|
+
export { GodRaysCombineShader, GodRaysDepthMaskShader, GodRaysFakeSunShader, GodRaysGenerateShader } from './shaders/GodRaysShader.js';
|
300
|
+
export { HalftoneShader } from './shaders/HalftoneShader.js';
|
301
|
+
export { HorizontalBlurShader } from './shaders/HorizontalBlurShader.js';
|
302
|
+
export { HorizontalTiltShiftShader } from './shaders/HorizontalTiltShiftShader.js';
|
303
|
+
export { HueSaturationShader } from './shaders/HueSaturationShader.js';
|
304
|
+
export { KaleidoShader } from './shaders/KaleidoShader.js';
|
305
|
+
export { LuminosityHighPassShader } from './shaders/LuminosityHighPassShader.js';
|
306
|
+
export { LuminosityShader } from './shaders/LuminosityShader.js';
|
307
|
+
export { MirrorShader } from './shaders/MirrorShader.js';
|
308
|
+
export { NormalMapShader } from './shaders/NormalMapShader.js';
|
309
|
+
export { ParallaxShader } from './shaders/ParallaxShader.js';
|
310
|
+
export { PixelShader } from './shaders/PixelShader.js';
|
311
|
+
export { RGBShiftShader } from './shaders/RGBShiftShader.js';
|
312
|
+
export { SAOShader } from './shaders/SAOShader.js';
|
313
|
+
export { SMAABlendShader, SMAAEdgesShader, SMAAWeightsShader } from './shaders/SMAAShader.js';
|
314
|
+
export { SSAOBlurShader, SSAODepthShader, SSAOShader } from './shaders/SSAOShader.js';
|
315
|
+
export { SSRBlurShader, SSRDepthShader, SSRShader } from './shaders/SSRShader.js';
|
316
|
+
export { SepiaShader } from './shaders/SepiaShader.js';
|
317
|
+
export { SobelOperatorShader } from './shaders/SobelOperatorShader.js';
|
318
|
+
export { SubsurfaceScatteringShader } from './shaders/SubsurfaceScatteringShader.js';
|
319
|
+
export { TechnicolorShader } from './shaders/TechnicolorShader.js';
|
320
|
+
export { ToneMapShader } from './shaders/ToneMapShader.js';
|
321
|
+
export { ToonShader1, ToonShader2, ToonShaderDotted, ToonShaderHatching } from './shaders/ToonShader.js';
|
322
|
+
export { TriangleBlurShader } from './shaders/TriangleBlurShader.js';
|
323
|
+
export { UnpackDepthRGBAShader } from './shaders/UnpackDepthRGBAShader.js';
|
324
|
+
export { VerticalBlurShader } from './shaders/VerticalBlurShader.js';
|
325
|
+
export { VerticalTiltShiftShader } from './shaders/VerticalTiltShiftShader.js';
|
326
|
+
export { VignetteShader } from './shaders/VignetteShader.js';
|
327
|
+
export { VolumeRenderShader1 } from './shaders/VolumeShader.js';
|
328
|
+
export { WaterRefractionShader } from './shaders/WaterRefractionShader.js';
|
package/lines/LineMaterial.d.ts
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
import { ShaderMaterial, Vector2,
|
2
|
-
import {
|
3
|
-
export declare type
|
1
|
+
import { ShaderMaterial, Vector2, Color } from 'three';
|
2
|
+
import type { ShaderMaterialParameters } from 'three';
|
3
|
+
export declare type ColorOptions = Color | string | number;
|
4
|
+
export interface LineMaterialParameters extends ShaderMaterialParameters {
|
4
5
|
color?: ColorOptions;
|
5
|
-
linewidth?: number;
|
6
6
|
dashed?: boolean;
|
7
|
+
dashOffset?: number;
|
7
8
|
dashScale?: number;
|
8
9
|
dashSize?: number;
|
9
|
-
dashOffset?: number;
|
10
10
|
gapSize?: number;
|
11
|
+
linewidth?: number;
|
11
12
|
resolution?: Vector2;
|
12
|
-
}
|
13
|
+
}
|
13
14
|
declare class LineMaterial extends ShaderMaterial {
|
14
15
|
private readonly isLineMaterial;
|
15
16
|
dashed: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);const s=(e=1)=>{const n=new Float32Array(4096*e*4),r=new t.DataTexture(n,1024,4*e,t.RGBAFormat,t.FloatType);return r.wrapS=t.RepeatWrapping,r.wrapT=t.RepeatWrapping,r.magFilter=t.NearestFilter,r.needsUpdate=!0,r},i=(e,t,n=0)=>{const r=Math.floor(1024);t.arcLengthDivisions=r/2,t.updateArcLengths();const s=t.getSpacedPoints(r),i=t.computeFrenetFrames(r,!0);for(let t=0;t<r;t++){const r=Math.floor(t/1024),o=t%1024;let f=s[t];a(e,o,f.x,f.y,f.z,0+r+4*n),f=i.tangents[t],a(e,o,f.x,f.y,f.z,1+r+4*n),f=i.normals[t],a(e,o,f.x,f.y,f.z,2+r+4*n),f=i.binormals[t],a(e,o,f.x,f.y,f.z,3+r+4*n)}e.needsUpdate=!0},a=(e,t,n,r,s,i)=>{const a=e.image,{data:o}=a,f=4096*i;o[4*t+f+0]=n,o[4*t+f+1]=r,o[4*t+f+2]=s,o[4*t+f+3]=1}
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);const s=(e=1)=>{const n=new Float32Array(4096*e*4),r=new t.DataTexture(n,1024,4*e,t.RGBAFormat,t.FloatType);return r.wrapS=t.RepeatWrapping,r.wrapT=t.RepeatWrapping,r.magFilter=t.NearestFilter,r.needsUpdate=!0,r},i=(e,t,n=0)=>{const r=Math.floor(1024);t.arcLengthDivisions=r/2,t.updateArcLengths();const s=t.getSpacedPoints(r),i=t.computeFrenetFrames(r,!0);for(let t=0;t<r;t++){const r=Math.floor(t/1024),o=t%1024;let f=s[t];a(e,o,f.x,f.y,f.z,0+r+4*n),f=i.tangents[t],a(e,o,f.x,f.y,f.z,1+r+4*n),f=i.normals[t],a(e,o,f.x,f.y,f.z,2+r+4*n),f=i.binormals[t],a(e,o,f.x,f.y,f.z,3+r+4*n)}e.needsUpdate=!0},a=(e,t,n,r,s,i)=>{const a=e.image,{data:o}=a,f=4096*i;o[4*t+f+0]=n,o[4*t+f+1]=r,o[4*t+f+2]=s,o[4*t+f+3]=1},o=e=>({spineTexture:{value:e},pathOffset:{type:"f",value:0},pathSegment:{type:"f",value:1},spineOffset:{type:"f",value:161},spineLength:{type:"f",value:400},flow:{type:"i",value:1}});function f(e,t,n=1){e.__ok||(e.__ok=!0,e.onBeforeCompile=e=>{if(e.__modified)return;e.__modified=!0,Object.assign(e.uniforms,t);const r=`\n\t\tuniform sampler2D spineTexture;\n\t\tuniform float pathOffset;\n\t\tuniform float pathSegment;\n\t\tuniform float spineOffset;\n\t\tuniform float spineLength;\n\t\tuniform int flow;\n\n\t\tfloat textureLayers = ${4*n}.;\n\t\tfloat textureStacks = 1.;\n\n\t\t${e.vertexShader}\n\t\t`.replace("#include <beginnormal_vertex>","").replace("#include <defaultnormal_vertex>","").replace("#include <begin_vertex>","").replace(/void\s*main\s*\(\)\s*\{/,"\n void main() {\n #include <beginnormal_vertex>\n\n vec4 worldPos = modelMatrix * vec4(position, 1.);\n\n bool bend = flow > 0;\n float xWeight = bend ? 0. : 1.;\n\n #ifdef USE_INSTANCING\n float pathOffsetFromInstanceMatrix = instanceMatrix[3][2];\n float spineLengthFromInstanceMatrix = instanceMatrix[3][0];\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLengthFromInstanceMatrix : 0.;\n float mt = (spinePortion * pathSegment + pathOffset + pathOffsetFromInstanceMatrix)*textureStacks;\n #else\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLength : 0.;\n float mt = (spinePortion * pathSegment + pathOffset)*textureStacks;\n #endif\n\n mt = mod(mt, textureStacks);\n float rowOffset = floor(mt);\n\n #ifdef USE_INSTANCING\n rowOffset += instanceMatrix[3][1] * 4.;\n #endif\n\n vec3 spinePos = texture2D(spineTexture, vec2(mt, (0. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 a = texture2D(spineTexture, vec2(mt, (1. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 b = texture2D(spineTexture, vec2(mt, (2. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 c = texture2D(spineTexture, vec2(mt, (3. + rowOffset + 0.5) / textureLayers)).xyz;\n mat3 basis = mat3(a, b, c);\n\n vec3 transformed = basis\n * vec3(worldPos.x * xWeight, worldPos.y * 1., worldPos.z * 1.)\n + spinePos;\n\n vec3 transformedNormal = normalMatrix * (basis * objectNormal);\n\t\t\t").replace("#include <project_vertex>","vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;");e.vertexShader=r})}class l{constructor(e,n=1){r.default(this,"curveArray",void 0),r.default(this,"curveLengthArray",void 0),r.default(this,"object3D",void 0),r.default(this,"splineTexure",void 0),r.default(this,"uniforms",void 0);const i=e.clone(),a=s(n),l=o(a);i.traverse((e=>{(e instanceof t.Mesh||e instanceof t.InstancedMesh)&&(e.material=e.material.clone(),f(e.material,l,n))})),this.curveArray=new Array(n),this.curveLengthArray=new Array(n),this.object3D=i,this.splineTexure=a,this.uniforms=l}updateCurve(e,t){if(e>=this.curveArray.length)throw Error("Index out of range for Flow");const n=t.getLength();this.uniforms.spineLength.value=n,this.curveLengthArray[e]=n,this.curveArray[e]=t,i(this.splineTexure,t,e)}moveAlongCurve(e){this.uniforms.pathOffset.value+=e}}const u=new t.Matrix4;exports.Flow=l,exports.InstancedFlow=class extends l{constructor(e,n,s,i){const a=new t.InstancedMesh(s,i,e);a.instanceMatrix.setUsage(t.DynamicDrawUsage),super(a,n),r.default(this,"offsets",void 0),r.default(this,"whichCurve",void 0),this.offsets=new Array(e).fill(0),this.whichCurve=new Array(e).fill(0)}writeChanges(e){u.makeTranslation(this.curveLengthArray[this.whichCurve[e]],this.whichCurve[e],this.offsets[e]),this.object3D.setMatrixAt(e,u),this.object3D.instanceMatrix.needsUpdate=!0}moveIndividualAlongCurve(e,t){this.offsets[e]+=t,this.writeChanges(e)}setCurve(e,t){if(isNaN(t))throw Error("curve index being set is Not a Number (NaN)");this.whichCurve[e]=t,this.writeChanges(e)}},exports.getUniforms=o,exports.initSplineTexture=s,exports.modifyShader=f,exports.updateSplineTexture=i;
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import { DataTexture, Mesh, InstancedMesh, Material, Curve, BufferGeometry } from 'three';
|
2
|
-
import {
|
2
|
+
import type { IUniform } from 'three';
|
3
3
|
export declare const initSplineTexture: (numberOfCurves?: number) => DataTexture;
|
4
4
|
export declare const updateSplineTexture: <TCurve extends Curve<any>>(texture: DataTexture, splineCurve: TCurve, offset?: number) => void;
|
5
|
-
export interface
|
6
|
-
|
7
|
-
|
8
|
-
pathSegment: TUniform<number>;
|
9
|
-
spineOffset: TUniform<number>;
|
10
|
-
spineLength: TUniform<number>;
|
11
|
-
flow: TUniform<number>;
|
5
|
+
export interface INumericUniform extends IUniform {
|
6
|
+
type: 'f' | 'i';
|
7
|
+
value: number;
|
12
8
|
}
|
13
|
-
export declare
|
9
|
+
export declare type CurveModifierUniforms = {
|
10
|
+
spineTexture: IUniform<DataTexture>;
|
11
|
+
pathOffset: INumericUniform;
|
12
|
+
pathSegment: INumericUniform;
|
13
|
+
spineOffset: INumericUniform;
|
14
|
+
spineLength: INumericUniform;
|
15
|
+
flow: INumericUniform;
|
16
|
+
};
|
17
|
+
export declare const getUniforms: (splineTexture: DataTexture) => CurveModifierUniforms;
|
14
18
|
export declare type ModifiedMaterial<TMaterial extends Material> = TMaterial & {
|
15
19
|
__ok: boolean;
|
16
20
|
};
|
@@ -69,36 +69,33 @@ const setTextureValue = (texture, index, x, y, z, o) => {
|
|
69
69
|
*
|
70
70
|
* @param { DataTexture } Texture which holds the curve description
|
71
71
|
*/
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
};
|
100
|
-
return uniforms;
|
101
|
-
}
|
72
|
+
const getUniforms = splineTexture => ({
|
73
|
+
spineTexture: {
|
74
|
+
value: splineTexture
|
75
|
+
},
|
76
|
+
pathOffset: {
|
77
|
+
type: 'f',
|
78
|
+
value: 0
|
79
|
+
},
|
80
|
+
// time of path curve
|
81
|
+
pathSegment: {
|
82
|
+
type: 'f',
|
83
|
+
value: 1
|
84
|
+
},
|
85
|
+
// fractional length of path
|
86
|
+
spineOffset: {
|
87
|
+
type: 'f',
|
88
|
+
value: 161
|
89
|
+
},
|
90
|
+
spineLength: {
|
91
|
+
type: 'f',
|
92
|
+
value: 400
|
93
|
+
},
|
94
|
+
flow: {
|
95
|
+
type: 'i',
|
96
|
+
value: 1
|
97
|
+
}
|
98
|
+
});
|
102
99
|
function modifyShader(material, uniforms, numberOfCurves = 1) {
|
103
100
|
if (material.__ok) return;
|
104
101
|
material.__ok = true;
|
package/objects/Lensflare.cjs.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");class e extends t.Mesh{constructor(){super(e.Geometry,new t.MeshBasicMaterial({opacity:0,transparent:!0})),this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const i=new t.Vector3,r=new t.Vector3,o=new t.
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");class e extends t.Mesh{constructor(){super(e.Geometry,new t.MeshBasicMaterial({opacity:0,transparent:!0})),this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const i=new t.Vector3,r=new t.Vector3,o=new t.DataTexture(new Uint8Array(768),16,16,t.RGBAFormat);o.minFilter=t.NearestFilter,o.magFilter=t.NearestFilter,o.wrapS=t.ClampToEdgeWrapping,o.wrapT=t.ClampToEdgeWrapping;const s=new t.DataTexture(new Uint8Array(768),16,16,t.RGBAFormat);s.minFilter=t.NearestFilter,s.magFilter=t.NearestFilter,s.wrapS=t.ClampToEdgeWrapping,s.wrapT=t.ClampToEdgeWrapping;const a=e.Geometry,l=new t.RawShaderMaterial({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );\n\n\t\t\t\t}",depthTest:!0,depthWrite:!1,transparent:!1}),c=new t.RawShaderMaterial({uniforms:{map:{value:o},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\t\t\t\tattribute vec2 uv;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUV = uv;\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform sampler2D map;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texture2D( map, vUV );\n\n\t\t\t\t}",depthTest:!1,depthWrite:!1,transparent:!1}),u=new t.Mesh(a,l),v=[],p=n.Shader,d=new t.RawShaderMaterial({uniforms:{map:{value:null},occlusionMap:{value:s},color:{value:new t.Color(16777215)},scale:{value:new t.Vector2},screenPosition:{value:new t.Vector3}},vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,blending:t.AdditiveBlending,transparent:!0,depthWrite:!1}),m=new t.Mesh(a,d);this.addElement=function(t){v.push(t)};const f=new t.Vector2,y=new t.Vector2,x=new t.Box2,h=new t.Vector4;this.onBeforeRender=function(t,e,n){t.getCurrentViewport(h);const p=h.w/h.z,g=h.z/2,w=h.w/2;let b=16/h.w;if(f.set(b*p,b),x.min.set(h.x,h.y),x.max.set(h.x+(h.z-16),h.y+(h.w-16)),r.setFromMatrixPosition(this.matrixWorld),r.applyMatrix4(n.matrixWorldInverse),!(r.z>0)&&(i.copy(r).applyMatrix4(n.projectionMatrix),y.x=h.x+i.x*g+g-8,y.y=h.y+i.y*w+w-8,x.containsPoint(y))){t.copyFramebufferToTexture(y,o);let e=l.uniforms;e.scale.value=f,e.screenPosition.value=i,t.renderBufferDirect(n,null,a,l,u,null),t.copyFramebufferToTexture(y,s),e=c.uniforms,e.scale.value=f,e.screenPosition.value=i,t.renderBufferDirect(n,null,a,c,u,null);const r=2*-i.x,p=2*-i.y;for(let e=0,o=v.length;e<o;e++){const o=v[e],s=d.uniforms;s.color.value.copy(o.color),s.map.value=o.texture,s.screenPosition.value.x=i.x+r*o.distance,s.screenPosition.value.y=i.y+p*o.distance,b=o.size/h.w;const l=h.w/h.z;s.scale.value.set(b*l,b),d.uniformsNeedUpdate=!0,t.renderBufferDirect(n,null,a,d,m,null)}}},this.dispose=function(){l.dispose(),c.dispose(),d.dispose(),o.dispose(),s.dispose();for(let t=0,e=v.length;t<e;t++)v[t].texture.dispose()}}}e.prototype.isLensflare=!0;class n{constructor(e,n=1,i=0,r=new t.Color(16777215)){this.texture=e,this.size=n,this.distance=i,this.color=r}}n.Shader={uniforms:{map:{value:null},occlusionMap:{value:null},color:{value:null},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform vec3 screenPosition;\n\t\tuniform vec2 scale;\n\n\t\tuniform sampler2D occlusionMap;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvUV = uv;\n\n\t\t\tvec2 pos = position.xy;\n\n\t\t\tvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\n\n\t\t\tvVisibility = visibility.r / 9.0;\n\t\t\tvVisibility *= 1.0 - visibility.g / 9.0;\n\t\t\tvVisibility *= visibility.b / 9.0;\n\n\t\t\tgl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform sampler2D map;\n\t\tuniform vec3 color;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texture = texture2D( map, vUV );\n\t\t\ttexture.a *= vVisibility;\n\t\t\tgl_FragColor = texture;\n\t\t\tgl_FragColor.rgb *= color;\n\n\t\t}"},e.Geometry=function(){const e=new t.BufferGeometry,n=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),i=new t.InterleavedBuffer(n,5);return e.setIndex([0,1,2,0,2,3]),e.setAttribute("position",new t.InterleavedBufferAttribute(i,3,0,!1)),e.setAttribute("uv",new t.InterleavedBufferAttribute(i,2,3,!1)),e}(),exports.Lensflare=e,exports.LensflareElement=n;
|
package/objects/Lensflare.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Mesh, MeshBasicMaterial, Vector3,
|
1
|
+
import { Mesh, MeshBasicMaterial, Vector3, DataTexture, RGBAFormat, NearestFilter, ClampToEdgeWrapping, RawShaderMaterial, Color, Vector2, AdditiveBlending, Box2, Vector4, BufferGeometry, InterleavedBuffer, InterleavedBufferAttribute } from 'three';
|
2
2
|
|
3
3
|
class Lensflare extends Mesh {
|
4
4
|
constructor() {
|
@@ -13,8 +13,16 @@ class Lensflare extends Mesh {
|
|
13
13
|
const positionScreen = new Vector3();
|
14
14
|
const positionView = new Vector3(); // textures
|
15
15
|
|
16
|
-
const tempMap = new
|
17
|
-
|
16
|
+
const tempMap = new DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, RGBAFormat);
|
17
|
+
tempMap.minFilter = NearestFilter;
|
18
|
+
tempMap.magFilter = NearestFilter;
|
19
|
+
tempMap.wrapS = ClampToEdgeWrapping;
|
20
|
+
tempMap.wrapT = ClampToEdgeWrapping;
|
21
|
+
const occlusionMap = new DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, RGBAFormat);
|
22
|
+
occlusionMap.minFilter = NearestFilter;
|
23
|
+
occlusionMap.magFilter = NearestFilter;
|
24
|
+
occlusionMap.wrapS = ClampToEdgeWrapping;
|
25
|
+
occlusionMap.wrapT = ClampToEdgeWrapping; // material
|
18
26
|
|
19
27
|
const geometry = Lensflare.Geometry;
|
20
28
|
const material1a = new RawShaderMaterial({
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "three-stdlib",
|
3
|
-
"version": "2.8.
|
3
|
+
"version": "2.8.12",
|
4
4
|
"private": false,
|
5
5
|
"description": "stand-alone library of threejs examples",
|
6
6
|
"main": "index.cjs.js",
|
@@ -32,6 +32,6 @@
|
|
32
32
|
"zstddec": "^0.0.2"
|
33
33
|
},
|
34
34
|
"peerDependencies": {
|
35
|
-
"three": ">=0.
|
35
|
+
"three": ">=0.122.0"
|
36
36
|
}
|
37
37
|
}
|
@@ -1,42 +1,14 @@
|
|
1
1
|
import { MeshBasicMaterial, WebGLRenderer, ShaderMaterial, WebGLRenderTarget } from 'three';
|
2
2
|
import { Pass, FullScreenQuad } from './Pass';
|
3
3
|
declare class AfterimagePass extends Pass {
|
4
|
-
shader:
|
5
|
-
uniforms: {
|
6
|
-
damp: {
|
7
|
-
value: number;
|
8
|
-
};
|
9
|
-
tOld: {
|
10
|
-
value: null;
|
11
|
-
};
|
12
|
-
tNew: {
|
13
|
-
value: null;
|
14
|
-
};
|
15
|
-
};
|
16
|
-
vertexShader: string;
|
17
|
-
fragmentShader: string;
|
18
|
-
};
|
4
|
+
shader: import("../shaders/AfterimageShader").IAfterimageShader;
|
19
5
|
uniforms: any;
|
20
6
|
textureComp: WebGLRenderTarget;
|
21
7
|
textureOld: WebGLRenderTarget;
|
22
8
|
shaderMaterial: ShaderMaterial;
|
23
9
|
compFsQuad: FullScreenQuad<ShaderMaterial>;
|
24
10
|
copyFsQuad: FullScreenQuad<MeshBasicMaterial>;
|
25
|
-
constructor(damp?: number, shader?:
|
26
|
-
uniforms: {
|
27
|
-
damp: {
|
28
|
-
value: number;
|
29
|
-
};
|
30
|
-
tOld: {
|
31
|
-
value: null;
|
32
|
-
};
|
33
|
-
tNew: {
|
34
|
-
value: null;
|
35
|
-
};
|
36
|
-
};
|
37
|
-
vertexShader: string;
|
38
|
-
fragmentShader: string;
|
39
|
-
});
|
11
|
+
constructor(damp?: number, shader?: import("../shaders/AfterimageShader").IAfterimageShader);
|
40
12
|
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget): void;
|
41
13
|
setSize(width: number, height: number): void;
|
42
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t={uniforms:{tDiffuse:{value:null},exposure:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define saturate(a) clamp( a, 0.0, 1.0 )","uniform sampler2D tDiffuse;","uniform float exposure;","varying vec2 vUv;","vec3 RRTAndODTFit( vec3 v ) {","\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;","\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;","\treturn a / b;","}","vec3 ACESFilmicToneMapping( vec3 color ) {","\tconst mat3 ACESInputMat = mat3(","\t\tvec3( 0.59719, 0.07600, 0.02840 ),","\t\tvec3( 0.35458, 0.90834, 0.13383 ),","\t\tvec3( 0.04823, 0.01566, 0.83777 )","\t);","\tconst mat3 ACESOutputMat = mat3(","\t\tvec3( 1.60475, -0.10208, -0.00327 ),","\t\tvec3( -0.53108, 1.10813, -0.07276 ),","\t\tvec3( -0.07367, -0.00605, 1.07602 )","\t);","\tcolor = ACESInputMat * color;","\tcolor = RRTAndODTFit( color );","\tcolor = ACESOutputMat * color;","\treturn saturate( color );","}","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\ttex.rgb *= exposure / 0.6;","\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );","}"].join("\n")};exports.ACESFilmicToneMappingShader=t;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { IUniform, Texture } from 'three';
|
2
|
+
import type { IShader } from './types';
|
3
|
+
export declare type ACESFilmicToneMappingShaderUniforms = {
|
4
|
+
exposure: IUniform<number>;
|
5
|
+
tDiffuse: IUniform<Texture | null>;
|
6
|
+
};
|
7
|
+
export interface IACESFilmicToneMappingShader extends IShader<ACESFilmicToneMappingShaderUniforms> {
|
8
|
+
}
|
9
|
+
export declare const ACESFilmicToneMappingShader: IACESFilmicToneMappingShader;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* this implementation of ACES is modified to accommodate a brighter viewing environment.
|
6
6
|
* the scale factor of 1/0.6 is subjective. see discussion in #19621.
|
7
7
|
*/
|
8
|
-
|
8
|
+
const ACESFilmicToneMappingShader = {
|
9
9
|
uniforms: {
|
10
10
|
tDiffuse: {
|
11
11
|
value: null
|
@@ -1,16 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
value: null;
|
8
|
-
};
|
9
|
-
tNew: {
|
10
|
-
value: null;
|
11
|
-
};
|
12
|
-
};
|
13
|
-
vertexShader: string;
|
14
|
-
fragmentShader: string;
|
1
|
+
import type { IUniform, Texture } from 'three';
|
2
|
+
import type { IShader } from './types';
|
3
|
+
export declare type AfterimageShaderUniforms = {
|
4
|
+
damp: IUniform<number>;
|
5
|
+
tNew: IUniform<Texture | null>;
|
6
|
+
tOld: IUniform<Texture | null>;
|
15
7
|
};
|
16
|
-
export
|
8
|
+
export interface IAfterimageShader extends IShader<AfterimageShaderUniforms> {
|
9
|
+
}
|
10
|
+
export declare const AfterimageShader: IAfterimageShader;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={uniforms:{},vertexShader:["void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};exports.BasicShader=e;
|
package/shaders/BasicShader.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
import type { IShader } from './types';
|
2
|
+
export declare type BasicShaderUniforms = {};
|
3
|
+
export interface IBasicShader extends IShader<BasicShaderUniforms> {
|
4
|
+
}
|
5
|
+
export declare const BasicShader: IBasicShader;
|
package/shaders/BasicShader.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Simple test shader
|
3
3
|
*/
|
4
|
-
|
4
|
+
const BasicShader = {
|
5
5
|
uniforms: {},
|
6
6
|
vertexShader: ['void main() {', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
|
7
7
|
fragmentShader: ['void main() {', ' gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );', '}'].join('\n')
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 base = texture2D( tDiffuse, vUv );","\tvec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","\tfloat lum = dot( lumCoeff, base.rgb );","\tvec3 blend = vec3( lum );","\tfloat L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","\tvec3 result1 = 2.0 * base.rgb * blend;","\tvec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","\tvec3 newColor = mix( result1, result2, L );","\tfloat A2 = opacity * base.a;","\tvec3 mixRGB = A2 * newColor.rgb;","\tmixRGB += ( ( 1.0 - A2 ) * base.rgb );","\tgl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};exports.BleachBypassShader=e;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
export
|
4
|
-
|
5
|
-
|
6
|
-
opacity: Uniform;
|
7
|
-
};
|
8
|
-
vertexShader: string;
|
9
|
-
fragmentShader: string;
|
1
|
+
import type { IUniform, Texture } from 'three';
|
2
|
+
import type { IShader } from './types';
|
3
|
+
export declare type BleachBypassShaderUniforms = {
|
4
|
+
opacity: IUniform<number>;
|
5
|
+
tDiffuse: IUniform<Texture | null>;
|
10
6
|
};
|
7
|
+
export interface IBleachBypassShader extends IShader<BleachBypassShaderUniforms> {
|
8
|
+
}
|
9
|
+
export declare const BleachBypassShader: IBleachBypassShader;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","\tvec4 texel1 = texture2D( tDiffuse1, vUv );","\tvec4 texel2 = texture2D( tDiffuse2, vUv );","\tgl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};exports.BlendShader=e;
|
package/shaders/BlendShader.d.ts
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export const BlendShader: {
|
1
|
+
export declare const BlendShader: {
|
4
2
|
uniforms: {
|
5
|
-
tDiffuse1:
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
tDiffuse1: {
|
4
|
+
value: null;
|
5
|
+
};
|
6
|
+
tDiffuse2: {
|
7
|
+
value: null;
|
8
|
+
};
|
9
|
+
mixRatio: {
|
10
|
+
value: number;
|
11
|
+
};
|
12
|
+
opacity: {
|
13
|
+
value: number;
|
14
|
+
};
|
9
15
|
};
|
10
16
|
vertexShader: string;
|
11
17
|
fragmentShader: string;
|