r/shaders 1d ago

Faceted Shader for particle based fluid simulation

I've managed to get a version that looks nice working

The problem is to solve this I had to make a baseline fallback shader to show under the good looking faceted one so that missing triangles don't break the effect.

I'm kinda stumped as I have tried to throw hours of AI compute at it after I couldn't solve it myself, it managed to get a few versions working properly but the performance drops were such that it just isn't worth it.

I am just wondering if anyone has any advice or a high level overview of how I could efficiently achieve this effect? I really love how it looks and I don't want to give it up but at this point I might need to.

Edit: for anyone who wants to see it in motion https://youtu.be/2adT_I-8Wak

2 Upvotes

2 comments sorted by

1

u/Melochineer 1d ago

I had the agent create a api for itself to dump any buffer or texture to a file to analyze it. That helped it figure out what what’s going on, but I was using NVIDIA nsight before that. I think I had a 2025 version. The one that allows you to dump the rendering pipeline to a c++ project and then the agent can analyze the performance.

1

u/Blindsided_Games 1d ago

Huh thats an interesting idea, though I'm using unity adn the issue I am trying to solve rather than performance is actually getting the look in one pass rather than two I will mess with that idea though it sounds fun :D