WIP: My approach to a (poor man's?) particle system for Fabric

2

Comments

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

    I believe the GeometryAttr work was done so that it supports any geometry type that can have attributes (Polygon meshes, lines, points).

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • craouettecraouette Posts: 113

    Yes, I am sure they are working with any sub class of BaseGeometry because it is the class that is holding "GeometryAttributes attributes;". but, the compounds are built with PolygonMesh as input type, which I found misleading, specially when some of the compounds will work only with PolygonMesh.

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    I think @craouette is referring to the Presets that come with Canvas as opposed to the actual method itself.

    Last time I checked the GeometryAttribute presets were very targeted to PolygonMeshes as opposed to being more abstract. Not sure if much has changed in recent nightlies.

  • craouettecraouette Posts: 113

    yes, I am referring to the geometryAttributes describes in this video:
    https://vimeo.com/149419587

    sorry if I was not clear.

  • mootzoidmootzoid Fabric Employee Posts: 185 Fabric Employee

    Last time I checked the GeometryAttribute presets were very targeted to PolygonMeshes as opposed to being more abstract.

    This has changed. All the GeometryAttribute presets were entirely redesigned, expanded and now support all geometry types, ie. PolygonMesh, Lines and Points.

    All this goodness will be available very soon in 2.1.:-)

    Cheers,
    Eric

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    This has changed. All the GeometryAttribute presets were entirely redesigned, expanded and now support all geometry types, ie. PolygonMesh, Lines and Points.

    Was expecting this to be on the roadmap so didn't pay much attention to it back then, but that's great to hear. Looking forward to using it.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi,

    I am stuck at the moment - probably at the point you were just talking about, which I somehow could not follow. It seems I can not really create the additional attributes, even if it seemed to work before.

    To cut it short (sorry for being obviously braindead): I can not, currently, do "Points.GetOrCreateVec3Attribute('blabla');", can I? (According to Canvas I can not).

    Sigh ... thought I could present my first particle solver today ... well ... I guess I have to go back to the point where Helge said "wait" :)

    Marc


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

  • mootzoidmootzoid Fabric Employee Posts: 185 Fabric Employee

    Hi Marc,

    Points.GetOrCreateVec3Attribute('blabla'); should work with any Geometry (Points, Lines, PolygonMesh).
    Could you send a code snippet or screenshot?

    Cheers,
    Eric

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭
    edited February 2016

    Sir, yes, Sir!


    (required extension "Geometry" is loaded)

    Probably my fault. Says me wife.

    Marc


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

  • HelgeHelge Moderator, Fabric Employee Posts: 314 Fabric Employee

    Hey guys,

    just to give you a head up. 2.1.0 is out, and it comes with the new attribute presets, which will be powerful companions on the way to a particle system. :smile:

    http://fabricengine.com/whats-new-in-fabric-engine-2-1/

    Research Engineer @ Fabric Software

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭
    edited February 2016

    Got it. As my wife said. My fault.
    RadialEmitter (experimental state), using GeometryAttributes, is doing something (nothing visible yet, though) ...


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

  • HelgeHelge Moderator, Fabric Employee Posts: 314 Fabric Employee

    Hey Marc,

    did you set the pointSizes attribute? If the particles don't have a radius, they won't be visible. If you can share you graph I am happy to have a look.

    Best!

    Research Engineer @ Fabric Software

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi,

    I am so easy to please ...

    Steps:

    • Create myParticleSimulation
    • Create "maRadialEmitter" on that simulation
    • have the timeline tick do a "maParticleSolve" each tick
    • draw the points from the Simulation container

    Just a first step. Gravity isn't correctly respected yet - but ... hey, did I mention that I am easy to please?

    Marc


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

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

    Awesome @malbrecht!

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Gravity is working :)

    Question: Does it make sense to post a "WIP" package (extension and sample graph) here or should I limit that to "milestones" - if anyone wants to play along anyway?

    Marc


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

  • craouettecraouette Posts: 113

    it's an open discussion... post often to get feedback!

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    Nice! Post more and often is what I'd recommend.

    Is this on Github? I want to play! ;)

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi,

    not on github yet ... not well documented enough and too much WIP :)
    Here's the current snapshot, the content of the "Exts" should go into your Fabric installations Exts folder obviously ...

    RadialEmitter is set to 0.5 Mio particles, you might want to reduce that :-) Let me know what you think ...

    Marc


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

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

    @malbrecht said:
    Here's the current snapshot, the content of the "Exts" should go into your Fabric installations Exts folder obviously ...

    You shouldn't add things to the installation folders. You should add the Exts folders to custom libs via the FABRIC_EXTS_PATH and dfg presets to the FABRIC_DFG_PATH environment variables.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    @malbrecht said:
    Hi,

    not on github yet ... not well documented enough and too much WIP :)
    Here's the current snapshot, the content of the "Exts" should go into your Fabric installations Exts folder obviously ...

    RadialEmitter is set to 0.5 Mio particles, you might want to reduce that :-) Let me know what you think ...

    Marc

    Just put the Snapshot on Github and I'll work from there. That way we can easily track progress and submit issues. Then I can also have a look at setting up a Pull Request that changes it according to @EricT comment so it doesn't have to be installed in the Fabric Engine directory.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭
    edited March 2016

    Sir, yes, Sir! :-)

    https://github.com/Marc-Albrecht/fabric_maParticles

    Got to work (for mon(k)ey) a bit ... more than enough to do on this, I was just happy last night to actually see something on the screen that did not start with a red ERROR ...

    Next things I'll add, when I find time:

    • cage solver (to limit movement of all particles in a simulation to a container box, providing "bounce" properties from the walls)
    • plane solver (like the above, only for an unlimited plane, e.g. for ground planes)
    • mass handling
    • clusters (I'll have to try to understand the Points' provided octree and whatsnots matrixes to hopefully avoid reinventing the wheel)
    • docs (sigh!)

    Marc


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

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    Sweet. Had a quick look and tested it. Example runs fine!

    Refactored the repository to a recommended folder structure and set up a Pull Request.

    Hope to take a closer look soon.

  • craouettecraouette Posts: 113
    edited March 2016

    the emitter is boxy because you take 3 random values (between min and max) for the initial velocity => you can have v=(max,max,max) as initial velocity.

    to have a radial emitter, take 3 random number (1 - 2 rand()), normalize the obtained vector, scale it by (min+(max-min)*rand()) where rand returns a random number between 0 and 1.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    ... 3 random values (between min and max) for the initial velocity. ...

    man - thanks - of course. Sorry for being so dumb!

    @Roy Nieterau Thanks - will update with next upload!

    Marc


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

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    Thanks - will update with next upload!

    What's your experience with Github? With the pull request you should be able to pull it and merge it. Or is there another reason you need to update first?

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭
    edited March 2016

    Hi, Roy,

    I started using GitHub for you, because you asked me to. I don't have any use for it otherwise :-)

    If you need me to include the "pull" into the main line, I will do that of course, right away. The way I work, usually, is in cycles, though, not updating a release on each single enhancement.

    Marc

    P.S. I merged your addition into the main trunk - and added a note in the merge comment that the batch file you provided (thanks) is only for Windows. This is a good example why I don't do immediate inclusions of external changes into code I feel responsible for. I am already unhappy with the lack of documentation I provided and adding features that are platform-specific without documenting them properly I try to avoid, if possible. This is, however, NOT a critique to your help, which I really appreciate! It is an attempt at explaining why I am not a fan of the new "open source" philosophy.


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

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭
    edited March 2016

    If you need me to include the "pull" into the main line, I will do that of course, right away. The way I work, usually, is in cycles, though, not updating a release on each single enhancement.

    Sure. Totally understand. I think Version Control is very powerful in what is often referred to as "agile development" where features are implemented step by step instead of a great leap in version. This is similar to how commits should be done, one by one and clearly descriptive. It's especially powerful when working with others.

    Regarding the batch file being Windows-only. That's correct. I think I also mentioned it in the commit. I can easily add a environment.sh file so it also covers Linux/OSX in that regard. What do you think?

    And that I asked was purely because I noticed your account was new on Github, as such I wondered what your background with it was. No rush otherwise. ;)

    Thanks for merging.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭
    edited March 2016

    All good here :)

    Yeah, I am not a fan of cloud based services - the code I usually deliver is NDA protected, using clouds there would be like cleaning a shotgun by pointing it at your own eyes and firing it until the barrel looks clean enough.
    And I am not a fan of constant commits to a code that is under heavy development. Especially not when working in larger teams. That, in my experience, only works if there is someone responsible for checking each and every commit thoroughly before merging it in.

    I know I am stubborn, old and ... stubborn. It takes time to teach an old dog new tricks, bare with me ...

    Marc

    P.S. I think an additional .sh environment file is not needed, currently I'd prefer pointing to that in documentation. I am a fan of keeping it straight and simple ( :kiss: ), including minimizing the number of files in an archive ...


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

  • craouettecraouette Posts: 113

    One question: what is the best way to swap attributes... using a verlet integrator requires to have the current and the previous position, and at each step, the current position is updated according to forces and the previous is (mostly, in case of collision it is not the case) copied form the starting current position. So, the best way to work is to use the current positions attribute and the previousPositions attribute to compute the new position and store the updated position in the previousPositions attribute. At the end, when all particles are updated, the attributes are swap: positions becomes previousPositions and vice versa. but position is managed a bit differently than other attributes, so renaming the attributes won't do the trick, right? What is the best way to do this?

  • HelgeHelge Moderator, Fabric Employee Posts: 314 Fabric Employee

    Just our two cents: Fabric is all managed through GitHub. Git is perfectly safe, even for very big software projects like Fabric.

    Research Engineer @ Fabric Software

2
Sign In or Register to comment.