godotengine / godot

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

Heavy artifacting with GPUParticles3D trails #70546

Open Jamsers opened 1 year ago

Jamsers commented 1 year ago

Godot version

4.0.beta10.official

System information

Windows 11 22H2, GTX 1650 Mobile, NVIDIA Driver 527.56, Vulkan

Issue description

Heavy artifacting when GPUParticles3D trails are used. I initially thought this to be a duplicate of #56691/#59072/#65443 but after using beta 10 which already had #70418 merged, I thought I'd submit a separate bug report for posterity.

https://user-images.githubusercontent.com/39361911/209455169-601fe2b9-34d3-4247-9062-030af6a32c9c.mp4

Steps to reproduce

In the minimal reproduction project, simply shoot the robots one after the other as quickly as possible.

Minimal reproduction project

GPUFlickering.zip

nathanjf commented 1 year ago

This is still an issue. I ended up having the wait a physics frames before making the particle systems visible.

Here is a code snippet from my effect class that shows how I ended up getting around it. I'd try to fix the source code, but I don't even know how to begin searching the Godot repo for the relevant files. It seems like the most straightforward fix would just be make all gpu particle systems preprocess 1 physics frame.

CPUParticles3D do not have this issue and that's why those are also used in my effects.

func fire():
    for oneshot_system in oneshot_systems_cpu:
        oneshot_system.visible = true
        oneshot_system.restart()
        oneshot_system.emitting = true

    for oneshot_system in oneshot_systems_gpu:
        oneshot_system.restart()
        oneshot_system.emitting = true

    frame_delay = true

var frame_delay = false
var second_frame_delay = false
func _physics_process(delta):
    if frame_delay and second_frame_delay:
        frame_delay = false
        second_frame_delay = false
        for oneshot_system in oneshot_systems_gpu:
            oneshot_system.visible = true

    if frame_delay:
        second_frame_delay = true
clayjohn commented 1 year ago

@nathanjf what version of the engine are you using?

nathanjf commented 1 year ago

4.1 stable mono

clayjohn commented 1 year ago

@nathanjf can you test with 4.1.1? I made a PR that helps with similar artifacts

tdaven commented 1 month ago

I tried to reproduce this. While I am on Linux/AMD card, I was able to reproduce the original issue with 4.0.4 stable. But I am unable to reproduce on v4.4.dev.custom_build [4254946de].

https://github.com/user-attachments/assets/e153c40f-15e2-41ba-989f-be574896b72d

The MRP linked above did require a few changes in order for it to run. There was an issue with the modification stack on skeleton3d and with NavigationAgent3D. Though, I made the same changes in the old vs new so I don't think if affected the result.