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

GLES2 CPUParticles2D cause flicker, flashes, erratic behaviour on screen on OSX, iOS export, Windows, Linux #28719

Closed
aleksfadini opened this issue May 6, 2019 · 22 comments

Comments

@aleksfadini
Copy link

aleksfadini commented May 6, 2019

Godot version:
3.1

OS/device including version:
Linux, kernel 5.0.9
OpenGL ES 2.0 Renderer: Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2)
As well as iOS and iphones (see comments)

Issue description:
When spawning CPUParticles2D nodes, screen flickers and/or flashes erratically.
EDIT: It seems that spawning particles exclusively in _physics_process fixes/reduces the issue. Spawning them in other ways, directly or such as children of an instanced node, causes the issue. Projects exported to iOS are particularly buggy.

Steps to reproduce:
It's sufficient to spawn dynamically CPUParticles2D nodes (see minimal project attached)

Minimal reproduction project:

debug.zip

@akien-mga akien-mga added this to the 3.2 milestone May 6, 2019
@akien-mga
Copy link
Member

I can't reproduce the issue on Mageia 7, kernel 5.1.0-rc7, mesa 19.0.3.
Both my IGP and dGPU handle it fine:
OpenGL ES 2.0 Renderer: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2).
OpenGL ES 2.0 Renderer: AMD VEGAM (DRM 3.30.0, 5.1.0-desktop-0.rc7.2.mga7, LLVM 8.0.0)

Tested 3.1-stable, 3.1.1-stable and current master, all work fine for me.

@DrMoriarty
Copy link
Contributor

I tested this debug project on MacOSX 10.13.6. In original state it doesn't flicker nor GLES2, neither GLES3.
When I added a texture to CPUParticle it start flickering for both video drivers.
OpenGL ES 3.0 Renderer: NVIDIA GeForce GT 1030 OpenGL Engine
https://vimeo.com/334515804

OpenGL ES 2.0 Renderer: NVIDIA GeForce GT 1030 OpenGL Engine
https://vimeo.com/334516016

This is an example of flickered moment:
Снимок экрана 2019-05-06 в 23 23 02

@DrMoriarty
Copy link
Contributor

Also I can see flickering on Android (GLES 2.0) much often than on iOS (GLES 3.0) All flickering related to usage of many CPUParticles2D at one time.

@aleksfadini
Copy link
Author

aleksfadini commented May 6, 2019

I can confirm I have flickering when also exporting the project to iOS. So the original name of this issue should be renamed since it seems to plague any platform.

And yes, my minimum reproduction project should have included a texture. Sorry about that.

Finally, things seem to get worse for me if if the editor is opened for longer and the project is run (and stopped) many times.

@AlexHoratio
Copy link
Contributor

I also have this issue on my computer, running up-to-date Arch Linux on Godot 3.1.1-stable.

The flickering only seems to exist initially- it tapers off after a few seconds of spawning CPUParticles2D nodes. Really weird.

This issue also seems to exist on my machine without even adding a texture to the nodes, as I was able to reproduce it via the minimum reproduction project. D:

@aleksfadini
Copy link
Author

aleksfadini commented May 9, 2019

This is a recorded video example of the bug in a project exported to iOS. You can see artifacts as lines flashing on the screen of random color.

You can see 3 random diagonal lines flickering, in the span of a few seconds.

They disappear when switching to gles3 or taking out all the cpuParticles2D in the game.

https://link.resilio.com/#f=IMG_0073.TRIM.MOV&t=6&i=BZSSECEVLJD6ASEBAU57RMCMMQKWAENPG&e=1557637321&v=2.6

@justinlok
Copy link

Running Windows 10 Godot 3.1.1-stable and ES 2.0 Renderer on GeForce GTX 970/PCIe/SSE2. Can confirm, screen flickering especially if you instance a large amount (like hundreds) of CPUParticles2D in a single frame. They don't even have to be emitting, just having the node there causes flickering. Not spawning CPUParticles2D stops the issue entirely.

@DrMoriarty
Copy link
Contributor

I have tried a lot of combination and just have found one which not flickering:
GLES3
NV workaround = True
FB Allocation = 3D w/o effects
Hdr = OFF
But the most important step - instantiate particle in _physics_process (not in regular _process).
I will try another combinations, may be only one component leads to flickering state.

