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

GPUParticles2D additive blending artifacts #74785

Closed
dcarlile42 opened this issue Mar 11, 2023 · 4 comments · Fixed by #80215
Closed

GPUParticles2D additive blending artifacts #74785

dcarlile42 opened this issue Mar 11, 2023 · 4 comments · Fixed by #80215

Comments

@dcarlile42
Copy link

Godot version

v4.0.stable.official [92bee43]

System information

Windows 11, Vulkan, NVIDIA GeForce RTX 2060 with Max-Q Design, Driver Version 531.18

Issue description

CPU is AMD Ryzen 9 4900HS with Radeon Graphics, running with set DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 to force GeForce GPU.

When trying to use additive blending with 2D GPU Particles in 4.0 I'm getting strange artifacts that don't appear in 3.5. I actually get the same artifacts using CPU particles as well. Using Compatibility the artifacts are better, but still not as smooth as 3.5 and very noisy.

Godot 3.5

screenshot

Godot 4.0

screenshot

Godot 4.0 Compatibility

screenshot_compatibility

Steps to reproduce

  • Set up a GPUParticles2D node using a 32x32 "smoke" texture designed for additive blending
  • Texture should use linear filtering
  • add CanvasItemMaterial, set Blend Mode to Add
  • ~1200 particles moving to the left at speed 128
  • life 7 seconds
  • color ramp down to transparent at end of life
  • see example projects for all the particle settings

Minimal reproduction project

ParticleBlendingIssue_20230311.zip

@clayjohn
Copy link
Member

This looks like it was caused by our move to using RGB8 render targets in 2D. I tested my theory by modifying the OpenGL renderer to use an RGBA16 render target (as it does in 3.x) and it restored the same smooth blending that the 3.x version had.

We discussed adding support for a "high precision" mode (in #61667), but in the end decided against it as most users didn't need high precision 2D rendering, they mostly wanted it for data processing or for 3D effects, so we went with another direction. But this case shows that there are situations were an HDR 2D render target may be needed.

@limbonaut
Copy link
Contributor

We have encountered a similar issue. Particle effects that use hue and blending are not producing result as good as in 3.5. Here is a video comparison of the same particle effect in both Godot 4.0 and 3.5:

effect-repro-6000.mp4

@Calinou
Copy link
Member

Calinou commented Apr 20, 2023

We have encountered a similar issue. Particle effects that use hue and blending are not producing result as good as in 3.5. Here is a video comparison of the same particle effect in both Godot 4.0 and 3.5:

This is due to a separate issue: #75153

@dcarlile42
Copy link
Author

I can confirm this change resolves my use case. A big thanks to everyone involved.

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

Successfully merging a pull request may close this issue.

5 participants