New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan: Using main Viewport as Sprite2D texture causing artefacts and error #60475
Comments
This same error was mentioned in a few places so I want to create a link to them so that people eventually find this issue as it doesn't yet come up on Google:
Also this error still happens in v4 Beta 6 |
This issue is still occurring in 4.0.3. |
Still occurring in 4.1.1 stable. More or less any viewport texture to itself, in order to reference a prior frame. This all works in spite of the message suggesting that it is not allowed. The error spam ends up making the debugger quite useless that I will likely build Godot myself to silence it, which isn't the worst workaround. |
I found a workaround that eliminates the warning. try this: var viewport_texture = get_viewport().get_texture()
node.texture = ImageTexture.create_from_image( viewport_texture.get_image() ) the docs mention that you might want to do await RenderingServer.frame_post_draw before creating the image texture. Which wasn't necessary for my usecase. But I thought I would still mention it here. |
Just jumping in here to add some context. Using the root Viewport as a texture to draw a Sprite in the root Viewport is not supported and cannot be supported. The error is correct, but not very helpful for end-users. What we probably need to do is detect if the user is trying to use the ViewportTexture of the root Viewport and then provide a proper error that this is not supported. This will of course be tricky as we need to do the same for SubViewports (SubViewports cannot be used as a texture to draw an item that is a child of that SubViewport) |
Godot version
v4.0.alpha6.official [e4f0fc5]
System information
Windows 11, Vulkan, Nvidia 3080Ti (511.79)
Issue description
Using main Viewport as Sprite2D texture causing artefacts and error:
E 0:00:02:0993 draw_list_bind_uniform_set: Attempted to use the same texture in framebuffer attachment and a uniform (set: 3, binding: 0), this is not allowed.
<C++ Error> Condition "attachable_ptr[i].texture == bound_ptr[j]" is true.
<C++ Source> drivers/vulkan/rendering_device_vulkan.cpp:7419 @ draw_list_bind_uniform_set()
Steps to reproduce
Create sprite 2d, assign main viewport texture to it.
Minimal reproduction project
Viewport.zip
The text was updated successfully, but these errors were encountered: