-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Open
Description
Description
Using WebGPURenderer with WebGLBackend, reusing a texture node to assign a RenderTarget texture flips the Y texture coordinate. This can be reproduced with nodes in the examples such as GaussianBlurNode.
This might be caused by some internal state for texture coordinate abstraction not being updated or relying on a wrong assumption, but I'm not sure where.
Reproduction steps
- Render a texture using a texture node.
- Assign a new texture to the texture node to reuse it.
- Render the texture.
Code
const textureNode = texture(null)
const material = new NodeMaterial()
material.fragmentNode = textureNode
const mesh = new QuadMesh(material)
// First pass:
textureNode.value = image
const rt1 = new RenderTarget(100, 100)
renderer.setRenderTarget(rt1)
mesh.render(renderer)
// Second pass:
textureNode.value = rt1.texture
// Uncommenting the line below doesn't change the result, but uncommenting it
// and commenting out the above line does change the result.
// material.fragmentNode = texture(rt1.texture)
const rt2 = new RenderTarget(100, 100)
renderer.setRenderTarget(rt2)
mesh.render(renderer)
See also the fiddles below.
Live example
- Minimal reproduction: https://jsfiddle.net/shotamatsuda/j6btgk0n/
- Using GaussianBlurNode: https://jsfiddle.net/shotamatsuda/o6dbgyL4/
Screenshots
Version
r179
Device
Desktop
Browser
Chrome
OS
MacOS