Skip to content
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

Instancing sprite is glitchy #68529

Closed
Coder2195Text opened this issue Nov 11, 2022 · 10 comments
Closed

Instancing sprite is glitchy #68529

Coder2195Text opened this issue Nov 11, 2022 · 10 comments
Labels

Comments

@Coder2195Text
Copy link

Coder2195Text commented Nov 11, 2022

Godot version

Godot 4 Beta 4

System information

Ubuntu 22.04 Running on Vulkan Mesa Intel® UHD Graphics 620 (WHL GT2)

Issue description

Instancing a sprite is pretty laggy, and if you look at timestamp 0:29, a random missile trail pops in and out of view (THERE IS NO MISSILE ATTACHED TO THE TRAIL)

I have shown in the video I have performance mode on.

If you look at my code, I am using threads as well (Scripts/GameScene/Player.cs line 25)

online-screen-recorder-2022-11-11--15-38-15.mp4

Steps to reproduce

https://github.com/Coder2195Text/fighter-jet-rampage
clone this

Minimal reproduction project

https://github.com/Coder2195Text/fighter-jet-rampage

@clayjohn
Copy link
Member

Could you please provide an MRP? An MRP is a minimal reproduction project. Essentially it contains the fewest elements possible to reproduce the bug (more info here).

While it may be helpful to have your entire game available, it is not fair to ask contributors to debug your entire game to figure out a) if this is a bug in your code or in Godot and b) where in Godot the bug exists (if one exists at all).

To start, you can try to isolate elements of your game that you think are causing the problem. You mention that you are using threads, threads are a powerful tool but can be challenging to get right. When making an MRP, you should try to run your scene without threads and see if you can still reproduce the issue.

@Coder2195Text
Copy link
Author

Coder2195Text commented Nov 11, 2022

Could you please provide an MRP? An MRP is a minimal reproduction project. Essentially it contains the fewest elements possible to reproduce the bug (more info here).

While it may be helpful to have your entire game available, it is not fair to ask contributors to debug your entire game to figure out a) if this is a bug in your code or in Godot and b) where in Godot the bug exists (if one exists at all).

To start, you can try to isolate elements of your game that you think are causing the problem. You mention that you are using threads, threads are a powerful tool but can be challenging to get right. When making an MRP, you should try to run your scene without threads and see if you can still reproduce the issue.

My game isnt a full on game yet, all it is is basic movement and firing of missiles, nothing more. It should be pretty minial

The reason I used threads was this issue happens without threads, so threads is eliminated as an reason
Particles arent the cause, because I disabled them and issue still happens.
The glb sizes are only a few kb, so it cant be vertices.
image
I disabled lighting as well.
Still doesnt work

I dont see anymore things that could be lowering the fps everytime a missile spawns.

@Calinou
Copy link
Member

Calinou commented Nov 11, 2022

The stutter is a duplicate of #61233. The particle issue is likely a duplicate of #56691.

@Coder2195Text
Copy link
Author

The stutter is a duplicate of #61233. The particle issue is likely a duplicate of #56691.

Its not about the particles, cuz I ruled those out

As for duplicate of #61233 is there any current way to fix it? Because on the issue there isnt a solution that I see

@Coder2195Text
Copy link
Author

Coder2195Text commented Nov 11, 2022

The stutter is a duplicate of #61233. The particle issue is likely a duplicate of #56691.

I found that after firing a missile, these errors are added to debug

E 0:00:03:0209   compute_list_bind_uniform_set: Condition "!uniform_set" is true.
  <C++ Source>   drivers/vulkan/rendering_device_vulkan.cpp:8262 @ compute_list_bind_uniform_set()
E 0:00:03:0209   compute_list_dispatch: Uniforms were never supplied for set (2) at the time of drawing, which are required by the pipeline
  <C++ Error>    Method/function failed.
  <C++ Source>   drivers/vulkan/rendering_device_vulkan.cpp:8461 @ compute_list_dispatch()

@Calinou
Copy link
Member

Calinou commented Nov 11, 2022

As for duplicate of #61233 is there any current way to fix it? Because on the issue there isnt a solution that I see

Like in 3.x, you can show the material for a single frame when the project starts. This can be done behind a solid surface (if no occlusion culling is used), but it must be done in front of the camera so that the object isn't culled outside the view frustum.

@Coder2195Text
Copy link
Author

Can I leave it for the whole duration? because I might attach 1 missile under the belly of the airplane

As for duplicate of #61233 is there any current way to fix it? Because on the issue there isnt a solution that I see

Like in 3.x, you can show the material for a single frame when the project starts. This can be done behind a solid surface (if no occlusion culling is used), but it must be done in front of the camera so that the object isn't culled outside the view frustum.

so can I show for more than a frame?

@Coder2195Text
Copy link
Author

As for duplicate of #61233 is there any current way to fix it? Because on the issue there isnt a solution that I see

Like in 3.x, you can show the material for a single frame when the project starts. This can be done behind a solid surface (if no occlusion culling is used), but it must be done in front of the camera so that the object isn't culled outside the view frustum.

I tried placing a missile under jets belly, that causes TREMEDOUS lag

@Coder2195Text
Copy link
Author

oops, it was layer issue I see

@Coder2195Text
Copy link
Author

I found out why its glitchy because my missile is stuck in the plane and it lags trying to free itself
Since I forgot to change the physics layers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants