@luma.gl/shadertools 9.1.0-alpha.14 → 9.1.0-alpha.16
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 +143 -122
- package/dist/dist.min.js +63 -55
- package/dist/index.cjs +141 -120
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +39 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -21
- package/dist/lib/shader-module/shader-module.d.ts +2 -2
- package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
- package/dist/lib/shader-module/shader-module.js +22 -4
- package/dist/lib/shader-module/shader-pass.d.ts +13 -6
- package/dist/lib/shader-module/shader-pass.d.ts.map +1 -1
- package/dist/module-injectors.d.ts +1 -1
- package/dist/module-injectors.d.ts.map +1 -1
- package/dist/module-injectors.js +5 -5
- package/dist/modules/lighting/lights/lighting.d.ts.map +1 -1
- package/dist/modules/lighting/lights/lighting.js +1 -0
- package/dist/modules/module-injectors.d.ts +1 -1
- package/dist/modules/module-injectors.d.ts.map +1 -1
- package/dist/modules/module-injectors.js +5 -5
- package/dist/{modules → passes}/postprocessing/fxaa/fxaa.d.ts +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/fxaa/fxaa.js +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +44 -0
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/brightnesscontrast.js +28 -5
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/denoise.d.ts +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/denoise.js +1 -1
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/huesaturation.d.ts +2 -2
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/huesaturation.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/noise.d.ts +2 -2
- package/dist/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/noise.js +2 -6
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/sepia.d.ts +2 -2
- package/dist/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/sepia.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/vibrance.d.ts +2 -2
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/vibrance.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/vignette.d.ts +6 -2
- package/dist/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-adjust-filters/vignette.js +6 -6
- package/dist/{modules → passes}/postprocessing/image-blur-filters/tiltshift.d.ts +4 -4
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-blur-filters/tiltshift.js +5 -5
- package/dist/{modules → passes}/postprocessing/image-blur-filters/triangleblur.d.ts +3 -3
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-blur-filters/triangleblur.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-blur-filters/zoomblur.d.ts +1 -1
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-blur-filters/zoomblur.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-fun-filters/colorhalftone.d.ts +2 -2
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-fun-filters/colorhalftone.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-fun-filters/dotscreen.d.ts +2 -2
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-fun-filters/dotscreen.js +2 -2
- package/dist/{modules → passes}/postprocessing/image-fun-filters/edgework.d.ts +3 -3
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-fun-filters/edgework.js +4 -4
- package/dist/{modules → passes}/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-fun-filters/hexagonalpixelate.js +1 -1
- package/dist/{modules → passes}/postprocessing/image-fun-filters/ink.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/ink.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-fun-filters/ink.js +1 -1
- package/dist/{modules → passes}/postprocessing/image-fun-filters/magnify.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-fun-filters/magnify.js +1 -1
- package/dist/{modules → passes}/postprocessing/image-warp-filters/bulgepinch.d.ts +1 -1
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-warp-filters/bulgepinch.js +1 -1
- package/dist/{modules → passes}/postprocessing/image-warp-filters/swirl.d.ts +1 -1
- package/dist/passes/postprocessing/image-warp-filters/swirl.d.ts.map +1 -0
- package/dist/{modules → passes}/postprocessing/image-warp-filters/swirl.js +1 -1
- package/dist/passes/postprocessing/image-warp-filters/warp.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +40 -40
- package/src/lib/shader-module/shader-module.ts +25 -6
- package/src/lib/shader-module/shader-pass.ts +17 -5
- package/src/module-injectors.ts +5 -5
- package/src/modules/engine/picking/README.md +9 -9
- package/src/modules/lighting/lights/lighting.ts +1 -0
- package/src/modules/module-injectors.ts +5 -5
- package/src/{modules → passes}/postprocessing/fxaa/fxaa.ts +1 -1
- package/src/{modules → passes}/postprocessing/image-adjust-filters/brightnesscontrast.ts +30 -5
- package/src/{modules → passes}/postprocessing/image-adjust-filters/denoise.ts +1 -1
- package/src/{modules → passes}/postprocessing/image-adjust-filters/huesaturation.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-adjust-filters/noise.ts +2 -6
- package/src/{modules → passes}/postprocessing/image-adjust-filters/sepia.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-adjust-filters/vibrance.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-adjust-filters/vignette.ts +6 -6
- package/src/{modules → passes}/postprocessing/image-blur-filters/tiltshift.ts +5 -5
- package/src/{modules → passes}/postprocessing/image-blur-filters/triangleblur.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-blur-filters/zoomblur.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-fun-filters/colorhalftone.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-fun-filters/dotscreen.ts +2 -2
- package/src/{modules → passes}/postprocessing/image-fun-filters/edgework.ts +4 -4
- package/src/{modules → passes}/postprocessing/image-fun-filters/hexagonalpixelate.ts +1 -1
- package/src/{modules → passes}/postprocessing/image-fun-filters/ink.ts +1 -1
- package/src/{modules → passes}/postprocessing/image-fun-filters/magnify.ts +1 -1
- package/src/{modules → passes}/postprocessing/image-warp-filters/bulgepinch.ts +1 -1
- package/src/{modules → passes}/postprocessing/image-warp-filters/swirl.ts +1 -1
- package/dist/modules/postprocessing/fxaa/fxaa.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +0 -39
- package/dist/modules/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/denoise.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/huesaturation.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/noise.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/sepia.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/vibrance.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-adjust-filters/vignette.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-blur-filters/tiltshift.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-blur-filters/triangleblur.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-blur-filters/zoomblur.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-fun-filters/colorhalftone.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-fun-filters/dotscreen.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-fun-filters/edgework.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-fun-filters/ink.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-fun-filters/magnify.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-warp-filters/bulgepinch.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-warp-filters/swirl.d.ts.map +0 -1
- package/dist/modules/postprocessing/image-warp-filters/warp.d.ts.map +0 -1
- /package/dist/{modules → passes}/postprocessing/image-warp-filters/warp.d.ts +0 -0
- /package/dist/{modules → passes}/postprocessing/image-warp-filters/warp.js +0 -0
- /package/src/{modules → passes}/postprocessing/image-warp-filters/warp.ts +0 -0
package/dist/dist.dev.js
CHANGED
|
@@ -203,20 +203,20 @@ var __exports__ = (() => {
|
|
|
203
203
|
var MODULE_INJECTORS_FS = (
|
|
204
204
|
/* glsl */
|
|
205
205
|
`#ifdef MODULE_MATERIAL
|
|
206
|
-
|
|
206
|
+
fragColor = material_filterColor(fragColor);
|
|
207
207
|
#endif
|
|
208
208
|
|
|
209
209
|
#ifdef MODULE_LIGHTING
|
|
210
|
-
|
|
210
|
+
fragColor = lighting_filterColor(fragColor);
|
|
211
211
|
#endif
|
|
212
212
|
|
|
213
213
|
#ifdef MODULE_FOG
|
|
214
|
-
|
|
214
|
+
fragColor = fog_filterColor(fragColor);
|
|
215
215
|
#endif
|
|
216
216
|
|
|
217
217
|
#ifdef MODULE_PICKING
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
fragColor = picking_filterHighlightColor(fragColor);
|
|
219
|
+
fragColor = picking_filterPickingColor(fragColor);
|
|
220
220
|
#endif
|
|
221
221
|
|
|
222
222
|
#ifdef MODULE_LOGDEPTH
|
|
@@ -260,7 +260,7 @@ var __exports__ = (() => {
|
|
|
260
260
|
throw new Error(type);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
function injectShader(
|
|
263
|
+
function injectShader(source2, stage, inject, injectStandardStubs = false) {
|
|
264
264
|
const isVertex = stage === "vertex";
|
|
265
265
|
for (const key in inject) {
|
|
266
266
|
const fragmentData = inject[key];
|
|
@@ -274,43 +274,43 @@ var __exports__ = (() => {
|
|
|
274
274
|
switch (key) {
|
|
275
275
|
case "vs:#decl":
|
|
276
276
|
if (isVertex) {
|
|
277
|
-
|
|
277
|
+
source2 = source2.replace(DECLARATION_INJECT_MARKER, fragmentString);
|
|
278
278
|
}
|
|
279
279
|
break;
|
|
280
280
|
case "vs:#main-start":
|
|
281
281
|
if (isVertex) {
|
|
282
|
-
|
|
282
|
+
source2 = source2.replace(REGEX_START_OF_MAIN, (match) => match + fragmentString);
|
|
283
283
|
}
|
|
284
284
|
break;
|
|
285
285
|
case "vs:#main-end":
|
|
286
286
|
if (isVertex) {
|
|
287
|
-
|
|
287
|
+
source2 = source2.replace(REGEX_END_OF_MAIN, (match) => fragmentString + match);
|
|
288
288
|
}
|
|
289
289
|
break;
|
|
290
290
|
case "fs:#decl":
|
|
291
291
|
if (!isVertex) {
|
|
292
|
-
|
|
292
|
+
source2 = source2.replace(DECLARATION_INJECT_MARKER, fragmentString);
|
|
293
293
|
}
|
|
294
294
|
break;
|
|
295
295
|
case "fs:#main-start":
|
|
296
296
|
if (!isVertex) {
|
|
297
|
-
|
|
297
|
+
source2 = source2.replace(REGEX_START_OF_MAIN, (match) => match + fragmentString);
|
|
298
298
|
}
|
|
299
299
|
break;
|
|
300
300
|
case "fs:#main-end":
|
|
301
301
|
if (!isVertex) {
|
|
302
|
-
|
|
302
|
+
source2 = source2.replace(REGEX_END_OF_MAIN, (match) => fragmentString + match);
|
|
303
303
|
}
|
|
304
304
|
break;
|
|
305
305
|
default:
|
|
306
|
-
|
|
306
|
+
source2 = source2.replace(key, (match) => match + fragmentString);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
|
|
309
|
+
source2 = source2.replace(DECLARATION_INJECT_MARKER, "");
|
|
310
310
|
if (injectStandardStubs) {
|
|
311
|
-
|
|
311
|
+
source2 = source2.replace(/\}\s*$/, (match) => match + MODULE_INJECTORS[stage]);
|
|
312
312
|
}
|
|
313
|
-
return
|
|
313
|
+
return source2;
|
|
314
314
|
}
|
|
315
315
|
function combineInjects(injects) {
|
|
316
316
|
const result = {};
|
|
@@ -334,7 +334,7 @@ ${inject[key]}` : inject[key];
|
|
|
334
334
|
}
|
|
335
335
|
initializeShaderModules(module.dependencies || []);
|
|
336
336
|
const {
|
|
337
|
-
|
|
337
|
+
propTypes = {},
|
|
338
338
|
deprecations = [],
|
|
339
339
|
// defines = {},
|
|
340
340
|
inject = {}
|
|
@@ -343,15 +343,15 @@ ${inject[key]}` : inject[key];
|
|
|
343
343
|
normalizedInjections: normalizeInjections(inject),
|
|
344
344
|
parsedDeprecations: parseDeprecationDefinitions(deprecations)
|
|
345
345
|
};
|
|
346
|
-
if (
|
|
347
|
-
instance.propValidators = makePropValidators(
|
|
346
|
+
if (propTypes) {
|
|
347
|
+
instance.propValidators = makePropValidators(propTypes);
|
|
348
348
|
}
|
|
349
349
|
module.instance = instance;
|
|
350
350
|
}
|
|
351
351
|
function getShaderModuleUniforms(module, props, oldUniforms) {
|
|
352
352
|
initializeShaderModule(module);
|
|
353
353
|
const uniforms = oldUniforms || { ...module.defaultUniforms };
|
|
354
|
-
if (module.getUniforms) {
|
|
354
|
+
if (props && module.getUniforms) {
|
|
355
355
|
return module.getUniforms(props, uniforms);
|
|
356
356
|
}
|
|
357
357
|
return getValidatedProperties(props, module.instance?.propValidators, module.name);
|
|
@@ -476,18 +476,18 @@ ${inject[key]}` : inject[key];
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
// src/lib/shader-transpiler/transpile-glsl-shader.ts
|
|
479
|
-
function transpileGLSLShader(
|
|
480
|
-
const sourceGLSLVersion = Number(
|
|
479
|
+
function transpileGLSLShader(source2, stage) {
|
|
480
|
+
const sourceGLSLVersion = Number(source2.match(/^#version[ \t]+(\d+)/m)?.[1] || 100);
|
|
481
481
|
if (sourceGLSLVersion !== 300) {
|
|
482
482
|
throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");
|
|
483
483
|
}
|
|
484
484
|
switch (stage) {
|
|
485
485
|
case "vertex":
|
|
486
|
-
|
|
487
|
-
return
|
|
486
|
+
source2 = convertShader(source2, ES300_VERTEX_REPLACEMENTS);
|
|
487
|
+
return source2;
|
|
488
488
|
case "fragment":
|
|
489
|
-
|
|
490
|
-
return
|
|
489
|
+
source2 = convertShader(source2, ES300_FRAGMENT_REPLACEMENTS);
|
|
490
|
+
return source2;
|
|
491
491
|
default:
|
|
492
492
|
throw new Error(stage);
|
|
493
493
|
}
|
|
@@ -511,11 +511,11 @@ ${inject[key]}` : inject[key];
|
|
|
511
511
|
// `varying` keyword replaced with `in`
|
|
512
512
|
[makeVariableTextRegExp("varying"), "in $1"]
|
|
513
513
|
];
|
|
514
|
-
function convertShader(
|
|
514
|
+
function convertShader(source2, replacements) {
|
|
515
515
|
for (const [pattern, replacement] of replacements) {
|
|
516
|
-
|
|
516
|
+
source2 = source2.replace(pattern, replacement);
|
|
517
517
|
}
|
|
518
|
-
return
|
|
518
|
+
return source2;
|
|
519
519
|
}
|
|
520
520
|
function makeVariableTextRegExp(qualifier) {
|
|
521
521
|
return new RegExp(`\\b${qualifier}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`, "g");
|
|
@@ -577,11 +577,11 @@ ${inject[key]}` : inject[key];
|
|
|
577
577
|
}
|
|
578
578
|
|
|
579
579
|
// src/lib/glsl-utils/get-shader-info.ts
|
|
580
|
-
function getShaderInfo(
|
|
580
|
+
function getShaderInfo(source2, defaultName) {
|
|
581
581
|
return {
|
|
582
|
-
name: getShaderName(
|
|
582
|
+
name: getShaderName(source2, defaultName),
|
|
583
583
|
language: "glsl",
|
|
584
|
-
version: getShaderVersion(
|
|
584
|
+
version: getShaderVersion(source2)
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
function getShaderName(shader, defaultName = "unnamed") {
|
|
@@ -589,9 +589,9 @@ ${inject[key]}` : inject[key];
|
|
|
589
589
|
const match = SHADER_NAME_REGEXP.exec(shader);
|
|
590
590
|
return match ? match[1] : defaultName;
|
|
591
591
|
}
|
|
592
|
-
function getShaderVersion(
|
|
592
|
+
function getShaderVersion(source2) {
|
|
593
593
|
let version = 100;
|
|
594
|
-
const words =
|
|
594
|
+
const words = source2.match(/[^\s]+/g);
|
|
595
595
|
if (words && words.length >= 2 && words[0] === "#version") {
|
|
596
596
|
const parsedVersion = parseInt(words[1], 10);
|
|
597
597
|
if (Number.isFinite(parsedVersion)) {
|
|
@@ -649,7 +649,7 @@ ${DECLARATION_INJECT_MARKER}
|
|
|
649
649
|
function assembleShaderWGSL(platformInfo, options) {
|
|
650
650
|
const {
|
|
651
651
|
// id,
|
|
652
|
-
source,
|
|
652
|
+
source: source2,
|
|
653
653
|
stage,
|
|
654
654
|
modules,
|
|
655
655
|
// defines = {},
|
|
@@ -657,8 +657,8 @@ ${DECLARATION_INJECT_MARKER}
|
|
|
657
657
|
inject = {},
|
|
658
658
|
log: log2
|
|
659
659
|
} = options;
|
|
660
|
-
assert(typeof
|
|
661
|
-
const coreSource =
|
|
660
|
+
assert(typeof source2 === "string", "shader source must be a string");
|
|
661
|
+
const coreSource = source2;
|
|
662
662
|
let assembledSource = "";
|
|
663
663
|
const hookFunctionMap = normalizeShaderHooks(hookFunctions);
|
|
664
664
|
const hookInjections = {};
|
|
@@ -714,7 +714,7 @@ ${DECLARATION_INJECT_MARKER}
|
|
|
714
714
|
function assembleShaderGLSL(platformInfo, options) {
|
|
715
715
|
const {
|
|
716
716
|
id,
|
|
717
|
-
source,
|
|
717
|
+
source: source2,
|
|
718
718
|
stage,
|
|
719
719
|
language = "glsl",
|
|
720
720
|
modules,
|
|
@@ -724,11 +724,11 @@ ${DECLARATION_INJECT_MARKER}
|
|
|
724
724
|
prologue = true,
|
|
725
725
|
log: log2
|
|
726
726
|
} = options;
|
|
727
|
-
assert(typeof
|
|
728
|
-
const sourceVersion = language === "glsl" ? getShaderInfo(
|
|
727
|
+
assert(typeof source2 === "string", "shader source must be a string");
|
|
728
|
+
const sourceVersion = language === "glsl" ? getShaderInfo(source2).version : -1;
|
|
729
729
|
const targetVersion = platformInfo.shaderLanguageVersion;
|
|
730
730
|
const sourceVersionDirective = sourceVersion === 100 ? "#version 100" : "#version 300 es";
|
|
731
|
-
const sourceLines =
|
|
731
|
+
const sourceLines = source2.split("\n");
|
|
732
732
|
const coreSource = sourceLines.slice(1).join("\n");
|
|
733
733
|
const allDefines = {};
|
|
734
734
|
modules.forEach((module) => {
|
|
@@ -743,7 +743,7 @@ ${DECLARATION_INJECT_MARKER}
|
|
|
743
743
|
assembledSource = prologue ? `${sourceVersionDirective}
|
|
744
744
|
|
|
745
745
|
// ----- PROLOGUE -------------------------
|
|
746
|
-
${getShaderNameDefine({ id, source, stage })}
|
|
746
|
+
${getShaderNameDefine({ id, source: source2, stage })}
|
|
747
747
|
${`#define SHADER_TYPE_${stage.toUpperCase()}`}
|
|
748
748
|
|
|
749
749
|
${getPlatformShaderDefines(platformInfo)}
|
|
@@ -822,8 +822,8 @@ ${getApplicationDefines(allDefines)}
|
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
824
|
function getShaderNameDefine(options) {
|
|
825
|
-
const { id, source, stage } = options;
|
|
826
|
-
const injectShaderName = id &&
|
|
825
|
+
const { id, source: source2, stage } = options;
|
|
826
|
+
const injectShaderName = id && source2.indexOf("SHADER_NAME") === -1;
|
|
827
827
|
return injectShaderName ? `
|
|
828
828
|
#define SHADER_NAME ${id}_${stage}` : "";
|
|
829
829
|
}
|
|
@@ -857,23 +857,23 @@ ${getApplicationDefines(allDefines)}
|
|
|
857
857
|
throw new Error("Shader module must have a name");
|
|
858
858
|
}
|
|
859
859
|
const moduleName = module.name.toUpperCase().replace(/[^0-9a-z]/gi, "_");
|
|
860
|
-
let
|
|
860
|
+
let source2 = `// ----- MODULE ${module.name} ---------------
|
|
861
861
|
|
|
862
862
|
`;
|
|
863
863
|
if (stage !== "wgsl") {
|
|
864
|
-
|
|
864
|
+
source2 += `#define MODULE_${moduleName}
|
|
865
865
|
`;
|
|
866
866
|
}
|
|
867
|
-
|
|
867
|
+
source2 += `${moduleSource}
|
|
868
868
|
`;
|
|
869
|
-
return
|
|
869
|
+
return source2;
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
// src/lib/preprocessor/preprocessor.ts
|
|
873
873
|
var IFDEF_REGEXP = /^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/;
|
|
874
874
|
var ENDIF_REGEXP = /^\s*\#\s*endif\s*$/;
|
|
875
|
-
function preprocess(
|
|
876
|
-
const lines =
|
|
875
|
+
function preprocess(source2, options) {
|
|
876
|
+
const lines = source2.split("\n");
|
|
877
877
|
const output = [];
|
|
878
878
|
let conditional = true;
|
|
879
879
|
let currentDefine = null;
|
|
@@ -943,14 +943,14 @@ ${getApplicationDefines(allDefines)}
|
|
|
943
943
|
assembleWGSLShader(props) {
|
|
944
944
|
const modules = this._getModuleList(props.modules);
|
|
945
945
|
const hookFunctions = this._hookFunctions;
|
|
946
|
-
const { source, getUniforms: getUniforms9 } = assembleWGSLShader({
|
|
946
|
+
const { source: source2, getUniforms: getUniforms9 } = assembleWGSLShader({
|
|
947
947
|
...props,
|
|
948
948
|
// @ts-expect-error
|
|
949
949
|
source: props.source,
|
|
950
950
|
modules,
|
|
951
951
|
hookFunctions
|
|
952
952
|
});
|
|
953
|
-
const preprocessedSource = props.platformInfo.shaderLanguage === "wgsl" ? preprocess(
|
|
953
|
+
const preprocessedSource = props.platformInfo.shaderLanguage === "wgsl" ? preprocess(source2) : source2;
|
|
954
954
|
return { source: preprocessedSource, getUniforms: getUniforms9, modules };
|
|
955
955
|
}
|
|
956
956
|
/**
|
|
@@ -2510,12 +2510,12 @@ void main() {
|
|
|
2510
2510
|
}
|
|
2511
2511
|
};
|
|
2512
2512
|
var WgslScanner = class {
|
|
2513
|
-
constructor(
|
|
2513
|
+
constructor(source2) {
|
|
2514
2514
|
this._tokens = [];
|
|
2515
2515
|
this._start = 0;
|
|
2516
2516
|
this._current = 0;
|
|
2517
2517
|
this._line = 1;
|
|
2518
|
-
this._source =
|
|
2518
|
+
this._source = source2 !== null && source2 !== void 0 ? source2 : "";
|
|
2519
2519
|
}
|
|
2520
2520
|
/// Scan all tokens from the source.
|
|
2521
2521
|
scanTokens() {
|
|
@@ -4626,11 +4626,11 @@ void main() {
|
|
|
4626
4626
|
});
|
|
4627
4627
|
|
|
4628
4628
|
// src/lib/wgsl/get-shader-layout-wgsl.ts
|
|
4629
|
-
function getShaderLayoutFromWGSL(
|
|
4629
|
+
function getShaderLayoutFromWGSL(source2) {
|
|
4630
4630
|
const shaderLayout = { attributes: [], bindings: [] };
|
|
4631
4631
|
let parsedWGSL;
|
|
4632
4632
|
try {
|
|
4633
|
-
parsedWGSL = parseWGSL(
|
|
4633
|
+
parsedWGSL = parseWGSL(source2);
|
|
4634
4634
|
} catch (error) {
|
|
4635
4635
|
import_core.log.error(error.message)();
|
|
4636
4636
|
return shaderLayout;
|
|
@@ -4670,9 +4670,9 @@ void main() {
|
|
|
4670
4670
|
function getType(type) {
|
|
4671
4671
|
return type.format ? `${type.name}<${type.format.name}>` : type.name;
|
|
4672
4672
|
}
|
|
4673
|
-
function parseWGSL(
|
|
4673
|
+
function parseWGSL(source2) {
|
|
4674
4674
|
try {
|
|
4675
|
-
return new WgslReflect(
|
|
4675
|
+
return new WgslReflect(source2);
|
|
4676
4676
|
} catch (error) {
|
|
4677
4677
|
if (error instanceof Error) {
|
|
4678
4678
|
throw error;
|
|
@@ -8041,11 +8041,31 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
8041
8041
|
}
|
|
8042
8042
|
};
|
|
8043
8043
|
|
|
8044
|
-
// src/
|
|
8044
|
+
// src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts
|
|
8045
|
+
var source = (
|
|
8046
|
+
/* wgsl */
|
|
8047
|
+
`struct brightnessContrastUniforms {
|
|
8048
|
+
float brightness;
|
|
8049
|
+
float contrast;
|
|
8050
|
+
};
|
|
8051
|
+
|
|
8052
|
+
// Binding 0:1 is reserved for shader passes
|
|
8053
|
+
@binding(1) @group(0) var<uniform> brightnessContrast : brightnessContrastUniforms;
|
|
8054
|
+
|
|
8055
|
+
fn brightnessContrast_filterColor_ext(color: vec4<f32>, texSize: vec2<f32>, texCoords: vec2<f32>) -> vec4<f32> {
|
|
8056
|
+
color.rgb += brightnessContrast.brightness;
|
|
8057
|
+
if (brightnessContrast.contrast > 0.0) {
|
|
8058
|
+
color.rgb = (color.rgb - 0.5) / (1.0 - brightnessContrast.contrast) + 0.5;
|
|
8059
|
+
} else {
|
|
8060
|
+
color.rgb = (color.rgb - 0.5) * (1.0 + brightnessContrast.contrast) + 0.5;
|
|
8061
|
+
}
|
|
8062
|
+
return color;
|
|
8063
|
+
}
|
|
8064
|
+
`
|
|
8065
|
+
);
|
|
8045
8066
|
var fs4 = (
|
|
8046
8067
|
/* glsl */
|
|
8047
|
-
`
|
|
8048
|
-
uniform brightnessContrastUniforms {
|
|
8068
|
+
`uniform brightnessContrastUniforms {
|
|
8049
8069
|
float brightness;
|
|
8050
8070
|
float contrast;
|
|
8051
8071
|
} brightnessContrast;
|
|
@@ -8060,7 +8080,7 @@ vec4 brightnessContrast_filterColor(vec4 color) {
|
|
|
8060
8080
|
return color;
|
|
8061
8081
|
}
|
|
8062
8082
|
|
|
8063
|
-
vec4
|
|
8083
|
+
vec4 brightnessContrast_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8064
8084
|
return brightnessContrast_filterColor(color);
|
|
8065
8085
|
}
|
|
8066
8086
|
`
|
|
@@ -8073,15 +8093,20 @@ vec4 brightnessContrast_filterColor(vec4 color, vec2 texSize, vec2 texCoords) {
|
|
|
8073
8093
|
brightness: "f32",
|
|
8074
8094
|
contrast: "f32"
|
|
8075
8095
|
},
|
|
8076
|
-
|
|
8096
|
+
defaultUniforms: {
|
|
8097
|
+
brightness: 0,
|
|
8098
|
+
contrast: 0
|
|
8099
|
+
},
|
|
8100
|
+
propTypes: {
|
|
8077
8101
|
brightness: { format: "f32", value: 0, min: -1, max: 1 },
|
|
8078
8102
|
contrast: { format: "f32", value: 0, min: -1, max: 1 }
|
|
8079
8103
|
},
|
|
8080
|
-
|
|
8081
|
-
|
|
8104
|
+
passes: [{ filter: true }],
|
|
8105
|
+
source,
|
|
8106
|
+
fs: fs4
|
|
8082
8107
|
};
|
|
8083
8108
|
|
|
8084
|
-
// src/
|
|
8109
|
+
// src/passes/postprocessing/image-adjust-filters/denoise.ts
|
|
8085
8110
|
var fs5 = (
|
|
8086
8111
|
/* glsl */
|
|
8087
8112
|
`uniform denoiseUniforms {
|
|
@@ -8115,7 +8140,7 @@ vec4 denoise_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8115
8140
|
uniformTypes: {
|
|
8116
8141
|
strength: "f32"
|
|
8117
8142
|
},
|
|
8118
|
-
|
|
8143
|
+
propTypes: {
|
|
8119
8144
|
strength: { format: "f32", value: 0.5, min: 0, max: 1 }
|
|
8120
8145
|
// strength: {..., adjust: (strength: number): number => 0.53 + 200 * Math.pow(1 - strength, 4) // TODO - JS preprocessing
|
|
8121
8146
|
},
|
|
@@ -8123,7 +8148,7 @@ vec4 denoise_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8123
8148
|
passes: [{ sampler: true }, { sampler: true }]
|
|
8124
8149
|
};
|
|
8125
8150
|
|
|
8126
|
-
// src/
|
|
8151
|
+
// src/passes/postprocessing/image-adjust-filters/huesaturation.ts
|
|
8127
8152
|
var fs6 = (
|
|
8128
8153
|
/* glsl */
|
|
8129
8154
|
`uniform hueSaturationUniforms {
|
|
@@ -8154,7 +8179,7 @@ vec4 hueSaturation_filterColor(vec4 color) {
|
|
|
8154
8179
|
return color;
|
|
8155
8180
|
}
|
|
8156
8181
|
|
|
8157
|
-
vec4
|
|
8182
|
+
vec4 hueSaturation_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8158
8183
|
return hueSaturation_filterColor(color);
|
|
8159
8184
|
}
|
|
8160
8185
|
`
|
|
@@ -8168,14 +8193,14 @@ vec4 hueSaturation_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8168
8193
|
hue: "f32",
|
|
8169
8194
|
saturation: "f32"
|
|
8170
8195
|
},
|
|
8171
|
-
|
|
8196
|
+
propTypes: {
|
|
8172
8197
|
hue: { value: 0, min: -1, max: 1 },
|
|
8173
8198
|
saturation: { value: 0, min: -1, max: 1 }
|
|
8174
8199
|
},
|
|
8175
8200
|
passes: [{ filter: true }]
|
|
8176
8201
|
};
|
|
8177
8202
|
|
|
8178
|
-
// src/
|
|
8203
|
+
// src/passes/postprocessing/image-adjust-filters/noise.ts
|
|
8179
8204
|
var fs7 = (
|
|
8180
8205
|
/* glsl */
|
|
8181
8206
|
`uniform noiseUniforms {
|
|
@@ -8186,17 +8211,13 @@ float rand(vec2 co) {
|
|
|
8186
8211
|
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
|
8187
8212
|
}
|
|
8188
8213
|
|
|
8189
|
-
vec4
|
|
8214
|
+
vec4 noise_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8190
8215
|
float diff = (rand(texCoord) - 0.5) * noise.amount;
|
|
8191
8216
|
color.r += diff;
|
|
8192
8217
|
color.g += diff;
|
|
8193
8218
|
color.b += diff;
|
|
8194
8219
|
return color;
|
|
8195
8220
|
}
|
|
8196
|
-
|
|
8197
|
-
vec4 noise_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8198
|
-
return noise_filterColor(color, texCoord);
|
|
8199
|
-
}
|
|
8200
8221
|
`
|
|
8201
8222
|
);
|
|
8202
8223
|
var noise = {
|
|
@@ -8206,14 +8227,14 @@ vec4 noise_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8206
8227
|
uniformTypes: {
|
|
8207
8228
|
amount: "f32"
|
|
8208
8229
|
},
|
|
8209
|
-
|
|
8230
|
+
propTypes: {
|
|
8210
8231
|
amount: { value: 0.5, min: 0, max: 1 }
|
|
8211
8232
|
},
|
|
8212
8233
|
fs: fs7,
|
|
8213
8234
|
passes: [{ filter: true }]
|
|
8214
8235
|
};
|
|
8215
8236
|
|
|
8216
|
-
// src/
|
|
8237
|
+
// src/passes/postprocessing/image-adjust-filters/sepia.ts
|
|
8217
8238
|
var fs8 = (
|
|
8218
8239
|
/* glsl */
|
|
8219
8240
|
`uniform sepiaUniforms {
|
|
@@ -8233,7 +8254,7 @@ vec4 sepia_filterColor(vec4 color) {
|
|
|
8233
8254
|
return color;
|
|
8234
8255
|
}
|
|
8235
8256
|
|
|
8236
|
-
vec4
|
|
8257
|
+
vec4 sepia_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8237
8258
|
return sepia_filterColor(color);
|
|
8238
8259
|
}
|
|
8239
8260
|
`
|
|
@@ -8245,14 +8266,14 @@ vec4 sepia_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8245
8266
|
uniformTypes: {
|
|
8246
8267
|
amount: "f32"
|
|
8247
8268
|
},
|
|
8248
|
-
|
|
8269
|
+
propTypes: {
|
|
8249
8270
|
amount: { value: 0.5, min: 0, max: 1 }
|
|
8250
8271
|
},
|
|
8251
8272
|
fs: fs8,
|
|
8252
8273
|
passes: [{ filter: true }]
|
|
8253
8274
|
};
|
|
8254
8275
|
|
|
8255
|
-
// src/
|
|
8276
|
+
// src/passes/postprocessing/image-adjust-filters/vibrance.ts
|
|
8256
8277
|
var fs9 = (
|
|
8257
8278
|
/* glsl */
|
|
8258
8279
|
`uniform vibranceUniforms {
|
|
@@ -8267,7 +8288,7 @@ vec4 vibrance_filterColor(vec4 color) {
|
|
|
8267
8288
|
return color;
|
|
8268
8289
|
}
|
|
8269
8290
|
|
|
8270
|
-
vec4
|
|
8291
|
+
vec4 vibrance_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8271
8292
|
return vibrance_filterColor(color);
|
|
8272
8293
|
}
|
|
8273
8294
|
`
|
|
@@ -8276,14 +8297,14 @@ vec4 vibrance_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8276
8297
|
props: {},
|
|
8277
8298
|
uniforms: {},
|
|
8278
8299
|
name: "vibrance",
|
|
8279
|
-
|
|
8300
|
+
propTypes: {
|
|
8280
8301
|
amount: { value: 0, min: -1, max: 1 }
|
|
8281
8302
|
},
|
|
8282
8303
|
fs: fs9,
|
|
8283
8304
|
passes: [{ filter: true }]
|
|
8284
8305
|
};
|
|
8285
8306
|
|
|
8286
|
-
// src/
|
|
8307
|
+
// src/passes/postprocessing/image-adjust-filters/vignette.ts
|
|
8287
8308
|
var fs10 = (
|
|
8288
8309
|
/* glsl */
|
|
8289
8310
|
`uniform vignetteUniforms {
|
|
@@ -8291,15 +8312,11 @@ vec4 vibrance_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8291
8312
|
float amount;
|
|
8292
8313
|
} vignette;
|
|
8293
8314
|
|
|
8294
|
-
vec4
|
|
8315
|
+
vec4 vignette_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8295
8316
|
float dist = distance(texCoord, vec2(0.5, 0.5));
|
|
8296
8317
|
float ratio = smoothstep(0.8, vignette.radius * 0.799, dist * (vignette.amount + vignette.radius));
|
|
8297
8318
|
return color.rgba * ratio + (1.0 - ratio)*vec4(0.0, 0.0, 0.0, 1.0);
|
|
8298
8319
|
}
|
|
8299
|
-
|
|
8300
|
-
vec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8301
|
-
return vignette_filterColor(color, texCoord);
|
|
8302
|
-
}
|
|
8303
8320
|
`
|
|
8304
8321
|
);
|
|
8305
8322
|
var vignette = {
|
|
@@ -8310,7 +8327,11 @@ vec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8310
8327
|
radius: "f32",
|
|
8311
8328
|
amount: "f32"
|
|
8312
8329
|
},
|
|
8313
|
-
|
|
8330
|
+
defaultUniforms: {
|
|
8331
|
+
radius: 0.5,
|
|
8332
|
+
amount: 0.5
|
|
8333
|
+
},
|
|
8334
|
+
propTypes: {
|
|
8314
8335
|
radius: { value: 0.5, min: 0, max: 1 },
|
|
8315
8336
|
amount: { value: 0.5, min: 0, max: 1 }
|
|
8316
8337
|
},
|
|
@@ -8318,7 +8339,7 @@ vec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8318
8339
|
fs: fs10
|
|
8319
8340
|
};
|
|
8320
8341
|
|
|
8321
|
-
// src/
|
|
8342
|
+
// src/passes/postprocessing/image-blur-filters/tiltshift.ts
|
|
8322
8343
|
var fs11 = (
|
|
8323
8344
|
/* glsl */
|
|
8324
8345
|
`uniform tiltShiftUniforms {
|
|
@@ -8378,21 +8399,21 @@ vec4 tiltShift_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8378
8399
|
end: "vec2<f32>",
|
|
8379
8400
|
invert: "i32"
|
|
8380
8401
|
},
|
|
8381
|
-
|
|
8402
|
+
propTypes: {
|
|
8382
8403
|
blurRadius: { value: 15, min: 0, max: 50 },
|
|
8383
8404
|
gradientRadius: { value: 200, min: 0, max: 400 },
|
|
8384
8405
|
start: { value: [0, 0] },
|
|
8385
8406
|
end: { value: [1, 1] },
|
|
8386
|
-
invert: { value:
|
|
8407
|
+
invert: { value: 0, private: true }
|
|
8387
8408
|
},
|
|
8388
8409
|
passes: [
|
|
8389
|
-
{ sampler: true, uniforms: { invert:
|
|
8390
|
-
{ sampler: true, uniforms: { invert:
|
|
8410
|
+
{ sampler: true, uniforms: { invert: 0 } },
|
|
8411
|
+
{ sampler: true, uniforms: { invert: 1 } }
|
|
8391
8412
|
],
|
|
8392
8413
|
fs: fs11
|
|
8393
8414
|
};
|
|
8394
8415
|
|
|
8395
|
-
// src/
|
|
8416
|
+
// src/passes/postprocessing/image-blur-filters/triangleblur.ts
|
|
8396
8417
|
var fs12 = (
|
|
8397
8418
|
/* glsl */
|
|
8398
8419
|
`uniform triangleBlurUniforms {
|
|
@@ -8438,7 +8459,7 @@ vec4 triangleBlur_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8438
8459
|
radius: "f32",
|
|
8439
8460
|
delta: "vec2<f32>"
|
|
8440
8461
|
},
|
|
8441
|
-
|
|
8462
|
+
propTypes: {
|
|
8442
8463
|
radius: { value: 20, min: 0, softMax: 100 },
|
|
8443
8464
|
delta: { value: [1, 0], private: true }
|
|
8444
8465
|
},
|
|
@@ -8450,7 +8471,7 @@ vec4 triangleBlur_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8450
8471
|
]
|
|
8451
8472
|
};
|
|
8452
8473
|
|
|
8453
|
-
// src/
|
|
8474
|
+
// src/passes/postprocessing/image-blur-filters/zoomblur.ts
|
|
8454
8475
|
var fs13 = `
|
|
8455
8476
|
uniform zoomBlurUniforms {
|
|
8456
8477
|
vec2 center;
|
|
@@ -8493,7 +8514,7 @@ vec4 zoomBlur_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8493
8514
|
center: "vec2<f32>",
|
|
8494
8515
|
strength: "f32"
|
|
8495
8516
|
},
|
|
8496
|
-
|
|
8517
|
+
propTypes: {
|
|
8497
8518
|
center: { value: [0.5, 0.5] },
|
|
8498
8519
|
strength: { value: 0.3, min: 0, softMax: 1 }
|
|
8499
8520
|
},
|
|
@@ -8502,7 +8523,7 @@ vec4 zoomBlur_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8502
8523
|
passes: [{ sampler: true }]
|
|
8503
8524
|
};
|
|
8504
8525
|
|
|
8505
|
-
// src/
|
|
8526
|
+
// src/passes/postprocessing/image-fun-filters/colorhalftone.ts
|
|
8506
8527
|
var fs14 = (
|
|
8507
8528
|
/* glsl */
|
|
8508
8529
|
`uniform colorHalftoneUniforms {
|
|
@@ -8521,7 +8542,7 @@ float pattern(float angle, float scale, vec2 texSize, vec2 texCoord) {
|
|
|
8521
8542
|
return (sin(point.x) * sin(point.y)) * 4.0;
|
|
8522
8543
|
}
|
|
8523
8544
|
|
|
8524
|
-
vec4
|
|
8545
|
+
vec4 colorHalftone_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8525
8546
|
float scale = 3.1514 / colorHalftone.size;
|
|
8526
8547
|
vec3 cmy = 1.0 - color.rgb;
|
|
8527
8548
|
float k = min(cmy.x, min(cmy.y, cmy.z));
|
|
@@ -8550,7 +8571,7 @@ vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8550
8571
|
angle: "f32",
|
|
8551
8572
|
size: "f32"
|
|
8552
8573
|
},
|
|
8553
|
-
|
|
8574
|
+
propTypes: {
|
|
8554
8575
|
center: { value: [0.5, 0.5] },
|
|
8555
8576
|
angle: { value: 1.1, softMin: 0, softMax: Math.PI / 2 },
|
|
8556
8577
|
size: { value: 4, min: 1, softMin: 3, softMax: 20 }
|
|
@@ -8559,7 +8580,7 @@ vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8559
8580
|
passes: [{ filter: true }]
|
|
8560
8581
|
};
|
|
8561
8582
|
|
|
8562
|
-
// src/
|
|
8583
|
+
// src/passes/postprocessing/image-fun-filters/dotscreen.ts
|
|
8563
8584
|
var fs15 = (
|
|
8564
8585
|
/* glsl */
|
|
8565
8586
|
`uniform dotScreenUniforms {
|
|
@@ -8580,7 +8601,7 @@ float pattern(vec2 texSize, vec2 texCoord) {
|
|
|
8580
8601
|
return (sin(point.x) * sin(point.y)) * 4.0;
|
|
8581
8602
|
}
|
|
8582
8603
|
|
|
8583
|
-
vec4
|
|
8604
|
+
vec4 dotScreen_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
8584
8605
|
float average = (color.r + color.g + color.b) / 3.0;
|
|
8585
8606
|
return vec4(vec3(average * 10.0 - 5.0 + pattern(texSize, texCoord)), color.a);
|
|
8586
8607
|
}
|
|
@@ -8595,7 +8616,7 @@ vec4 dotScreen_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8595
8616
|
angle: "f32",
|
|
8596
8617
|
size: "f32"
|
|
8597
8618
|
},
|
|
8598
|
-
|
|
8619
|
+
propTypes: {
|
|
8599
8620
|
center: { value: [0.5, 0.5] },
|
|
8600
8621
|
angle: { value: 1.1, softMin: 0, softMax: Math.PI / 2 },
|
|
8601
8622
|
size: { value: 3, min: 1, softMin: 3, softMax: 20 }
|
|
@@ -8604,7 +8625,7 @@ vec4 dotScreen_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
8604
8625
|
passes: [{ filter: true }]
|
|
8605
8626
|
};
|
|
8606
8627
|
|
|
8607
|
-
// src/
|
|
8628
|
+
// src/passes/postprocessing/image-fun-filters/edgework.ts
|
|
8608
8629
|
var fs16 = (
|
|
8609
8630
|
/* glsl */
|
|
8610
8631
|
`uniform edgeWorkUniforms {
|
|
@@ -8669,7 +8690,7 @@ vec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8669
8690
|
name: "edgeWork",
|
|
8670
8691
|
dependencies: [random],
|
|
8671
8692
|
fs: fs16,
|
|
8672
|
-
|
|
8693
|
+
propTypes: {
|
|
8673
8694
|
radius: { value: 2, min: 1, softMax: 50 },
|
|
8674
8695
|
delta: { value: [1, 0], private: true }
|
|
8675
8696
|
},
|
|
@@ -8677,17 +8698,17 @@ vec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8677
8698
|
{
|
|
8678
8699
|
// @ts-expect-error
|
|
8679
8700
|
sampler: "edgeWork_sampleColor1",
|
|
8680
|
-
|
|
8701
|
+
propTypes: { delta: [1, 0] }
|
|
8681
8702
|
},
|
|
8682
8703
|
{
|
|
8683
8704
|
// @ts-expect-error
|
|
8684
8705
|
sampler: "edgeWork_sampleColor2",
|
|
8685
|
-
|
|
8706
|
+
propTypes: { delta: [0, 1] }
|
|
8686
8707
|
}
|
|
8687
8708
|
]
|
|
8688
8709
|
};
|
|
8689
8710
|
|
|
8690
|
-
// src/
|
|
8711
|
+
// src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts
|
|
8691
8712
|
var fs17 = (
|
|
8692
8713
|
/* glsl */
|
|
8693
8714
|
`uniform hexagonalPixelateUniforms {
|
|
@@ -8742,7 +8763,7 @@ vec4 hexagonalPixelate_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord
|
|
|
8742
8763
|
center: "vec2<f32>",
|
|
8743
8764
|
scale: "f32"
|
|
8744
8765
|
},
|
|
8745
|
-
|
|
8766
|
+
propTypes: {
|
|
8746
8767
|
center: { value: [0.5, 0.5], hint: "screenspace" },
|
|
8747
8768
|
scale: { value: 10, min: 1, softMin: 5, softMax: 50 }
|
|
8748
8769
|
},
|
|
@@ -8750,7 +8771,7 @@ vec4 hexagonalPixelate_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord
|
|
|
8750
8771
|
passes: [{ sampler: true }]
|
|
8751
8772
|
};
|
|
8752
8773
|
|
|
8753
|
-
// src/
|
|
8774
|
+
// src/passes/postprocessing/image-fun-filters/ink.ts
|
|
8754
8775
|
var fs18 = (
|
|
8755
8776
|
/* glsl */
|
|
8756
8777
|
`uniform inkUniforms {
|
|
@@ -8790,13 +8811,13 @@ vec4 ink_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8790
8811
|
uniformTypes: {
|
|
8791
8812
|
strength: "f32"
|
|
8792
8813
|
},
|
|
8793
|
-
|
|
8814
|
+
propTypes: {
|
|
8794
8815
|
strength: { value: 0.25, min: 0, softMax: 1 }
|
|
8795
8816
|
},
|
|
8796
8817
|
passes: [{ sampler: true }]
|
|
8797
8818
|
};
|
|
8798
8819
|
|
|
8799
|
-
// src/
|
|
8820
|
+
// src/passes/postprocessing/image-fun-filters/magnify.ts
|
|
8800
8821
|
var fs19 = (
|
|
8801
8822
|
/* glsl */
|
|
8802
8823
|
`uniform magnifyUniforms {
|
|
@@ -8830,7 +8851,7 @@ vec4 magnify_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8830
8851
|
borderWidthPixels: "f32",
|
|
8831
8852
|
borderColor: "vec4<f32>"
|
|
8832
8853
|
},
|
|
8833
|
-
|
|
8854
|
+
propTypes: {
|
|
8834
8855
|
// range 0 to 1
|
|
8835
8856
|
screenXY: { value: [0, 0] },
|
|
8836
8857
|
radiusPixels: 200,
|
|
@@ -8842,7 +8863,7 @@ vec4 magnify_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8842
8863
|
passes: [{ sampler: true }]
|
|
8843
8864
|
};
|
|
8844
8865
|
|
|
8845
|
-
// src/
|
|
8866
|
+
// src/passes/postprocessing/image-warp-filters/warp.ts
|
|
8846
8867
|
var fs20 = (
|
|
8847
8868
|
/* glsl */
|
|
8848
8869
|
`vec4 warp_sampleColor(sampler2D source, vec2 texSize, vec2 coord) {
|
|
@@ -8863,7 +8884,7 @@ vec4 magnify_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8863
8884
|
fs: fs20
|
|
8864
8885
|
};
|
|
8865
8886
|
|
|
8866
|
-
// src/
|
|
8887
|
+
// src/passes/postprocessing/image-warp-filters/bulgepinch.ts
|
|
8867
8888
|
var fs21 = (
|
|
8868
8889
|
/* glsl */
|
|
8869
8890
|
`uniform bulgePinchUniforms {
|
|
@@ -8906,7 +8927,7 @@ vec4 bulgePinch_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8906
8927
|
radius: "f32",
|
|
8907
8928
|
strength: "f32"
|
|
8908
8929
|
},
|
|
8909
|
-
|
|
8930
|
+
propTypes: {
|
|
8910
8931
|
center: { value: [0.5, 0.5] },
|
|
8911
8932
|
radius: { value: 200, min: 1, softMax: 600 },
|
|
8912
8933
|
strength: { value: 0.5, min: -1, max: 1 }
|
|
@@ -8914,7 +8935,7 @@ vec4 bulgePinch_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8914
8935
|
passes: [{ sampler: true }]
|
|
8915
8936
|
};
|
|
8916
8937
|
|
|
8917
|
-
// src/
|
|
8938
|
+
// src/passes/postprocessing/image-warp-filters/swirl.ts
|
|
8918
8939
|
var fs22 = (
|
|
8919
8940
|
/* glsl */
|
|
8920
8941
|
`uniform swirlUniforms {
|
|
@@ -8959,7 +8980,7 @@ vec4 swirl_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8959
8980
|
radius: "f32",
|
|
8960
8981
|
angle: "f32"
|
|
8961
8982
|
},
|
|
8962
|
-
|
|
8983
|
+
propTypes: {
|
|
8963
8984
|
center: { value: [0.5, 0.5] },
|
|
8964
8985
|
radius: { value: 200, min: 1, softMax: 600 },
|
|
8965
8986
|
angle: { value: 3, softMin: -25, softMax: 25 }
|
|
@@ -8967,7 +8988,7 @@ vec4 swirl_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
8967
8988
|
passes: [{ sampler: true }]
|
|
8968
8989
|
};
|
|
8969
8990
|
|
|
8970
|
-
// src/
|
|
8991
|
+
// src/passes/postprocessing/fxaa/fxaa.ts
|
|
8971
8992
|
var fs23 = `
|
|
8972
8993
|
#define FXAA_QUALITY_PRESET 29
|
|
8973
8994
|
|
|
@@ -9551,7 +9572,7 @@ vec4 fxaa_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
9551
9572
|
`;
|
|
9552
9573
|
var fxaa = {
|
|
9553
9574
|
name: "fxaa",
|
|
9554
|
-
|
|
9575
|
+
propTypes: {},
|
|
9555
9576
|
fs: fs23,
|
|
9556
9577
|
passes: [{ sampler: true }],
|
|
9557
9578
|
getUniforms: (props) => props
|