@luma.gl/shadertools 9.0.0-beta.1 → 9.0.0-beta.2
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 +79 -84
- package/dist/index.cjs +86 -82
- package/dist/lib/shader-assembly/assemble-shaders.js +2 -7
- package/dist/lib/shader-assembly/assemble-shaders.js.map +1 -1
- package/dist/modules/lighting/no-material/dirlight.d.ts +2 -0
- package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -1
- package/dist/modules/lighting/no-material/dirlight.js +20 -4
- package/dist/modules/lighting/no-material/dirlight.js.map +1 -1
- package/dist.min.js +82 -82
- package/package.json +3 -3
- package/src/.DS_Store +0 -0
- package/src/lib/shader-assembly/assemble-shaders.ts +10 -7
- package/src/libs/.DS_Store +0 -0
- package/src/modules/lighting/no-material/dirlight.ts +32 -4
package/dist/dist.dev.js
CHANGED
|
@@ -329,8 +329,8 @@ ${inject[key]}` : inject[key];
|
|
|
329
329
|
constructor(props) {
|
|
330
330
|
const {
|
|
331
331
|
name,
|
|
332
|
-
vs:
|
|
333
|
-
fs:
|
|
332
|
+
vs: vs6,
|
|
333
|
+
fs: fs28,
|
|
334
334
|
dependencies = [],
|
|
335
335
|
uniformPropTypes = {},
|
|
336
336
|
getUniforms: getUniforms9,
|
|
@@ -340,8 +340,8 @@ ${inject[key]}` : inject[key];
|
|
|
340
340
|
} = props;
|
|
341
341
|
assert(typeof name === "string");
|
|
342
342
|
this.name = name;
|
|
343
|
-
this.vs =
|
|
344
|
-
this.fs =
|
|
343
|
+
this.vs = vs6;
|
|
344
|
+
this.fs = fs28;
|
|
345
345
|
this.getModuleUniforms = getUniforms9;
|
|
346
346
|
this.dependencies = ShaderModuleInstance.instantiateModules(dependencies);
|
|
347
347
|
this.deprecations = this._parseDeprecationDefinitions(deprecations);
|
|
@@ -725,8 +725,8 @@ precision highp float;
|
|
|
725
725
|
`;
|
|
726
726
|
function assembleShaders(options) {
|
|
727
727
|
const {
|
|
728
|
-
vs:
|
|
729
|
-
fs:
|
|
728
|
+
vs: vs6,
|
|
729
|
+
fs: fs28
|
|
730
730
|
} = options;
|
|
731
731
|
const modules = resolveModules(options.modules || []);
|
|
732
732
|
switch (options.platformInfo.shaderLanguage) {
|
|
@@ -734,13 +734,13 @@ precision highp float;
|
|
|
734
734
|
return {
|
|
735
735
|
vs: assembleGLSLShader(options.platformInfo, {
|
|
736
736
|
...options,
|
|
737
|
-
source:
|
|
737
|
+
source: vs6,
|
|
738
738
|
stage: "vertex",
|
|
739
739
|
modules
|
|
740
740
|
}),
|
|
741
741
|
fs: assembleGLSLShader(options.platformInfo, {
|
|
742
742
|
...options,
|
|
743
|
-
source:
|
|
743
|
+
source: fs28,
|
|
744
744
|
stage: "fragment",
|
|
745
745
|
modules
|
|
746
746
|
}),
|
|
@@ -750,13 +750,13 @@ precision highp float;
|
|
|
750
750
|
return {
|
|
751
751
|
vs: assembleWGSLShader(options.platformInfo, {
|
|
752
752
|
...options,
|
|
753
|
-
source:
|
|
753
|
+
source: vs6,
|
|
754
754
|
stage: "vertex",
|
|
755
755
|
modules
|
|
756
756
|
}),
|
|
757
757
|
fs: assembleWGSLShader(options.platformInfo, {
|
|
758
758
|
...options,
|
|
759
|
-
source:
|
|
759
|
+
source: fs28,
|
|
760
760
|
stage: "fragment",
|
|
761
761
|
modules
|
|
762
762
|
}),
|
|
@@ -769,18 +769,12 @@ precision highp float;
|
|
|
769
769
|
source,
|
|
770
770
|
stage,
|
|
771
771
|
modules,
|
|
772
|
-
defines = {},
|
|
773
772
|
hookFunctions = [],
|
|
774
773
|
inject = {},
|
|
775
774
|
log
|
|
776
775
|
} = options;
|
|
777
776
|
assert(typeof source === "string", "shader source must be a string");
|
|
778
777
|
const coreSource = source;
|
|
779
|
-
const allDefines = {};
|
|
780
|
-
modules.forEach((module) => {
|
|
781
|
-
Object.assign(allDefines, module.getDefines());
|
|
782
|
-
});
|
|
783
|
-
Object.assign(allDefines, defines);
|
|
784
778
|
let assembledSource = "";
|
|
785
779
|
const hookFunctionMap = normalizeShaderHooks(hookFunctions);
|
|
786
780
|
const hookInjections = {};
|
|
@@ -808,7 +802,8 @@ precision highp float;
|
|
|
808
802
|
mainInjections[key] = [injection];
|
|
809
803
|
}
|
|
810
804
|
}
|
|
811
|
-
|
|
805
|
+
const modulesToInject = platformInfo.type !== "webgpu" ? modules : [];
|
|
806
|
+
for (const module of modulesToInject) {
|
|
812
807
|
if (log) {
|
|
813
808
|
module.checkDeprecations(coreSource, log);
|
|
814
809
|
}
|
|
@@ -981,15 +976,15 @@ ${getApplicationDefines(allDefines)}
|
|
|
981
976
|
if (!props.vs) {
|
|
982
977
|
throw new Error("no vertex shader");
|
|
983
978
|
}
|
|
984
|
-
const
|
|
985
|
-
let
|
|
979
|
+
const vs6 = getShaderSource(props.platformInfo, props.vs);
|
|
980
|
+
let fs28;
|
|
986
981
|
if (props.fs) {
|
|
987
|
-
|
|
982
|
+
fs28 = getShaderSource(props.platformInfo, props.fs);
|
|
988
983
|
}
|
|
989
984
|
return {
|
|
990
985
|
...props,
|
|
991
|
-
vs:
|
|
992
|
-
fs:
|
|
986
|
+
vs: vs6,
|
|
987
|
+
fs: fs28
|
|
993
988
|
};
|
|
994
989
|
}
|
|
995
990
|
function getShaderSource(platformInfo, shader) {
|
|
@@ -4606,14 +4601,14 @@ float getPointLightAttenuation(PointLight pointLight, float distance) {
|
|
|
4606
4601
|
}
|
|
4607
4602
|
|
|
4608
4603
|
// src/modules/lighting/no-material/dirlight.ts
|
|
4609
|
-
var
|
|
4604
|
+
var VS_GLSL = glsl`\
|
|
4610
4605
|
out vec3 dirlight_vNormal;
|
|
4611
4606
|
|
|
4612
4607
|
void dirlight_setNormal(vec3 normal) {
|
|
4613
4608
|
dirlight_vNormal = normalize(normal);
|
|
4614
4609
|
}
|
|
4615
4610
|
`;
|
|
4616
|
-
var
|
|
4611
|
+
var FS_GLSL = glsl`\
|
|
4617
4612
|
uniform dirlightUniforms {
|
|
4618
4613
|
vec3 lightDirection;
|
|
4619
4614
|
} dirlight;
|
|
@@ -4629,8 +4624,8 @@ vec4 dirlight_filterColor(vec4 color) {
|
|
|
4629
4624
|
var dirlight = {
|
|
4630
4625
|
name: "dirlight",
|
|
4631
4626
|
dependencies: [],
|
|
4632
|
-
vs:
|
|
4633
|
-
fs:
|
|
4627
|
+
vs: VS_GLSL,
|
|
4628
|
+
fs: FS_GLSL,
|
|
4634
4629
|
uniformTypes: {
|
|
4635
4630
|
lightDirection: "vec3<f32>"
|
|
4636
4631
|
},
|
|
@@ -4895,7 +4890,7 @@ vec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspac
|
|
|
4895
4890
|
};
|
|
4896
4891
|
|
|
4897
4892
|
// src/modules/lighting/pbr-material/pbr-vertex.glsl.ts
|
|
4898
|
-
var
|
|
4893
|
+
var vs2 = glsl`\
|
|
4899
4894
|
uniform projection {
|
|
4900
4895
|
mat4 u_MVPMatrix;
|
|
4901
4896
|
mat4 u_ModelMatrix;
|
|
@@ -4940,7 +4935,7 @@ void pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, ve
|
|
|
4940
4935
|
`;
|
|
4941
4936
|
|
|
4942
4937
|
// src/modules/lighting/pbr-material/pbr-fragment.glsl.ts
|
|
4943
|
-
var
|
|
4938
|
+
var fs3 = glsl`\
|
|
4944
4939
|
#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)
|
|
4945
4940
|
# error PBR fragment shader: Texture LOD is not available
|
|
4946
4941
|
#endif
|
|
@@ -5368,8 +5363,8 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
5368
5363
|
// src/modules/lighting/pbr-material/pbr-material.ts
|
|
5369
5364
|
var pbrMaterial = {
|
|
5370
5365
|
name: "pbr",
|
|
5371
|
-
vs:
|
|
5372
|
-
fs:
|
|
5366
|
+
vs: vs2,
|
|
5367
|
+
fs: fs3,
|
|
5373
5368
|
defines: {
|
|
5374
5369
|
LIGHTING_FRAGMENT: 1,
|
|
5375
5370
|
HAS_NORMALMAP: 0,
|
|
@@ -5438,7 +5433,7 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
5438
5433
|
};
|
|
5439
5434
|
|
|
5440
5435
|
// src/modules/postprocessing/image-adjust-filters/brightnesscontrast.ts
|
|
5441
|
-
var
|
|
5436
|
+
var fs4 = glsl`\
|
|
5442
5437
|
|
|
5443
5438
|
uniform BrightnessContrast{
|
|
5444
5439
|
float brightness;
|
|
@@ -5479,14 +5474,14 @@ vec4 brightnessContrast_filterColor(vec4 color, vec2 texSize, vec2 texCoords) {
|
|
|
5479
5474
|
max: 1
|
|
5480
5475
|
}
|
|
5481
5476
|
},
|
|
5482
|
-
fs:
|
|
5477
|
+
fs: fs4,
|
|
5483
5478
|
passes: [{
|
|
5484
5479
|
filter: true
|
|
5485
5480
|
}]
|
|
5486
5481
|
};
|
|
5487
5482
|
|
|
5488
5483
|
// src/modules/postprocessing/image-adjust-filters/denoise.ts
|
|
5489
|
-
var
|
|
5484
|
+
var fs5 = glsl`\
|
|
5490
5485
|
uniform Noise {
|
|
5491
5486
|
float strength;
|
|
5492
5487
|
} noise;
|
|
@@ -5523,7 +5518,7 @@ vec4 denoise_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5523
5518
|
max: 0.1
|
|
5524
5519
|
}
|
|
5525
5520
|
},
|
|
5526
|
-
fs:
|
|
5521
|
+
fs: fs5,
|
|
5527
5522
|
passes: [{
|
|
5528
5523
|
sampler: true
|
|
5529
5524
|
}, {
|
|
@@ -5532,7 +5527,7 @@ vec4 denoise_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5532
5527
|
};
|
|
5533
5528
|
|
|
5534
5529
|
// src/modules/postprocessing/image-adjust-filters/huesaturation.ts
|
|
5535
|
-
var
|
|
5530
|
+
var fs6 = glsl`\
|
|
5536
5531
|
uniform HueSaturation {
|
|
5537
5532
|
float hue;
|
|
5538
5533
|
float saturation;
|
|
@@ -5583,14 +5578,14 @@ vec4 hueSaturation_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
5583
5578
|
max: 1
|
|
5584
5579
|
}
|
|
5585
5580
|
},
|
|
5586
|
-
fs:
|
|
5581
|
+
fs: fs6,
|
|
5587
5582
|
passes: [{
|
|
5588
5583
|
filter: true
|
|
5589
5584
|
}]
|
|
5590
5585
|
};
|
|
5591
5586
|
|
|
5592
5587
|
// src/modules/postprocessing/image-adjust-filters/noise.ts
|
|
5593
|
-
var
|
|
5588
|
+
var fs7 = glsl`\
|
|
5594
5589
|
uniform Noise {
|
|
5595
5590
|
float amount;
|
|
5596
5591
|
} noise;
|
|
@@ -5623,14 +5618,14 @@ vec4 noise_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
5623
5618
|
max: 1
|
|
5624
5619
|
}
|
|
5625
5620
|
},
|
|
5626
|
-
fs:
|
|
5621
|
+
fs: fs7,
|
|
5627
5622
|
passes: [{
|
|
5628
5623
|
filter: true
|
|
5629
5624
|
}]
|
|
5630
5625
|
};
|
|
5631
5626
|
|
|
5632
5627
|
// src/modules/postprocessing/image-adjust-filters/sepia.ts
|
|
5633
|
-
var
|
|
5628
|
+
var fs8 = glsl`\
|
|
5634
5629
|
uniform Sepia {
|
|
5635
5630
|
float amount;
|
|
5636
5631
|
} sepia;
|
|
@@ -5664,14 +5659,14 @@ vec4 sepia_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
5664
5659
|
max: 1
|
|
5665
5660
|
}
|
|
5666
5661
|
},
|
|
5667
|
-
fs:
|
|
5662
|
+
fs: fs8,
|
|
5668
5663
|
passes: [{
|
|
5669
5664
|
filter: true
|
|
5670
5665
|
}]
|
|
5671
5666
|
};
|
|
5672
5667
|
|
|
5673
5668
|
// src/modules/postprocessing/image-adjust-filters/vibrance.ts
|
|
5674
|
-
var
|
|
5669
|
+
var fs9 = glsl`\
|
|
5675
5670
|
uniform Vibrance {
|
|
5676
5671
|
float amount;
|
|
5677
5672
|
} vibrance;
|
|
@@ -5697,14 +5692,14 @@ vec4 vibrance_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
5697
5692
|
max: 1
|
|
5698
5693
|
}
|
|
5699
5694
|
},
|
|
5700
|
-
fs:
|
|
5695
|
+
fs: fs9,
|
|
5701
5696
|
passes: [{
|
|
5702
5697
|
filter: true
|
|
5703
5698
|
}]
|
|
5704
5699
|
};
|
|
5705
5700
|
|
|
5706
5701
|
// src/modules/postprocessing/image-adjust-filters/vignette.ts
|
|
5707
|
-
var
|
|
5702
|
+
var fs10 = glsl`\
|
|
5708
5703
|
uniform Vignette {
|
|
5709
5704
|
float radius;
|
|
5710
5705
|
float amount;
|
|
@@ -5722,7 +5717,7 @@ vec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
5722
5717
|
`;
|
|
5723
5718
|
var vignette = {
|
|
5724
5719
|
name: "vignette",
|
|
5725
|
-
fs:
|
|
5720
|
+
fs: fs10,
|
|
5726
5721
|
uniformTypes: {
|
|
5727
5722
|
radius: "f32",
|
|
5728
5723
|
amount: "f32"
|
|
@@ -5745,7 +5740,7 @@ vec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
5745
5740
|
};
|
|
5746
5741
|
|
|
5747
5742
|
// src/modules/postprocessing/image-blur-filters/tiltshift.ts
|
|
5748
|
-
var
|
|
5743
|
+
var fs11 = glsl`\
|
|
5749
5744
|
uniform TiltShift {
|
|
5750
5745
|
float blurRadius;
|
|
5751
5746
|
float gradientRadius;
|
|
@@ -5833,11 +5828,11 @@ vec4 tiltShift_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5833
5828
|
}
|
|
5834
5829
|
}],
|
|
5835
5830
|
dependencies: [random],
|
|
5836
|
-
fs:
|
|
5831
|
+
fs: fs11
|
|
5837
5832
|
};
|
|
5838
5833
|
|
|
5839
5834
|
// src/modules/postprocessing/image-blur-filters/triangleblur.ts
|
|
5840
|
-
var
|
|
5835
|
+
var fs12 = glsl`\
|
|
5841
5836
|
uniform float radius;
|
|
5842
5837
|
uniform vec2 delta;
|
|
5843
5838
|
|
|
@@ -5887,7 +5882,7 @@ vec4 triangleBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5887
5882
|
private: true
|
|
5888
5883
|
}
|
|
5889
5884
|
},
|
|
5890
|
-
fs:
|
|
5885
|
+
fs: fs12,
|
|
5891
5886
|
dependencies: [random],
|
|
5892
5887
|
passes: [{
|
|
5893
5888
|
sampler: true,
|
|
@@ -5903,7 +5898,7 @@ vec4 triangleBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5903
5898
|
};
|
|
5904
5899
|
|
|
5905
5900
|
// src/modules/postprocessing/image-blur-filters/zoomblur.ts
|
|
5906
|
-
var
|
|
5901
|
+
var fs13 = `
|
|
5907
5902
|
uniform vec2 center;
|
|
5908
5903
|
uniform float strength;
|
|
5909
5904
|
|
|
@@ -5951,7 +5946,7 @@ vec4 zoomBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5951
5946
|
softMax: 1
|
|
5952
5947
|
}
|
|
5953
5948
|
},
|
|
5954
|
-
fs:
|
|
5949
|
+
fs: fs13,
|
|
5955
5950
|
dependencies: [random],
|
|
5956
5951
|
passes: [{
|
|
5957
5952
|
sampler: true
|
|
@@ -5959,7 +5954,7 @@ vec4 zoomBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
5959
5954
|
};
|
|
5960
5955
|
|
|
5961
5956
|
// src/modules/postprocessing/image-fun-filters/colorhalftone.ts
|
|
5962
|
-
var
|
|
5957
|
+
var fs14 = glsl`\
|
|
5963
5958
|
uniform ColorHalftone {
|
|
5964
5959
|
vec2 center;
|
|
5965
5960
|
float angle;
|
|
@@ -6018,14 +6013,14 @@ vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
6018
6013
|
softMax: 20
|
|
6019
6014
|
}
|
|
6020
6015
|
},
|
|
6021
|
-
fs:
|
|
6016
|
+
fs: fs14,
|
|
6022
6017
|
passes: [{
|
|
6023
6018
|
filter: true
|
|
6024
6019
|
}]
|
|
6025
6020
|
};
|
|
6026
6021
|
|
|
6027
6022
|
// src/modules/postprocessing/image-fun-filters/dotscreen.ts
|
|
6028
|
-
var
|
|
6023
|
+
var fs15 = glsl`\
|
|
6029
6024
|
uniform DotScreen {
|
|
6030
6025
|
vec2 center;
|
|
6031
6026
|
float angle;
|
|
@@ -6072,14 +6067,14 @@ vec4 dotScreen_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
|
6072
6067
|
softMax: 20
|
|
6073
6068
|
}
|
|
6074
6069
|
},
|
|
6075
|
-
fs:
|
|
6070
|
+
fs: fs15,
|
|
6076
6071
|
passes: [{
|
|
6077
6072
|
filter: true
|
|
6078
6073
|
}]
|
|
6079
6074
|
};
|
|
6080
6075
|
|
|
6081
6076
|
// src/modules/postprocessing/image-fun-filters/edgework.ts
|
|
6082
|
-
var
|
|
6077
|
+
var fs16 = glsl`\
|
|
6083
6078
|
uniform EdgeWork {
|
|
6084
6079
|
float radius;
|
|
6085
6080
|
vec2 delta;
|
|
@@ -6148,7 +6143,7 @@ vec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
6148
6143
|
private: true
|
|
6149
6144
|
}
|
|
6150
6145
|
},
|
|
6151
|
-
fs:
|
|
6146
|
+
fs: fs16,
|
|
6152
6147
|
dependencies: [random],
|
|
6153
6148
|
passes: [{
|
|
6154
6149
|
sampler: "edgeWork_sampleColor1",
|
|
@@ -6164,7 +6159,7 @@ vec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
6164
6159
|
};
|
|
6165
6160
|
|
|
6166
6161
|
// src/modules/postprocessing/image-fun-filters/hexagonalpixelate.ts
|
|
6167
|
-
var
|
|
6162
|
+
var fs17 = glsl`\
|
|
6168
6163
|
uniform HexagonalPixelate {
|
|
6169
6164
|
vec2 center;
|
|
6170
6165
|
float scale;
|
|
@@ -6226,14 +6221,14 @@ vec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoor
|
|
|
6226
6221
|
softMax: 50
|
|
6227
6222
|
}
|
|
6228
6223
|
},
|
|
6229
|
-
fs:
|
|
6224
|
+
fs: fs17,
|
|
6230
6225
|
passes: [{
|
|
6231
6226
|
sampler: true
|
|
6232
6227
|
}]
|
|
6233
6228
|
};
|
|
6234
6229
|
|
|
6235
6230
|
// src/modules/postprocessing/image-fun-filters/ink.ts
|
|
6236
|
-
var
|
|
6231
|
+
var fs18 = glsl`\
|
|
6237
6232
|
uniform Ink {
|
|
6238
6233
|
float strength;
|
|
6239
6234
|
} ink;
|
|
@@ -6274,14 +6269,14 @@ vec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
6274
6269
|
softMax: 1
|
|
6275
6270
|
}
|
|
6276
6271
|
},
|
|
6277
|
-
fs:
|
|
6272
|
+
fs: fs18,
|
|
6278
6273
|
passes: [{
|
|
6279
6274
|
sampler: true
|
|
6280
6275
|
}]
|
|
6281
6276
|
};
|
|
6282
6277
|
|
|
6283
6278
|
// src/modules/postprocessing/image-fun-filters/magnify.ts
|
|
6284
|
-
var
|
|
6279
|
+
var fs19 = glsl`\
|
|
6285
6280
|
uniform Magnify {
|
|
6286
6281
|
vec2 screenXY;
|
|
6287
6282
|
float radiusPixels;
|
|
@@ -6323,14 +6318,14 @@ vec4 magnify_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
6323
6318
|
value: [255, 255, 255, 255]
|
|
6324
6319
|
}
|
|
6325
6320
|
},
|
|
6326
|
-
fs:
|
|
6321
|
+
fs: fs19,
|
|
6327
6322
|
passes: [{
|
|
6328
6323
|
sampler: true
|
|
6329
6324
|
}]
|
|
6330
6325
|
};
|
|
6331
6326
|
|
|
6332
6327
|
// src/modules/postprocessing/image-warp-filters/warp.ts
|
|
6333
|
-
var
|
|
6328
|
+
var fs20 = glsl`\
|
|
6334
6329
|
vec4 warp_sampleColor(sampler2D texture, vec2 texSize, vec2 coord) {
|
|
6335
6330
|
vec4 color = texture2D(texture, coord / texSize);
|
|
6336
6331
|
vec2 clampedCoord = clamp(coord, vec2(0.0), texSize);
|
|
@@ -6344,11 +6339,11 @@ vec4 warp_sampleColor(sampler2D texture, vec2 texSize, vec2 coord) {
|
|
|
6344
6339
|
`;
|
|
6345
6340
|
var warp = {
|
|
6346
6341
|
name: "warp",
|
|
6347
|
-
fs:
|
|
6342
|
+
fs: fs20
|
|
6348
6343
|
};
|
|
6349
6344
|
|
|
6350
6345
|
// src/modules/postprocessing/image-warp-filters/bulgepinch.ts
|
|
6351
|
-
var
|
|
6346
|
+
var fs21 = glsl`\
|
|
6352
6347
|
uniform BulgePinch {
|
|
6353
6348
|
float radius;
|
|
6354
6349
|
float strength;
|
|
@@ -6379,7 +6374,7 @@ vec4 bulgePinch_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
6379
6374
|
`;
|
|
6380
6375
|
var bulgePinch = {
|
|
6381
6376
|
name: "bulgePinch",
|
|
6382
|
-
fs:
|
|
6377
|
+
fs: fs21,
|
|
6383
6378
|
uniformTypes: {
|
|
6384
6379
|
center: "vec2<f32>",
|
|
6385
6380
|
radius: "f32",
|
|
@@ -6407,7 +6402,7 @@ vec4 bulgePinch_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
6407
6402
|
};
|
|
6408
6403
|
|
|
6409
6404
|
// src/modules/postprocessing/image-warp-filters/swirl.ts
|
|
6410
|
-
var
|
|
6405
|
+
var fs22 = glsl`\
|
|
6411
6406
|
uniform Swirl {
|
|
6412
6407
|
float radius;
|
|
6413
6408
|
float angle;
|
|
@@ -6440,7 +6435,7 @@ vec4 swirl_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
6440
6435
|
`;
|
|
6441
6436
|
var swirl = {
|
|
6442
6437
|
name: "swirl",
|
|
6443
|
-
fs:
|
|
6438
|
+
fs: fs22,
|
|
6444
6439
|
uniformTypes: {
|
|
6445
6440
|
center: "vec2<f32>",
|
|
6446
6441
|
radius: "f32",
|
|
@@ -6468,7 +6463,7 @@ vec4 swirl_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
6468
6463
|
};
|
|
6469
6464
|
|
|
6470
6465
|
// src/modules/postprocessing/fxaa/fxaa.ts
|
|
6471
|
-
var
|
|
6466
|
+
var fs23 = `
|
|
6472
6467
|
#define FXAA_QUALITY_PRESET 29
|
|
6473
6468
|
|
|
6474
6469
|
#if (FXAA_QUALITY_PRESET == 10)
|
|
@@ -7052,7 +7047,7 @@ vec4 fxaa_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
|
7052
7047
|
var fxaa = {
|
|
7053
7048
|
name: "fxaa",
|
|
7054
7049
|
uniformPropTypes: {},
|
|
7055
|
-
fs:
|
|
7050
|
+
fs: fs23,
|
|
7056
7051
|
passes: [{
|
|
7057
7052
|
sampler: true
|
|
7058
7053
|
}]
|
|
@@ -7947,7 +7942,7 @@ void mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {
|
|
|
7947
7942
|
};
|
|
7948
7943
|
|
|
7949
7944
|
// src/modules-webgl1/geometry/geometry.ts
|
|
7950
|
-
var
|
|
7945
|
+
var vs3 = glsl`\
|
|
7951
7946
|
varying vec4 geometry_vPosition;
|
|
7952
7947
|
varying vec3 geometry_vNormal;
|
|
7953
7948
|
|
|
@@ -7963,7 +7958,7 @@ void geometry_setPosition(vec3 position) {
|
|
|
7963
7958
|
geometry_vPosition = vec4(position, 1.);
|
|
7964
7959
|
}
|
|
7965
7960
|
`;
|
|
7966
|
-
var
|
|
7961
|
+
var fs24 = glsl`\
|
|
7967
7962
|
varying vec4 geometry_vPosition;
|
|
7968
7963
|
varying vec3 geometry_vNormal;
|
|
7969
7964
|
|
|
@@ -7977,8 +7972,8 @@ vec3 geometry_getNormal() {
|
|
|
7977
7972
|
`;
|
|
7978
7973
|
var geometry = {
|
|
7979
7974
|
name: "geometry",
|
|
7980
|
-
vs:
|
|
7981
|
-
fs:
|
|
7975
|
+
vs: vs3,
|
|
7976
|
+
fs: fs24
|
|
7982
7977
|
};
|
|
7983
7978
|
|
|
7984
7979
|
// ../../node_modules/@math.gl/core/dist/lib/common.js
|
|
@@ -9569,7 +9564,7 @@ vec3 project_getNormal_World() {
|
|
|
9569
9564
|
return project_vNormalWorld;
|
|
9570
9565
|
}
|
|
9571
9566
|
`;
|
|
9572
|
-
var
|
|
9567
|
+
var vs4 = `${common}
|
|
9573
9568
|
|
|
9574
9569
|
// Unprefixed uniforms
|
|
9575
9570
|
uniform mat4 modelMatrix;
|
|
@@ -9623,13 +9618,13 @@ vec4 project_to_clipspace(vec3 position) {
|
|
|
9623
9618
|
return viewProjectionMatrix * vec4(position, 1.);
|
|
9624
9619
|
}
|
|
9625
9620
|
`;
|
|
9626
|
-
var
|
|
9621
|
+
var fs25 = `
|
|
9627
9622
|
${common}`;
|
|
9628
9623
|
var project = {
|
|
9629
9624
|
name: "project",
|
|
9630
9625
|
getUniforms: getUniforms5,
|
|
9631
|
-
vs:
|
|
9632
|
-
fs:
|
|
9626
|
+
vs: vs4,
|
|
9627
|
+
fs: fs25
|
|
9633
9628
|
};
|
|
9634
9629
|
|
|
9635
9630
|
// src/modules-webgl1/lighting/lights/lights.glsl.ts
|
|
@@ -9772,7 +9767,7 @@ float getPointLightAttenuation(PointLight pointLight, float distance) {
|
|
|
9772
9767
|
}
|
|
9773
9768
|
return uniforms;
|
|
9774
9769
|
}
|
|
9775
|
-
var
|
|
9770
|
+
var fs26 = glsl`\
|
|
9776
9771
|
uniform vec3 dirlight_uLightDirection;
|
|
9777
9772
|
|
|
9778
9773
|
/*
|
|
@@ -9786,7 +9781,7 @@ vec4 dirlight_filterColor(vec4 color) {
|
|
|
9786
9781
|
`;
|
|
9787
9782
|
var dirlight2 = {
|
|
9788
9783
|
name: "dirlight",
|
|
9789
|
-
fs:
|
|
9784
|
+
fs: fs26,
|
|
9790
9785
|
getUniforms: getUniforms7,
|
|
9791
9786
|
dependencies: [project]
|
|
9792
9787
|
};
|
|
@@ -9918,7 +9913,7 @@ vec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspac
|
|
|
9918
9913
|
};
|
|
9919
9914
|
|
|
9920
9915
|
// src/modules-webgl1/lighting/pbr/pbr-vertex.glsl.ts
|
|
9921
|
-
var
|
|
9916
|
+
var vs5 = glsl`\
|
|
9922
9917
|
uniform mat4 u_MVPMatrix;
|
|
9923
9918
|
uniform mat4 u_ModelMatrix;
|
|
9924
9919
|
uniform mat4 u_NormalMatrix;
|
|
@@ -9959,7 +9954,7 @@ void pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, ve
|
|
|
9959
9954
|
`;
|
|
9960
9955
|
|
|
9961
9956
|
// src/modules-webgl1/lighting/pbr/pbr-fragment.glsl.ts
|
|
9962
|
-
var
|
|
9957
|
+
var fs27 = glsl`\
|
|
9963
9958
|
#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)
|
|
9964
9959
|
# error PBR fragment shader: Texture LOD is not available
|
|
9965
9960
|
#endif
|
|
@@ -10363,8 +10358,8 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
10363
10358
|
// src/modules-webgl1/lighting/pbr/pbr.ts
|
|
10364
10359
|
var pbr = {
|
|
10365
10360
|
name: "pbr",
|
|
10366
|
-
vs:
|
|
10367
|
-
fs:
|
|
10361
|
+
vs: vs5,
|
|
10362
|
+
fs: fs27,
|
|
10368
10363
|
defines: {
|
|
10369
10364
|
LIGHTING_FRAGMENT: 1
|
|
10370
10365
|
},
|