Jump to content
Hash, Inc. - Animation:Master

aaver

*A:M User*
  • Posts

    614
  • Joined

  • Last visited

Posts posted by aaver

  1. [...]I have a question though... are we nuts?
    Some, I'd guess, but who isn't :blink:

     

    Couldn't this be done without using multipass and a single material... box? Just put a grid on the mesh with a bright light and render in one pass?
    It can, but it's not as fun...or is it?:[attachmentid=19014]

     

     

    EDIT:

     

    When animated:[attachmentid=19015]

    post-261-1154273461_thumb.jpg

    WFL01.mov

  2. hmm .. i guess there must be different approaches to this. filling the field with particles would resolve many of the issues, but how will this simulate 2 differently colored fluids mixing with each other? would each particle have a color and that would "rub off" onto neighbouring particles?
    I think this is the method. There are of course different approaches for the surface tracking mechanism (particles, implicit surfaces,...), but in principle they are the same. Free surface flow is actually mixing of two different fluids; water and air.
  3. is a 100x100x100 grid a coarse grid for a bowl of water?
    100x100x100 cells are probably good enough for the simulation, but not for realistic rendering.

     

    i'm not sure if interpolation is feasible. for a particle based solution yes, but for a density bitmap i dont see how that would work out
    But where do you get the density bitmap from? Generally, a CFD simulation produces a vector field. To visualize this in a realistic way, you will have to fill this vector field with some kind of "media" (mass less particles typically). For free surface flow, you will also have to have some kind of surface tracking mechanism (also particles usually) which is fed back to the CFD simulation. All these particles are then possible to transform into a density bitmap, should you want. The interpolation takes place when you move the particles in the vector field.

     

    if the simulation rund in realtime, it should be possible to solve every sub-frame .. unless the equations become instable for very little change
    Too large time steps are generally the reason for unstability although very small steps could give rise to floating point resolution instability. An implicit solver is always stable so the time steps should be chosen in order to make the water look realistic enough rather that to match the A:M sub-frame time step.

     

    anders, maybe we could team up on this project?
    I'm honored, but I have very little time for this at the moment. I'd be glad to help as much as I can though:)

     

    another problem is: how can we "feed" the solver with scene data from a:m?
    A year ago when I had more time for this I had a discussion with Bob Croucher on this. The GetPatchPoints() method is supposed to give you the patch points fully transformed in a Chor or Action, but for some reason it doesn't work as intended. Bob looked at it, but I don't know if this problem has been fixed in v13 SDK. If you have all the fully transformed patch points, it shouldn't be too hard to write a collision detector for a CFD solver.
  4. anyone knows a good CFD software for win+mac?

     

    i'm searching for a good CFD solver. i'd like to create an interface between a:m and the solver, but as of yet i didnt have as much luck ..

     

    OpenFOAM looks very good, but they say its only feasible to be used on unix flavours.

     

    ideally the software should be a c++ library package to solve cfd problems, to avoid too much hassle for the a:m user.

     

    Marcel,

     

     

     

    I've written some about this a long time ago here and I'm sure you know that I also have plans for fluids in A:M. For the 2D case (i.e. water surface without self collision) I'm almost ready. I just have to find some more time to finish it (the problem is that I don't have much time to spare).

     

     

     

    For the more general case (the one you probably aim for) I have done some pre studiers. I've read and hopefully understood most of the research papers related to fluids in computer graphics and I think I have decides for which approach to choose.

     

     

     

    Using a freely available CFD library has crossed my mind, but since all that I've fond has been intended for engineering work, I've decided to implement my own solver based on the papers I've read.

     

     

     

    The main differens between an engineering CFD solver and a CG one is that for engineering, every physical property has to be accurate while for CG it only has to look stunning :) The later is much easier for the computer.

     

    if someone can shed some light on these questions i'd be grateful, and maybe this brings us one step closer to cfd in a:m!
    I'm far from being an expert on this, but I'll try to give you some answers.

     

    how fast are the calculations?
    There are examples of dedicated CG CFD that runs real time on modern computers

    what grid sized will produce good results?
    That depends on the situation, but if you want realistic spray from free surface water, you will need a lot of resolution.

    how well do these simulations perform for sub-frame advances (multipass!)?
    There are two main approaches for solving differential equation; implicit methods and explicit ones. For the explicit method you need to have small enough time steps for the simulation to be stable. The implicit method is always stable for every time step, but you have to solve a large system of equations (i.e. invert large sparse matrices). I wouldn't recommend solving the system for every subframe though, but to interpolate the fluid position.

    anyone has wishes or ideas for the a:m integration?
    I have! and I'm sure I'm not alone :)
  5. Back in the mid 90's (1890's...I'm very old) I used to used to model with RayDS and it had a great feature for positioning models relative to each other. You could actually move models to butt up against each other as the program would sense their surfaces touching. So putting a glass on a table was simply a matter of dragging it to the surface until the glass stopped moving.

     

    Is this possible to acheive in A:M or is there a technical challenge that won't allow it?[...]

    Drop your glass model over your table model in the choreography window (from the top view)
  6. [...]I'm working through the new features of v13. Too bad you say it doesn't work there. Are you going to upgrade it?
    I never found a way to do this with the v12 SDK, but for v12 there is a workaround involving copying dll:s from the v11 install. I wouldn't be surprised if the workaround works for v13 too.

     

    With the v13 SDK I think it's possible again, however, but since I don't have access to A:M v13, I can't debug the plugin. When I upgrade my A:M licence and find some time, I will continue with this and some other plugins.

  7. To fix the bug, always change the Head CP:

     

    Thanks. I am trying to make this plugin available to others. When I run it on another machine than the one I compiled it on I get this message:

     

    Unable to load plug-in [F:\Program Files\Hash Inc\V13.0\HXT\decalDeform.hxt], The specified module could not be found.

     

    (run on Windows XP home edition service pack 2. AM Version 13.0a.)

     

    Is there a guide somewhere on how to productionize a plugin? Do you have to have a Mac to compile the plugin for Mac users?

     

     

     

    I'm not familiar with that error message, but I compiled my own version of the plugin. I've attached it so you can test if that one gives you the same error. (Note: In my version, the displacement takes place in the y direction)

     

     

     

    Steffen knows everything on making plugins for the Mac (and not only for the Mac). Read all his posts on the SDK forum!

    ImageDisplace.zip

  8. OK, I fixed the repetitive CP problem with Steffen's code. Thanks again Steffen.

     

    You still have one bug left that is hard to find. When you change a CP you should change the Head CP of the CP stack. Since your code changes most stacks several times, it will probably take a while before you experience this bug.

     

    To fix the bug, always change the Head CP:

     

    cp = hbpuv->GetPatch()->GetCP2()->GetHead();

  9. Oh yea,

    this code still gives me trouble. What is the proper way to type cast this line? HPatch5 *fivePoint = hbpuv->GetPatch();

     

    if ( hbpuv->IsPatch5UV() ) 
    {
     HPatch5  *fivePoint = hbpuv->GetPatch();
    
     cp = hbpuv->GetPatch()->GetCP5();
     pos = *cp->GetPosition();
     hcp->ReadBitmap(uvs[12].x*dWidth, uvs[12].y*dHeight, &heightValue, &opacity, 1);  
     pos += Vector(0.0f, 0.0f, heightValue.Red());
     cp->SetPosition( &pos );
    } 

     

    Try this :)

     

    
    if ( hbpuv->IsPatch5UV() ) {
      HPatch5 *fivePoint =(HPatch5 *)hbpuv->GetPatch();
      cp = fivePoint->GetCP5();
      pos = *cp->GetPosition();
      hcp->ReadBitmap(uvs[12].x*dWidth, uvs[12].y*dHeight, &heightValue, &opacity, 1);
      pos += Vector(0.0f, 0.0f, heightValue.Red());
      cp->SetPosition( &pos );	
    }
    
    

     

     

     

    Also, you have one more problem to solve before your plugin is ready. You displace most of the CPs more than once.

     

    For a grid like this

     

    
    CP1------CP2------CP3
    
    |		|		|
    
    CP4------CP5------CP6
    
    |		|		|
    
    CP7------CP8------CP9
    
    

     

     

     

    with your code, CP1, CP3, CP7 and CP9 are displaced once, CP2, CP4, CP6 and CP8 are displaced twice and CP5 is displaced four times since it's a member of four different patches.

     

     

     

    Before you are ready, you have to add some bookkepeing so you displace every CP just once. I think Steffen offered you some code in another thread that may be usefull for that.

  10. OK, this is getting good now. The plugin folder appears when I right click on the decal and my plugin is there in the wizzards folder. My dialog box comes up, I press OK and the member function below gets called. The mesh is deformed but not as I expect. The plugin is displacing the CPs on the perimeter of the mesh only.[...]

     

    You do realize that the HDecal coordinates and the UV coordinates are different, don't you.

     

    Try this and I think you will have a working plugin :)

     

    
    int dWidth = hcp->GetWidth();
    int dHeight = hcp->GetHeight();
    .
    .
    .
    hcp->ReadBitmap(uvs[0].x*dWidth, uvs[0].y*dHeight, &heightValue, &opacity, 1);
    
    

  11. maybe you should consider calling the plugin directly from the HDecal.

     

    You mean like right clicking on the decal and seeing a plugin option there? How do I get the plugin option to show up there?

     

    In my Entry.cpp file I have:

     

    extern "C" __declspec(dllexport) BOOL HxtOnCommand(TreeObject, UINT index)

    {

    switch(index)

    {

    case MODEL:

    bla bla bla

    case OBJECTCONTAINER:

    bla bla lba

    }

    return FALSE;

    )

     

    Is this the member funtion that generates the "plugin" option when you right click on the model or decal or coreography?

     

    To call your plugin from a HDecal, try this

     

    enum { DECAL };
    extern "C" __declspec(dllexport) const BOOL HxtLoadCommandEntry(UINT index, ObjectType &objtype)
    {
      switch (index) {
      case DECAL:
      objtype = HOT_DECAL;
      return TRUE;
      }
      return FALSE;
    }

     

     

    Also, once I get the cp with this code:

     

    HPatch *hp = hbpuv->GetPatch();

    HCP *cp = hp->GetCP1();

    Vector *pos = cp->getPosition();

     

    ???? how do I alter or modify the z coordinate of pos before calling setPosition in the next step ????

     

    cp->SetPosition(pos)

     

     

     

    How do you set

     

    Try this:

     

    
    HCP *cp = hp->GetCP1();
     Vector pos = *cp->GetPosition();
     pos += Vector( 0.0f, 0.0f, 10.0f ); // or what ever...
     cp->SetPosition( &pos );
    
    

  12. Is this right?

     

    HDecal *hd = hmc->GetChildDecalContainer()->GetChildDecal();

    Yes it is, but maybe you should consider calling the plugin directly from the HDecal. That way you won't have to decide which decal to base the displacements from, should there be more than one. You can of course decide to pick the right one from a drop down list. It's a matter of taste, I guess.
    Wow, I am realizing as I study your code Aavers, that you gave me the entire solution. So far it appears to be supported in V13 SDK.
    If that's the case, I'm happy to be able to help :)
  13. I'm still working on this as in thinking about it, but it isn'ta high priority anymore.

     

    Aaver,

    Do you happen to have any source code that extracts the greyscale RGB value from a decal at a CP location? I am making a large mountain terrain with rugged cliffs and geological formations. I use 5 point patches and hooks to put lots of patches where the details are high and transition out to large patches to save on model size. I want to apply a heightmap decal to the finished 2D mesh or maybe even use a rotoscope and alter the altitude of the CPs with the greyscale values. I apologize for putting this request on several threads of this form but I am anxious to complete this plugin so I can finish my mountain range in time.

    I'm sorry, but I can't give you any advice off-hand to solve this.

     

    However, this pseudo code might be helpful:

     

    Vector2 uvs[15];
    
    HClipProperty *hcp = hd->GetChildDecalClipContainer()->GetChildDecalClip()->GetClip();
    HDecalStamp *hds = hd->GetChildDecalStampContainer()->GetChildDecalStamp();
    
    for ( HBasePatchUV *hbpuv = hds->GetFirstPatchUV(); hbpuv; hbpuv = hds->GetNextPatchUV( hbpuv ) ) {
     hbpuv->GetUVs( uvs );
     if ( hbpuv->IsPatch5UV() ) {
      // hbpuv[0], hbpuv[3], hbpuv[6], hbpuv[9] and hbpuv[12] now holds the UVs for the 5 point patch
     } else {
      // hbpuv[0], hbpuv[3], hbpuv[6] and hbpuv[9] now holds the UVs for the 4 point patch
     }
    
     HPatch *hp = hbpuv->GetPatch(); //hp now holds a reference to the actual patch.
    
     // With hcp->ReadBitmap( float x, float y, RGBFloat *diffuse, float *opacity, float pixelwidth )
     // you may now read the color values from the decal for a particular UV coordinate and then
     // adjust the height for the Patch CPs accordingly
    }

  14. Well I probably won't tell you enough to convince you, but first thing is that I'd rather use the wizard/plug-in so I'm working right in A:M. I wouldn't have to save the model before seeing it in A:M.

     

    I would like to see your ocean plug-in incorporated into it (was that ever finished?), the rock generator sounded like a good idea (randomly placed rocks/boulders with adjustment for random sizes, irregularity, clumped together or not, quantity), and possibly a cloud generator, if possible. Also, auto groups for the various things added.

     

    If not, that's ok too, but I would like to see your ocean plug-in finished, if it wasn't. And if it was, where can I find it. :D

    So a simple plugin that just generates a patch model from a height map won't make you happy then? :P I think I'll start with that anyway and after that, I'll give the complete terrain wizard another thought.

     

    The ocean plugin isn't available. It's not that difficult to program though and I have an almost working version for A:M v11, but when the SDK changed for v12 it wasn't possible anymore (or maybe I just don't understand how to). In the v13 SDK, I think it's possible again, but I don't have access to A:M v13 which makes development virtually impossible. Maybe I'll finish the v11 version, but since it won't run under A:M v12 & v13 I'm not sure really. :huh:

     

    Eventually there will be an Ocean plugin available. I'm not able to tell you when, though...

  15. Aaver, are you still working on this? I would like to see an alternative to the standalone "Terraform".

     

    I'm still working on this as in thinking about it, but it isn'ta high priority anymore.

     

    Why would you like to see an alternative to the standalone "Terraform"? Maybe you could convince me to continue with this idea. Programming a simple plugin that just generates a patch model from a height map takes maybe a day or two so if that would make you happier, I'd consider it :)

  16. I agree with Yves that making this tool as a plugin would be much easier, but also that you have to know some c++ - not much, but some. Only you Michael know if learning c++ is fun enough to make it worthwhile.

    That depends upon your definition of "some". :D

    Yes, of course it does ;)

     

     

    Also, when does a plugin stop being a plugin? I agree that it would be easier if AM TerraForm were a plugin ( and I feel somewhat guilty that's not!) but you could just as easily argue that it would be easier if Photoshop were a plugin.
    You shouldn't feel guilty at all. I think a standalone application is as easy/good as a plugin. What I'm trying to say is that I think it would be easier for you as a programmer.
  17. As some may remember I am also making a terrain tool for A:M, but I haven't been able to put much effort into it yet. Because of that, I have followed this thread with great interest and I'd like to complement Michael on a great achievement so far.

     

    Well, this is one reason to use the SDK. You would have a good fBm generator already coded, based on the most recent version of the Perlin noise, and ready to call with your sample points and use.

    But I'd have to learn C++ which I really don't want to do. Even the small amount I learned 7 years ago to write GridWizard v2 wasn't nearly enough for me to make heads or tails of the SDK - I couldn't even draw a 2-point spline. And I haven't touched C++ since then; I'd have to spends 6-8 months at least of my free time trying to learn enough to make AM TerraForm a plugin.

     

    I agree with Yves that making this tool as a plugin would be much easier, but also that you have to know some c++ - not much, but some. Only you Michael know if learning c++ is fun enough to make it worthwhile.

     

    As I said, I am certainly taking the plugin path, but one thing have made me worried:

     

    [...]The only addition is that I've added saving the patch data in the model file so that AM doesn't need to do it.[...]This is a pretty big improvement on the usability of AM TerraForm since large meshes are now instantly usable instead of having to wait for AM to calculate all the patch data; I frequently use 256x256 meshes and if I rememebr correctly, it used to take AM 7-8 hours to calculate the patch data.

     

    I think I can confirm this. On my computer 32x32 don't take much time at all, 64x64 takes less than 2 seconds and 128x128 takes about 60 seconds for "Finding Patches" & "Aligning Normals". This is an indication of exponential time complexity and if I extrapolate a 256x256 mesh will take about 10 hours. There is a method for this in the SDK also and it takes the same time to complete. If there isn't a workaround for this in the SDK that I'm not aware of, I see this as a potential problem. Not for Michael of course, but for me and my plugin.

     

    I'm not sure what the typical use case will look like. Will you really use such dense meshes as 256x256 or will your typical choice be something like 32x32 with a displacement map?

     

    If you actually want 256x256 or even greater, this isn't practically possible with a pure plugin solution. Of course you can do all your terrain manipulation in the plugin and when you are ready you can write the data to a model file, just as Michael does. But then you still have to deal with different versions of file formats. Not having to deal with this is one of the main reasons for taking the plugin path in the first place.

  18. Alright Aaver,

    I'll give you some input if thats cool.

    The effects are just prototypes and I really appreciate your input. Of course it's cool!

     

    The Tornado/wirlwind effect is a good start, but perhaps we'll want levels of violence to it. I think the concept is good, but I'd like to see layers of wirling. ie.. a layer on the inside spinning the fastest.. another just outside spinning less fast and another more transparent layer spinning less around that... Then another layer with debris getting wiped around the funnel. At the base perhaps some dust and stuff getting kicked up off the ground.

     

    Oh yeah and a cow swirling around in it ;-P.. just kidding about the cow.

    That sounds very reasonable. I'll see what I can do. To bad about the cow, though ;-P

     

     

    The Loon inflating should be easy enough, I think. You might explore distortion cages and a pose slider. Perhaps separating the arms, legs, body and head.. as points of inflation.. could make for some cool popping action to the inflation, like a performed balloon. I like where its all going so far.
    This sounds like a lot of character animation and not so much automated FX as I would like. Hm. Maybe I'm not your man for this one. I will give it a try if no one else wants it, but I'm afraid I cannot promise Shrek quality.

     

    The water bucket.. is spot on, excellent. My only nitpick is that maybe the surface of the water could be more choppy and less symmetrical.. Something that should be easy enough with the new displacement.
    Glad you liked it already, but I think it can be much improved.

     

    Excellent stuff. I'll play around with these as well and see what pops out. Don't worry.. I won't duplicate your effort. I'm thinking that twister might come in handy for some other things.. and I know the bucket will.
    Thanks, but please do duplicate it if you want to and that goes for everyone. If you find anything interesting in my projects, consider it your own and do something cool for the movie with it. For me it's more important what is done than who has done it.

     

    Thanks for the contributions.. and I hope you can help out more if you have the time ;-)
    I wont be able to do anything for some weeks, but when I have the time, I'd be glad to help.

     

    /Anders

  19. I don't have very much time to spare, but this sounds like great fun and if you think you need yet another participant, I think I know enough c++ and 3D-programming to be of some kind of use.

×
×
  • Create New...