@forgeax/engine-shader 0.1.27 → 0.1.29
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/NOTICE +35 -0
- package/README.md +39 -0
- package/dist/ShaderRegistry.d.ts +8 -0
- package/dist/ShaderRegistry.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +312 -71
- package/dist/index.mjs.map +1 -1
- package/dist/material/artifact-types.d.ts +12 -2
- package/dist/material/artifact-types.d.ts.map +1 -1
- package/dist/material-schemas.d.ts +5 -0
- package/dist/material-schemas.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/ShaderRegistry.ts +10 -0
- package/src/__tests__/auto-exposure-graph.unit.test.ts +59 -0
- package/src/__tests__/bloom-fxaa-tonemap.unit.test.ts +30 -15
- package/src/__tests__/builtin-texture-sampling-contract.test.ts +1 -1
- package/src/__tests__/default-standard-pbr-alpha.unit.test.ts +2 -1
- package/src/__tests__/default-standard-pbr-transmission.unit.test.ts +167 -6
- package/src/__tests__/direct-light-layout.unit.test.ts +1 -1
- package/src/__tests__/lighting-punctual.unit.test.ts +29 -1
- package/src/__tests__/ltc-provenance.unit.test.ts +13 -2
- package/src/__tests__/material-builtins.unit.test.ts +1 -0
- package/src/__tests__/material-contract.unit.test.ts +42 -9
- package/src/__tests__/material-derived-builtins.integration.test.ts +18 -2
- package/src/__tests__/probe-lighting-composition.unit.test.ts +1 -1
- package/src/__tests__/reflection-probe-sampling.unit.test.ts +23 -2
- package/src/__tests__/scene-temporal.unit.test.ts +10 -0
- package/src/__tests__/shader.unit.test.ts +1 -0
- package/src/__tests__/sprite-variants.unit.test.ts +1 -0
- package/src/__tests__/ssr-artifact.unit.test.ts +141 -0
- package/src/__tests__/ssr-bgl.integration.test.ts +185 -0
- package/src/__tests__/standard-output-domain.unit.test.ts +36 -0
- package/src/__tests__/standard-pbr-artifact-receipt.unit.test.ts +93 -0
- package/src/__tests__/standard-surface-pass-evaluation.integration.test.ts +16 -4
- package/src/__tests__/surface-v1.unit.test.ts +6 -0
- package/src/__tests__/taa-resolve.unit.test.ts +20 -9
- package/src/__tests__/transmission-thickness-scale.unit.test.ts +6 -1
- package/src/__tests__/transparent-pbr.unit.test.ts +1 -1
- package/src/__tests__/vertex-color-variant.unit.test.ts +4 -1
- package/src/atmosphere-background.wgsl +3 -3
- package/src/auto-exposure-meter.wgsl +179 -0
- package/src/color-lut.wgsl +17 -0
- package/src/common.wgsl +7 -5
- package/src/default-standard-pbr-skin.wgsl +142 -40
- package/src/default-standard-pbr.wgsl +198 -82
- package/src/default_standard_surface.wgsl +56 -19
- package/src/fxaa.wgsl +9 -5
- package/src/ibl-sampling.wgsl +30 -6
- package/src/index.ts +189 -0
- package/src/lighting-punctual.wgsl +5 -6
- package/src/material/artifact-types.ts +109 -63
- package/src/material-schemas.ts +84 -8
- package/src/output-encoding.wgsl +10 -0
- package/src/pbr-temporal.wgsl +9 -1
- package/src/scene-temporal.wgsl +2 -0
- package/src/shadow-pcf.wgsl +6 -8
- package/src/shadow-surface.wgsl +16 -0
- package/src/shadow_caster.wgsl +99 -61
- package/src/sprite-lit.wgsl +4 -4
- package/src/sprite.wgsl +3 -3
- package/src/ssr-compose.wgsl +129 -0
- package/src/ssr-hiz-reduce.wgsl +53 -0
- package/src/ssr-hiz.wgsl +66 -0
- package/src/ssr-temporal.wgsl +305 -0
- package/src/ssr-trace.wgsl +784 -0
- package/src/standard-cluster.wgsl +6 -4
- package/src/standard-surface.wgsl +696 -0
- package/src/surface_v1.wgsl +6 -0
- package/src/taa-resolve.wgsl +222 -28
- package/src/tbn.wgsl +1 -1
- package/src/tonemap.wgsl +37 -18
- package/src/unlit.wgsl +3 -3
|
@@ -100,6 +100,7 @@ fn evaluate_cluster_light(
|
|
|
100
100
|
alpha_sq : f32,
|
|
101
101
|
f0 : vec3<f32>,
|
|
102
102
|
flat_2d : bool,
|
|
103
|
+
receive_shadows : bool,
|
|
103
104
|
) -> vec3<f32> {
|
|
104
105
|
let kind = light.metadata.x;
|
|
105
106
|
if (kind == KIND_POINT) {
|
|
@@ -111,7 +112,7 @@ fn evaluate_cluster_light(
|
|
|
111
112
|
}
|
|
112
113
|
#ifdef POINT_SHADOW_AVAILABLE
|
|
113
114
|
let layer = bitcast<i32>(light.metadata.y);
|
|
114
|
-
if (layer >= 0) {
|
|
115
|
+
if (receive_shadows && layer >= 0) {
|
|
115
116
|
let shadow = shadowParams[layer];
|
|
116
117
|
return evalPointShadowed(
|
|
117
118
|
light.position.xyz, light.colorTimesIntensity.xyz, light.position.w,
|
|
@@ -119,7 +120,7 @@ fn evaluate_cluster_light(
|
|
|
119
120
|
layer,
|
|
120
121
|
shadow.x,
|
|
121
122
|
shadow.y,
|
|
122
|
-
|
|
123
|
+
shadow.z, shadow.w,
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
126
|
#endif
|
|
@@ -163,7 +164,7 @@ fn evaluate_cluster_light(
|
|
|
163
164
|
world_pos, normal, view_dir, base_color, metallic, alpha_sq, f0,
|
|
164
165
|
view.spotLightViewProj[tile], tile, 0.005, 0.05,
|
|
165
166
|
3.0,
|
|
166
|
-
1.0,
|
|
167
|
+
select(0.0, 1.0, receive_shadows),
|
|
167
168
|
) * modifier
|
|
168
169
|
#ifdef PROJECTOR_AVAILABLE
|
|
169
170
|
* select(
|
|
@@ -212,6 +213,7 @@ fn evaluateStandardClusterLights(
|
|
|
212
213
|
alpha_sq : f32,
|
|
213
214
|
f0 : vec3<f32>,
|
|
214
215
|
flat_2d : bool,
|
|
216
|
+
receive_shadows : bool,
|
|
215
217
|
) -> vec3<f32> {
|
|
216
218
|
let gx = cluster_uniform.grid.x;
|
|
217
219
|
let gy = cluster_uniform.grid.y;
|
|
@@ -230,7 +232,7 @@ fn evaluateStandardClusterLights(
|
|
|
230
232
|
let light = light_data[light_index_list[list_offset + i]];
|
|
231
233
|
total_radiance += evaluate_cluster_light(
|
|
232
234
|
light, world_pos, normal, view_dir, base_color, metallic, alpha_sq, f0,
|
|
233
|
-
flat_2d,
|
|
235
|
+
flat_2d, receive_shadows,
|
|
234
236
|
);
|
|
235
237
|
}
|
|
236
238
|
return total_radiance;
|