@luma.gl/shadertools 9.1.0-alpha.16 → 9.1.0-alpha.18
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/dist.dev.js +277 -344
- package/dist/dist.min.js +215 -314
- package/dist/index.cjs +276 -346
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/lib/shader-module/shader-module.d.ts +24 -14
- package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
- package/dist/lib/shader-module/shader-module.js +11 -15
- package/dist/lib/shader-module/shader-pass.d.ts +4 -2
- package/dist/lib/shader-module/shader-pass.d.ts.map +1 -1
- package/dist/lib/utils/uniform-types.d.ts +11 -0
- package/dist/lib/utils/uniform-types.d.ts.map +1 -0
- package/dist/lib/utils/uniform-types.js +1 -0
- package/dist/modules/engine/picking/picking.d.ts +7 -7
- package/dist/modules/engine/picking/picking.d.ts.map +1 -1
- package/dist/modules/engine/picking/picking.js +2 -2
- package/dist/modules/engine/project/project.d.ts +9 -8
- package/dist/modules/engine/project/project.d.ts.map +1 -1
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts +3 -57
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts.map +1 -1
- package/dist/modules/lighting/gouraud-material/gouraud-material.js +9 -6
- package/dist/modules/lighting/lights/lighting-uniforms-glsl.d.ts +1 -1
- package/dist/modules/lighting/lights/lighting-uniforms-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/lights/lighting-uniforms-glsl.js +35 -12
- package/dist/modules/lighting/lights/lighting.d.ts +55 -29
- package/dist/modules/lighting/lights/lighting.d.ts.map +1 -1
- package/dist/modules/lighting/lights/lighting.js +46 -35
- package/dist/modules/lighting/no-material/dirlight.d.ts +3 -3
- package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -1
- package/dist/modules/lighting/no-material/dirlight.js +1 -1
- package/dist/modules/lighting/pbr-material/pbr-fragment-glsl.d.ts +1 -1
- package/dist/modules/lighting/pbr-material/pbr-fragment-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-fragment-glsl.js +56 -60
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts +56 -98
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-material.js +14 -22
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts +10 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.js +24 -0
- package/dist/modules/lighting/pbr-material/pbr-vertex-glsl.d.ts +1 -1
- package/dist/modules/lighting/pbr-material/pbr-vertex-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-vertex-glsl.js +8 -16
- package/dist/modules/lighting/phong-material/phong-material.d.ts +5 -59
- package/dist/modules/lighting/phong-material/phong-material.d.ts.map +1 -1
- package/dist/modules/lighting/phong-material/phong-material.js +6 -4
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts +1 -40
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.js +8 -87
- package/dist/modules-webgl1/project/project.d.ts +6 -4
- package/dist/modules-webgl1/project/project.d.ts.map +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.js +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.js +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts +3 -0
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.js +3 -0
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts +2 -2
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts +1 -1
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts +1 -1
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts +15 -11
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/edgework.js +24 -12
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts +2 -2
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts +1 -1
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +9 -3
- package/src/lib/shader-module/shader-module.ts +31 -20
- package/src/lib/shader-module/shader-pass.ts +7 -4
- package/src/lib/utils/uniform-types.ts +66 -0
- package/src/modules/engine/picking/picking.ts +9 -9
- package/src/modules/engine/project/project.ts +10 -9
- package/src/modules/lighting/gouraud-material/gouraud-material.ts +14 -12
- package/src/modules/lighting/lights/lighting-uniforms-glsl.ts +35 -12
- package/src/modules/lighting/lights/lighting.ts +83 -54
- package/src/modules/lighting/no-material/dirlight.ts +3 -3
- package/src/modules/lighting/pbr-material/pbr-fragment-glsl.ts +56 -60
- package/src/modules/lighting/pbr-material/pbr-material.ts +40 -74
- package/src/modules/lighting/pbr-material/pbr-projection.ts +39 -0
- package/src/modules/lighting/pbr-material/pbr-vertex-glsl.ts +8 -16
- package/src/modules/lighting/phong-material/phong-material.ts +12 -12
- package/src/modules/lighting/phong-material/phong-shaders-glsl.ts +8 -88
- package/src/modules-webgl1/project/project.ts +8 -7
- package/src/passes/postprocessing/fxaa/fxaa.ts +2 -2
- package/src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +0 -1
- package/src/passes/postprocessing/image-adjust-filters/huesaturation.ts +0 -1
- package/src/passes/postprocessing/image-adjust-filters/vibrance.ts +3 -0
- package/src/passes/postprocessing/image-blur-filters/tiltshift.ts +2 -2
- package/src/passes/postprocessing/image-blur-filters/triangleblur.ts +1 -1
- package/src/passes/postprocessing/image-blur-filters/zoomblur.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/colorhalftone.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/dotscreen.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/edgework.ts +26 -15
- package/src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/magnify.ts +2 -2
- package/src/passes/postprocessing/image-warp-filters/bulgepinch.ts +1 -1
- package/dist/modules/lighting/gouraud-material/gouraud-shaders-glsl.d.ts +0 -42
- package/dist/modules/lighting/gouraud-material/gouraud-shaders-glsl.d.ts.map +0 -1
- package/dist/modules/lighting/gouraud-material/gouraud-shaders-glsl.js +0 -134
- package/src/modules/lighting/gouraud-material/gouraud-shaders-glsl.ts +0 -137
|
@@ -1,42 +1,3 @@
|
|
|
1
1
|
export declare const PHONG_VS = "uniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n";
|
|
2
|
-
export declare const PHONG_FS = "uniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, material.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = material.ambient * surfaceColor * lighting.ambientColor;\n\n
|
|
3
|
-
/**
|
|
4
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
5
|
-
if (i >= lighting.pointLightCount) {
|
|
6
|
-
break;
|
|
7
|
-
}
|
|
8
|
-
PointLight pointLight = lighting_getPointLight(i);
|
|
9
|
-
vec3 light_position_worldspace = pointLight.position;
|
|
10
|
-
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
11
|
-
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
15
|
-
if (i >= lighting.directionalLightCount) {
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
PointLight pointLight = lighting_getDirectionalLight(i);
|
|
19
|
-
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
24
|
-
if (i >= lighting.pointLightCount) {
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
PointLight pointLight = lighting_getPointLight(i);
|
|
28
|
-
vec3 light_position_worldspace = pointLight.position;
|
|
29
|
-
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
30
|
-
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
34
|
-
if (i >= lighting.directionalLightCount) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
PointLight pointLight = lighting_getDirectionalLight(i);
|
|
38
|
-
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
*/
|
|
2
|
+
export declare const PHONG_FS = "uniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, material.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = material.ambient * surfaceColor * lighting.ambientColor;\n\n for (int i = 0; i < lighting.pointLightCount; i++) {\n PointLight pointLight = lighting_getPointLight(i);\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);\n }\n\n int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);\n for (int i = lighting.pointLightCount; i < totalLights; i++) {\n DirectionalLight directionalLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n \n return lightColor;\n}\n";
|
|
42
3
|
//# sourceMappingURL=phong-shaders-glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phong-shaders-glsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-glsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,mKAOpB,CAAC;AAEF,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"phong-shaders-glsl.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/phong-material/phong-shaders-glsl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,mKAOpB,CAAC;AAEF,eAAO,MAAM,QAAQ,gjEA8CpB,CAAC"}
|
|
@@ -39,99 +39,20 @@ vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 positio
|
|
|
39
39
|
vec3 view_direction = normalize(cameraPosition - position_worldspace);
|
|
40
40
|
lightColor = material.ambient * surfaceColor * lighting.ambientColor;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
PointLight pointLight = lighting_getPointLight(
|
|
42
|
+
for (int i = 0; i < lighting.pointLightCount; i++) {
|
|
43
|
+
PointLight pointLight = lighting_getPointLight(i);
|
|
44
44
|
vec3 light_position_worldspace = pointLight.position;
|
|
45
45
|
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
DirectionalLight directionalLight = lighting_getDirectionalLight(0);
|
|
49
|
-
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/*
|
|
53
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
54
|
-
if (i >= lighting.pointLightCount) {
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
PointLight pointLight = lighting.pointLight[i];
|
|
58
|
-
vec3 light_position_worldspace = pointLight.position;
|
|
59
|
-
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
60
|
-
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
46
|
+
float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));
|
|
47
|
+
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);
|
|
61
48
|
}
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
DirectionalLight directionalLight = lighting.directionalLight[i];
|
|
50
|
+
int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);
|
|
51
|
+
for (int i = lighting.pointLightCount; i < totalLights; i++) {
|
|
52
|
+
DirectionalLight directionalLight = lighting_getDirectionalLight(i);
|
|
68
53
|
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
69
54
|
}
|
|
70
|
-
|
|
71
|
-
return lightColor;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
vec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
|
|
75
|
-
vec3 lightColor = vec3(0, 0, 0);
|
|
76
|
-
vec3 surfaceColor = vec3(0, 0, 0);
|
|
77
|
-
|
|
78
|
-
if (lighting.enabled == 0) {
|
|
79
|
-
vec3 view_direction = normalize(cameraPosition - position_worldspace);
|
|
80
|
-
|
|
81
|
-
switch (lighting.lightType) {
|
|
82
|
-
case 0:
|
|
83
|
-
PointLight pointLight = lighting_getPointLight(0);
|
|
84
|
-
vec3 light_position_worldspace = pointLight.position;
|
|
85
|
-
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
86
|
-
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
87
|
-
break;
|
|
88
|
-
|
|
89
|
-
case 1:
|
|
90
|
-
DirectionalLight directionalLight = lighting_getDirectionalLight(0);
|
|
91
|
-
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
55
|
+
|
|
95
56
|
return lightColor;
|
|
96
57
|
}
|
|
97
58
|
`;
|
|
98
|
-
// TODO - handle multiple lights
|
|
99
|
-
/**
|
|
100
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
101
|
-
if (i >= lighting.pointLightCount) {
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
PointLight pointLight = lighting_getPointLight(i);
|
|
105
|
-
vec3 light_position_worldspace = pointLight.position;
|
|
106
|
-
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
107
|
-
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
111
|
-
if (i >= lighting.directionalLightCount) {
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
PointLight pointLight = lighting_getDirectionalLight(i);
|
|
115
|
-
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
120
|
-
if (i >= lighting.pointLightCount) {
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
PointLight pointLight = lighting_getPointLight(i);
|
|
124
|
-
vec3 light_position_worldspace = pointLight.position;
|
|
125
|
-
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
126
|
-
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
130
|
-
if (i >= lighting.directionalLightCount) {
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
PointLight pointLight = lighting_getDirectionalLight(i);
|
|
134
|
-
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
*/
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Vector3, Matrix4 } from '@math.gl/core';
|
|
2
|
+
import type { NumberArray3, NumberArray16 } from '@math.gl/core';
|
|
1
3
|
type ProjectionProps = {
|
|
2
|
-
modelMatrix?:
|
|
3
|
-
viewMatrix?:
|
|
4
|
-
projectionMatrix?:
|
|
5
|
-
cameraPositionWorld?:
|
|
4
|
+
modelMatrix?: Readonly<Matrix4 | NumberArray16>;
|
|
5
|
+
viewMatrix?: Readonly<Matrix4 | NumberArray16>;
|
|
6
|
+
projectionMatrix?: Readonly<Matrix4 | NumberArray16>;
|
|
7
|
+
cameraPositionWorld?: Readonly<Vector3 | NumberArray3>;
|
|
6
8
|
};
|
|
7
9
|
declare function getUniforms(opts?: ProjectionProps, prevUniforms?: {}): Record<string, any>;
|
|
8
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/modules-webgl1/project/project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/modules-webgl1/project/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAE/D,KAAK,eAAe,GAAG;IACrB,WAAW,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,aAAa,CAAC,CAAC;IAChD,UAAU,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,aAAa,CAAC,CAAC;IAC/C,gBAAgB,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,aAAa,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;CACxD,CAAC;AAWF,iBAAS,WAAW,CAAC,IAAI,GAAE,eAAwC,EAAE,YAAY,KAAK,uBA2BrF;AA2ED;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;CAK+C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fxaa.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/fxaa/fxaa.ts"],"names":[],"mappings":"AAyqBA,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC;AAC3B,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;;;
|
|
1
|
+
{"version":3,"file":"fxaa.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/fxaa/fxaa.ts"],"names":[],"mappings":"AAyqBA,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC;AAC3B,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;;;CAM2C,CAAC"}
|
|
@@ -11,7 +11,6 @@ export type BrightnessContrastUniforms = BrightnessContrastProps;
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const brightnessContrast: {
|
|
13
13
|
readonly props: BrightnessContrastProps;
|
|
14
|
-
readonly uniforms: BrightnessContrastUniforms;
|
|
15
14
|
readonly name: "brightnessContrast";
|
|
16
15
|
readonly uniformTypes: {
|
|
17
16
|
readonly brightness: "f32";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brightnesscontrast.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts"],"names":[],"mappings":"AA+CA,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;oBAChB,uBAAuB
|
|
1
|
+
{"version":3,"file":"brightnesscontrast.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts"],"names":[],"mappings":"AA+CA,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;oBAChB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBkB,CAAC"}
|
|
@@ -20,7 +20,6 @@ export type HueSaturationUniforms = HueSaturationProps;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const hueSaturation: {
|
|
22
22
|
readonly props: HueSaturationProps;
|
|
23
|
-
readonly uniforms: HueSaturationUniforms;
|
|
24
23
|
readonly name: "hueSaturation";
|
|
25
24
|
readonly fs: "uniform hueSaturationUniforms {\n float hue;\n float saturation;\n} hueSaturation;\n\nvec4 hueSaturation_filterColor(vec4 color) {\n // hue adjustment, wolfram alpha: RotationTransform[angle, {1, 1, 1}][{x, y, z}]\n float angle = hueSaturation.hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(color.rgb);\n color.rgb = vec3(\n dot(color.rgb, weights.xyz),\n dot(color.rgb, weights.zxy),\n dot(color.rgb, weights.yzx)\n );\n\n // saturation adjustment\n float average = (color.r + color.g + color.b) / 3.0;\n if (hueSaturation.saturation > 0.0) {\n color.rgb += (average - color.rgb) * (1.0 - 1.0 / (1.001 - hueSaturation.saturation));\n } else {\n color.rgb += (average - color.rgb) * (-hueSaturation.saturation);\n }\n\n return color;\n}\n\nvec4 hueSaturation_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {\n return hueSaturation_filterColor(color);\n}\n";
|
|
26
25
|
readonly uniformTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"huesaturation.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-adjust-filters/huesaturation.ts"],"names":[],"mappings":"AAwCA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;iEAC6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;oBACX,kBAAkB
|
|
1
|
+
{"version":3,"file":"huesaturation.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-adjust-filters/huesaturation.ts"],"names":[],"mappings":"AAwCA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;iEAC6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;oBACX,kBAAkB;;;;;;;;;;;;;;;;;;;;;;CAckB,CAAC"}
|
|
@@ -11,6 +11,9 @@ export declare const vibrance: {
|
|
|
11
11
|
readonly props: VibranceProps;
|
|
12
12
|
readonly uniforms: VibranceUniforms;
|
|
13
13
|
readonly name: "vibrance";
|
|
14
|
+
readonly uniformTypes: {
|
|
15
|
+
readonly amount: "f32";
|
|
16
|
+
};
|
|
14
17
|
readonly propTypes: {
|
|
15
18
|
readonly amount: {
|
|
16
19
|
readonly value: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vibrance.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-adjust-filters/vibrance.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE7C,qGAAqG;AACrG,eAAO,MAAM,QAAQ;oBACN,aAAa;uBACV,gBAAgB
|
|
1
|
+
{"version":3,"file":"vibrance.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-adjust-filters/vibrance.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE7C,qGAAqG;AACrG,eAAO,MAAM,QAAQ;oBACN,aAAa;uBACV,gBAAgB;;;;;;;;;;;;;;;;CAU2B,CAAC"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export type TiltShiftProps = {
|
|
6
6
|
/** The x,y coordinate of the start of the line segment. */
|
|
7
|
-
start?: number
|
|
7
|
+
start?: [number, number];
|
|
8
8
|
/** The xm y coordinate of the end of the line segment. */
|
|
9
|
-
end?: number
|
|
9
|
+
end?: [number, number];
|
|
10
10
|
/** The maximum radius of the pyramid blur. */
|
|
11
11
|
blurRadius?: number;
|
|
12
12
|
/** The distance from the line at which the maximum blur radius is reached. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiltshift.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-blur-filters/tiltshift.ts"],"names":[],"mappings":"AAqDA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"tiltshift.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-blur-filters/tiltshift.ts"],"names":[],"mappings":"AAqDA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;oBACP,cAAc;uBACX,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuB4B,CAAC"}
|
|
@@ -8,7 +8,7 @@ export type TriangleBlurProps = {
|
|
|
8
8
|
/** The radius of the pyramid convolved with the image. */
|
|
9
9
|
radius?: number;
|
|
10
10
|
/** @deprecated internal property */
|
|
11
|
-
delta?: number
|
|
11
|
+
delta?: [number, number];
|
|
12
12
|
};
|
|
13
13
|
export type TriangleBlurUniforms = TriangleBlurProps;
|
|
14
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangleblur.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-blur-filters/triangleblur.ts"],"names":[],"mappings":"AA2CA;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"triangleblur.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-blur-filters/triangleblur.ts"],"names":[],"mappings":"AA2CA;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,YAAY;oBACV,iBAAiB;uBACd,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB+B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type ZoomBlurProps = {
|
|
5
5
|
/** - The x, y coordinate of the blur origin. */
|
|
6
|
-
center?: number
|
|
6
|
+
center?: [number, number];
|
|
7
7
|
/** - The strength of the blur. Values in the range 0 to 1 are usually sufficient, where 0 doesn't change the image and 1 creates a highly blurred image. */
|
|
8
8
|
strength?: number;
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoomblur.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-blur-filters/zoomblur.ts"],"names":[],"mappings":"AA0CA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"zoomblur.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-blur-filters/zoomblur.ts"],"names":[],"mappings":"AA0CA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,4JAA4J;IAC5J,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,QAAQ;oBACN,aAAa;uBACV,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAc2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorhalftone.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/colorhalftone.ts"],"names":[],"mappings":"AA4CA;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"colorhalftone.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/colorhalftone.ts"],"names":[],"mappings":"AA4CA;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gDAAgD;IAChD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,aAAa;oBACX,kBAAkB;uBACf,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAegC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotscreen.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/dotscreen.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"dotscreen.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/dotscreen.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iDAAiD;IACjD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,SAAS;oBACP,cAAc;uBACX,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe4B,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
export type EdgeWorkProps = {
|
|
7
7
|
/** radius The radius of the effect in pixels. */
|
|
8
8
|
radius?: number;
|
|
9
|
-
/** @deprecated
|
|
10
|
-
|
|
9
|
+
/** @deprecated xy or RGB */
|
|
10
|
+
mode?: 0 | 1;
|
|
11
11
|
};
|
|
12
12
|
export type EdgeWorkUniforms = EdgeWorkProps;
|
|
13
13
|
/**
|
|
@@ -23,27 +23,31 @@ export declare const edgeWork: {
|
|
|
23
23
|
readonly name: "random";
|
|
24
24
|
readonly fs: "float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n";
|
|
25
25
|
}];
|
|
26
|
-
readonly fs: "uniform edgeWorkUniforms {\n float radius;\n
|
|
26
|
+
readonly fs: "uniform edgeWorkUniforms {\n float radius;\n int mode;\n} edgeWork;\n\nvec4 edgeWork_sampleColorRGB(sampler2D source, vec2 texSize, vec2 texCoord, vec2 delta) {\n vec2 relativeDelta = edgeWork.radius * delta / texSize;\n\n vec2 color = vec2(0.0);\n vec2 total = vec2(0.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec3 sampleColor = texture(source, texCoord + relativeDelta * percent).rgb;\n float average = (sampleColor.r + sampleColor.g + sampleColor.b) / 3.0;\n color.x += average * weight;\n total.x += weight;\n if (abs(t) < 15.0) {\n weight = weight * 2.0 - 1.0;\n color.y += average * weight;\n total.y += weight;\n }\n }\n return vec4(color / total, 0.0, 1.0);\n}\n\nvec4 edgeWork_sampleColorXY(sampler2D source, vec2 texSize, vec2 texCoord, vec2 delta) {\n vec2 relativeDelta = edgeWork.radius * delta / texSize;\n\n vec2 color = vec2(0.0);\n vec2 total = vec2(0.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec2 sampleColor = texture(source, texCoord + relativeDelta * percent).xy;\n color.x += sampleColor.x * weight;\n total.x += weight;\n if (abs(t) < 15.0) {\n weight = weight * 2.0 - 1.0;\n color.y += sampleColor.y * weight;\n total.y += weight;\n }\n }\n float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0);\n return vec4(c, c, c, 1.0);\n}\n\nvec4 edgeWork_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {\n switch (edgeWork.mode) {\n case 0: \n return edgeWork_sampleColorRGB(source, texSize, texCoord, vec2(1., 0.));\n case 1: \n default:\n return edgeWork_sampleColorXY(source, texSize, texCoord, vec2(0., 1.));\n }\n}\n";
|
|
27
|
+
readonly uniformTypes: {
|
|
28
|
+
readonly radius: "f32";
|
|
29
|
+
readonly mode: "i32";
|
|
30
|
+
};
|
|
27
31
|
readonly propTypes: {
|
|
28
32
|
readonly radius: {
|
|
29
33
|
readonly value: 2;
|
|
30
34
|
readonly min: 1;
|
|
31
35
|
readonly softMax: 50;
|
|
32
36
|
};
|
|
33
|
-
readonly
|
|
34
|
-
readonly value:
|
|
37
|
+
readonly mode: {
|
|
38
|
+
readonly value: 0;
|
|
35
39
|
readonly private: true;
|
|
36
40
|
};
|
|
37
41
|
};
|
|
38
42
|
readonly passes: [{
|
|
39
|
-
readonly sampler:
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
43
|
+
readonly sampler: true;
|
|
44
|
+
readonly uniforms: {
|
|
45
|
+
readonly mode: 0;
|
|
42
46
|
};
|
|
43
47
|
}, {
|
|
44
|
-
readonly sampler:
|
|
45
|
-
readonly
|
|
46
|
-
readonly
|
|
48
|
+
readonly sampler: true;
|
|
49
|
+
readonly uniforms: {
|
|
50
|
+
readonly mode: 1;
|
|
47
51
|
};
|
|
48
52
|
}];
|
|
49
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edgework.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/edgework.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"edgework.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/edgework.ts"],"names":[],"mappings":"AA0EA;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,QAAQ;oBACN,aAAa;uBACV,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB8B,CAAC"}
|
|
@@ -5,11 +5,11 @@ import { random } from "../../../modules/math/random/random.js";
|
|
|
5
5
|
const fs = /* glsl */ `\
|
|
6
6
|
uniform edgeWorkUniforms {
|
|
7
7
|
float radius;
|
|
8
|
-
|
|
8
|
+
int mode;
|
|
9
9
|
} edgeWork;
|
|
10
10
|
|
|
11
|
-
vec4
|
|
12
|
-
vec2 relativeDelta = edgeWork.radius *
|
|
11
|
+
vec4 edgeWork_sampleColorRGB(sampler2D source, vec2 texSize, vec2 texCoord, vec2 delta) {
|
|
12
|
+
vec2 relativeDelta = edgeWork.radius * delta / texSize;
|
|
13
13
|
|
|
14
14
|
vec2 color = vec2(0.0);
|
|
15
15
|
vec2 total = vec2(0.0);
|
|
@@ -33,8 +33,8 @@ vec4 edgeWork_sampleColor1(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
33
33
|
return vec4(color / total, 0.0, 1.0);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
vec4
|
|
37
|
-
vec2 relativeDelta = edgeWork.radius *
|
|
36
|
+
vec4 edgeWork_sampleColorXY(sampler2D source, vec2 texSize, vec2 texCoord, vec2 delta) {
|
|
37
|
+
vec2 relativeDelta = edgeWork.radius * delta / texSize;
|
|
38
38
|
|
|
39
39
|
vec2 color = vec2(0.0);
|
|
40
40
|
vec2 total = vec2(0.0);
|
|
@@ -57,6 +57,16 @@ vec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
57
57
|
float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0);
|
|
58
58
|
return vec4(c, c, c, 1.0);
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
vec4 edgeWork_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
62
|
+
switch (edgeWork.mode) {
|
|
63
|
+
case 0:
|
|
64
|
+
return edgeWork_sampleColorRGB(source, texSize, texCoord, vec2(1., 0.));
|
|
65
|
+
case 1:
|
|
66
|
+
default:
|
|
67
|
+
return edgeWork_sampleColorXY(source, texSize, texCoord, vec2(0., 1.));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
`;
|
|
61
71
|
/**
|
|
62
72
|
* Edge Work -
|
|
@@ -69,20 +79,22 @@ export const edgeWork = {
|
|
|
69
79
|
name: 'edgeWork',
|
|
70
80
|
dependencies: [random],
|
|
71
81
|
fs,
|
|
82
|
+
uniformTypes: {
|
|
83
|
+
radius: 'f32',
|
|
84
|
+
mode: 'i32'
|
|
85
|
+
},
|
|
72
86
|
propTypes: {
|
|
73
87
|
radius: { value: 2, min: 1, softMax: 50 },
|
|
74
|
-
|
|
88
|
+
mode: { value: 0, private: true }
|
|
75
89
|
},
|
|
76
90
|
passes: [
|
|
77
91
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
propTypes: { delta: [1, 0] }
|
|
92
|
+
sampler: true,
|
|
93
|
+
uniforms: { mode: 0 }
|
|
81
94
|
},
|
|
82
95
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
propTypes: { delta: [0, 1] }
|
|
96
|
+
sampler: true,
|
|
97
|
+
uniforms: { mode: 1 }
|
|
86
98
|
}
|
|
87
99
|
]
|
|
88
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexagonalpixelate.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts"],"names":[],"mappings":"AAmDA;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"hexagonalpixelate.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts"],"names":[],"mappings":"AAmDA;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,oDAAoD;IACpD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;oBACf,sBAAsB;uBACnB,yBAAyB;;;;;;;;;;;;;;;;;;;;;;CAaoC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type MagnifyProps = {
|
|
5
5
|
/** x, y position in screen coords, both x and y is normalized and in range `[0, 1]`. `[0, 0]` is the up left corner, `[1, 1]` is the bottom right corner. Default value is `[0, 0]`. */
|
|
6
|
-
screenXY?: number
|
|
6
|
+
screenXY?: [number, number];
|
|
7
7
|
/** effect radius in pixels. Default value is `100`. */
|
|
8
8
|
radiusPixels?: number;
|
|
9
9
|
/** magnify level. Default value is `2`. */
|
|
@@ -11,7 +11,7 @@ export type MagnifyProps = {
|
|
|
11
11
|
/** border width of the effect circle, will not show border if value <= 0.0. Default value is `0`. */
|
|
12
12
|
borderWidthPixels?: number;
|
|
13
13
|
/** border color of the effect circle. Default value is `[255, 255, 255, 255]`. */
|
|
14
|
-
borderColor?: number
|
|
14
|
+
borderColor?: [number, number, number, number];
|
|
15
15
|
};
|
|
16
16
|
export type MagnifyUniforms = MagnifyProps;
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magnify.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/magnify.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,wLAAwL;IACxL,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"magnify.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-fun-filters/magnify.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,wLAAwL;IACxL,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qGAAqG;IACrG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAmBuC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Bulges or pinches the image in a circle. */
|
|
2
2
|
export type BulgePinchProps = {
|
|
3
3
|
/** The [x, y] coordinates of the center of the circle of effect. */
|
|
4
|
-
center?: number
|
|
4
|
+
center?: [number, number];
|
|
5
5
|
/** The radius of the circle of effect. */
|
|
6
6
|
radius?: number;
|
|
7
7
|
/** strength -1 to 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulgepinch.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-warp-filters/bulgepinch.ts"],"names":[],"mappings":"AAqCA,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG;IAC5B,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"bulgepinch.d.ts","sourceRoot":"","sources":["../../../../src/passes/postprocessing/image-warp-filters/bulgepinch.ts"],"names":[],"mappings":"AAqCA,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG;IAC5B,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,UAAU;oBACR,eAAe;uBACZ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/shadertools",
|
|
3
|
-
"version": "9.1.0-alpha.
|
|
3
|
+
"version": "9.1.0-alpha.18",
|
|
4
4
|
"description": "Shader module system for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@luma.gl/core": "9.1.0-alpha.
|
|
49
|
+
"@luma.gl/core": "9.1.0-alpha.17"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@math.gl/core": "4.1.0-alpha.3",
|
|
53
53
|
"@math.gl/types": "4.1.0-alpha.3",
|
|
54
54
|
"wgsl_reflect": "^1.0.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "61c927cfdc3b96eb71aa014cbeac2bfe9375c0f6"
|
|
57
57
|
}
|