0 votes

I tried to port a bricks game implemented by iq on shadertoy that works entirely with the GPU to godot, but I ran into difficulties. I don't understand why I can't use the viewport texture like this.

viewportTexture

E 0:00:02:0587 draw_list_bind_uniform_set: Attempted to use the same texture in framebuffer attachment and a uniform (set: 1, binding: 1), 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()

in godot

I have uploaded the project files to the github repository, would anyone like to help me?

https://github.com/HK-SHAO/GodotBricksGameShader

The game in shadertoy: https://www.shadertoy.com/view/MddGzf

Here is my computer configuration and godot version information.

Godot version

Godot Engine v4.0.alpha6.official.e4f0fc50f

System information

Windows 11, Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3070 Ti Laptop GPU

Godot version Godot Engine v4.0.alpha6.official.e4f0fc50f
in Engine by (12 points)

Godot 4 is still in alpha. Have you tried in Godot 3? If it works in Godot 3 and not in Godot 4 then it's probably a bug.

Thanks, I'll give it a try.
But I'd like to know if there's a better way for the fragment shader to get the sampler2D of the previous frame, similar to the backbuffer in glsl.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.