WIP: Fluid-O-Matic - question(s)

malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

Moin,

my Fluid-O-Matic (J. Stam based gas- and fluid simulation) finally is working. Still lots of work on getting it PEX-i-fied and allow for collision objects, but so far I love playing with smoke and liquids in Fabric :smile:
Yes, I know, there's a preset in 2.3.0 for 2d. But I wanted 3d. And I wanted way more control (viscosity, diffusion, directional forces).

I vaguely remember seeing some hint at a simple surface-meshing preset, but that may, of course, have been Eric Mootz' emPolygonizer. If anyone could point me towards something "usable out of the box" in Fabric, I would not need to come up with my own idea. Right now I am merely outputting boxes ("voxels").

If there isn't something out of the box, I'll sit down and write my own surface-mesher. Since I have a 3d matrix with fixed positions, I don't have to deal with arbitrary vertex offsets, so this should be way easier than what the professionals have to do :wink:

Another question is about piping the geometry to DCC. Everything mesh-related I can prep nicely in Fabric. I am basing form on density right now (adjustable threshold), but it would make sense to use the velocity field for material information.
Does anyone have a cool idea about how transport material information to modo? I suspect that all other DCCs/hosts can deal with arbitrary point attributes, but I am afraid the current modo plugin does not (or, more likely, modo as such does not). I could create UV attributes and remap textures to a set of, say, various color or smoke-sprite image files. But I am not even sure if that works well enough and before I waste time on this, I thought I better ask.

Marc


Marc Albrecht - marc-albrecht.de - does things.

«1

