Conversation
|
pkg.pr.new packages benchmark commit |
b89b489 to
5e31cf5
Compare
5e31cf5 to
a677387
Compare
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:
📋 All resultsClick to reveal the results table (351 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
There was a problem hiding this comment.
Thumbnails are missing
| { | ||
| "title": "Compute Cascades (with flooding)", | ||
| "category": "rendering", | ||
| "tags": ["experimental", "3d"] |
There was a problem hiding this comment.
Include the coolness factor here
b6a0e20 to
24fb17c
Compare
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.80, 1.57, 3.41, 4.90, 6.17, 8.30, 17.49, 20.20]
line [0.80, 1.55, 3.45, 5.29, 6.13, 8.20, 17.56, 17.79]
line [0.83, 1.61, 3.67, 5.09, 6.02, 10.18, 17.52, 17.90]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.25, 0.49, 0.65, 0.78, 1.00, 1.04, 1.21, 1.35]
line [0.22, 0.48, 0.53, 0.69, 0.89, 0.95, 1.22, 1.35]
line [0.33, 0.50, 0.64, 0.79, 1.00, 1.10, 1.26, 1.38]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.74, 1.82, 3.48, 5.82, 10.49, 20.97, 45.08, 92.10]
line [0.76, 1.68, 3.33, 5.20, 10.42, 21.18, 47.15, 92.87]
line [0.76, 1.74, 3.62, 5.08, 10.30, 22.80, 44.97, 93.14]
|
aleksanderkatan
left a comment
There was a problem hiding this comment.
Let's goo radiance cascades!! 🦋⚰️
| "types": "./dist/index.d.ts" | ||
| }, | ||
| "scripts": { | ||
| "build": "unbuild", |
There was a problem hiding this comment.
tsdown + no index.cjs?
| } | ||
|
|
||
| export const sdfSlot = tgpu.slot<(uv: d.v2f) => number>(); | ||
| export const colorSlot = tgpu.slot<(uv: d.v2f) => d.v3f>(); |
There was a problem hiding this comment.
Shouldn't there also be a way to provide transmittance of a pixel? Otherwise, transmittance will always be either 0 or 1, right?
There was a problem hiding this comment.
This is not that simple, let's say an object has a transmittance of 0.5, what do we do once we hit it? We can't really continue marching since we have hit the surface. We could do a fixed step (to get out of surface) and then march with inverted sign but that gets complicated fast. I will consider this out of scope for now but something I would like to support in the future (of course since the whole ray marching loop is a slot a very capable user could possibly inject non binary transmittance)
… the new system, add cool factor
There was a problem hiding this comment.
Pull request overview
Adds a new @typegpu/radiance-cascades workspace package and integrates it into the docs, alongside a reusable Jump Flood (JFA) implementation in @typegpu/sdf, to support fast 2D lighting/radiance cascade demos.
Changes:
- Introduce
@typegpu/radiance-cascadespackage (core cascades compute + runner API) and wire it into the monorepo/workspace. - Add
createJumpFlood(JFA) to@typegpu/sdfand export it for reuse in examples. - Add new docs examples for radiance cascades (including a drawing-driven variant) and update an existing jump-flood snapshot test.
Reviewed changes
Copilot reviewed 23 out of 26 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds workspace links/lock entries for the new radiance-cascades package. |
| packages/typegpu/src/tgsl/accessProp.ts | Adjusts .kind handling for TGSL member access. |
| packages/typegpu/src/indexNamedExports.ts | Exposes isTextureView from the public typegpu barrel exports. |
| packages/typegpu-sdf/src/jumpFlood.ts | New Jump Flood executor implementation (init, ping-pong passes, finalize). |
| packages/typegpu-sdf/src/index.ts | Exports Jump Flood API from @typegpu/sdf. |
| packages/typegpu-radiance-cascades/* | New package (compute kernels, runner API, build config, docs). |
| apps/typegpu-docs/package.json | Adds @typegpu/radiance-cascades dependency for docs usage. |
| apps/typegpu-docs/src/examples/rendering/radiance-cascades/* | New interactive radiance-cascades example (scene + drag interaction). |
| apps/typegpu-docs/src/examples/rendering/radiance-cascades-drawing/* | New example combining drawing → SDF (JFA) → radiance cascades. |
| apps/typegpu-docs/src/examples/algorithms/jump-flood-distance/index.ts | Uses an explicit f32-max constant for distance initialization. |
| apps/typegpu-docs/tests/individual-example-tests/jump-flood-distance.test.ts | Updates snapshot expectations accordingly. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let dimensions = getCascadeDimensions(); | ||
|
|
||
| const interval0 = 1 / dimensions.cascadeProbes; | ||
| const maxIntervalStart = 1.5; | ||
| const cascadeAmount = Math.ceil(Math.log2((maxIntervalStart * 3) / interval0 + 1) / 2); |
| return snip(target.dataType.type, UnknownData, 'constant'); | ||
| } | ||
| // Example: d.vec3f().kind === 'vec3f' | ||
| // We are not a struct here so it's okey |
| export type Executor = { | ||
| /** Run the jump flood algorithm. */ | ||
| run(): void; | ||
| /** The SDF output texture (r32float). */ |
| return { | ||
| run, | ||
| with: (bg) => createExecutor([...additionalBindGroups, bg]), | ||
| destroy, | ||
| output: dst as OutputTextureProp, | ||
| }; |
No description provided.