webgl-operate
webgl-operate copied to clipboard
WIP: Metaballs
Current setup:
The demo is rendered by drawing a NDC-Triangle. The whole geometry is loaded via textures.
Features:
- Multiple Metaballs that can interact with each other
- Phong shading with point lights
- (possible but currently not used) Metaballs with negative energy
- skybox though the texture access vector is wrong / broken.
TODO:
- raymarch with newton
- freslen-term (- image-based-lightning)
- add metaball surface
Further improvement:
- even faster raymarch
- transparent metaballs (current version is too basic)
- metaballs have individual alpha value
FAILED to implement so far:
- I tried to add a camera to the scene but ended up seeing nothing.
Open questions:
- When two metaballs are merging, the normals of the metaballs point in the opposite directions thus leading to a normal that ist almost near 0 which leads to rendering artifacts at the merging point.
Coverage remained the same at 20.208% when pulling 650eb23203c716adca9cdfe66036f076efd0be51 on metaballs into f799c52a38ccc998d097b7224e1d220713d51b53 on master.
its too slow for now 🥲 - probably going to optimize at some point. We will keep the branch though! Thanks a lot.
That matches with my memory. I did not see further performance improvements when using the newton method. I would suggest switching back to the interval bisection. As far as I remember, it took more iterations, but each iteration was way faster and was therefore overall faster. And it did not have the small rendering artifacts (as far as I remember, at least).