Comments

  • AlexanderMAlexanderM Posts: 132 ✭✭

    It's very interesting

    Let's say NO to Autodesk®Fabric®

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    Great stuff @malbrecht !

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • mootzoidmootzoid Fabric Employee Posts: 185 Fabric Employee
  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭
    edited August 2016

    humh ... thanks guys - now I fear the vid has dried my actual questions to dust ...

    OK, so I guess I'll do my own surface-meshing, right? :wink:


    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    The only mesher I know of is Mootz's polygonizer.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    The only mesher I know of is Mootz's polygonizer.

    Thanks! Then I know what I have to do next.
    Note: That's not to say I don't like em-Polygonizer. It's simply to say that I want to learn how to do it myself :wink:

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • AlexanderMAlexanderM Posts: 132 ✭✭
    edited August 2016

    OpenVDB is the fast and best mesher. One person wrote the extension, but later he abandoned this work http://forums.fabricengine.com/discussion/comment/1660/

    http://www.openvdb.org/about/

    Let's say NO to Autodesk®Fabric®

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi, Alexander,

    thanks, yeah, I know of OpenVDB. But like I said: I would prefer understanding how to do it. That's why I scribbled together that solver in the first place ... the general problem I have with plugins/KITs is that you never know if you got the license right. Doing it yourself it safer, but even then you get smacked sometimes ...

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • Kevin TureskiKevin Tureski Posts: 126 ✭✭

    Hey Mark, Jos is a good friend of mine. I'm sure he'd be pleased to see this. Buy his book - he was pretty happy that it sold out at Siggraph!

    The Art of Fluid Animation
    by Jos Stam
    Link: http://a.co/6rWttC0

  • Kevin TureskiKevin Tureski Posts: 126 ✭✭

    Hey Mark, Jos is a good friend of mine. I'm sure he'd be pleased to see this. Buy his book - he was pretty happy to find out that it sold out at Siggraph!

    The Art of Fluid Animation
    by Jos Stam
    Link: http://a.co/6rWttC0

  • Kevin TureskiKevin Tureski Posts: 126 ✭✭

    Hey Mark, Jos is a good friend of mine. I'm sure he'd be pleased to see this. Buy his book - he was pretty happy to find out that it sold out at Siggraph!

    The Art of Fluid Animation
    by Jos Stam
    Link: http://a.co/6rWttC0

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi, Cevin (sorry, couldn't resist :lol: )

    I bought "the other book" (by Mr. Bridson) and loved it, although, unfortunately, its (ebook) publication is a complete mess (the publisher doesn't seem to care about ebooks, they don't even know what an ebook is, as it seems).
    So when I got fed up with the tech-issues (again, the Bridson book otherwise is really good), I went for Mr. Stam's book, obviously - only to find out it's from the same publisher. And THAT one I did not want to support again so soon.
    Therefor I had to do with what I could find on the web, interpreting it by what I learned from the Bridson book.

    Obviously I will now, immediately and right away without any further delay, at least rent Mr. Stam's book through the publisher.

    Please give him a kiss from me (you can get it back once we meet) - I'll come up with a better video as soon as I have the bells and whistles attached!

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • Kevin TureskiKevin Tureski Posts: 126 ✭✭

    I flipped through the e-version as we were having beers at Siggraph. It was just fine.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    almost half through the book, love it :)

    (although sold as an ebook, it is none, seems to be a DRM tagged PDF, so you don't have any of the benefits of an ebook - but at least the VitalSource reader, opposed to the Amazon Kindle Reader, works)

    Anyway, on topic: Working on a meshing function now - still not sure how to best get the velocity attributes over to the DCC.


    Marc Albrecht - marc-albrecht.de - does things.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    I guess I'll add a general gravity influence, what do you think?

    This is using the "voxel-to-polygon-surface" I quickly hacked together (neighboring voxels get glued together and double faces are removed).


    Marc Albrecht - marc-albrecht.de - does things.

  • Kevin TureskiKevin Tureski Posts: 126 ✭✭

    I think I would be very careful not to step in that :-)

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Nothing important, just playin' around with new features. I added a "particle" output (XfoArray), a position-shaker (randomizing particle positions within their respective cell) and point-forces/wall-forces (now a constant gravity or a steady wind are possible).

    Going for "secondary particles" now - I wonder what the best approach there would be, some simplistic PIC (just averaging each secondary particle's velocity over to all particles in the destination cell)?

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • JM Kin TelaJM Kin Tela Posts: 89

    Let me say,

    Amazing work,

    maybe you would be interested on this: http://www.cs.columbia.edu/cg/surfaceliquids/

    It's a liquid solver based on surfaces...
    It has problems with fluids with internal rotations...
    but amazing for specific task like water crowns and liquid smashing.

    Anyway sorry for the offtopic comments
    and I'll be waiting for any way of loading your work and watch all the bits&bolts of it :) !

    good luck on your knowledge quest! sempai.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hey, thanks - both for the praise and for the paper link! I just wish I would understand the math language better, so that these proposal-papers don't make me feel inferior all the time ;)
    But I'll try to work my way through it!

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Silly idea, I know ... I thought: What about using an image map as source for the density field?

    ... and then I tried to calm down, using the hexagonizer:

    Since the imagemap2density-preset can be triggered from a keyframe-node, why not put in a circle and a ...

    boat?

    This triggered another crazy idea ... but first I have to do some cloth sim for Mica!

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭


    Marc Albrecht - marc-albrecht.de - does things.

  • Paul DoylePaul Doyle Administrator, Fabric Employee Posts: 229 admin

    it looks like you are having fun :)

    CEO at Fabric Software
    Twitter

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭


    Marc Albrecht - marc-albrecht.de - does things.

  • scaronscaron Fabric for Houdini Posts: 171

    Awesome work Marc! Not to distract you but here is a resource you might be interested in...

    http://mantaflow.com/

    some heavy hitters in the fluid simulation world have made this open source simulation framework and are using it to teach CS courses on the subject. I was hoping to wrap this up for Fabric Engine (like bullet) just haven't the time :)

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Thanks, man - now that I have a basic understanding about how fluid simulations work (in general, not claiming that I understand every version, every magic or, behold, even every single line of math), I am absolutely willing in using 3rd party solutions.
    I really wanted to learn this stuff. Right now I am working on a complete rewrite of my code, so that I, hopefully, can give it out of hands without having to dig a deep hole first (for the embarrassment of publishing spaghetti code right from the Marc-labs) :)

    Marc

    P.S. looking at mantaflow right away now, Sir!


    Marc Albrecht - marc-albrecht.de - does things.

  • scaronscaron Fabric for Houdini Posts: 171

    I personally was going to wrap it in an extension but you don't have to wrap it or use it directly. You can use Mantaflow source purely for inspiration and learning. Good luck!

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    V2 is in the works. I have rewritten almost everything to be more modular, stackable and, if needed, noodleble. Meaning: You can use a one-node-does-it-all function (the "Solver" node), but instead you can create your own simulation now, having access to advection, diffusion, reprojection and the fields.
    There's still some debugging to do, obviously, but I think this is looking neat enough already to show off here:

    The Solver only needs a timeline input. You can simply tick "reset on zero", so you don't have to setup a reset-function or a variable yourself, it's all being taken care of already. The Solver also outputs a reset signal, so you can chain in your own reset-features simply by hooking up to the reset-out.
    The solver can be disabled, allowing you to play with the static fields without any calculations being done, speeding up experiment setups.
    Calculations are only done when the timeline actually changes. If the timeline does not change, the solver returns immediately.

    The "creative functions" are those that you will actually want to use. Both density-injector and velocity-injector allow for sub-blocks, meaning: You could just voxelize a teapot, ignoring the actual size of the simulation, and blob the voxel field into the simulation. Same goes for velocities.
    The "fill velocity" function has a randomizer, so you can create a "natural" initial noise field.
    The "hardcore functions" can be re-used to add heat fields or e.g. dampen down velocities, whatever.

    I hope to get it working this week and, maybe, find someone who's interested in playing along ... my goal obviously is to publish this thingy for general use ...

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    what happens to a teapot that gets voxelized into "simpleGas"?


    Marc Albrecht - marc-albrecht.de - does things.

  • mootzoidmootzoid Fabric Employee Posts: 185 Fabric Employee
«1
Sign In or Register to comment.