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

GPGPU particle flickering #239

Open
monolithMktg opened this issue Nov 6, 2024 · 0 comments
Open

GPGPU particle flickering #239

monolithMktg opened this issue Nov 6, 2024 · 0 comments

Comments

@monolithMktg
Copy link

monolithMktg commented Nov 6, 2024

Here is a fiddle explaining the problem.:
A simple GPGPU particles simulation which begins flickering around the 15-20 seconds mark from its start, gradually builds up and gets worse with time.

I looked online for solutions and tried the following fixes for z-depth fighting:

  1. narrowed down near and far planes significantly,
  2. turnedalpha onand turned depth off in renderer and set transparency: true in Program settings.

I saw a comment in the GPGPU class which says // to add 0.5 to be center pixel ? but didn't work either when I tried
+ (0.5/this.size):

        // Create coords for output texture
        this.coords = new Float32Array(this.dataLength * 2);
        for (let i = 0; i < this.dataLength; i++) {
            const x = (i % this.size) / this.size + (0.5/this.size); // to add 0.5 to be center pixel ?
            const y = Math.floor(i / this.size) / this.size + (0.5/this.size);
            this.coords.set([x, y ], i * 2);
        }

Any help would be appreciated. Thanks.

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

No branches or pull requests

1 participant