Jump to content

eetu's lab


eetu

Recommended Posts

  • 2 months later...
  • 1 month later...

Q: What does a TD do when he has some free time?

A: Stupid shit.

I saw the emNewton N-body particle video and began thinking whether it could be sped up with a FLIPish approach.

Looks like it can :)

grav_05.mov

I'm doing it as follows:

1. Accumulate all masses to a volume, that is, add up all particles within a voxel.

2. Create another (vector) volume, and for each voxel, calculate the gravitational force exerted on it by

the other mass voxels, considering them as a point in the center of each voxel, with the accumulated mass thereof.

Add all these forces together.

3. For each particle, read an interpolated value from the volume with the gravitational forces, use it as acceleration.

4. Repeat.

Steps 1 and 2 are done in a SOP Solver, step 3 in a POP Solver, both in the same DOPnet. This way it will work with any other forces as well.

Example of mass and force volumes:

grav_01.jpg

The advantage of doing it this way is that you can stuff a shitload of particles through it. The naive

particle-to-particle force calculation is of N^2 complexity with regards to particle count, this method is

of N^6 complexity with regards to linear voxel resolution. I've done some 10 million particle sims and it didn't

slow things down too much, but for emNewton going from 1 million (the highest in their video) to 10 million should

slow them down 100-fold. The volume sizes I've used this far have been 30-60^3 - doesn't sound like much, but seems to be ok.

The flipside (ha) of this method is that the result is somewhat incorrect :) The gravitational forces are greatest when

the particles are next to each other, but in my version the particles within the same voxel do not affect each other.

The result is a more tame version of the simulation.

I should try and do the naive particle-to-particle approach too, would be interesting to compare.

I do not have pretty renders like the emNewton stuff, but here are a few test quicktimes:

 

grav_01.mov

grav_02.mov

grav_03.mov

grav_04.mov

Edited by eetu
Link to comment
Share on other sites

Hey Eetu, when you said "I've done some 10 million particle sims and it didn't slow things down too much", are you talking about the viewport performance? I liked how that guy had interactive feedback in the viewport. But your stuff must be better :)

Edited by magneto
Link to comment
Share on other sites

Hey Eetu, when you said "I've done some 10 million particle sims and it didn't slow things down too much", are you talking about the viewport performance? I liked how that guy had interactive feedback in the viewport. But your stuff must be better :)

Ohh, I didn't even watch the viewport video. This system is far from interactive. With "not too much" I meant going from 1 to 10 million doubled the sim time, as opposed to the 100 times I'd expect from their system. I think it was something like from 20 to 40 seconds per frame, with a small volume size. I think their rendered video said 10 sec sim time for 1 million particles, so 100x that would be 17 minutes per frame. They do quote only a 10-fold increase from 100k to 1 million, so maybe they are not using the brute force method.

The only way this system is better, is that it will work in the "dozens of millions of particles" -range, while theirs will take forever. Unless their system uses some clever hierarchical acceleration scheme (barnes-hut or somesuch), in which case it is better in all respects :)

Although it's nice that this is all VOPs, no code.

  • Like 1
Link to comment
Share on other sites

Me too! :) I'll give it a shot when I get home tonight I think.

Thanks man, I don't know about smoke sims yet but my only concern is would the boxes not have to be high-res enough in length/height to deform like that in the vid, which didn't look segmented but smooth? :)

Link to comment
Share on other sites

Thanks man, I don't know about smoke sims yet but my only concern is would the boxes not have to be high-res enough in length/height to deform like that in the vid, which didn't look segmented but smooth? :)

I don't think the boxes themselves are actually deforming outside of scaling along the direction that they are moving... 99% sure it's just an optical illusion since there are so many overlapping boxes.

Edit -- that'd still be possible -- however much more computationally complex. ;)

Edited by Solitude
Link to comment
Share on other sites

I hear you, I sort of noticed that illusion when I watched it again :)

Still would be good to put emFluid4 to shame with some Houdini magic :D

....annnndd Done.

Cubes:

http://fx-td.com/content/misc/Pyro_Cubes.mov

Not perfect, but certainly a good start in the right direction.

Wires:

http://fx-td.com/content/misc/Pyro_Wire.mov

I keep forgetting about polywire... sooo bendy 'cubes' is actually quite easy in this case, just a little slower to generate the geo. I lowered the particle count a lot so I didn't have to wait too long. Also note: the normals are smoothed so they look rounder than they actually are. Also, the artifacting at the beginnning -- I think you should only have to add a radius attribute to clean that up... can also drive that by speed as well if you wanted.

Hip file:

http://fx-td.com/content/misc/Pyro_Cubes.hip

Enjoy!

P.S. -- Sorry Eetu for hijacking the thread! Just looked like too much fun to pass up. :( I'll move it elsewhere..earlier next time.

  • Like 3
Link to comment
Share on other sites

I hear you, I sort of noticed that illusion when I watched it again :)

Still would be good to put emFluid4 to shame with some Houdini magic :D

Another hijacking of eetus lab, he will need to bring out the shotgun soon to clean up his lab :D .. Decided to actually make a render this time:

.. houdini boxes for the win :) Edited by Magnus Pettersson
  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...