three-stdlib 2.8.10 → 2.9.0
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 +2 -52
- package/index.js +53 -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 +3 -3
- package/postprocessing/AfterimagePass.d.ts +2 -30
- package/postprocessing/RenderPixelatedPass.cjs.js +1 -0
- package/postprocessing/RenderPixelatedPass.js +213 -0
- 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/shaders/SSRShader.d.ts
CHANGED
@@ -1,11 +1,5 @@
|
|
1
|
-
import { Matrix4, Vector2
|
2
|
-
|
3
|
-
* References:
|
4
|
-
* https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
|
5
|
-
*/
|
6
|
-
|
7
|
-
export const SSRShader: SSRShader;
|
8
|
-
export interface SSRShader {
|
1
|
+
import { Matrix4, Vector2 } from 'three';
|
2
|
+
export declare const SSRShader: {
|
9
3
|
defines: {
|
10
4
|
MAX_STEP: number;
|
11
5
|
isPerspectiveCamera: boolean;
|
@@ -15,45 +9,82 @@ export interface SSRShader {
|
|
15
9
|
isSelective: boolean;
|
16
10
|
};
|
17
11
|
uniforms: {
|
18
|
-
tDiffuse:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
12
|
+
tDiffuse: {
|
13
|
+
value: null;
|
14
|
+
};
|
15
|
+
tNormal: {
|
16
|
+
value: null;
|
17
|
+
};
|
18
|
+
tMetalness: {
|
19
|
+
value: null;
|
20
|
+
};
|
21
|
+
tDepth: {
|
22
|
+
value: null;
|
23
|
+
};
|
24
|
+
cameraNear: {
|
25
|
+
value: null;
|
26
|
+
};
|
27
|
+
cameraFar: {
|
28
|
+
value: null;
|
29
|
+
};
|
30
|
+
resolution: {
|
31
|
+
value: Vector2;
|
32
|
+
};
|
33
|
+
cameraProjectionMatrix: {
|
34
|
+
value: Matrix4;
|
35
|
+
};
|
36
|
+
cameraInverseProjectionMatrix: {
|
37
|
+
value: Matrix4;
|
38
|
+
};
|
39
|
+
opacity: {
|
40
|
+
value: number;
|
41
|
+
};
|
42
|
+
maxDistance: {
|
43
|
+
value: number;
|
44
|
+
};
|
45
|
+
cameraRange: {
|
46
|
+
value: number;
|
47
|
+
};
|
48
|
+
surfDist: {
|
49
|
+
value: number;
|
50
|
+
};
|
51
|
+
thickTolerance: {
|
52
|
+
value: number;
|
53
|
+
};
|
31
54
|
};
|
32
55
|
vertexShader: string;
|
33
56
|
fragmentShader: string;
|
34
|
-
}
|
35
|
-
|
36
|
-
export const SSRDepthShader: SSRDepthShader;
|
37
|
-
export interface SSRDepthShader {
|
57
|
+
};
|
58
|
+
export declare const SSRDepthShader: {
|
38
59
|
defines: {
|
39
60
|
PERSPECTIVE_CAMERA: number;
|
40
61
|
};
|
41
62
|
uniforms: {
|
42
|
-
tDepth:
|
43
|
-
|
44
|
-
|
63
|
+
tDepth: {
|
64
|
+
value: null;
|
65
|
+
};
|
66
|
+
cameraNear: {
|
67
|
+
value: null;
|
68
|
+
};
|
69
|
+
cameraFar: {
|
70
|
+
value: null;
|
71
|
+
};
|
45
72
|
};
|
46
73
|
vertexShader: string;
|
47
74
|
fragmentShader: string;
|
48
|
-
}
|
49
|
-
|
50
|
-
export const SSRBlurShader: SSRBlurShader;
|
51
|
-
export interface SSRBlurShader {
|
75
|
+
};
|
76
|
+
export declare const SSRBlurShader: {
|
52
77
|
uniforms: {
|
53
|
-
tDiffuse:
|
54
|
-
|
55
|
-
|
78
|
+
tDiffuse: {
|
79
|
+
value: null;
|
80
|
+
};
|
81
|
+
resolution: {
|
82
|
+
value: Vector2;
|
83
|
+
};
|
84
|
+
opacity: {
|
85
|
+
value: number;
|
86
|
+
};
|
56
87
|
};
|
57
88
|
vertexShader: string;
|
58
89
|
fragmentShader: string;
|
59
|
-
}
|
90
|
+
};
|
package/shaders/SSRShader.js
CHANGED
@@ -5,7 +5,7 @@ import { Vector2, Matrix4 } from 'three';
|
|
5
5
|
* https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
8
|
+
const SSRShader = {
|
9
9
|
defines: {
|
10
10
|
MAX_STEP: 0,
|
11
11
|
isPerspectiveCamera: true,
|
@@ -241,7 +241,7 @@ var SSRShader = {
|
|
241
241
|
}
|
242
242
|
`
|
243
243
|
};
|
244
|
-
|
244
|
+
const SSRDepthShader = {
|
245
245
|
defines: {
|
246
246
|
PERSPECTIVE_CAMERA: 1
|
247
247
|
},
|
@@ -310,7 +310,7 @@ var SSRDepthShader = {
|
|
310
310
|
|
311
311
|
`
|
312
312
|
};
|
313
|
-
|
313
|
+
const SSRBlurShader = {
|
314
314
|
uniforms: {
|
315
315
|
tDiffuse: {
|
316
316
|
value: null
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const o={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tvec3 c = color.rgb;","\tcolor.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","\tcolor.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","\tcolor.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","\tgl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};exports.SepiaShader=o;
|
package/shaders/SepiaShader.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export const SepiaShader: {
|
1
|
+
export declare const SepiaShader: {
|
4
2
|
uniforms: {
|
5
|
-
tDiffuse:
|
6
|
-
|
3
|
+
tDiffuse: {
|
4
|
+
value: null;
|
5
|
+
};
|
6
|
+
amount: {
|
7
|
+
value: number;
|
8
|
+
};
|
7
9
|
};
|
8
10
|
vertexShader: string;
|
9
11
|
fragmentShader: string;
|
package/shaders/SepiaShader.js
CHANGED
@@ -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},resolution:{value:new(require("three").Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","\tconst mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","\tconst mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","\tfloat tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","\tfloat tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","\tfloat tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","\tfloat tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","\tfloat tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","\tfloat tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","\tfloat tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","\tfloat tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","\tfloat tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","\tfloat valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","\t\tGx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","\t\tGx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","\tfloat valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","\t\tGy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","\t\tGy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","\tfloat G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","\tgl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};exports.SobelOperatorShader=t;
|
@@ -1,9 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
export const SobelOperatorShader: {
|
1
|
+
import { Vector2 } from 'three';
|
2
|
+
export declare const SobelOperatorShader: {
|
4
3
|
uniforms: {
|
5
|
-
tDiffuse:
|
6
|
-
|
4
|
+
tDiffuse: {
|
5
|
+
value: null;
|
6
|
+
};
|
7
|
+
resolution: {
|
8
|
+
value: Vector2;
|
9
|
+
};
|
7
10
|
};
|
8
11
|
vertexShader: string;
|
9
12
|
fragmentShader: string;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");const t=e.ShaderChunk.meshphong_frag.slice(0,e.ShaderChunk.meshphong_frag.indexOf("void main() {")),i=e.ShaderChunk.meshphong_frag.slice(e.ShaderChunk.meshphong_frag.indexOf("void main() {")),n={uniforms:e.UniformsUtils.merge([e.ShaderLib.phong.uniforms,{thicknessMap:{value:null},thicknessColor:{value:new e.Color(16777215)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:["#define USE_UV",e.ShaderChunk.meshphong_vert].join("\n"),fragmentShader:["#define USE_UV","#define SUBSURFACE",t,"uniform sampler2D thicknessMap;","uniform float thicknessPower;","uniform float thicknessScale;","uniform float thicknessDistortion;","uniform float thicknessAmbient;","uniform float thicknessAttenuation;","uniform vec3 thicknessColor;","void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {","\tvec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;","\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));","\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;","\tvec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;","\treflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;","}",i.replace("#include <lights_fragment_begin>",(r=e.ShaderChunk.lights_fragment_begin,s="RE_Direct( directLight, geometry, material, reflectedLight );",o=["RE_Direct( directLight, geometry, material, reflectedLight );","#if defined( SUBSURFACE ) && defined( USE_UV )"," RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);","#endif"].join("\n"),r.split(s).join(o)))].join("\n")};var r,s,o;exports.SubsurfaceScatteringShader=n;
|
@@ -1,37 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export const SubsurfaceScatteringShader: {
|
4
|
-
uniforms: {
|
5
|
-
alphaMap: Uniform;
|
6
|
-
ambientLightColor: Uniform;
|
7
|
-
color: Uniform;
|
8
|
-
diffuse: Uniform;
|
9
|
-
directionalLights: Uniform;
|
10
|
-
directionalShadowMap: Uniform;
|
11
|
-
directionalShadowMatrix: Uniform;
|
12
|
-
emissive: Uniform;
|
13
|
-
hemisphereLights: Uniform;
|
14
|
-
lightProbe: Uniform;
|
15
|
-
map: Uniform;
|
16
|
-
opacity: Uniform;
|
17
|
-
pointLights: Uniform;
|
18
|
-
pointShadowMap: Uniform;
|
19
|
-
pointShadowMatrix: Uniform;
|
20
|
-
rectAreaLights: Uniform;
|
21
|
-
shininess: Uniform;
|
22
|
-
specular: Uniform;
|
23
|
-
spotLights: Uniform;
|
24
|
-
spotShadowMap: Uniform;
|
25
|
-
spotShadowMatrix: Uniform;
|
26
|
-
thicknessAmbient: Uniform;
|
27
|
-
thicknessAttenuation: Uniform;
|
28
|
-
thicknessColor: Uniform;
|
29
|
-
thicknessDistortion: Uniform;
|
30
|
-
thicknessMap: Uniform;
|
31
|
-
thicknessPower: Uniform;
|
32
|
-
thicknessScale: Uniform;
|
33
|
-
uvTransform: Uniform;
|
34
|
-
};
|
1
|
+
export declare const SubsurfaceScatteringShader: {
|
2
|
+
uniforms: any;
|
35
3
|
vertexShader: string;
|
36
4
|
fragmentShader: string;
|
37
5
|
};
|
@@ -12,9 +12,9 @@ function replaceAll(string, find, replace) {
|
|
12
12
|
return string.split(find).join(replace);
|
13
13
|
}
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
const meshphong_frag_head = ShaderChunk['meshphong_frag'].slice(0, ShaderChunk['meshphong_frag'].indexOf('void main() {'));
|
16
|
+
const meshphong_frag_body = ShaderChunk['meshphong_frag'].slice(ShaderChunk['meshphong_frag'].indexOf('void main() {'));
|
17
|
+
const SubsurfaceScatteringShader = {
|
18
18
|
uniforms: UniformsUtils.merge([ShaderLib['phong'].uniforms, {
|
19
19
|
thicknessMap: {
|
20
20
|
value: null
|
@@ -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}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","\tvec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","\tgl_FragColor = newTex;","}"].join("\n")};exports.TechnicolorShader=e;
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* More historical info here: http://www.widescreenmuseum.com/oldcolor/technicolor1.htm
|
5
5
|
* Demo here: http://charliehoey.com/technicolor_shader/shader_test.html
|
6
6
|
*/
|
7
|
-
|
7
|
+
const TechnicolorShader = {
|
8
8
|
uniforms: {
|
9
9
|
tDiffuse: {
|
10
10
|
value: null
|
@@ -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},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","\tuniform sampler2D luminanceMap;","#else","\tuniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","\t#ifdef ADAPTED_LUMINANCE","\t\tfloat fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","\t#else","\t\tfloat fLumAvg = averageLuminance;","\t#endif","\tfloat fLumPixel = linearToRelativeLuminance( vColor );","\tfloat fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","\tfloat fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","\treturn fLumCompressed * vColor;","}","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};exports.ToneMapShader=e;
|
@@ -1,13 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export const ToneMapShader: {
|
1
|
+
export declare const ToneMapShader: {
|
4
2
|
uniforms: {
|
5
|
-
tDiffuse:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
tDiffuse: {
|
4
|
+
value: null;
|
5
|
+
};
|
6
|
+
averageLuminance: {
|
7
|
+
value: number;
|
8
|
+
};
|
9
|
+
luminanceMap: {
|
10
|
+
value: null;
|
11
|
+
};
|
12
|
+
maxLuminance: {
|
13
|
+
value: number;
|
14
|
+
};
|
15
|
+
minLuminance: {
|
16
|
+
value: number;
|
17
|
+
};
|
18
|
+
middleGrey: {
|
19
|
+
value: number;
|
20
|
+
};
|
11
21
|
};
|
12
22
|
vertexShader: string;
|
13
23
|
fragmentShader: string;
|
package/shaders/ToneMapShader.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("three")
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("three");const i={uniforms:{uDirLightPos:{value:new o.Vector3},uDirLightColor:{value:new o.Color(15658734)},uAmbientLightColor:{value:new o.Color(328965)},uBaseColor:{value:new o.Color(16777215)}},vertexShader:["varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvNormal = normalize( normalMatrix * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvRefract = refract( normalize( I ), worldNormal, 1.02 );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tfloat intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );","\tintensity += length(lightWeighting) * 0.2;","\tfloat cameraWeighting = dot( normalize( vNormal ), vRefract );","\tintensity += pow( 1.0 - length( cameraWeighting ), 6.0 );","\tintensity = intensity * 0.2 + 0.3;","\tif ( intensity < 0.50 ) {","\t\tgl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );","\t} else {","\t\tgl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );","}","}"].join("\n")},r={uniforms:{uDirLightPos:{value:new o.Vector3},uDirLightColor:{value:new o.Color(15658734)},uAmbientLightColor:{value:new o.Color(328965)},uBaseColor:{value:new o.Color(15658734)},uLineColor1:{value:new o.Color(8421504)},uLineColor2:{value:new o.Color(0)},uLineColor3:{value:new o.Color(0)},uLineColor4:{value:new o.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);","\tfloat light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {","\t\tgl_FragColor *= vec4( uLineColor1, 1.0 );","\t}","\tif ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {","\t\tgl_FragColor *= vec4( uLineColor2, 1.0 );","\t}","}"].join("\n")},e={uniforms:{uDirLightPos:{value:new o.Vector3},uDirLightColor:{value:new o.Color(15658734)},uAmbientLightColor:{value:new o.Color(328965)},uBaseColor:{value:new o.Color(16777215)},uLineColor1:{value:new o.Color(0)},uLineColor2:{value:new o.Color(0)},uLineColor3:{value:new o.Color(0)},uLineColor4:{value:new o.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(lightWeighting) < 1.00 ) {","\t\tif ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.75 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor2, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor3, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.3465 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor4, 1.0 );","\t}","\t}","}"].join("\n")},t={uniforms:{uDirLightPos:{value:new o.Vector3},uDirLightColor:{value:new o.Color(15658734)},uAmbientLightColor:{value:new o.Color(328965)},uBaseColor:{value:new o.Color(16777215)},uLineColor1:{value:new o.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","gl_FragColor = vec4( uBaseColor, 1.0 );","if ( length(lightWeighting) < 1.00 ) {","\t\tif ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","}"].join("\n")};exports.ToonShader1=i,exports.ToonShader2=r,exports.ToonShaderDotted=t,exports.ToonShaderHatching=e;
|
package/shaders/ToonShader.d.ts
CHANGED
@@ -1,53 +1,99 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
export const ToonShader1: {
|
1
|
+
import { Color, Vector3 } from 'three';
|
2
|
+
export declare const ToonShader1: {
|
4
3
|
uniforms: {
|
5
|
-
uDirLightPos:
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
uDirLightPos: {
|
5
|
+
value: Vector3;
|
6
|
+
};
|
7
|
+
uDirLightColor: {
|
8
|
+
value: Color;
|
9
|
+
};
|
10
|
+
uAmbientLightColor: {
|
11
|
+
value: Color;
|
12
|
+
};
|
13
|
+
uBaseColor: {
|
14
|
+
value: Color;
|
15
|
+
};
|
9
16
|
};
|
10
17
|
vertexShader: string;
|
11
18
|
fragmentShader: string;
|
12
19
|
};
|
13
|
-
|
14
|
-
export const ToonShader2: {
|
20
|
+
export declare const ToonShader2: {
|
15
21
|
uniforms: {
|
16
|
-
uDirLightPos:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
uDirLightPos: {
|
23
|
+
value: Vector3;
|
24
|
+
};
|
25
|
+
uDirLightColor: {
|
26
|
+
value: Color;
|
27
|
+
};
|
28
|
+
uAmbientLightColor: {
|
29
|
+
value: Color;
|
30
|
+
};
|
31
|
+
uBaseColor: {
|
32
|
+
value: Color;
|
33
|
+
};
|
34
|
+
uLineColor1: {
|
35
|
+
value: Color;
|
36
|
+
};
|
37
|
+
uLineColor2: {
|
38
|
+
value: Color;
|
39
|
+
};
|
40
|
+
uLineColor3: {
|
41
|
+
value: Color;
|
42
|
+
};
|
43
|
+
uLineColor4: {
|
44
|
+
value: Color;
|
45
|
+
};
|
24
46
|
};
|
25
47
|
vertexShader: string;
|
26
48
|
fragmentShader: string;
|
27
49
|
};
|
28
|
-
|
29
|
-
export const ToonShaderHatching: {
|
50
|
+
export declare const ToonShaderHatching: {
|
30
51
|
uniforms: {
|
31
|
-
uDirLightPos:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
52
|
+
uDirLightPos: {
|
53
|
+
value: Vector3;
|
54
|
+
};
|
55
|
+
uDirLightColor: {
|
56
|
+
value: Color;
|
57
|
+
};
|
58
|
+
uAmbientLightColor: {
|
59
|
+
value: Color;
|
60
|
+
};
|
61
|
+
uBaseColor: {
|
62
|
+
value: Color;
|
63
|
+
};
|
64
|
+
uLineColor1: {
|
65
|
+
value: Color;
|
66
|
+
};
|
67
|
+
uLineColor2: {
|
68
|
+
value: Color;
|
69
|
+
};
|
70
|
+
uLineColor3: {
|
71
|
+
value: Color;
|
72
|
+
};
|
73
|
+
uLineColor4: {
|
74
|
+
value: Color;
|
75
|
+
};
|
39
76
|
};
|
40
77
|
vertexShader: string;
|
41
78
|
fragmentShader: string;
|
42
79
|
};
|
43
|
-
|
44
|
-
export const ToonShaderDotted: {
|
80
|
+
export declare const ToonShaderDotted: {
|
45
81
|
uniforms: {
|
46
|
-
uDirLightPos:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
82
|
+
uDirLightPos: {
|
83
|
+
value: Vector3;
|
84
|
+
};
|
85
|
+
uDirLightColor: {
|
86
|
+
value: Color;
|
87
|
+
};
|
88
|
+
uAmbientLightColor: {
|
89
|
+
value: Color;
|
90
|
+
};
|
91
|
+
uBaseColor: {
|
92
|
+
value: Color;
|
93
|
+
};
|
94
|
+
uLineColor1: {
|
95
|
+
value: Color;
|
96
|
+
};
|
51
97
|
};
|
52
98
|
vertexShader: string;
|
53
99
|
fragmentShader: string;
|
package/shaders/ToonShader.js
CHANGED
@@ -9,7 +9,7 @@ import { Vector3, Color } from 'three';
|
|
9
9
|
* dotted
|
10
10
|
*/
|
11
11
|
|
12
|
-
|
12
|
+
const ToonShader1 = {
|
13
13
|
uniforms: {
|
14
14
|
uDirLightPos: {
|
15
15
|
value: new Vector3()
|
@@ -27,7 +27,7 @@ var ToonShader1 = {
|
|
27
27
|
vertexShader: ['varying vec3 vNormal;', 'varying vec3 vRefract;', 'void main() {', ' vec4 worldPosition = modelMatrix * vec4( position, 1.0 );', ' vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );', ' vec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );', ' vNormal = normalize( normalMatrix * normal );', ' vec3 I = worldPosition.xyz - cameraPosition;', ' vRefract = refract( normalize( I ), worldNormal, 1.02 );', ' gl_Position = projectionMatrix * mvPosition;', '}'].join('\n'),
|
28
28
|
fragmentShader: ['uniform vec3 uBaseColor;', 'uniform vec3 uDirLightPos;', 'uniform vec3 uDirLightColor;', 'uniform vec3 uAmbientLightColor;', 'varying vec3 vNormal;', 'varying vec3 vRefract;', 'void main() {', ' float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);', ' vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;', ' float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );', ' intensity += length(lightWeighting) * 0.2;', ' float cameraWeighting = dot( normalize( vNormal ), vRefract );', ' intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );', ' intensity = intensity * 0.2 + 0.3;', ' if ( intensity < 0.50 ) {', ' gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );', ' } else {', ' gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );', '}', '}'].join('\n')
|
29
29
|
};
|
30
|
-
|
30
|
+
const ToonShader2 = {
|
31
31
|
uniforms: {
|
32
32
|
uDirLightPos: {
|
33
33
|
value: new Vector3()
|
@@ -57,7 +57,7 @@ var ToonShader2 = {
|
|
57
57
|
vertexShader: ['varying vec3 vNormal;', 'void main() {', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', ' vNormal = normalize( normalMatrix * normal );', '}'].join('\n'),
|
58
58
|
fragmentShader: ['uniform vec3 uBaseColor;', 'uniform vec3 uLineColor1;', 'uniform vec3 uLineColor2;', 'uniform vec3 uLineColor3;', 'uniform vec3 uLineColor4;', 'uniform vec3 uDirLightPos;', 'uniform vec3 uDirLightColor;', 'uniform vec3 uAmbientLightColor;', 'varying vec3 vNormal;', 'void main() {', ' float camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);', ' float light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);', ' gl_FragColor = vec4( uBaseColor, 1.0 );', ' if ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {', ' gl_FragColor *= vec4( uLineColor1, 1.0 );', ' }', ' if ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {', ' gl_FragColor *= vec4( uLineColor2, 1.0 );', ' }', '}'].join('\n')
|
59
59
|
};
|
60
|
-
|
60
|
+
const ToonShaderHatching = {
|
61
61
|
uniforms: {
|
62
62
|
uDirLightPos: {
|
63
63
|
value: new Vector3()
|
@@ -87,7 +87,7 @@ var ToonShaderHatching = {
|
|
87
87
|
vertexShader: ['varying vec3 vNormal;', 'void main() {', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', ' vNormal = normalize( normalMatrix * normal );', '}'].join('\n'),
|
88
88
|
fragmentShader: ['uniform vec3 uBaseColor;', 'uniform vec3 uLineColor1;', 'uniform vec3 uLineColor2;', 'uniform vec3 uLineColor3;', 'uniform vec3 uLineColor4;', 'uniform vec3 uDirLightPos;', 'uniform vec3 uDirLightColor;', 'uniform vec3 uAmbientLightColor;', 'varying vec3 vNormal;', 'void main() {', ' float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);', ' vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;', ' gl_FragColor = vec4( uBaseColor, 1.0 );', ' if ( length(lightWeighting) < 1.00 ) {', ' if ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {', ' gl_FragColor = vec4( uLineColor1, 1.0 );', ' }', ' }', ' if ( length(lightWeighting) < 0.75 ) {', ' if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {', ' gl_FragColor = vec4( uLineColor2, 1.0 );', ' }', ' }', ' if ( length(lightWeighting) < 0.50 ) {', ' if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {', ' gl_FragColor = vec4( uLineColor3, 1.0 );', ' }', ' }', ' if ( length(lightWeighting) < 0.3465 ) {', ' if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {', ' gl_FragColor = vec4( uLineColor4, 1.0 );', ' }', ' }', '}'].join('\n')
|
89
89
|
};
|
90
|
-
|
90
|
+
const ToonShaderDotted = {
|
91
91
|
uniforms: {
|
92
92
|
uDirLightPos: {
|
93
93
|
value: new Vector3()
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t={uniforms:{texture:{value:null},delta:{value:new(require("three").Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","\tvec4 color = vec4( 0.0 );","\tfloat total = 0.0;","\tfloat offset = rand( vUv );","\tfor ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","\t\tfloat percent = ( t + offset - 0.5 ) / ITERATIONS;","\t\tfloat weight = 1.0 - abs( percent );","\t\tcolor += texture2D( texture, vUv + delta * percent ) * weight;","\t\ttotal += weight;","\t}","\tgl_FragColor = color / total;","}"].join("\n")};exports.TriangleBlurShader=t;
|
@@ -1,9 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
export const TriangleBlurShader: {
|
1
|
+
import { Vector2 } from 'three';
|
2
|
+
export declare const TriangleBlurShader: {
|
4
3
|
uniforms: {
|
5
|
-
texture:
|
6
|
-
|
4
|
+
texture: {
|
5
|
+
value: null;
|
6
|
+
};
|
7
|
+
delta: {
|
8
|
+
value: Vector2;
|
9
|
+
};
|
7
10
|
};
|
8
11
|
vertexShader: string;
|
9
12
|
fragmentShader: string;
|
@@ -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;","#include <packing>","void main() {","\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","\tgl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};exports.UnpackDepthRGBAShader=e;
|