-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Closed
Labels
Milestone
Description
Description
Using WebGPURenderer with WebGLBackend, sampling a depth pass texture using TextureNode.load() attempts to assign a vec4 value to a float variable, resulting in a compilation error. This doesn't reproduce when using TextureNode.sample().
Reproduction steps
- Render a scene using
PassNode. - Sample the depth texture using
TextureNode.load().
Code
const renderer = new WebGPURenderer({ forceWebGL: true })
await renderer.init()
const passNode = pass(scene, camera)
const depthNode = passNode.getTextureNode('depth')
// This will be transpiled to:
// float nodeVar0;
// nodeVar0 = texelFetch( nodeUniform0, ..., 0 );
// Expected:
// float nodeVar0;
// nodeVar0 = texelFetch( nodeUniform0, ..., 0 ).x;
const outputNode = depthNode.load(ivec2(0, 0))
const material = new NodeMaterial()
material.fragmentNode = outputNode
const mesh = new QuadMesh(material)
mesh.render(renderer)Live example
https://jsfiddle.net/shotamatsuda/r7ms2wfk/
(See errors in the console output)
Screenshots
No response
Version
r179
Device
Desktop
Browser
Chrome
OS
MacOS