Skip to content

docs: Compute radiance cascades (fast)#1987

Draft
reczkok wants to merge 26 commits intomainfrom
docs/compute-gi-rc
Draft

docs: Compute radiance cascades (fast)#1987
reczkok wants to merge 26 commits intomainfrom
docs/compute-gi-rc

Conversation

@reczkok
Copy link
Copy Markdown
Contributor

@reczkok reczkok commented Dec 16, 2025

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 16, 2025

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@49d0790157a107e19b8a71a4a050f037c8d1297f
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@49d0790157a107e19b8a71a4a050f037c8d1297f
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@49d0790157a107e19b8a71a4a050f037c8d1297f

benchmark
view benchmark

commit
view commit

@reczkok reczkok force-pushed the docs/compute-gi-rc branch 3 times, most recently from b89b489 to 5e31cf5 Compare December 19, 2025 14:44
@reczkok reczkok force-pushed the docs/compute-gi-rc branch from 5e31cf5 to a677387 Compare January 14, 2026 14:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 14, 2026

📊 Bundle Size Comparison

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 320 31 1

👀 Notable results

Static test results:

No major changes.

Dynamic test results:

Test tsdown
isTextureView from typegpu.ts 60.48 kB

📋 All results

Click to reveal the results table (351 entries).
Test tsdown
isUsableAsUniform from typegpu.ts 60.46 kB ($${\color{red}+0.0\%}$$)
isTexture from typegpu.ts 60.47 kB ($${\color{red}+0.0\%}$$)
isSampler from typegpu.ts 60.48 kB ($${\color{red}+0.0\%}$$)
isComparisonSampler from typegpu.ts 60.49 kB ($${\color{red}+0.0\%}$$)
isVariable from typegpu.ts 62.26 kB ($${\color{red}+0.0\%}$$)
isUsableAsVertex from typegpu.ts 86.04 kB ($${\color{red}+0.0\%}$$)
isBuffer from typegpu.ts 86.04 kB ($${\color{red}+0.0\%}$$)
WgslGenerator from typegpu.ts 102.03 kB ($${\color{red}+0.0\%}$$)
tgpuImportEverything.ts 252.32 kB ($${\color{red}+0.0\%}$$)
tgpu from typegpu.ts 252.32 kB ($${\color{red}+0.0\%}$$)
tgpu.fn from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.init from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.lazy from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.slot from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.const from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.unroll from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.resolve from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.accessor from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.comptime from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.vertexFn from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.computeFn from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.fragmentFn from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.privateVar from typegpu.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpuImportOne.ts 252.33 kB ($${\color{red}+0.0\%}$$)
tgpu.vertexLayout from typegpu.ts 252.34 kB ($${\color{red}+0.0\%}$$)
tgpu.workgroupVar from typegpu.ts 252.34 kB ($${\color{red}+0.0\%}$$)
tgpu.initFromDevice from typegpu.ts 252.34 kB ($${\color{red}+0.0\%}$$)
tgpu.bindGroupLayout from typegpu.ts 252.34 kB ($${\color{red}+0.0\%}$$)
tgpu.mutableAccessor from typegpu.ts 252.34 kB ($${\color{red}+0.0\%}$$)
tgpu.resolveWithContext from typegpu.ts 252.34 kB ($${\color{red}+0.0\%}$$)
importEntireLibrary.ts 279.57 kB ($${\color{red}+0.0\%}$$)
dataImportEverything.ts 86.94 kB (➖)
dataImportOneDirect.ts 22.50 kB (➖)
dataImportOneStar.ts 22.50 kB (➖)
functionWithUseGpu.ts 282 B (➖)
functionWithoutUseGpu.ts 24 B (➖)
stdImportEverything.ts 102.32 kB (➖)
stdImportOneDirect.ts 46.09 kB (➖)
stdImportOneStar.ts 46.09 kB (➖)
MissingBindGroupsError from typegpu.ts 1.34 kB (➖)
MissingLinksError from typegpu.ts 201 B (➖)
MissingSlotValueError from typegpu.ts 151 B (➖)
MissingVertexBuffersError from typegpu.ts 1.35 kB (➖)
NotUniformError from typegpu.ts 1.30 kB (➖)
ResolutionError from typegpu.ts 1.55 kB (➖)
ShaderGenerator from typegpu.ts 1.80 kB (➖)
Void from typegpudata.ts 734 B (➖)
abs from typegpustd.ts 63.39 kB (➖)
acos from typegpustd.ts 63.39 kB (➖)
acosh from typegpustd.ts 63.39 kB (➖)
add from typegpustd.ts 46.08 kB (➖)
align from typegpudata.ts 24.19 kB (➖)
alignmentOf from typegpudata.ts 19.73 kB (➖)
allEq from typegpustd.ts 49.03 kB (➖)
all from typegpustd.ts 49.03 kB (➖)
and from typegpustd.ts 49.02 kB (➖)
any from typegpustd.ts 49.03 kB (➖)
arrayLength from typegpustd.ts 12.23 kB (➖)
arrayOf from typegpudata.ts 24.00 kB (➖)
asin from typegpustd.ts 63.39 kB (➖)
asinh from typegpustd.ts 63.39 kB (➖)
atan2 from typegpustd.ts 63.39 kB (➖)
atan from typegpustd.ts 63.39 kB (➖)
atanh from typegpustd.ts 63.39 kB (➖)
atomicAdd from typegpustd.ts 13.60 kB (➖)
atomicAnd from typegpustd.ts 13.60 kB (➖)
atomicLoad from typegpustd.ts 13.58 kB (➖)
atomicMax from typegpustd.ts 13.60 kB (➖)
atomicMin from typegpustd.ts 13.60 kB (➖)
atomicOr from typegpustd.ts 13.60 kB (➖)
atomicStore from typegpustd.ts 13.59 kB (➖)
atomicSub from typegpustd.ts 13.60 kB (➖)
atomicXor from typegpustd.ts 13.60 kB (➖)
atomic from typegpudata.ts 779 B (➖)
bitShiftLeft from typegpustd.ts 46.08 kB (➖)
bitShiftRight from typegpustd.ts 46.08 kB (➖)
bitcastU32toF32 from typegpustd.ts 41.91 kB (➖)
bitcastU32toI32 from typegpustd.ts 41.91 kB (➖)
bool from typegpudata.ts 10.78 kB (➖)
builtin from typegpudata.ts 26.37 kB (➖)
ceil from typegpustd.ts 63.39 kB (➖)
clamp from typegpustd.ts 63.39 kB (➖)
common from typegpu.ts 53.43 kB (➖)
comparisonSampler from typegpudata.ts 753 B (➖)
cos from typegpustd.ts 63.39 kB (➖)
cosh from typegpustd.ts 63.39 kB (➖)
countLeadingZeros from typegpustd.ts 63.39 kB (➖)
countOneBits from typegpustd.ts 63.39 kB (➖)
countTrailingZeros from typegpustd.ts 63.39 kB (➖)
cross from typegpustd.ts 63.39 kB (➖)
d from typegpu.ts 84.63 kB (➖)
deepEqual from typegpudata.ts 2.77 kB (➖)
degrees from typegpustd.ts 63.39 kB (➖)
determinant from typegpustd.ts 63.39 kB (➖)
disarrayOf from typegpudata.ts 12.76 kB (➖)
discard from typegpustd.ts 11.98 kB (➖)
distance from typegpustd.ts 63.39 kB (➖)
div from typegpustd.ts 46.08 kB (➖)
dot4I8Packed from typegpustd.ts 63.39 kB (➖)
dot4U8Packed from typegpustd.ts 63.39 kB (➖)
dot from typegpustd.ts 63.38 kB (➖)
dpdxCoarse from typegpustd.ts 12.83 kB (➖)
dpdxFine from typegpustd.ts 12.83 kB (➖)
dpdx from typegpustd.ts 12.83 kB (➖)
dpdyCoarse from typegpustd.ts 12.83 kB (➖)
dpdyFine from typegpustd.ts 12.83 kB (➖)
dpdy from typegpustd.ts 12.83 kB (➖)
eq from typegpustd.ts 49.03 kB (➖)
exp2 from typegpustd.ts 63.39 kB (➖)
exp from typegpustd.ts 63.39 kB (➖)
extensionEnabled from typegpustd.ts 12.32 kB (➖)
extractBits from typegpustd.ts 63.39 kB (➖)
f16 from typegpudata.ts 10.78 kB (➖)
f32 from typegpudata.ts 10.78 kB (➖)
faceForward from typegpustd.ts 63.39 kB (➖)
firstLeadingBit from typegpustd.ts 63.39 kB (➖)
firstTrailingBit from typegpustd.ts 63.39 kB (➖)
float16 from typegpudata.ts 18.69 kB (➖)
float16x2 from typegpudata.ts 18.69 kB (➖)
float16x4 from typegpudata.ts 18.69 kB (➖)
float32 from typegpudata.ts 18.69 kB (➖)
float32x2 from typegpudata.ts 18.69 kB (➖)
float32x3 from typegpudata.ts 18.69 kB (➖)
float32x4 from typegpudata.ts 18.69 kB (➖)
floor from typegpustd.ts 63.39 kB (➖)
fma from typegpustd.ts 63.39 kB (➖)
formatToWGSLType from typegpudata.ts 18.68 kB (➖)
fract from typegpustd.ts 63.39 kB (➖)
frexp from typegpustd.ts 63.39 kB (➖)
fwidthCoarse from typegpustd.ts 12.83 kB (➖)
fwidthFine from typegpustd.ts 12.83 kB (➖)
fwidth from typegpustd.ts 12.83 kB (➖)
ge from typegpustd.ts 49.03 kB (➖)
getLongestContiguousPrefix from typegpudata.ts 22.52 kB (➖)
gt from typegpustd.ts 49.03 kB (➖)
i32 from typegpudata.ts 10.78 kB (➖)
identity2 from typegpustd.ts 24.71 kB (➖)
identity3 from typegpustd.ts 24.71 kB (➖)
identity4 from typegpustd.ts 24.71 kB (➖)
insertBits from typegpustd.ts 63.39 kB (➖)
interpolate from typegpudata.ts 24.20 kB (➖)
invariant from typegpudata.ts 24.57 kB (➖)
inverseSqrt from typegpustd.ts 63.39 kB (➖)
isAccessor from typegpu.ts 65 B (➖)
isAlignAttrib from typegpudata.ts 755 B (➖)
isAtomic from typegpudata.ts 755 B (➖)
isBufferShorthand from typegpu.ts 1.81 kB (➖)
isBuiltinAttrib from typegpudata.ts 757 B (➖)
isBuiltin from typegpudata.ts 22.45 kB (➖)
isCloseTo from typegpustd.ts 49.03 kB (➖)
isContiguous from typegpudata.ts 22.51 kB (➖)
isData from typegpudata.ts 2.39 kB (➖)
isDecorated from typegpudata.ts 758 B (➖)
isDisarray from typegpudata.ts 1.69 kB (➖)
isInterpolateAttrib from typegpudata.ts 761 B (➖)
isLazy from typegpu.ts 61 B (➖)
isLocationAttrib from typegpudata.ts 758 B (➖)
isLooseData from typegpudata.ts 1.74 kB (➖)
isLooseDecorated from typegpudata.ts 1.70 kB (➖)
isMutableAccessor from typegpu.ts 73 B (➖)
isPackedData from typegpudata.ts 18.75 kB (➖)
isPtr from typegpudata.ts 752 B (➖)
isSizeAttrib from typegpudata.ts 754 B (➖)
isSlot from typegpu.ts 61 B (➖)
isTextureView from typegpu.ts 60.48 kB
isTgpuComputeFn from typegpu.ts 69 B (➖)
isTgpuFn from typegpu.ts 765 B (➖)
isTgpuFragmentFn from typegpu.ts 70 B (➖)
isTgpuVertexFn from typegpu.ts 68 B (➖)
isUnstruct from typegpudata.ts 1.69 kB (➖)
isUsableAsRender from typegpu.ts 55 B (➖)
isUsableAsSampled from typegpu.ts 56 B (➖)
isUsableAsStorage from typegpu.ts 56 B (➖)
isWgslArray from typegpudata.ts 754 B (➖)
isWgslData from typegpudata.ts 1.31 kB (➖)
isWgslStruct from typegpudata.ts 755 B (➖)
ldexp from typegpustd.ts 63.39 kB (➖)
le from typegpustd.ts 49.03 kB (➖)
length from typegpustd.ts 63.38 kB (➖)
location from typegpudata.ts 24.19 kB (➖)
log2 from typegpustd.ts 63.39 kB (➖)
log from typegpustd.ts 63.39 kB (➖)
lt from typegpustd.ts 49.03 kB (➖)
mat2x2f from typegpudata.ts 24.71 kB (➖)
mat3x3f from typegpudata.ts 24.71 kB (➖)
mat4x4f from typegpudata.ts 24.71 kB (➖)
matToArray from typegpudata.ts 24.84 kB (➖)
max from typegpustd.ts 63.39 kB (➖)
memoryLayoutOf from typegpudata.ts 39.82 kB (➖)
min from typegpustd.ts 63.39 kB (➖)
mix from typegpustd.ts 63.39 kB (➖)
mod from typegpustd.ts 46.08 kB (➖)
modf from typegpustd.ts 63.39 kB (➖)
mul from typegpustd.ts 46.08 kB (➖)
ne from typegpustd.ts 49.03 kB (➖)
neg from typegpustd.ts 46.08 kB (➖)
normalize from typegpustd.ts 63.39 kB (➖)
not from typegpustd.ts 49.03 kB (➖)
or from typegpustd.ts 49.02 kB (➖)
pack2x16float from typegpustd.ts 33.72 kB (➖)
pack4x8unorm from typegpustd.ts 33.72 kB (➖)
packedFormats from typegpudata.ts 18.71 kB (➖)
pow from typegpustd.ts 63.39 kB (➖)
ptrFn from typegpudata.ts 859 B (➖)
ptrHandle from typegpudata.ts 851 B (➖)
ptrPrivate from typegpudata.ts 858 B (➖)
ptrStorage from typegpudata.ts 856 B (➖)
ptrUniform from typegpudata.ts 852 B (➖)
ptrWorkgroup from typegpudata.ts 860 B (➖)
quantizeToF16 from typegpustd.ts 63.39 kB (➖)
radians from typegpustd.ts 63.39 kB (➖)
range from typegpustd.ts 12.59 kB (➖)
ref from typegpudata.ts 4.18 kB (➖)
reflect from typegpustd.ts 63.39 kB (➖)
refract from typegpustd.ts 63.39 kB (➖)
reverseBits from typegpustd.ts 63.39 kB (➖)
rotateX4 from typegpustd.ts 46.84 kB (➖)
rotateY4 from typegpustd.ts 46.85 kB (➖)
rotateZ4 from typegpustd.ts 46.85 kB (➖)
rotationX4 from typegpustd.ts 24.71 kB (➖)
rotationY4 from typegpustd.ts 24.71 kB (➖)
rotationZ4 from typegpustd.ts 24.71 kB (➖)
round from typegpustd.ts 63.39 kB (➖)
sampler from typegpudata.ts 742 B (➖)
saturate from typegpustd.ts 63.39 kB (➖)
scale4 from typegpustd.ts 46.84 kB (➖)
scaling4 from typegpustd.ts 24.71 kB (➖)
select from typegpustd.ts 49.03 kB (➖)
sign from typegpustd.ts 63.39 kB (➖)
sin from typegpustd.ts 63.39 kB (➖)
sinh from typegpustd.ts 63.39 kB (➖)
sint16 from typegpudata.ts 18.69 kB (➖)
sint16x2 from typegpudata.ts 18.69 kB (➖)
sint16x4 from typegpudata.ts 18.69 kB (➖)
sint32 from typegpudata.ts 18.69 kB (➖)
sint32x2 from typegpudata.ts 18.69 kB (➖)
sint32x3 from typegpudata.ts 18.69 kB (➖)
sint32x4 from typegpudata.ts 18.69 kB (➖)
sint8 from typegpudata.ts 18.69 kB (➖)
sint8x2 from typegpudata.ts 18.69 kB (➖)
sint8x4 from typegpudata.ts 18.69 kB (➖)
sizeOf from typegpudata.ts 22.50 kB (➖)
size from typegpudata.ts 24.19 kB (➖)
smoothstep from typegpustd.ts 63.39 kB (➖)
snorm16 from typegpudata.ts 18.69 kB (➖)
snorm16x2 from typegpudata.ts 18.69 kB (➖)
snorm16x4 from typegpudata.ts 18.69 kB (➖)
snorm8 from typegpudata.ts 18.69 kB (➖)
snorm8x2 from typegpudata.ts 18.69 kB (➖)
snorm8x4 from typegpudata.ts 18.69 kB (➖)
sqrt from typegpustd.ts 63.39 kB (➖)
std from typegpu.ts 99.54 kB (➖)
step from typegpustd.ts 63.39 kB (➖)
storageBarrier from typegpustd.ts 13.60 kB (➖)
struct from typegpudata.ts 3.37 kB (➖)
sub from typegpustd.ts 46.08 kB (➖)
subgroupAdd from typegpustd.ts 21.76 kB (➖)
subgroupAll from typegpustd.ts 21.76 kB (➖)
subgroupAnd from typegpustd.ts 21.76 kB (➖)
subgroupAny from typegpustd.ts 21.76 kB (➖)
subgroupBallot from typegpustd.ts 21.76 kB (➖)
subgroupBroadcastFirst from typegpustd.ts 21.76 kB (➖)
subgroupBroadcast from typegpustd.ts 21.76 kB (➖)
subgroupElect from typegpustd.ts 21.76 kB (➖)
subgroupExclusiveAdd from typegpustd.ts 21.76 kB (➖)
subgroupExclusiveMul from typegpustd.ts 21.76 kB (➖)
subgroupInclusiveAdd from typegpustd.ts 21.76 kB (➖)
subgroupInclusiveMul from typegpustd.ts 21.76 kB (➖)
subgroupMax from typegpustd.ts 21.76 kB (➖)
subgroupMin from typegpustd.ts 21.76 kB (➖)
subgroupMul from typegpustd.ts 21.76 kB (➖)
subgroupOr from typegpustd.ts 21.76 kB (➖)
subgroupShuffleDown from typegpustd.ts 21.76 kB (➖)
subgroupShuffleUp from typegpustd.ts 21.76 kB (➖)
subgroupShuffleXor from typegpustd.ts 21.76 kB (➖)
subgroupShuffle from typegpustd.ts 21.76 kB (➖)
subgroupXor from typegpustd.ts 21.76 kB (➖)
tan from typegpustd.ts 63.39 kB (➖)
tanh from typegpustd.ts 63.39 kB (➖)
texture1d from typegpudata.ts 11.23 kB (➖)
texture2dArray from typegpudata.ts 11.25 kB (➖)
texture2d from typegpudata.ts 11.23 kB (➖)
texture3d from typegpudata.ts 11.23 kB (➖)
textureBarrier from typegpustd.ts 13.59 kB (➖)
textureCubeArray from typegpudata.ts 11.26 kB (➖)
textureCube from typegpudata.ts 11.24 kB (➖)
textureDepth2dArray from typegpudata.ts 11.24 kB (➖)
textureDepth2d from typegpudata.ts 11.22 kB (➖)
textureDepthCubeArray from typegpudata.ts 11.25 kB (➖)
textureDepthCube from typegpudata.ts 11.23 kB (➖)
textureDepthMultisampled2d from typegpudata.ts 11.25 kB (➖)
textureDimensions from typegpustd.ts 23.51 kB (➖)
textureExternal from typegpudata.ts 873 B (➖)
textureGather from typegpustd.ts 23.51 kB (➖)
textureLoad from typegpustd.ts 23.52 kB (➖)
textureMultisampled2d from typegpudata.ts 11.26 kB (➖)
textureSampleBaseClampToEdge from typegpustd.ts 23.52 kB (➖)
textureSampleBias from typegpustd.ts 23.52 kB (➖)
textureSampleCompareLevel from typegpustd.ts 23.52 kB (➖)
textureSampleCompare from typegpustd.ts 23.52 kB (➖)
textureSampleGrad from typegpustd.ts 23.52 kB (➖)
textureSampleLevel from typegpustd.ts 23.52 kB (➖)
textureSample from typegpustd.ts 23.52 kB (➖)
textureStorage1d from typegpudata.ts 1.01 kB (➖)
textureStorage2dArray from typegpudata.ts 1.03 kB (➖)
textureStorage2d from typegpudata.ts 1.01 kB (➖)
textureStorage3d from typegpudata.ts 1.01 kB (➖)
textureStore from typegpustd.ts 23.52 kB (➖)
translate4 from typegpustd.ts 46.84 kB (➖)
translation4 from typegpustd.ts 24.71 kB (➖)
transpose from typegpustd.ts 63.39 kB (➖)
trunc from typegpustd.ts 63.39 kB (➖)
u16 from typegpudata.ts 10.80 kB (➖)
u32 from typegpudata.ts 10.78 kB (➖)
uint16 from typegpudata.ts 18.69 kB (➖)
uint16x2 from typegpudata.ts 18.69 kB (➖)
uint16x4 from typegpudata.ts 18.69 kB (➖)
uint32 from typegpudata.ts 18.69 kB (➖)
uint32x2 from typegpudata.ts 18.69 kB (➖)
uint32x3 from typegpudata.ts 18.69 kB (➖)
uint32x4 from typegpudata.ts 18.69 kB (➖)
uint8 from typegpudata.ts 18.68 kB (➖)
uint8x2 from typegpudata.ts 18.69 kB (➖)
uint8x4 from typegpudata.ts 18.69 kB (➖)
unorm10 10 10 2 from typegpudata.ts 18.69 kB (➖)
unorm16 from typegpudata.ts 18.69 kB (➖)
unorm16x2 from typegpudata.ts 18.69 kB (➖)
unorm16x4 from typegpudata.ts 18.69 kB (➖)
unorm8 from typegpudata.ts 18.69 kB (➖)
unorm8x2 from typegpudata.ts 18.69 kB (➖)
unorm8x4 bgra from typegpudata.ts 18.69 kB (➖)
unorm8x4 from typegpudata.ts 18.69 kB (➖)
unpack2x16float from typegpustd.ts 33.72 kB (➖)
unpack4x8unorm from typegpustd.ts 33.72 kB (➖)
unstruct from typegpudata.ts 1.65 kB (➖)
vec2b from typegpudata.ts 17.19 kB (➖)
vec2f from typegpudata.ts 17.19 kB (➖)
vec2h from typegpudata.ts 17.19 kB (➖)
vec2i from typegpudata.ts 17.19 kB (➖)
vec2u from typegpudata.ts 17.19 kB (➖)
vec3b from typegpudata.ts 17.19 kB (➖)
vec3f from typegpudata.ts 17.19 kB (➖)
vec3h from typegpudata.ts 17.19 kB (➖)
vec3i from typegpudata.ts 17.19 kB (➖)
vec3u from typegpudata.ts 17.19 kB (➖)
vec4b from typegpudata.ts 17.19 kB (➖)
vec4f from typegpudata.ts 17.19 kB (➖)
vec4h from typegpudata.ts 17.19 kB (➖)
vec4i from typegpudata.ts 17.19 kB (➖)
vec4u from typegpudata.ts 17.19 kB (➖)
workgroupBarrier from typegpustd.ts 13.60 kB (➖)

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

} from './operators.ts';

