[v11] webgpu/BlurPass is still the WebGL implementation and imports from legacy
Problem
src/webgpu/Materials/BlurPass/BlurPass.tsx is not a WebGPU implementation. Its own first line says so:
//* TODO: Convert GLSL shaders to TSL for WebGPU ==============================
import { Mesh, BufferGeometry, ..., WebGLRenderTarget, WebGLRenderer, ... } from '#three'
import { ConvolutionMaterial } from '@legacy/Materials/ConvolutionMaterial'Two problems:
It imports the legacy GLSL
ConvolutionMaterial— aShaderMaterial— from thelegacytree. This is the onlywebgpu → legacyimport in the codebase.It imports
WebGLRenderer, whichthree/webgpudoes not export. Verified:WebGLRenderer ** NOT EXPORTED ** WebGLRenderTarget exported RenderTarget exported
That is the same shape as #2764. It is not currently breaking anything only because it is deliberately excluded from the barrel — src/webgpu/Materials/index.ts has //export * from './BlurPass', and the built webgpu/index.mjs contains zero references to it. That call was correct.
Why this matters beyond BlurPass
It explains #2661. The legacy MeshReflectorMaterial blurs its reflection with this pass:
'defines-USE_BLUR': hasBlur ? '' : undefined, // legacy :181
if (hasBlur) blurpass.render(gl, fbo1, fbo2) // legacy :223The WebGPU MeshReflectorMaterial computes hasBlur at line 83 and never uses it — because there is no usable WebGPU BlurPass to call. So blur is inert on WebGPU, which is consistent with the "wrong reflections" report.
Why this is agent-ok
A TSL ConvolutionMaterial already exists right next to it, at src/webgpu/Materials/ConvolutionMaterial/, and is exported. The conversion is largely:
- swap
@legacy/Materials/ConvolutionMaterial→./ConvolutionMaterial WebGLRenderTarget→RenderTarget(exported bythree/webgpu)WebGLRenderer→ theR3FRendererunion, or drop the annotation — seegetMaxAnisotropy()insrc/utils/generic.tsfor the narrowing pattern- re-enable the barrel export
Visual verification needs a GPU, so the result wants human review even though the change does not.
Acceptance
src/webgpu/Materials/BlurPassuses the TSLConvolutionMaterialand nolegacyimport.- It is exported from
/webgpuandyarn test:bundlesstill passes. MeshReflectorMaterial'shasBluris wired to it, andblurvisibly changes the reflection (#2661).
Source: pmndrs/drei