Repository navigation
S8a: point and spot lights from KHR_lights_punctual - #111
Open
DennisSmolek wants to merge 2 commits into
Open
DennisSmolek wants to merge 2 commits into
DennisSmolek wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #52 (S8: point and spot lights; S8 keeps basisu / Draco / meshopt, occlusion slots, exact browser PNG decode, instancing).
What changed
pointandspot(KHR_lights_punctual) in the scene copy light table (after the environment),SceneCopyInput.punctualLights,SCENE_FLAG.punctual,SceneCopy.punctual. Delta lights: NEE only,delta = true, pdf 1, no MIS, never hit by a ray. Power4 pi Y(I)(point) andY(I)times the integral of the falloff (spot, closed form); selection treats them as bounded lights (V527).saturate(cos * scale + offset)^2,scale = 1 / max(0.001, cos inner - cos outer).rangeignored (V526).integrator.punctual(megakernel and wavefront shareptShadingModulesWgsl), set byptSceneOptionsfrom the scene copy;setScenethrows on a mismatch. ReSTIR refuses it with a message. +470 B on the plain megakernel when on.loadGltfreturnspunctualLights(world position, -Z axis for spots, candela as W/sr); benchLightDescgetspoint/spot; pbrtpoint/spot, Mitsubapoint/spot, glTF exporter write them.docs/concepts/lights.mdx,loading-gltf.mdx; DIVERGES V525-V527; TASKS S8a (split); one CLAUDE.md trap.Verified
node bench/size-snapshot.tsbefore / after,diff -rqover 355 files, empty.punctual-point,punctual-spot,punctual-spot-ramp(256 spp, load-wait 0, correctness only): closed formalbedo/pi * I * atten * cos / r^2, mean rel dev 5.6e-7 / -6.6e-7 / -3.4e-6, zero leak outside the cones. Wavefront = megakernel: max per-pixel difference 0.punctual-pointandpunctual-spot: mean 0.000%, max 0.07% (pbrt) / 0.00% (Mitsuba):Iis W/sr 1:1 in both. The spot ring (about one pixel) is masked: their smoothstep differs from glTF's ramp (V525).punctual.test.ts(both packages), loader fixtures inload.test.tsandgltf-scene.test.ts.pnpm typecheckclean apart from the known@pmndrs/vdberrors.Check yourself
node bench/adapters/matrix.ts --renderers pt-megakernel,pt-wavefront --scenes punctual-point,punctual-spot,punctual-spot-ramp --spp 256 --name rthennode bench/adapters/punctual-check.ts --report r --pair --refs(the refs neednode bench/references/render.ts --scenes punctual-point,punctual-spot --spp 1024).Left
ReSTIR with punctual lights; NEE through media / equiangular with punctual lights (generic
li.deltapath, not run); KhronosLightsPunctualLampis not in the MANIFEST (a hand-built glTF is the fixture).🤖 Generated with Claude Code