Skip to content

WebGPU: add LightProbeGrid example#33670

Closed
querielo wants to merge 7 commits into
mrdoob:devfrom
querielo:kirill/webgpu-lightprobes
Closed

WebGPU: add LightProbeGrid example#33670
querielo wants to merge 7 commits into
mrdoob:devfrom
querielo:kirill/webgpu-lightprobes

Conversation

@querielo

@querielo querielo commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds WebGPU light probe grid support and expands the examples to cover single-volume, multi-volume, and Sponza scenes. The WebGPU path remains separate from the existing WebGL LightProbeGrid addon.

Included

  • add webgpu_lightprobes.html
  • add webgpu_lightprobes_complex.html
  • add webgpu_lightprobes_sponza.html
  • add screenshots for the new examples
  • register the new examples in examples/files.json
  • add LightProbeGridGPU.js so probe grids can be added to the scene and baked directly

Notes

  • WebGPU path is kept separate from the existing WebGL addon
  • examples can use scene.add( probes ) and await probes.bake( renderer, scene, options )
  • multi-volume sampling automatically uses object-origin bounds selection, matching the existing WebGL behavior
  • single-volume sampling avoids bounds rejection, matching the existing WebGL behavior

Demo

Screenshot 2026-05-28 at 20 11 48

Copilot AI review requested due to automatic review settings May 28, 2026 18:17
@querielo

Copy link
Copy Markdown
Contributor Author

@sunag @Mugen87 Could you help me?

% npm run test-e2e-webgpu webgpu_lightprobes_sponza

> three@0.184.0 test-e2e-webgpu
> node test/e2e/puppeteer.js --webgpu webgpu_lightprobes_sponza

Diff 0.0% in file: webgpu_lightprobes_sponza
TEST PASSED! 1 screenshots rendered correctly.
Closing...


% npm run test-e2e webgpu_lightprobes_sponza

> three@0.184.0 test-e2e
> node test/e2e/puppeteer.js webgpu_lightprobes_sponza

Diff 0.0% in file: webgpu_lightprobes_sponza
TEST PASSED! 1 screenshots rendered correctly.
Closing...

@querielo querielo force-pushed the kirill/webgpu-lightprobes branch 2 times, most recently from b2e64cb to 0b184e9 Compare May 28, 2026 20:55
@querielo

querielo commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@sunag @Mugen87 @mrdoob forceWebGL: true and forceWebGL: false produces different images and the difference is not LightProbeGrid.

Isolation results:

full WebGL fallback (forceWebGL) vs native WebGPU: 0.199% diff
GI disabled:                                       0.251% diff
shadows disabled:                                  0.126% diff
GI + shadows + light + sky disabled:               0.803% diff
model hidden too, flat background only:            0.000% diff

So source is mesh edge rasterization / MSAA coverage between WebGLBackend and WebGPUBackend. Bright high-contrast geometry edges differ slightly. That is why JPEGs differ by ~0.2-0.3%, even though visually same.

I'll try to disable MSAA for now to get the tests passing.

@querielo

Copy link
Copy Markdown
Contributor Author

@sunag I’ve just updated LightProbeGridGPU, it should be much easier to use now. What device are you using to generate the previews?

@sunag

sunag commented May 29, 2026

Copy link
Copy Markdown
Collaborator

@sunag I’ve just updated LightProbeGridGPU, it should be much easier to use now. What device are you using to generate the previews?

I’m taking the screenshot directly from the zip that the E2E testing is generating internally in a more private way (as colaborator), because the Windows screenshots I’ve been taking recently have been failing by minimal percentages.

@Mugen87

Mugen87 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Actually, we wanted to wait with a port until LightProbeGrid gets more stable. It's up to @mrdoob to decide an appropriate point in time.

IMO, at least #33658 should be done before focusing on a port.

@Mugen87

Mugen87 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Closing for now. We make a fresh PR when #33658 is done.

@Mugen87 Mugen87 closed this Jun 15, 2026
@Mugen87 Mugen87 added this to the r185 milestone Jun 15, 2026
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