How would I make a basic fluid simulation? (How do we make a editablemesh area)

Ok so, I’ve found the key to POSSIBLY do the most “advanced thing on roblox” (people are lazy and don’t think hard), Ok so. imagine it like this,

You have two balls,
Green is the collison (literally just a ball part thats invisible with cancollide on)
Blue is the editablemesh (cancollide off etc)

So, When the balls are seperated and not grouped together, they will render their own editablemesh.
image
Now, another example when they are grouped / together.

Here are 2 groups, same colors as before. When they are together, they will use ONE editablemesh to render themselves.
image

Now, I think you get what im saying here.

How do we. (Yes you and me, cause i know people will kickstart this into a bunch of madness),

Calculate the area of those balls, convert it to verticie positions, and make a editablemesh? While trying to keep it as optimized as possible?

To sum it up. How do we take the area of a group of balls, Use a singular editablemesh to wrap them together.

i wrote this at 12 am please dont get on me for how bad i explained this

1 Like

Looking deeper, this might be the method many fluid simulation departments use, but have custom physics controllers for their particles. so Yes, This is literally is the key to making Water on roblox. Crazy huh…

Some fluid departments also add quick-calculating to determine if a particle is being realistic or not, as shown here.

To optimize, you’ll of course, have to use a meshpart for the collisons, (so you can take the verticies, i believe), but makesure there isnt much verticies, to simplify the editablemesh scanning.

Yes i know, it wont look the same as what you’d expect from more creditable fluid simulation, but that’s because we dont have a custom physics controller, If anything, I just first wanna knock out how we’re gonna even make a editablemesh like this.

EditableMesh would be very laggy and demanding on the device. It would work though. Normal methods use shaders to connect fluid particles. A simple way to do this is using raymarching. Sadly the Roblox engine does not have a shader editor.

I dont see why you cant simulate the particles without connections though

If the physics solver doesn’t have rigid collision with other particles (allowing them to almost overlap the same position), there are algorithms for searching which particles are the closest to any one particle, and it’s possible to just use the positions of particles that are “surface particles” and construct the mesh that way. To get the rotation of vertices (so the triangle is visible) you have to know the general direction where there is the least particles or which direction the closest grouping of particles are. Raymarching is the better solution for rendering the water, but until we get support for actual shaders, trying to render a water simulation (and computing the physics), we probably won’t get close.
Anyways check out this awesome video :+1: https://youtu.be/rSKMYc1CQHE?si=P4Hyap8XT32wwHj1

Ive made a real-time simulation of my own. You can simulate the liquid particles using any technique but im having trouble making it look like liquid.

Then we start one by one, no?
Each particle would have 4 verticies, almost like a square.
It reads those verticies and generates a hull around both of the particles.

So in our test scenario, lets have two particles. We stick them together.

Is there any current method on generating a hull of these two particles? if there is, we have hope.

1 Like