News for hackers. Stuff that matters.
Re:NPM won't publish packages containing the word keygen by Const-me on Wednesday June 14, 2023 @11:24AM (#36327377)
The pixel shader is cool, but consumes too much resources. On my 1080Ti, uses about 20% of GPU to render, which is too expensive for such a simple graphics.

I’ve looked at the source, and it seems you’re doing too much computations there. Metaballs are usually rather simple, and they don’t require any trigonometric functions. Compute something like `sum( ball.z / length( pixel - ball.xy ) )` and apply the threshold. If you want anti-aliasing, use fwidth() for the screen-space partial derivative of that value after the loop, compute two thresholds around the iso-value, then smoothstep() instead of a hard threshold.

Also, consider moving the ball parameters (center and size) into a constant buffer and update them on CPU. Because there’s just a few balls, JavaScript is good enough for the job. Your current version computes these things from time for each pixel for each frame. There’re about 8 megapixels on my display, so these computation costs are escalating very quickly.

Re:NPM won't publish packages containing the word keygen by ezekg on Wednesday June 14, 2023 @12:33PM (#36328440)
My lack of knowledge in shaders is showing. :)

I sent you an email with a job offer.

Re:NPM won't publish packages containing the word keygen by dvngnt_ on Wednesday June 14, 2023 @02:33PM (#36330473)
this works fine for me on mobile brave