Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
mrdoob
commented
Jul 7, 2026
…rt, function or class Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Description
This PR replaces the separable blur (latitudinal/longitudinal) in
PMREMGeneratorwith a spiral kernel that importance-samples the Gaussian, ports the same approach to the WebGPUPMREMGeneratorso both renderers produce matching output, and optimizes the internal vertex shader.Changes
poleAxisspecial case.sin(theta) / thetaterm corrects planar sample density to solid angle._blurperforms two passes atsigma / sqrt(2), composing to the requested sigma while squaring the effective sample count.sigma ≈ 0.04at 256 (e.g.sigma = 1.0produced only ~0.12 radians of blur).PMREMGeneratorofWebGPURendererreceived the same port (TSL blur inPMREMUtils.jsplus the bakedoutputDirectionattribute), removing the last divergence between the two generators forfromScene().blurfunction is renamed tosphericalGaussianBlur(with new parameters). Nothing is added to the TSL namespace (PMREMUtilsis no longer exported there since TSL: Do not exportPMREMUtils#33986).outputDirectionattribute is precomputed in JavaScript, removing thefaceIndexattribute and the branchinggetDirectionlogic from the vertex shader, plus the now-unuseduvattribute.poleAxis, the CPU Gaussian weight table,dTheta, the vestigialsigmasarray andEXTRA_LOD_SIGMA. Blur uniforms reduced from 7 to 3.GGX_SAMPLESaligned to 256 on both renderers (was 512 on WebGPU; 0.03% of pixels differ, halves the prefilter cost).Verification
fromScene( new RoomEnvironment(), 0.04 )is pixel-equivalent todevon both renderers (mean diff 0.7/255, under 0.4% of pixels above 5/255).WebGPURendererandWebGLRenderernow agree onfromScene()output (0.04% of pixels differ atsigma = 0.04); WGSL and GLSL node backends match at 0.01%.fromScene()time is unchanged (sub-millisecond either way; the blur does 40 texture taps per pixel vs 78 before).sigma = 0andsigma = Infinitydegrade gracefully (copy and near-uniform blur respectively).(Made using https://jules.google/, https://antigravity.google/ and Claude Code)