godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.24k stars 20.23k forks source link

Uniforms were never supplied for set (3) at the time of drawing, which are required by the pipeline when adding textures to a particle shader mesh #65732

Closed benbot closed 1 year ago

benbot commented 2 years ago

Godot version

4.0.dev.15

System information

Arch Linux, Vulkan

Issue description

I am sometimes seeing "Uniforms were never supplied for set (3) at the time of drawing, which are required by the pipeline" when trying to add a texture to a StandardMaterial on a QuadMesh on 1 of 2 GPUParticle nodes in a scene.

Once this happens, it's impossible to use the QuadMesh on the 2nd GPUParticle with a StandardMaterial. This error spams constantly to the console, and if left alone for too long, will cause godot to crash

Steps to reproduce

  1. make a new scene,
  2. add a GPUParticle
  3. make a basic ProcessParticle
  4. add a QuadMesh to the particle emitter
  5. Set a StandardMaterial to the quad mesh
  6. apply a texture to the standardmaterial

Observe that everything appears fine

repeat steps 2-6 on the same scene

Observe that the aforementioned error appears constantly, eventually causing a crash.

Minimal reproduction project

No response

colinmbo commented 1 year ago

I am encountering the same problem, although the steps to reproduce are different. After adding a GPUParticles3D, creating a new ParticleProcessMaterial for it, adding a QuadMesh to the draw pass, and setting a StandardMaterial to the mesh, simply changing the shading mode to Unshaded consistently results in this same behavior, with the console spamming the same error and the material turning black. Changing the shading mode back to Per Pixel doesn't resolve the issue, and it can only be resolved by deleting the material altogether. I've yet to get any basic particles working in Godot 4 since even the earliest alphas due to similar issues.

EDIT: In fact, it appears that this same error displays regardless of the type of mesh being created, and regardless of whether it is a StandardMaterial3D or an ORMMaterial3D.

snougo commented 1 year ago

I can reproduce this issue in Godot4 beta6 on Mac, but I found that after swiching to another scene tab and switching back particles scene, it will stop to spma lots of error message.

https://user-images.githubusercontent.com/64188282/203945885-3906d41a-1da2-45d2-8050-ba5c43254156.mov

barrrettt commented 1 year ago

same issue, but diferent reproduccion. win11 rtx3000 series, v4.0beta6 same steps (y use spheremesh), but step 6: I don't add texture set "use as albedo" True

image

andyprice commented 1 year ago

I've been seeing the same issue. Just out of curiosity I added _shader_uniform_debug(dl->state.pipeline_shader) to the error message and it outputs this:

ERROR: Uniforms were never supplied for set (3) at the time of drawing, which are required by the pipeline:
Set: 0 Binding: 1 Type: Sampler Writable: N Length: 12
Set: 0 Binding: 2 Type: Sampler Writable: N Length: 1
Set: 0 Binding: 3 Type: Sampler Writable: N Length: 1
Set: 0 Binding: 4 Type: Sampler Writable: N Length: 1
Set: 0 Binding: 5 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 6 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 7 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 8 Type: UniformBuffer Writable: N Length: 3712
Set: 0 Binding: 9 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 10 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 11 Type: Texture Writable: N Length: 1
Set: 0 Binding: 12 Type: Texture Writable: N Length: 1
Set: 0 Binding: 13 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 14 Type: StorageBuffer Writable: N Length: 0
Set: 0 Binding: 15 Type: UniformBuffer Writable: N Length: 496
Set: 1 Binding: 0 Type: UniformBuffer Writable: N Length: 5632
Set: 1 Binding: 1 Type: UniformBuffer Writable: N Length: 144
Set: 1 Binding: 2 Type: StorageBuffer Writable: N Length: 0
Set: 1 Binding: 3 Type: Texture Writable: N Length: 1
Set: 1 Binding: 4 Type: Texture Writable: N Length: 1
Set: 1 Binding: 5 Type: Texture Writable: N Length: 1
Set: 1 Binding: 6 Type: Texture Writable: N Length: 1
Set: 1 Binding: 7 Type: Texture Writable: N Length: 8
Set: 1 Binding: 8 Type: Texture Writable: N Length: 8
Set: 1 Binding: 9 Type: StorageBuffer Writable: N Length: 0
Set: 1 Binding: 10 Type: Texture Writable: N Length: 1
Set: 1 Binding: 11 Type: Texture Writable: N Length: 1
Set: 1 Binding: 12 Type: Texture Writable: N Length: 1
Set: 1 Binding: 13 Type: Texture Writable: N Length: 1
Set: 1 Binding: 14 Type: Texture Writable: N Length: 1
Set: 1 Binding: 15 Type: Texture Writable: N Length: 1
Set: 1 Binding: 16 Type: Texture Writable: N Length: 1
Set: 1 Binding: 17 Type: Texture Writable: N Length: 1
Set: 1 Binding: 18 Type: UniformBuffer Writable: N Length: 896
Set: 1 Binding: 19 Type: Texture Writable: N Length: 1
Set: 1 Binding: 20 Type: Texture Writable: N Length: 1
Set: 2 Binding: 0 Type: StorageBuffer Writable: N Length: 0
Set: 3 Binding: 0 Type: UniformBuffer Writable: N Length: 128
Set: 3 Binding: 1 Type: Texture Writable: N Length: 1
Set: 3 Binding: 2 Type: Texture Writable: N Length: 1
Set: 3 Binding: 3 Type: Texture Writable: N Length: 1
   at: draw_list_draw (drivers/vulkan/rendering_device_vulkan.cpp:7830)

Perhaps somebody out there understands what it means (if it's valid data at all).

clayjohn commented 1 year ago

Looks like https://github.com/godotengine/godot/issues/69156 is a duplicate of this issue, but more discussion has been happening in https://github.com/godotengine/godot/issues/69156 so I will close this in favour of https://github.com/godotengine/godot/issues/69156

Necronomicron commented 1 year ago

I randomly get this error in v4.2.dev2.official [da81ca62a].

SaintGeo commented 1 year ago

I have been running 4.1.1 since release (~3 weeks) and encountered this error for the first time today. Closing and re-opening the project and the error is gone (F8 then F5 in the editor). This was my first time running the project after restarting the OS/godot editor.

My error did not spam to the console, it appeared twice and did not seem to have any impact on the project running.

AThousandShips commented 1 year ago

Please open a new issue with the relevant information, this issue was closed as a duplicate, and the other issue was closed, so this is not the same issue, and should be tracked as one