export { classifySlot, createJumpFlood } from './jumpFlood.ts';
export type { ColorTexture, JumpFloodExecutor, SdfTexture } from './jumpFlood.ts';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing as we're planning to add more things to the @typegpu/sdf package (like a default sdf renderer), maybe it would be worth it to wrap these additional type defs into a namespace?

export declare namespace JumpFlood {
  type ColorTexture = ...;
  type SdfTexture = ...;
  type Executor = ...;
}

Usage:

import { createJumpFlood, JumpFlood } from '@typegpu/sdf';

Alternative

We could also just export everything under JumpFlood:

import { JumpFlood } from '@typegpu/sdf';

const jumpFloodExecutor = JumpFlood.createExecutor({ ... });
//    ^? JumpFlood.Executor
Suggested change
export type { ColorTexture, JumpFloodExecutor, SdfTexture } from './jumpFlood.ts';
export * as JumpFlood from './jumpFlood.ts';

@@ -0,0 +1,37 @@
<div align="center">

# @typegpu/three
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sus ඞ

Suggested change
# @typegpu/three
# @typegpu/radiance-cascades

Comment on lines +5 to +37
🚧 **Under Construction** 🚧

</div>

A helper library for using TypeGPU with Three.js.

```ts
import * as TSL from 'three/tsl';
import * as t3 from '@typegpu/three';
import { fract } from 'typegpu/std';

const material1 = new THREE.MeshBasicNodeMaterial();
const pattern = TSL.texture(detailMap, TSL.uv().mul(10));
// `fromTSL` can be used to access any TSL node from a TypeGPU function
const patternAccess = t3.fromTSL(pattern, d.vec4f);
material1.colorNode = t3.toTSL(() => {
'use gpu';
return patternAccess.$;
});

const material2 = new THREE.MeshBasicNodeMaterial();
material2.colorNode = t3.toTSL(() => {
'use gpu';
// Many builtin TSL nodes are already reexported as `accessors`
const uv = t3.uv().$;

if (uv.x < 0.5) {
return d.vec4f(fract(uv.mul(4)), 0, 1);
}

return d.vec4f(1, 0, 0, 1);
});
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update usage docs

"unplugin-typegpu": "workspace:*"
},
"peerDependencies": {
"typegpu": "^0.9.0"
Copy link
Copy Markdown
Collaborator

@iwoplaza iwoplaza Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"typegpu": "^0.9.0"
"typegpu": "workspace:^"

@@ -0,0 +1,44 @@
{
"name": "@typegpu/radiance-cascades",
"version": "0.9.0",
Copy link
Copy Markdown
Collaborator

@iwoplaza iwoplaza Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we release it

Suggested change
"version": "0.9.0",
"version": "0.11.0",
"private": true,

Comment on lines +234 to +240
displayPipeline
.withColorAttachment({
view: context.getCurrentTexture().createView(),
loadOp: 'clear',
storeOp: 'store',
})
.draw(3);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
displayPipeline
.withColorAttachment({
view: context.getCurrentTexture().createView(),
loadOp: 'clear',
storeOp: 'store',
})
.draw(3);
displayPipeline.withColorAttachment({ view: context }).draw(3);

Comment on lines +127 to +128
for (let i = 0; i < scene.disks.length; i++) {
const disk = scene.disks[i];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (let i = 0; i < scene.disks.length; i++) {
const disk = scene.disks[i];
for (const disk of scene.disks) {

Comment on lines +137 to +138
for (let i = 0; i < scene.boxes.length; i++) {
const box = scene.boxes[i];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (let i = 0; i < scene.boxes.length; i++) {
const box = scene.boxes[i];
for (const box of scene.boxes) {

Comment on lines +1 to +2
import tgpu from 'typegpu';
import * as d from 'typegpu/data';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import tgpu from 'typegpu';
import * as d from 'typegpu/data';
import tgpu, { d } from 'typegpu';

Comment on lines +1 to +5
import * as sdf from '@typegpu/sdf';
import tgpu from 'typegpu';
import { fullScreenTriangle } from 'typegpu/common';
import * as d from 'typegpu/data';
import * as std from 'typegpu/std';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import * as sdf from '@typegpu/sdf';
import tgpu from 'typegpu';
import { fullScreenTriangle } from 'typegpu/common';
import * as d from 'typegpu/data';
import * as std from 'typegpu/std';
import * as sdf from '@typegpu/sdf';
import tgpu, { d, std, common } from 'typegpu';

Copy link
Copy Markdown
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thumbnails are missing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we mimic the control scheme from JFA here and clear colors on rmb?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could have two colors, and use the second one on rmb

{
"title": "Compute Cascades (with flooding)",
"category": "rendering",
"tags": ["experimental", "3d"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the coolness factor here

Comment thread packages/typegpu-radiance-cascades/src/cascades.ts Outdated
Comment on lines +110 to +126
console.debug('[radiance-cascades] config:', {
output: `${outputWidth}x${outputHeight}`,
cascadeDim: `${cascadeDimX}x${cascadeDimY}`,
probes: `${cascadeProbesX}x${cascadeProbesY}`,
cascadeCount: cascadeAmount,
sdfResolution: `${sdfResolution.width}x${sdfResolution.height}`,
textureMemory: `${((cascadeDimX * cascadeDimY * cascadeAmount * 8 * 2) / (1024 * 1024)).toFixed(
1,
)} MB (2x cascade textures)`,
dispatchesPerRun: `${cascadeAmount} cascade + 1 build = ${cascadeAmount + 1}`,
workgroupsPerCascadeDispatch: `${Math.ceil(cascadeDimX / 8)}x${Math.ceil(
cascadeDimY / 8,
)} = ${Math.ceil(cascadeDimX / 8) * Math.ceil(cascadeDimY / 8)}`,
workgroupsPerBuildDispatch: `${Math.ceil(outputWidth / 8)}x${Math.ceil(
outputHeight / 8,
)} = ${Math.ceil(outputWidth / 8) * Math.ceil(outputHeight / 8)}`,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we leave this in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will delet

Comment thread packages/typegpu-radiance-cascades/src/runner.ts
Comment thread packages/typegpu-radiance-cascades/src/runner.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

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.79, 1.59, 3.39, 5.40, 6.06, 7.82, 18.94, 22.87]
  line [0.81, 1.62, 3.87, 4.95, 6.05, 9.33, 18.18, 20.09]
  line [0.85, 1.66, 3.91, 5.28, 6.29, 9.59, 18.00, 20.79]
Loading
---
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.30, 0.52, 0.63, 0.72, 0.97, 1.03, 1.31, 1.37]
  line [0.33, 0.51, 0.63, 0.79, 1.01, 1.07, 1.28, 1.40]
  line [0.27, 0.49, 0.64, 0.74, 1.03, 1.05, 1.28, 1.39]
Loading
---
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.80, 1.88, 3.73, 5.04, 10.46, 21.95, 48.11, 94.82]
  line [0.79, 1.84, 3.77, 5.70, 10.59, 22.43, 47.14, 94.94]
  line [0.73, 1.76, 2.97, 5.29, 10.25, 21.52, 47.65, 93.51]
Loading

Copy link
Copy Markdown
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's goo radiance cascades!! 🦋⚰️


let accum = d.vec4f();

for (let i = d.u32(0); i < 4; i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (let i = d.u32(0); i < 4; i++) {
for (const i of tgpu.unroll(std.range(4))) {

Copy link
Copy Markdown
Contributor

@aleksanderkatan aleksanderkatan Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cool effect when the color drawn updates based on time, maybe we could include a switch for this? (though I see no easy way of drawing more than one shade per frame, maybe a slower color progression would make this less eye-straining)

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example has no mobile controls, thus is just an uninteractive black canvas. radiance-compute is not interactive either

let bestOutsideCoord = d.vec2f(-1);
let bestInsideDist = 1e20;
let bestOutsideDist = 1e20;
let bestInsideDist = d.f32(3.4 * 10 ** 38);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could expose constants like max, min, epsilon for each data type, like IEEE754 specifies?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could have two colors, and use the second one on rmb

"types": "./dist/index.d.ts"
},
"scripts": {
"build": "unbuild",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsdown + no index.cjs?

Comment on lines +4 to +5

🚧 **Under Construction** 🚧
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c:

Suggested change
🚧 **Under Construction** 🚧

readonly sdfOutput: SdfTexture;
/** The color output texture (rgba8unorm). */
readonly colorOutput: ColorTexture;
/** Clean up GPU resources created by this executor. */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** Clean up GPU resources created by this executor. */

}

export const sdfSlot = tgpu.slot<(uv: d.v2f) => number>();
export const colorSlot = tgpu.slot<(uv: d.v2f) => d.v3f>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there also be a way to provide transmittance of a pixel? Otherwise, transmittance will always be either 0 or 1, right?

Comment on lines +74 to +75
T = 0;
break;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also seems to treat transmittance binarily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants