reze-engine 0.64.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.d.ts +300 -94
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +1628 -787
- package/dist/graph/compile.d.ts.map +1 -1
- package/dist/graph/compile.js +5 -0
- package/dist/graph/presets/body.d.ts.map +1 -1
- package/dist/graph/presets/body.js +26 -24
- package/dist/graph/presets/cloth_rough.js +8 -8
- package/dist/graph/presets/cloth_smooth.js +8 -8
- package/dist/graph/presets/default.js +4 -4
- package/dist/graph/presets/eye.js +10 -10
- package/dist/graph/presets/face.d.ts.map +1 -1
- package/dist/graph/presets/face.js +28 -26
- package/dist/graph/presets/hair.js +6 -6
- package/dist/graph/presets/metal.js +8 -8
- package/dist/graph/presets/stockings.d.ts.map +1 -1
- package/dist/graph/presets/stockings.js +4 -11
- package/dist/graph/presets/unlit.d.ts.map +1 -1
- package/dist/graph/presets/unlit.js +9 -13
- package/dist/graph/registry.d.ts.map +1 -1
- package/dist/graph/registry.js +128 -157
- package/dist/graph/render-class.d.ts +5 -2
- package/dist/graph/render-class.d.ts.map +1 -1
- package/dist/graph/slots.d.ts.map +1 -1
- package/dist/graph/slots.js +12 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/model.d.ts +23 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +41 -1
- package/dist/outline-normals.d.ts +12 -0
- package/dist/outline-normals.d.ts.map +1 -0
- package/dist/outline-normals.js +100 -0
- package/dist/pmx-loader.d.ts +7 -0
- package/dist/pmx-loader.d.ts.map +1 -1
- package/dist/pmx-loader.js +17 -3
- package/dist/shaders/anchor-table.d.ts +11 -0
- package/dist/shaders/anchor-table.d.ts.map +1 -1
- package/dist/shaders/anchor-table.js +9 -3
- package/dist/shaders/directives.d.ts +42 -5
- package/dist/shaders/directives.d.ts.map +1 -1
- package/dist/shaders/directives.js +51 -4
- package/dist/shaders/lights.d.ts +11 -7
- package/dist/shaders/lights.d.ts.map +1 -1
- package/dist/shaders/lights.js +315 -271
- package/dist/shaders/materials/common.d.ts.map +1 -1
- package/dist/shaders/materials/common.js +30 -5
- package/dist/shaders/materials/nodes.d.ts +1 -1
- package/dist/shaders/materials/nodes.d.ts.map +1 -1
- package/dist/shaders/materials/nodes.js +191 -271
- package/dist/shaders/passes/bloom.d.ts +4 -3
- package/dist/shaders/passes/bloom.d.ts.map +1 -1
- package/dist/shaders/passes/bloom.js +58 -87
- package/dist/shaders/passes/composite.d.ts +1 -1
- package/dist/shaders/passes/composite.d.ts.map +1 -1
- package/dist/shaders/passes/composite.js +121 -77
- package/dist/shaders/passes/ground.js +1 -1
- package/dist/shaders/passes/mirror.d.ts +18 -12
- package/dist/shaders/passes/mirror.d.ts.map +1 -1
- package/dist/shaders/passes/mirror.js +59 -13
- package/dist/shaders/passes/outline.d.ts.map +1 -1
- package/dist/shaders/passes/outline.js +71 -14
- package/dist/shaders/passes/particles.d.ts.map +1 -1
- package/dist/shaders/passes/particles.js +9 -3
- package/dist/shaders/passes/probe.d.ts +45 -0
- package/dist/shaders/passes/probe.d.ts.map +1 -0
- package/dist/shaders/passes/probe.js +230 -0
- package/dist/shaders/passes/scene-contract.d.ts +13 -0
- package/dist/shaders/passes/scene-contract.d.ts.map +1 -1
- package/dist/shaders/passes/scene-contract.js +4 -0
- package/dist/shaders/scene-light-api.d.ts.map +1 -1
- package/dist/shaders/scene-light-api.js +1 -0
- package/dist/unity/globals.d.ts +7 -0
- package/dist/unity/globals.d.ts.map +1 -1
- package/dist/unity/globals.js +4 -3
- package/dist/unity/host.d.ts +18 -0
- package/dist/unity/host.d.ts.map +1 -1
- package/dist/unity/host.js +144 -70
- package/dist/unity/looks.d.ts +47 -0
- package/dist/unity/looks.d.ts.map +1 -1
- package/dist/unity/looks.js +150 -6
- package/dist/unity/skin.d.ts.map +1 -1
- package/dist/unity/skin.js +5 -2
- package/dist/unity/stage.d.ts +24 -0
- package/dist/unity/stage.d.ts.map +1 -1
- package/dist/unity/stage.js +59 -7
- package/package.json +1 -1
- package/src/engine.ts +2010 -1033
- package/src/graph/compile.ts +4 -0
- package/src/graph/presets/body.ts +26 -24
- package/src/graph/presets/cloth_rough.ts +8 -8
- package/src/graph/presets/cloth_smooth.ts +8 -8
- package/src/graph/presets/default.ts +4 -4
- package/src/graph/presets/eye.ts +10 -10
- package/src/graph/presets/face.ts +28 -26
- package/src/graph/presets/hair.ts +6 -6
- package/src/graph/presets/metal.ts +8 -8
- package/src/graph/presets/stockings.ts +4 -11
- package/src/graph/presets/unlit.ts +9 -13
- package/src/graph/registry.ts +133 -158
- package/src/graph/render-class.ts +5 -2
- package/src/graph/slots.ts +12 -2
- package/src/index.ts +1 -0
- package/src/model.ts +50 -1
- package/src/outline-normals.ts +110 -0
- package/src/pmx-loader.ts +18 -3
- package/src/shaders/anchor-table.ts +15 -3
- package/src/shaders/directives.ts +88 -6
- package/src/shaders/lights.ts +464 -415
- package/src/shaders/materials/common.ts +30 -5
- package/src/shaders/materials/nodes.ts +191 -271
- package/src/shaders/passes/bloom.ts +59 -87
- package/src/shaders/passes/composite.ts +121 -77
- package/src/shaders/passes/ground.ts +1 -1
- package/src/shaders/passes/mirror.ts +60 -13
- package/src/shaders/passes/outline.ts +71 -14
- package/src/shaders/passes/particles.ts +9 -3
- package/src/shaders/passes/probe.ts +240 -0
- package/src/shaders/passes/scene-contract.ts +17 -0
- package/src/shaders/scene-light-api.ts +1 -0
- package/src/unity/globals.ts +7 -3
- package/src/unity/host.ts +93 -20
- package/src/unity/looks.ts +182 -9
- package/src/unity/skin.ts +5 -2
- package/src/unity/stage.ts +66 -7
- package/dist/physics-debug.d.ts +0 -30
- package/dist/physics-debug.d.ts.map +0 -1
- package/dist/physics-debug.js +0 -526
- package/dist/shaders/agx-lut.d.ts +0 -11
- package/dist/shaders/agx-lut.d.ts.map +0 -1
- package/dist/shaders/agx-lut.js +0 -29
- package/dist/shaders/dfg_lut.d.ts +0 -3
- package/dist/shaders/dfg_lut.d.ts.map +0 -1
- package/dist/shaders/dfg_lut.js +0 -129
- package/dist/shaders/ltc_mag_lut.d.ts +0 -3
- package/dist/shaders/ltc_mag_lut.d.ts.map +0 -1
- package/dist/shaders/ltc_mag_lut.js +0 -1033
- package/dist/shaders/materials/body.d.ts +0 -2
- package/dist/shaders/materials/body.d.ts.map +0 -1
- package/dist/shaders/materials/body.js +0 -95
- package/dist/shaders/materials/cloth_rough.d.ts +0 -2
- package/dist/shaders/materials/cloth_rough.d.ts.map +0 -1
- package/dist/shaders/materials/cloth_rough.js +0 -69
- package/dist/shaders/materials/cloth_smooth.d.ts +0 -2
- package/dist/shaders/materials/cloth_smooth.d.ts.map +0 -1
- package/dist/shaders/materials/cloth_smooth.js +0 -61
- package/dist/shaders/materials/default.d.ts +0 -2
- package/dist/shaders/materials/default.d.ts.map +0 -1
- package/dist/shaders/materials/default.js +0 -43
- package/dist/shaders/materials/eye.d.ts +0 -2
- package/dist/shaders/materials/eye.d.ts.map +0 -1
- package/dist/shaders/materials/eye.js +0 -60
- package/dist/shaders/materials/face.d.ts +0 -2
- package/dist/shaders/materials/face.d.ts.map +0 -1
- package/dist/shaders/materials/face.js +0 -95
- package/dist/shaders/materials/hair.d.ts +0 -2
- package/dist/shaders/materials/hair.d.ts.map +0 -1
- package/dist/shaders/materials/hair.js +0 -90
- package/dist/shaders/materials/metal.d.ts +0 -2
- package/dist/shaders/materials/metal.d.ts.map +0 -1
- package/dist/shaders/materials/metal.js +0 -77
- package/dist/shaders/materials/mmd_classic.d.ts +0 -2
- package/dist/shaders/materials/mmd_classic.d.ts.map +0 -1
- package/dist/shaders/materials/mmd_classic.js +0 -66
- package/dist/shaders/materials/stockings.d.ts +0 -2
- package/dist/shaders/materials/stockings.d.ts.map +0 -1
- package/dist/shaders/materials/stockings.js +0 -122
- package/dist/shaders/passes/physics-debug.d.ts +0 -2
- package/dist/shaders/passes/physics-debug.d.ts.map +0 -1
- package/dist/shaders/passes/physics-debug.js +0 -69
- package/src/shaders/agx-lut.ts +0 -30
- package/src/shaders/dfg_lut.ts +0 -131
- package/src/shaders/ltc_mag_lut.ts +0 -1035
|
@@ -134,6 +134,13 @@ struct VertexOutput {
|
|
|
134
134
|
/** The scene fog's two amounts, computed PER VERTEX as the game does — see
|
|
135
135
|
* Engine.setSceneFog — and interpolated across the face. */
|
|
136
136
|
@location(5) fog: vec2f,
|
|
137
|
+
/** The vertex colour, RGBA — white on a mesh that carries none. A PMX keeps
|
|
138
|
+
* it in its first additional UV (what a converted game stage writes there:
|
|
139
|
+
* a plant's occlusion rides in its alpha). The attribute node reads it. */
|
|
140
|
+
@location(6) vcolor: vec4f,
|
|
141
|
+
/** The second UV set — a PMX's second additional UV (xy), else the first
|
|
142
|
+
* UV again. The uv_map node's uv2. */
|
|
143
|
+
@location(7) uv2: vec2f,
|
|
137
144
|
};
|
|
138
145
|
|
|
139
146
|
/** One fog layer's amount at a vertex of view depth d and world height y. */
|
|
@@ -165,6 +172,18 @@ struct LightVP { viewProj: array<mat4x4f, ${SHADOW_CASCADES.length}>, };
|
|
|
165
172
|
// The cast's own shadow map for a stage's floor — see _rzCastShadow.
|
|
166
173
|
@group(0) @binding(10) var castShadowMap: texture_depth_2d;
|
|
167
174
|
|
|
175
|
+
/** The stage's reflection probe (Engine.captureReflectionProbe): where it was
|
|
176
|
+
* captured (xyz) and its strength (w); the box it projects onto, min with the
|
|
177
|
+
* on-flag in w, then max. Off (boxMin.w 0) the sky stands in. */
|
|
178
|
+
struct ProbeUniforms {
|
|
179
|
+
center: vec4f,
|
|
180
|
+
boxMin: vec4f,
|
|
181
|
+
boxMax: vec4f,
|
|
182
|
+
};
|
|
183
|
+
// A cube, GGX-prefiltered down its mips — see rzProbeSpecular in nodes.ts.
|
|
184
|
+
@group(0) @binding(11) var probeCube: texture_cube<f32>;
|
|
185
|
+
@group(0) @binding(12) var<uniform> probe: ProbeUniforms;
|
|
186
|
+
|
|
168
187
|
/**
|
|
169
188
|
* How much of the cast stands between this point and the stage's shadow
|
|
170
189
|
* direction, 0–1 — setStageCastShadow. A 5×5 comparison filter at 1.5 texels:
|
|
@@ -186,7 +205,6 @@ fn _rzCastShadow(wp: vec3f) -> f32 {
|
|
|
186
205
|
}
|
|
187
206
|
return 1.0 - lit / 25.0;
|
|
188
207
|
}
|
|
189
|
-
// binding(9) brdfLut is declared inside NODES_WGSL (nodes.ts).
|
|
190
208
|
@group(1) @binding(0) var<storage, read> skinMats: array<mat4x4f>;
|
|
191
209
|
// What this object's lighting is, apart from the scene's, as the game's
|
|
192
210
|
// pipeline gives each renderer its own:
|
|
@@ -195,8 +213,10 @@ fn _rzCastShadow(wp: vec3f) -> f32 {
|
|
|
195
213
|
// layers, as the game lights them;
|
|
196
214
|
// ambient.x 1 while it has an ambient of its own (Engine.setModelAmbient),
|
|
197
215
|
// 0 for the world's;
|
|
198
|
-
// sh that ambient's irradiance, folded as the world's (ibl.ts)
|
|
199
|
-
|
|
216
|
+
// sh that ambient's irradiance, folded as the world's (ibl.ts);
|
|
217
|
+
// fill.rgb its fill (Engine.setModelFill), added after its graph times its
|
|
218
|
+
// surface colour — zero for a model that has none.
|
|
219
|
+
struct ObjectLight { layers: vec4u, ambient: vec4f, sh: array<vec4f, 9>, fill: vec4f }
|
|
200
220
|
@group(1) @binding(1) var<uniform> objectLight: ObjectLight;
|
|
201
221
|
|
|
202
222
|
/** The light arriving at a surface of this object facing n: its own ambient
|
|
@@ -301,9 +321,14 @@ const COMMON_VS_WGSL = /* wgsl */ `
|
|
|
301
321
|
@location(1) normal: vec3f,
|
|
302
322
|
@location(2) uv: vec2f,
|
|
303
323
|
@location(3) joints0: vec4<u32>,
|
|
304
|
-
@location(4) weights0: vec4<f32
|
|
324
|
+
@location(4) weights0: vec4<f32>,
|
|
325
|
+
// The extra stream (Engine: the model's attribute buffer, slot 4).
|
|
326
|
+
@location(5) vcolor: vec4<f32>,
|
|
327
|
+
@location(6) uv2: vec2<f32>
|
|
305
328
|
) -> VertexOutput {
|
|
306
329
|
var output: VertexOutput;
|
|
330
|
+
output.vcolor = vcolor;
|
|
331
|
+
output.uv2 = uv2;
|
|
307
332
|
let pos4 = vec4f(position, 1.0);
|
|
308
333
|
let weightSum = weights0.x + weights0.y + weights0.z + weights0.w;
|
|
309
334
|
let invWeightSum = select(1.0, 1.0 / weightSum, weightSum > 0.0001);
|
|
@@ -505,4 +530,4 @@ fn rz_dissolve_threshold(restPos: vec3f) -> f32 {
|
|
|
505
530
|
// The FSOut struct is NOT in here any more — see commonFsOutWgsl above. Every
|
|
506
531
|
// consumer of this constant appends it immediately, which is where it was.
|
|
507
532
|
export const COMMON_MATERIAL_PRELUDE_WGSL =
|
|
508
|
-
COMMON_BINDINGS_WGSL + WORLD_AMBIENT_WGSL + lightsApi(0, 6, "objectLight.layers.x") + SAMPLE_SHADOW_WGSL + COMMON_VS_WGSL
|
|
533
|
+
COMMON_BINDINGS_WGSL + WORLD_AMBIENT_WGSL + lightsApi(0, 6, "objectLight.layers.x", { binding: 9, sampler: "diffuseSampler" }) + SAMPLE_SHADOW_WGSL + COMMON_VS_WGSL
|