12 thoughts on “Compilation of test with link

  1. Verry nice, thumbs up! πŸ™‚

    I guess it took a lot of subframes when baking to recognize the impact of the high speed bullet… no critism, but the way itΒ΄s computed at the moment with the “faked” subframes takes quite some time, because all particles are computed every frame^^ I painfully learned that today when playing further around with your script πŸ™‚

    I cranked the particle number up to ~30K… simulation starts smoothly and looks good… but ends up with funky accelerating particles, when they suddenly recognized that they intersect another particle after changing from one frame to the next. Sure thatΒ΄s due the fact that i try to use no subframes to keep computation times low when baking… but after ~10 hours of trying around with settings 1, 2, 3… subframes without achiving control of their movement… honestly i began to ask my self if there might be a better solution for/instead subframing.

    I came up with the following idea (PLEASE dont judge me an idiot when reading the next sentences! I have ZERO Python knowledge and maybe therefore the idea might be complete Bull++++!)^^.

    To avoid subframing the whole bunch of particles every frame, to keep them “nice and slow” and therefore precisely colliding (to avoid those crazy, popping Kamikaze-Particles, i guess^^) my idea is basically to split “critical frames” (i.e. frame X everything is fine, but in frame X+1 particle “A” suddenly sticks in “B” => BOOM!) into “time-segments” and use these time-segments as subframes to correct the resulting frame.

    The whole idea assumes that the path, which particle “A” and “B” travel, is more or less roughly reconstructable for a defined amount of time. If that is not possible, you can skip the rest of the posting and safe a whole lot of time! πŸ™‚

    I came up with 2 variations of the idea. First one takes place after a bad collision happened and the second one tries to avoid them.

    1st Variation:
    2 Particles, namely “Tom” and “Jeff” πŸ™‚ Tom knows that he is safe at frame X, no one is in range of his “collision-box”. So he continues flying/sticking/sliding/whatever to the next frame, namely X+1. During calculation of this frame, he recognizes that Jeff has hit him. Jeff even passed his collision radius by a good margin! So, he knows that something went terribly wrong between frame X and X+1. Instead of popping away like crazy to get rid of each other, they both should take some time and think about what to do next…

    They have already some data available to handle the situation:
    What was my position,velocity, direction and so on at frame X and where is Jeff now and what is his data for frame X and X+1. But, as you have mentioned, they have no real subframes provided by Blender to check when the collison truly happened. Now they both need a little extra math to correct their position AS IF they collided between frame X and X+1 to solve their correct position for frame X+1. The TIME that passed between X and X+1 is 1/24 second/Frame @24FPS = ~0.04s splittable in as many time-segments as you like, for free^^ They calculate the point and time where the collison had to happen between the frames, by reconstructing the path they came from. Origin-Position in Frame X compared to Origin-Position in Frame X+, resulting in 2 straight Lines on which they can both travel back in time-segments until they “uncollide” . I.e collision at reconstructed “uncollide”-coordinate 6/24s away from the beginning of frame X+1. There both apply their normal collision reaction from that point on * 18/24s (rest of time of frame X+1) to finally reach their corrected positions in frame X+1.
    This example would result in one extra calculation for only 2 particles, instead of doing a whole fake subframe for all particles. Sure, in Extreme all particles could collide badly from one frame to another and so they all would need to be recomputed against each other. But a faked subframe computes them all every time, regardless if thereΒ΄s a collision or none^^

    If you did not fell asleep already, here comes the second variation to predict/avoid bad collisions πŸ™‚
    Calculate in advance the Path that each particle will travel from frame X to X+1 and check for a collision to come. Then apply the whole correction thingy from variation 1 to set the correct particle position in frame X+1…. wow, that was a short text! πŸ™‚

    but…”small” problem overall left… avoid popping “A” or “B” into “C” as a result of the applied correction, because “A” and “B” do not know if there is free space where they would like to place themself πŸ™
    ThatΒ΄s the point where my brain says: FORGET IT! Finish bothering this man with your stupid ideas and go to sleep!!! πŸ™‚

    I guess i wil do so…^^ So keep up the good work, i am sure you will come up with a better solution and the script will run fast like hell when you use Cython (as you admitted in the forums)… and maybe someday even PyCuda or PyOpenCL for particles and collision, like Enjalot and Andrew Young where once developing for the Blender Game Engine^^ Imagine, 10.000.000 particles in Realtime flying and colliding in Blender… πŸ™‚

    Best Regards

    Original OpenCL RTPS for Blender from Enja:
    Continued (added collisions and Rigid Bodies) by Andrew Young:

    • Hi Dan !

      Thanks a lot for your comment ! You ideas are not stupid at all because I thinking everyday on how to avoid subframing. Everytime a solution seem to be good , I realize this is Okay when you just have Tom and Jeff alone but become impossible when you start to add John , Roger … and 30k others particles … with multiples collsions and constraints πŸ™‚ With 12years of experienced in cg , I see a lot of simulation system and every of them use subframing when you come to have a lot of points to move ( some system don’t show it to you because is enough intelligent to control it them self ). Just in Blender , you need to subframe when you do cloth , rigidbody and fluid particles. I don’t know if you read all my thread on the forum but I did a funny competition with a friend when I did first test of my system one year ago. My friend did simulation with Lagao Multiphysics in XSI ( technology developped by Thiago Costa and purchased by Autodesk to be implemented in XSI ) and I trying to do the same with my system. And I’m be surprised: For the same amount of particles , I could tell to my friend in advance how many subframe He need to put to get it’s simulation stable. Probably one day if I find a way to avoid subframing , I win a Nobel price and I can mention your name if you help me πŸ˜‰

      What I can do , but not now , is trying to predict how many subframe I need for every particles for the next frame. It’s recently implemented in Blender for particles and it’s call “adaptive subframe”. I know than the velocity divided by 1/24 * subframe+1 need to be smaller than the radius of the smallest particles. Greater than that increase the chance of getting unstable. Probably some day I can check how to achieve a kind of adaptive subframing. Adaptive subframe can be achieve for all particles … a don’t know if it’s possible for each particles individually.

      For the test you did with my …. ultra alpha version of my script … it’s a bit normal you have difficulty to get somethings stable. You did it with links ? If yes , it’s probably because stiffness or damping is too high. I the version of my script you try , it’s too difficult to find the good stiffness for a amount of particles because it’s can be 1 …. or higher than 3000. Yesterday I’m working to keep this value between 0 and 1. It’s will be easier for the user to find the real value. And by experienced , with 32K particles you need probably 16 and higher subframes. I don’t know if you see my old video with broken Suzan ? 250k particles …. I raise the subframe to 100 for gettings somethings stable ( my friend did the same in Lagoa and reach closely the same amount of subframe ).

      I hope to get a good improvement with cython. I know the best way to get speed is probably read the code of Blender , learn C++ programming in my case , and integrate it directly in the code. But my goal is to keep has a addon and I don’t have a lot of time to learn C++ . I can use this method to learn C++ faster : http://d24w6bsrhbeh9d.cloudfront.net/photo/5525766_700b.jpg

      Yes I see PyCuda and PyOpenCL. Not all code are parrallelisable or easy to doing it. Just in Blender , why most of simulation just use 1 CPU ? But your link are interesting and I want to read it for sure when I have time. Again , thanks a lot for your constructive comment. It’s very appreciated. Soon I release a more usable and userfriendly version of my script. I probably put it in the download page of my blog.

      PS: Wow … just when I near finish this comment my old crappy netbook crash and I’m sure I lost all what I’m writing to you … but Google Chrome keep it in his cache and I just continue writing where I’m before I reboot.

    • oh ! and I forget … number of subframe influence how hard a constraints are too. I read a lots on this and it’s true averywhere …. in CG simulation and in gaming realtime simulation. More you have particles constrained together , more you need subframe to keep it rigid. When my script become more official , I will make some example scene , doc and tutorial for it. I know some trick to avoid long simulation not giving what you are expected. One more things , the way I “faking” substep work really fine and I don’t think it’s will be faster or better if Blender let’s me access to real subframes. I’m happy to find this way to achive it. I hope no new release of Blender make my script unusable because of change on particles.

  2. Hi again,

    Glad to hear that Chrome saved your work πŸ™‚ But it makes me think about what Chrome ak GOOGLE saves elsewhere and whom it might deliver that information in the background… but anyway, thats another topic, i will stay with Firefox anyway^^

    So, thank you very much for explaining me some basics. Now i understand things a bit better! Glad to hear that my idea was not complete nonsense, although impracticable by the fact which i already feared in my last posting ( “popping β€œA” or β€œB” into β€œC” as a result of the applied correction”) will screw things up πŸ™

    http://gloriousmind.com/wp-content/uploads/2012/05/Teach-yourself-C++-in-21-days.png describes nicely why i am a bit afraid to start learning programming languages by myself^^ I guess my reason is the same as yours… I am “already” 35 years old and although i use cg (more or less often) since 3dsMax 4.0 (~15 years ago) i could never motivate myself to learn a programming language in the past… shame on me^^

    I saw that you own a little DIY Router, made of MDF. Driven by Mach3 i guess?^^ Seems like you do not only have a programmers brain but are also a talented craftsman… thats a mighty combination πŸ™‚ By the way, that is the only “programming language” i am familiar with; “DIN G-Code” for CNC routers. Because this once was my job for several years. I even founded a small company, importing CNC-Routers from oversea and selling them in germany. But unfortunatelly all that is left now from this business, after the EUR/USD Crash 4 years ago and a serious illness, are some routers that i still own and use them now just as a hobby. If you like, check out Youtube for “dwTOOLS” to see some of the Routers in action that i once sold. Good & stable machines… i miss those times^^ But anyway, telling my computer to do “G02 X1 Y0 R1” does not make him move in tiny circles, damn! πŸ™‚

    Right now, i am having a look at http://interactivepython.org/courselib/static/thinkcspy/index.html to gather some more knowledge about that whole “Python-Blender-Programming-Monster-Thing”… I did a couple of programms, following the guide, and it did not even hurt^^ So i will dig deeper into it… seems to be fun, so far πŸ™‚

    If you like, you can look at 2 Videos i uploaded for you. Done in Blender with your great script. 1st one shows a stable result, although no subframes or Links used (only a little twaeking of friction in molcore.py), and relatively high particle count. It gives already a good first impression on simulating particles behaving like sand (already multiple times better than fluid particles forced to behave like “dry particles”, using crazy settings^^)


    The second one shows the same setup, no subframes and no Links, but with slightly different settings for friction and mass… resulting in a particle fountain in one of the bowls corners^^ Looks like particles get pushed away to the sides only on the bottom of the bowl, instead of lifting all the ones above them to gather room for further movement in Z direction, which is caused by the green collision object raising upwards.

    Note: I want to point out, for other downloaders, that this result is MY fault (due to using no subframes as advised) and not the fault of Pyroevils script!


    ThatΒ΄s it so far from my side for the moment. …puhh, didnΒ΄t intend to write so much text again, sorry^^ I promise to keep it shorter in the future πŸ™‚

    Best Regards

    3 interesting Links i forgot in my last posting, regarding Blender RTPS
    http://enja.org/opencl/ (Enjas HP, providing Infos about his work on RTPS)
    http://www.youtube.com/user/enjalot (Enjas Vids on RTPS development)
    http://www.youtube.com/watch?v=s2QBRazykEA (Blender 1.000.000 particles in Realtime with collisions, using EnjaΒ΄s RTPS in Blender)

    • Nice test !

      I’m happy to see somebodyelse using my script. Now I push a new commit of the script on Github. In the download folder dated of today. Now for link , you can put stiffness and damping between 0 and 1. If you putting stiffness at 1 ( really rigid ) , puting a bit of damping help to it to not explode. It’s help the springs constraint to not going back and forth too much time and become unstable. I don’t expose the friction parameters for now because is not react like I want. I need to implement some more complex things in the friction. Now is more react like damping , it’s alway equal , not variating depends if the particles rubbing hard or smoothly each other. No velocity transfert is implemented to. I need to take a look of that soon. Continue your test , put it on youtube and I can post it on my blog if you want.

      Have a nice day !

  3. “new release with friction exposed in the UI” , thank you! πŸ™‚

    for i in range(0,2):
    i = (i%2)
    for name in [“Mr. Gallant!”]:
    cold_coffee = name
    if i == (0):
    print (“Good Job!”)
    if i > (0):
    print (“Thumbs”,down,”for”,cold_coffee)

    No Turtles where harmed during my first steps in Python! πŸ˜‰

    (unfortunately, not much further testing done with the script… guess iΒ΄ve spend too much time in having a look at Python in the past 2 days^^)

    Best Regards

    • Your welcome ! πŸ™‚

      Nice script hahahaha
      Don’t look in my code for learning … not really clean and I’m not a pro coder … probably many this is wrong and not really aesthetic. πŸ˜›

  4. Hahaha, i am soooo far away from being able to judge your script, whether it is aesthetic or not. It is a miracle to me how it works, but it works! πŸ™‚

    I would be very very happy if i was able to read and understand your script for further learning… at the moment it still looks like a foreign language to me, because of my poor knowledge about Python^^ Remember, i am looking into Python for only 2 days now… my biggest success so far is to force a “Turtle” from the .turtle module to print a circle πŸ™‚

    But i am trying to learn it, so hang on! Maybe i can help you develop it further… in maybe 2 years^^ Sorry to tell, but itΒ΄s up to you to get it done πŸ˜‰

    Best Regards

  5. Hi Pyro and Dan,

    thats realy great work.. some more preformance is absolutely necessary on that. I did read everything and ask myself if it could not be possible to make everything faster than it is now. Pyro you said with c++ or put everything into blender source code it can be faster. Sorry if i did understand something wrong because im not programmer. My question is how long does it take to develop an faster version and a particle mesher thats also as fast as it could be with current programming (maybe gpu accelerated… would be very cooool ) code. I realy have a lot of respect to your work pyro thats realy great and on a very high level. I will suport when i have some money. Cool stuff guys and definitly at eye level of lagoa.
    Nobel price is already yours. Realy cool stuff.



    • I already work on a C version of my script with cython for better performance. It’s no so easy and I don’t have a lot of time but it’s coming. Stay tuned πŸ™‚ For the mesher , a coder work on a version I think. I send to him some paper coming from University of Utah of a integration.I want to ask him some news about it today. Be patient , all coming soon , slowly but surely πŸ™‚

  6. Pingback: timberland euro hiker

Leave a Reply to admin Cancel reply