Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Cocuy - Fluid Simulation for Unity

Discussion in 'Assets and Asset Store' started by Musiu-Bar, Apr 6, 2015.

  1. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    Yeah you can forget about Mac support until the author of this asset changes the methods used under the hood (not a trivial mission at all) or until Unity supports compute shaders on OS X - the way Apple are going I wouldn't be at all surprised if this ends up being via Metal rather than OpenGL.
     
    GameJob2017 likes this.
  2. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    92
    Too bad :(

    And the author's long silence is truly discouraging. Hopefully this project isn't abandoned.
     
  3. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,368
    Hi. Great asset. Are you familiar with Flowtools, an open frameworks project?


    I was wondering if Cocuy could possibly achieve something similar if using webcam as a source?
     
  4. jasonrwalters

    jasonrwalters

    Joined:
    Jul 16, 2014
    Posts:
    17
    @Musiu Bar is it possible to shoot in an arc?
     
  5. Giu007

    Giu007

    Joined:
    Sep 27, 2015
    Posts:
    3
    Is possible a clear tutorial how Cocuy works, I continuing to grab pieces from the demo, but are there other scripts that I have no idea what they do and how to use it, this plug in hasn`t the most linear way to be use. Also is possible in the future cocuy can mix different colours source?! or use different colour gradient with the same fluid grid simulator, without create massive number of grids for different source or different colour fires. Also there is the chance that with the new release this effect can work on IOS and Android? Cause now there is no way to make it work on mobile.... cheers
     
    Last edited: May 4, 2016
  6. ArcaneParadigm

    ArcaneParadigm

    Joined:
    Jan 8, 2014
    Posts:
    5
    Is there any manual ?
     
  7. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    91
    Hello,
    I was wondering, if this asset can help me achieve what I want to do.

    I want to have multiple, movable Jars.
    I want to have multiple, movable Spawn Points where Fluids in different colors spray out.
    I want the player to be able to move the Jars in a way, that Fluid can be put into it.
    In the end I want to be able to register which amounts of different Fluids are in the respective Jar.

    Especially the last point seems unlikely possible for me. Am I right?
     
  8. spinTouch

    spinTouch

    Joined:
    Dec 2, 2016
    Posts:
    2
    Cocuy - Fluid Simulation for Unity
    Hello, Does it support Unity 5 3D projects?
     
  9. spinTouch

    spinTouch

    Joined:
    Dec 2, 2016
    Posts:
    2
    Hi, any one there?
    I want a ring blocker? means a circle which can block the waves up to some radius. wave source should be inside the circle. Please let me know the suggestions or solution
     
  10. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    148
    Any update on this?

    Without Mac and Linux support, as much as this plugin looks awesome, it's not useful for me. Unity has now Compute Shaders support on all platforms and I'm not sure if it is possible to port.
     
    GameJob2017 likes this.
  11. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    126
    Sorry, sorta out of context, but can't PM you to respond to your job post since your forum profile probably does not allow PM's.
     
  12. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,248
    I would buy it if it would be still supported
     
  13. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi All,

    First of all, thanks a lot for your patience. I know we went missing for some time, but we bring good news! We have a working version of Cocuy running on Android and OpenGL (so no more dependencies to DX11!).

    Before I push an update however, I wanted to share with you an .apk so you can test it and see how it performs. In my Samsung Galaxy S6 it works very smooth at full resolution and quality but would love if you guys can give it a go and tell me how it performs.

    Please find the file << Here >>

    All these changes will be part of Cocuy 2.0 which I'll push as an update very soon.

    Once again, thanks so much for your patience. I know it's been a long time but it's been hard to keep up with life and a full time job while just wanting to go home to code some shaders.
     
    Last edited: Apr 12, 2017
  14. johnle

    johnle

    Joined:
    Mar 14, 2013
    Posts:
    2
    Have you tried with iOS?
    Compute shader is supposed now supported via Metal. Is your .compute code translatable?
    Would be great if it could.
     
  15. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi johnle,
    We haven't tested it with iOS yet as we want to get this release with Android first. It might be a matter of just targeting iOS without any changes but can't confirm. As far as I know from Unity 5.6 compute shaders with Metal are possible. Will try to update you on that one as soon as we can!
     
  16. Chuvi

    Chuvi

    Joined:
    Jul 14, 2013
    Posts:
    10
    Hi all!!!
    I found bug!
    If on Fluid plane object set MeshCollider convex toggle to On and move mouse, something terrible happens )
    And this can't reset, only restart.

    Or if i create custom mesh, this bug occurs.
     
    Last edited: May 23, 2017
  17. Chuvi

    Chuvi

    Joined:
    Jul 14, 2013
    Posts:
    10
    Someone ????
     
  18. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    154
    I've got a similar question; all of the pictures show a single-colour fluid - is it possible to support multiple-coloured fluids that mix and fade together with this?
     
  19. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    16
    Hello El Bar del Musiu,

    I am interested in buying your Unity Asset: Cocuy: The Fluid Simulator.

    First, I would like to have some questions:

    (1) I am using Mac to run Unity. So, does your asset work on Unity that is run on Mac ?
    In the past, I have seen only one Unity asset that does not work inside Unity that runs on Mac because of the shaders... That is the reason I ask you this question. So, if I purchase your asset and it does not work on Mac, can I get a refund ?

    (2) Does it work well with Unity 5.6.0 (on Mac) ?

    (3) Please update us after you have a chance to test this asset on iOS. I know that for now, you only support Android.

    Thank you.
     
    Last edited: Jun 7, 2017
  20. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    16
    -----------------------
    Hello,

    I work on my Mac to run Unity software. Would you please tell me if this asset can be used on my Mac ?

    Thanks.
     
    Last edited: Jun 7, 2017
  21. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi Chuvi, I've sent you a direct message to see how we can reproduce that bug
     
  22. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi,

    The way the colors work is you define a color ramp over their lifetime, so the fluid can change color and transparency as it dissipates. It would be technically possible to mix different colors but not without some changes to the shader. It's on the to-do list but can't say when it'll be done. I could help you out on what to change if you know your way around shaders :)
     
  23. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi GameJob2017
    Unfortunately no :( ... At the moment Unity doesn't provide Compute Shaders under Mac because they have a very old version of OpenGL. As soon as Unity provides that support Cocuy should be compatible.
     
    GameJob2017 likes this.
  24. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    Unity supports Compute Shaders on the Mac via Metal. Support for this in the Unity editor came with 5.6 and I have other, 3D versions of this fluid sim technique working fine on the mac. Havent tried yours yet.
     
    Last edited: Jun 13, 2017
    GameJob2017 likes this.
  25. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    Forgot to say I have other sims working on iOS too (modern iOS devices use metal just like macOS does).

    Sometimes the only change required to get existing compute shader projects to work on metal are to tick the box in the unity editor to enable editor metal support, and to change any standard shaders that use pragma target 5 to pragma target 4.5 (unity created a new target because metal doesnt support geometry or tessellation in unity yet)
     
    GameJob2017 likes this.
  26. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    16
    Hello elbows,

    Would you please post the links to the other "3D versions of this fluid sim technique" as you mentioned above ? Are they Unity assets also ?

    I will be very interested in trying those ASAP.... :)
    Thank you.
     
  27. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi elbows, thanks for that, I completely missed that release. If that's the case then Cocuy should be able to run on iOS and Mac.

    I will try to test it next week and confirm.

    Thanks!
     
  28. otherotter

    otherotter

    Joined:
    Jun 19, 2017
    Posts:
    1
    Dear Cocuy,

    Is it possible to let two (or more) systems interact with each other? so that the blue will interact with the green beam? now they just do there own thing. upload_2017-6-19_14-47-1.png
     
  29. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi otherotter,
    Unfortunately, at the moment each fluid simulation can only have one color ramp, so no mixing of colors. Other users have requested similar features, so I might look into adding it in a next release.
     
  30. Raspberry

    Raspberry

    Joined:
    Dec 4, 2015
    Posts:
    1
    Hello.
    I am dying to use this asset, but I am using Mac OSX, and Cocuy requires DX11.
    By the way, OSX supports Metal that supports compute shader.
    (When Metal editor option was enabled, It did not fire any error message on console window. but the game screen was only black.)
    Is there any way to use it on OSX?
     
    Last edited: Jun 24, 2017
  31. Hadrien

    Hadrien

    Joined:
    Sep 7, 2013
    Posts:
    25
    Hi @Musiu-Bar,

    Your asset looks amazing, I have the same question as Raspberry: does it work for both Mac OSX and iOS ? Thank you.
     
  32. juuuuun

    juuuuun

    Joined:
    Feb 17, 2014
    Posts:
    23
    Hello @Musiu-Bar

    I'm having this weird wipe out of particle field as the second image I attached after 10~20 seconds of running. I'm just using 4 manipulators moving on the edge (with material and velocity manipulator).

    Is there any way to avoid this wipe out effect which forces me to stop the scene and restart again to have the fluid effect again?

    Thanks,

    imag1.png

    imag2.png
     
  33. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    I got it working on the mac with metal :) I havent tried with iOS yet.

    Fix:

    Edit Cocuy/Materials/MaterialRenderer

    Change line 15 from #pragma target 5.0 to #pragma target 4.5

    I'm not sure if it all works perfectly as I only tested briefly, and metal in the editor is not completely stable for me with the versions of Unity I have been using recently (currently I'm on 5.6.1.p4)
     
  34. Sprawl

    Sprawl

    Joined:
    Jan 19, 2014
    Posts:
    27
    Hello, small question on this. Colors cannot be mixed, but I'm guessing I can change the color of the fluids in the shaders easily ? Also, while it's not possible to mix colors, could two fluid simulations of the same color mix impact eachother, or will both have their own independant simulations ?

    Last question, Is Cocoy 2.0 with no DX11 dependency that you talked about now ?

    Thanks a lot, and good work on this great asset !
     
  35. Hadrien

    Hadrien

    Joined:
    Sep 7, 2013
    Posts:
    25
    Yay, good news! Do you have a moment to try it on iOS ? I really need to know if it works before buying. Thanks a lot in advance :)
     
  36. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    I will try it one evening this week, probably tuesday or wednesday. Also keep in mind I am not the developer of this asset, just a user trying to help others.
     
  37. Hadrien

    Hadrien

    Joined:
    Sep 7, 2013
    Posts:
    25
    Hi elbows, thank you!

    And yes, I'm aware that you are not the dev and I do not want you to think I'm pushing you, it's good if you can test it, otherwise no problem I'll understand, we all have a full schedule ;)

    Thanks again for your help!
     
  38. cparki3

    cparki3

    Joined:
    Jan 13, 2014
    Posts:
    37
    Hi there, I really like the asset so far but I'm getting an inconsistent experience between my dev machine and my gaming rig. On my dev machine I have these epic looking effects and on my gaming rig its basically a ball with just a little velocity pushing the effect. Any idea on how to get things to be more consistent? Here is an example of what I'm trying to get and how it looks on my dev machine current state.

    upload_2017-6-29_15-57-1.png
     
  39. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi kongson,
    I was able to reproduce that bug locally, thanks for spotting that. Will have a look at it and get back to you with a fix!
    Thanks
     
  40. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hi cparki,
    Is your setup just a velocity and a particle manipulator with nothing else? Are both machines running in the Editor or as a stand alone application?
     
  41. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hey elbows, as usual, thanks again for looking into those things.

    I haven't been able to test on an iOS device that's why I haven't confirmed that it works. I'm still trying to get my hands on a Mac + iPhone to test but have been unsucessful. As soon as I can I will confirm it.

    If you find that it works just by changing the shader target model (with the #pragma) I can make that change in the asset very soon.
     
  42. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    Hey Sprawl,
    Yeah, the colour of the fluid is easily changed. You have a colour ramp to change the colour of the entire fluid and to control how it changes colour and transparency as it dissipates over time. It's quite simple once you see it in action.
    Also, within one simulation you can have as many "manipulators" as you want, which means you can have several objects interacting with the same coloured fluid and all interacting together.

    Cocuy 2.0 doesn't rely on DX11 anymore as Unity now supports Compute Shaders on Linux and Android (using OpenGL) and iOS (using Metal, but this I haven't been able to confirm personally, but others in the thread have been able to try it)
     
  43. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    Sorry that I'm behind schedule with my plan to try it on iOS for you, hoping to get a chance tomorrow.
     
  44. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    My initial iOS test resulted in failure, with the following messages visible in the xcode console during play:

    Metal: Compute shader has 1024 threads in a threadgroup which is more than the supported max of 512 in this device
     
  45. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,393
    Looks like I can make it work if I play with the THREAD_COUNT definition stuff in Cocuy_Common.compute :)

    edit - Oh yes, it works, thought it hadnt the first time I tried because Unity didnt update properly when I changed the thread count definition in that file.
     
  46. Sprawl

    Sprawl

    Joined:
    Jan 19, 2014
    Posts:
    27

    Thanks a lot, I will try it out :)
     
  47. Hadrien

    Hadrien

    Joined:
    Sep 7, 2013
    Posts:
    25
    Good news, thanks a lot :)
     
  48. Sprawl

    Sprawl

    Joined:
    Jan 19, 2014
    Posts:
    27
    Any tips on getting ComputeShaders to work in editor with Android as a target platform ?SystemInfo.supportsComputeShaders always return false for me. I can't seem to find the settings I need to enable it.
    It works well if my target platform is Windows.
     
  49. Musiu-Bar

    Musiu-Bar

    Joined:
    Apr 6, 2015
    Posts:
    58
    I've also had a lot of issues with it as well. For me it works sometimes when you disable the Graphics Emulation (Edit->Graphics Emulation->No Emulation) but that option has a tendency to crash Unity most of the time so I haven't tried again with newer versions of Unity.
     
  50. Sprawl

    Sprawl

    Joined:
    Jan 19, 2014
    Posts:
    27
    A Workaround I currently have is to work with Windows as my target platform and only switch to android when I'm exporting. It works but it's not ideal. I'll post an update if I find a solution to this.