@woosh/meep-engine 2.109.11 → 2.109.12
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/package.json +1 -1
- package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
- package/src/core/model/node-graph/node/Port.js +2 -1
- package/src/engine/graphics/sh3/gi/material/common.glsl +56 -2
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +1 -1
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Port.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/Port.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Port.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/Port.js"],"names":[],"mappings":"AAWA;IAmHI;;;;;OAKG;IACH,iDAFa,IAAI,CAQhB;IA9HD;;;OAGG;IACH,aAAU;IAEV;;;OAGG;IACH,IAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,WAFU,aAAa,GAAC,MAAM,CAEQ;IAEtC;;;OAGG;IACH,UAFU,QAAQ,CAEF;IAEhB;;;OAGG;IACH,UAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAenB;IAED,mBAEC;IAED;;;;;MAOC;IAED;;;;;;;OAOG;IACH,4CANW,MAAM,iCAuChB;IAiBL;;;OAGG;IACH,iBAFU,OAAO,CAEI;CANpB;8BAvI6B,oBAAoB;yBAFzB,qBAAqB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
2
|
import { objectKeyByValue } from "../../object/objectKeyByValue.js";
|
|
3
3
|
import { DataType } from "../type/DataType.js";
|
|
4
|
+
import { deserializeDataTypeFromJSON } from "../type/deserializeDataTypeFromJSON.js";
|
|
4
5
|
import { PortDirection } from "./PortDirection.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -98,7 +99,7 @@ export class Port {
|
|
|
98
99
|
this.name = name;
|
|
99
100
|
this.direction = PortDirection[direction];
|
|
100
101
|
|
|
101
|
-
let _type = dataType !== null ?
|
|
102
|
+
let _type = dataType !== null ? deserializeDataTypeFromJSON(dataType) : null;
|
|
102
103
|
|
|
103
104
|
if (registry !== undefined && _type !== null) {
|
|
104
105
|
assert.equal(registry.isNodeRegistry, true, 'registry.isNodeRegistry !== true');
|
|
@@ -126,7 +126,7 @@ float SampleBlended(sampler2D tex, vec2 uv0, vec2 uv1, vec2 uv2, vec4 weights) {
|
|
|
126
126
|
return samp0 * weights.x + samp1 * weights.y + samp2 * weights.z;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
vec2
|
|
129
|
+
vec2 lpv_probe_getDepthTriangular(uint probe_index, vec3 direction) {
|
|
130
130
|
// get offset
|
|
131
131
|
uint depth_tile_resolution = lpv_u_probe_depth_resolution;
|
|
132
132
|
uvec2 atlas_size = uvec2(4096u);
|
|
@@ -174,6 +174,60 @@ vec2 lpv_probe_getDepth(uint probe_index, vec3 direction) {
|
|
|
174
174
|
return vec2(mean, mean2);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
float lpv_bilinear_lerp(float v00, float v01, float v10, float v11, vec2 fraction) {
|
|
178
|
+
|
|
179
|
+
float x0 = mix(v00, v01, fraction.x);
|
|
180
|
+
float x1 = mix(v10, v11, fraction.x);
|
|
181
|
+
|
|
182
|
+
return mix(x0, x1, fraction.y);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
vec2 lpv_sample_bilinear(sampler2D tex, ivec2 texel_position, vec2 fraction) {
|
|
186
|
+
|
|
187
|
+
float texel_00 = texelFetch(tex, texel_position, 0).r;
|
|
188
|
+
float texel_01 = texelFetch(tex, texel_position + ivec2(1, 0), 0).r;
|
|
189
|
+
float texel_10 = texelFetch(tex, texel_position + ivec2(0, 1), 0).r;
|
|
190
|
+
float texel_11 = texelFetch(tex, texel_position + ivec2(1, 1), 0).r;
|
|
191
|
+
|
|
192
|
+
return vec2(
|
|
193
|
+
lpv_bilinear_lerp(
|
|
194
|
+
texel_00, texel_01,
|
|
195
|
+
texel_10, texel_11,
|
|
196
|
+
fraction
|
|
197
|
+
),
|
|
198
|
+
lpv_bilinear_lerp(
|
|
199
|
+
texel_00*texel_00, texel_01*texel_01,
|
|
200
|
+
texel_10*texel_10, texel_11*texel_11,
|
|
201
|
+
fraction
|
|
202
|
+
)
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
vec2 lpv_probe_getDepthBilinear(uint probe_index, vec3 direction) {
|
|
207
|
+
// get offset
|
|
208
|
+
uint depth_tile_resolution = lpv_u_probe_depth_resolution;
|
|
209
|
+
uvec2 atlas_size = uvec2(4096u);
|
|
210
|
+
|
|
211
|
+
uint tiles_per_row = atlas_size.x / depth_tile_resolution;
|
|
212
|
+
|
|
213
|
+
uint tile_x = probe_index % tiles_per_row;
|
|
214
|
+
uint tile_y = probe_index / tiles_per_row;
|
|
215
|
+
|
|
216
|
+
vec2 tile_offset = vec2(
|
|
217
|
+
tile_x * depth_tile_resolution,
|
|
218
|
+
tile_y * depth_tile_resolution
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
// convert direction to UV
|
|
222
|
+
vec2 octahedral_uv = clamp(VecToSphereOct(direction) * 0.5 + 0.5, 0.0, 1.0);
|
|
223
|
+
vec2 grid = octahedral_uv * vec2(depth_tile_resolution - 1u);
|
|
224
|
+
|
|
225
|
+
vec2 gridFrac = fract(grid);
|
|
226
|
+
vec2 gridFloor = floor(grid);
|
|
227
|
+
|
|
228
|
+
return lpv_sample_bilinear(lpv_t_probe_depth, ivec2(gridFloor+tile_offset),gridFrac);
|
|
229
|
+
}
|
|
230
|
+
|
|
177
231
|
vec3 lpv_probe_getPosition(uint probe_index) {
|
|
178
232
|
return texelFetch(lpv_t_probe_positions, lpv_index_to_256_coordinate(probe_index), 0).rgb;
|
|
179
233
|
}
|
|
@@ -254,7 +308,7 @@ float lpv_probe_getVisibilityMask(vec3 position, uint probe_index) {
|
|
|
254
308
|
|
|
255
309
|
vec3 direction = local_probe_offset / distToProbe;
|
|
256
310
|
|
|
257
|
-
vec2 temp =
|
|
311
|
+
vec2 temp = lpv_probe_getDepthBilinear(probe_index, direction);
|
|
258
312
|
|
|
259
313
|
float mean = temp.x;
|
|
260
314
|
float variance = abs(mean * mean - temp.y);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathTracerProbeRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js"],"names":[],"mappings":"AAuBA;IACI,mBAA0B;IAC1B,yBAAqB;IACrB,
|
|
1
|
+
{"version":3,"file":"PathTracerProbeRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js"],"names":[],"mappings":"AAuBA;IACI,mBAA0B;IAC1B,yBAAqB;IACrB,qBAAmB;IACnB,qBAAyB;IAEzB,uBAA6B;IAE7B;;;;;;;;OAQG;IACH,kCAPW,MAAM,aACN,MAAM,YACN,MAAM,EAAE,mBACR,MAAM,UACN,MAAM,EAAE,iBACR,MAAM,QAahB;IAED,iFAuCC;IAKD,mBACC;IAED,4BAKC;CACJ;8BA5F6B,oBAAoB;2BAHvB,8BAA8B;gCADzB,mCAAmC"}
|
|
@@ -24,7 +24,7 @@ const sampled_irradiance = new Float32Array(3);
|
|
|
24
24
|
export class PathTracerProbeRenderer extends ProbeRenderer {
|
|
25
25
|
tracer = new PathTracer();
|
|
26
26
|
max_bounce_count = 7;
|
|
27
|
-
sample_count =
|
|
27
|
+
sample_count = 192;
|
|
28
28
|
random = seededRandom(0);
|
|
29
29
|
|
|
30
30
|
scene = new PathTracedScene()
|