Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Fluidity - NextGen Fluid Dynamics - [ RELEASED ]

Discussion in 'Assets and Asset Store' started by smb02dunnal, Oct 22, 2013.

  1. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    The new version has just arrived at the assetstore :D . (the weather is bad and I can play around with this jetengine :cool: )
    But in the old text demo there is now a weird behaviour: when I shoot a ball the whole simulation bounding box gets grey for a moment.:confused:
     
  2. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I got that as well! But I created a new scene and just recreated the demo using the same parameters and all was well??? It confused me as the scenes looked the same (at least from the outside). There might of been some stale data somewhere hidden in the scene I think.


    Thanks!
     
  3. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I also realized that in the Ruins Demo is some bug: When you turn on the heat haze for the main fire, the simulation volume get visible (semitransparent brown) when the strength of the haze is between 1 and 2.
     
  4. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Okay, I'll investigate this. Is it using the default settings for everything that comes with the project? (So I know for testing)
     
  5. mojao

    mojao

    Joined:
    Sep 2, 2013
    Posts:
    47
    I Got a Update Now! additiveblend and heat haze is looks so great! thanks!
     
  6. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Thanks!
     
  7. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hello, I just bought this asset (very promising!) and I'm currently trying to wrap my head around how to assign intensity through code (C#) using this:

    transform.GetComponent<FluidVolume>().intensity = 1;

    But all I get is the following error:

    ... error CS0246: The type or namespace name `FluidVolume' could not be found. Are you missing a using directive or an assembly reference?

    So I was wondering: what am I doing wrong here? Thanks...!


    Update 1:

    I added using Fluidity.Volume at the beginning of my script (which probably helps) but now I get:

    ...error CS0122: `Fluidity.Volume.BaseVolume.intensity' is inaccessible due to its protection level

    So I'm stuck again...


    Update 2:

    Alright, I got it to work now. But I had to go into the BaseVolume.cs file and change:

    [SerializeField] protected float intensity = 1;

    To:

    [SerializeField] public float intensity = 1;

    And I suspect I'd have to do the same thing to any other variable I need to control via scripting at runtime. But I'm not sure; maybe there's a better (and cleaner) way to access this? Or else if this is indeed required, then could you please integrate those changes in the next update?

    Again, it does work but I'm not sure if that's the correct way to go about it...
     
    Last edited: Nov 6, 2013
  8. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Feature request: Full public API to set the properties of the fluid from code.

    The TempEmiter effector has only a radius property. Is it possible to have also a Emision Force property .Like in the Controller script (Emitter settings).
     
  9. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Hey! Thanks for buying Fluidity.

    Yeah you will need to access members using their namespace qualified name. That's what you did in your first update.

    Secondly, yeah that's one way of doing it, a slightly better way might be for me to create some accessors for the properties needing to be exposed (this way I can keep tabs on what's been changed and update any private data as necessary. I was thinking of doing this anyway so I can rebuild the gradient textures only when modified.

    That's a fail on my part, I've been too focused on the GPU code and forgot about the actual API... Next update, promise! ;)
     
  10. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank you for your reply! Here are two more questions for you:

    1) It's possible to get some really cool results by animating variables over time on the simulation itself (especially "Affected by Gravity"). Which is really nice, but -and I'm sure you see were I'm going with that- this is not quite useable in-game as-is. The reason being that if I do this, then ALL of the instances that refer to that simulation will be affected. Which is of course not the desired behavior: it would be much better to be able to tweak (that is animate) the values on a per-fluid volume basis.

    So my question is: would it be possible to move some of the simulation attributes (eg: "Affected by Gravity") onto the fluid volume itself, so that variables can be animated without disturbing other instances?

    For the sake of clarity: I'm testing your system for "Ghost of a Tale" and each skeletal rat has a fluid volume instance that triggers as they are "resurrected". Hence my need to have "individually animatable" behavior on the volumes. And I don't think creating as many actual simulations as there are rats would be a solution anyway...




    2) That's probably a silly question but I'll ask it anyway: would it be possible for you to create a DX9 version of this asset? Even if it wouldn't be as beautiful as using DX11 obviously. But that way it would at least ensure some measure of compatibility between "next-gen" and current-gen builds.

    Thanks!
     
  11. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I think you have answered your question already, the simulation attributes are tied to the simulation. How would you simulate a single fluid system with two different forces of gravity? :) Have you considered having the bare minimum number of simulations possible (bare in mind, there will be no overhead for any simulation that isn't currently on screen) and storing them in some sort of pool, then you could spawn volumes, tie them to an available simulation, use that simulation for the lifetime of the volume then return the simulation to the pool for re-use later? Such a thing is common in VFX systems in games (like particles for example). I could maybe provide an easy API for doing such a thing, but it would require some programming on your part.

    Again, resource pooling is the way to do this...

    While that might be possible (thinking flat surface 3D textures, which would give you a maximum of 16x16x16 resolution), and I'd love to give it a bash some day, I don't see that day coming any time soon. First i will be releasing the next update (more details to follow shortly), then I have another update in the works (water), so maybe after that?
     
  12. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439

    Feature noted, this seems kind of obvious now that it's been pointed out :/ This will be in the next update (which should be around the end of next week).
     
  13. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, that would make sense. If you can add an easy way to assign a simulation to a volume through code I should be able to take care of the rest... :) One thing though: do you think it would be possible to add a button to duplicate an existing simulation without having to manually re-enter every values?

    Sure, that'd be great, thanks!
     
  14. mojao

    mojao

    Joined:
    Sep 2, 2013
    Posts:
    47
    Mr smb02dunnal ,I'm sorry to bother you again, is there plan to add Flaming Bot scene as sample in next update ?
    This scene is throb with very nice feature ! (Especialy i know how to add damage and how to handring fire)
     
  15. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    It's no worries. I won't be adding the scene, as that would mean uploading the whole angry bots project with fluidity. I will be releasing a tutorial video, demonstrating how to set up your own 'Flaming Bots' scene without any programming, just starting with Fluidity and AngryBots.
     
    Last edited: Nov 8, 2013
  16. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I have another question (in addition to the one in my previous post): if a fluid volume is visible but its intensity is set to 0, does it still create overhead?
     
  17. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Very nice haze effect! much better than the one before.

    I was wondering if this would be possible to do and how expensive would it be:

    Lets say I have a helicopter, when it's taking off I want the pressure from the propellers to interact with the ground dust, sand or particles. Blowing them away or something, can it be done?
     
  18. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yes, because (if I remember rightly) intensity isn't a colour multiplier, but rather a multiplier of the sample location in the gradient, so technically you can have certain gradients which still render with an intensity of 0, maybe a better name might of been 'Gradient Scale' or something.. If you want a colour multiplier I can certainly add one :D
     
  19. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    It's the same, but thanks, I'll take your compliment anyway! :D

    Hmm, sounds possible, what you want is a directional turbulence zone? Or wind zone? Maybe reusing Unity wind zones is an option. Sounds like a new kind of effector to me though. Next update!
     
  20. mojao

    mojao

    Joined:
    Sep 2, 2013
    Posts:
    47
    oh,Mr.smb02dunnal , i aporogize my  ill‐mannered implore. Very sorry.
    Tutolial video will be very helpful! Thanks and i looking forward for video!
     
  21. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, thanks, that might be clearer. And an additional color multiplier on the volumes is also a great idea; basically anything to give as much control as possible on the look of the individual fluid volumes...
     
  22. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah sure, I worry it might be a little redundant as you can do the same thing by modifying the opacity of the gradient. I will try and make it as clear as possible from the editor.
     
  23. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    " what you want is a directional turbulence zone? Or wind zone?"

    I'm not sure, I think you would know which method is better. I'm super noob when it comes to particles.

    By the way you have an awesome attitude. I'm definitely buying this product soon, the only reason I haven't yet is because I don't want to disrupt my workflow, I end up going in circles and not finishing anything. :/

    Keep up the great work :)
     
  24. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I think I'm going with the explicit turbulence zone as opposed to dual purposing Unitys wind zones. Might be slightly more work for designers, but it's less implicit, and therefore better (as far as I'm concerned).

    Thanks! I understand!
     
  25. mojao

    mojao

    Joined:
    Sep 2, 2013
    Posts:
    47
    Hello,Mr.smb02dunnal. Good Day!
    If you don't mind, is there are plan to add Spherical Emitter?
    Now there is a Sphere emitter already, it emit direction is fixed directivity.
    If It is possible, i want to emit fluid omnidirectional like a Sun Burst.
    If it can be realize a combination with planned feature(attructer,mesh emitter. etc.),I'm sorry. And it sounds good !
     
    Last edited: Nov 13, 2013
  26. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Hey!

    I will look into this, sounds like the sort of thing I will be investigating for my next update.

    I really want to make use of some of the cool new graphics features present in 4.3 for my next update, stay tuned for more!
     
  27. mojao

    mojao

    Joined:
    Sep 2, 2013
    Posts:
    47
    Wow! Its so sweet! I am deeply indebted to you! Next update will be realy helpful.
    Making fire effect is so easiry with fluidity. so I am really grateful with you and fluidity. I'll always be your fan!
     
    Last edited: Nov 14, 2013
  28. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    By next update I really ment next next update BTW, my mistake. The next update is pretty much ready to roll out. I hope I will get around to it at the weekend. Full feature list to follow soon.
     
  29. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
  30. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    While dynamic GI is on my list of things to do, I haven't gotten around to it yet ;) But I don't see why it wouldn't be possible. The GI plugin would have to blend the ReactionCoordinate volume texture, from Fluidity, into the voxelized scene's emissive channel, before calculating the light accumulation.

    I'm sure the author would have a better understanding of his own system, but that's the jist of it though.
     
  31. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Does this support multi cameras? Oculus rift... Thanks, looks awesome!
     
  32. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I am currently working on the Occulus Rift support. I have just sent away what I hope to be the final project for testing on Occulus. As soon as I get confirmation I will be uploading the latest version to the asset store, which has much more than just Occulus Rift support.

    And yes, multiple cameras is supported.
     
  33. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Great! Most likely pick this up when confirmed working. Thanks
    (update: couldn't wait..too awesome..had to buy.)
     
    Last edited: Nov 15, 2013
  34. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Great, I'll keep you posted :)
     
  35. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I've imported the package into my level, getting this error (Unity 4.3 pro 4.22pro, set to DX11)
    Did you create that tutorial video? It worked when I open your pyropuffs package and imported fluidity into that project. The examples all worked great.

    Assets/Fluidity/Scripts/Renderers/FluidRenderer.cs(15,34): error CS0309: The type `FluidVolume' must be convertible to `Fluidity.Volume.BaseVolume' in order to use it as parameter `T' in the generic type or method `Fluidity.Renderer.BaseRenderer<T>'

    When I import it into a new project I get:

    Platform does not support compute shaders
    UnityEngine.ComputeShader:Dispatch(Int32, Int32, Int32, Int32)
    Fluidity.Physics.Simulation:Clear() (at Assets/Fluidity/Scripts/Simulation/Simulation.cs:515)
    Fluidity.Physics.Simulation:Destroy() (at Assets/Fluidity/Scripts/Simulation/Simulation.cs:279)
    Fluidity.Controller:KillSimulations() (at Assets/Fluidity/Scripts/Simulation/Controller.cs:342)
    Fluidity.Controller:OnDestroy() (at Assets/Fluidity/Scripts/Simulation/Controller.cs:292)

    thanks!!
     
    Last edited: Nov 15, 2013
  36. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Do you have another script called FluidVolume in your project by any chance? Maybe an older version of Fluidity? You will need to remove/rename any scripts that share the same filename of any of the Fluidity components.
     
  37. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Hi all! The next update is ready to go on the asset store. I'm just going to be doing some final testing tonight before submitting it.

    New features include:
    • Directional Temporary Emitters.
    • Turbulence Zones.
    • Heat Receivers, transfer information from GPU to CPU.
    • The flamethrower!!!
    • Translating Fluid Grids.
    • Volume Opacity Control.
    • Dirty state checking CPU optimisations.
    • Some minor simulation optimisations.
    • Minor refactor of rendering.
    • Multiple camera support!
    • Public API.
    • OCULUS RIFT SUPPORT!!!!
     
  38. mojao

    mojao

    Joined:
    Sep 2, 2013
    Posts:
    47
    Yeah!Its so cool and helpful!! I especially glad for heat reciever ,translate grid, and i will enjoy flame throwing !
    Thank you for meeting my demands, many thanks!
     
    Last edited: Nov 15, 2013
  39. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I want a baby from you :D
     
  40. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Errr... Thanks?... :D
     
  41. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Hmmm i bet its from using the volume explosion stuff you posted in another thread. Otherwise it couldnt be, im new to it.
    Ill keep hitting it tonight, at least i have it running in an odd way. Works so well, super excited for the new version!!!
    Translating volumes, i assume that means you could parent it to a dynamic moving object? Like a player?
     
  42. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Oh no... I found it... I'm also using an asset that has a script with the same name... Fluidvolume.cs
    Its from the dynamic water https://www.assetstore.unity3d.com/#/content/10382

    Any ideas here? I would LOVE to use them together. If you cant do anything maybe I can ask the author of dynamic water...
    thanks!
     
  43. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    All of Fluidity's scripts belong to namespaces, this has happened because I'm guessing the other FluidVolume script isn't in a namespace (is global) and because I'm using implicit resolution (using statements) its defaulting to the global FluidVolume. I'll put a fix in for it today. Thanks to that.
     
  44. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    excellent, thanks!
     
  45. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    That's the latest package just sent off to asset store.

    Here's some images from the new Ruins demo, (I'll upload it at some point for you to have a play about with, it's just fairly large and I'm tired :( )


    $Ruins 1.png $Ruins 2.png $Ruins 3.png
     
  46. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    ... Yes, thats the fluid's reflection in the tiles.
     
  47. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    WOW!! niiice.
     
  48. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Nice! I didnt get a chance to use this in my last thing, no time! But should have a proper go with it now
     
  49. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Thanks guys!

    I've uploaded the demo, but I've just realized the shadows aren't rendering, must have the default quality settings for web player set wrong. I'll reupload tonight.
     
  50. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439