@DrMoriarty
Copy link
Contributor

It looks like using _physics_process is a complete workaround for this issue. Could anybody check it on another OS?

@aleksfadini
Copy link
Author

aleksfadini commented May 12, 2019

I am trying to use your workaround that issue but it's nearly impossible since I seem to get the same bug even if the particle are spawned or instanced (even as part of an instance) from any bit of code that does not reside in _physics_process.
As an example, if I spawn an instance which contains GLES2 CPUParticles2D on click, I get erratic behaviours at times, once I export to iOS. This is quite broken :(
EDIT: updated the title to reflect that the bug affects iOS, Windows, Linux

@aleksfadini aleksfadini changed the title CPUParticles2D cause flicker, flashes, erratic behaviour on screen on Linux (GLES2) CPUParticles2D cause flicker, flashes, erratic behaviour on screen on Linux and iOS export (GLES2) May 12, 2019
@aleksfadini aleksfadini changed the title CPUParticles2D cause flicker, flashes, erratic behaviour on screen on Linux and iOS export (GLES2) GLES2 CPUParticles2D cause flicker, flashes, erratic behaviour on screen on Linux and iOS export May 12, 2019
@aleksfadini aleksfadini changed the title GLES2 CPUParticles2D cause flicker, flashes, erratic behaviour on screen on Linux and iOS export GLES2 CPUParticles2D cause flicker, flashes, erratic behaviour on screen on iOS export, Windows, Linux May 12, 2019
@DrMoriarty
Copy link
Contributor

@aleksfadini Great! At least it will help to detect how _physics_process environment differs from _process behaviour. I think that core developers could faster fix it with this information.

@DrMoriarty
Copy link
Contributor

@aleksfadini MacOSX too

@aleksfadini aleksfadini changed the title GLES2 CPUParticles2D cause flicker, flashes, erratic behaviour on screen on iOS export, Windows, Linux GLES2 CPUParticles2D cause flicker, flashes, erratic behaviour on screen on OSX, iOS export, Windows, Linux May 12, 2019
@aleksfadini
Copy link
Author

added OSX to the description. Thank you for putting it in high priority, and thanks again to the awesome Godot devs for taking care of this!!

@DrMoriarty
Copy link
Contributor

It seems like in current master this issue was fixed. I checked on 197b65f
MacOSX 10.14.4 Gles2/Gles3 looks ok.
Could anybody check it on another OSes?

@akien-mga
Copy link
Member

Tested again with the MRP + assigned texture to the CPUParticles2D. Same system as #28719 (comment) with slightly newer drivers and kernel.

With the master branch I don't see any flickering, using either GLES2 or GLES3 and both my Intel and AMD GPUs.
With 3.1.1-stable, I only get some flickering with GLES2 on AMD, when first starting the game. Then it runs further without flicker.

Since I can't reproduce all the issues that seem to be described here, I can't really say if it's fixed.

@jahd2602
Copy link
Contributor

Cherrypicking this commit, if you are not on master, may fix this problem: 24b7f08

@jahd2602
Copy link
Contributor

Confirmed on Android and Linux, cherry-picking 24b7f08 (Ensure non-emitting particles not processed on entering tree) on top of 3.1-stable fixed the problem so far.

@akien-mga
Copy link
Member

If I understand correctly this is fixed in the current master branch / 3.2 beta?

I'll close then, please comment if you can still reproduce the issue on 3.2.

@Lilith-In-Starlight
Copy link

Lilith-In-Starlight commented Jan 12, 2020

It still happens to my playtesters on 3.2 beta 6, they both have Windows 10 64 bits. Instead of using CPUParticles2D or Particles2D I used my own, but I tried using them and the bug was more intense. I'm assuming this is caused by the many add_child() calls because reducing the particles lowers the intensity of the bug and putting them on _physics_process() is almost a complete workaround this issue, but give it enoug particles and it'll start happening again.

Edit: Confused beta5 with 6.

@stefano-elysium
Copy link

This is happening on 3.2 too

@AdaLollA
Copy link

I am having the same issue in the Godot 4 beta with GpuParticles2d.

@Calinou
Copy link
Member

Calinou commented Sep 23, 2022

I am having the same issue in the Godot 4 beta with GpuParticles2d.

This is being tracked in #56691.

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

No branches or pull requests

10 participants