Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Screen Space Fluids Shaders [RELEASED]

Discussion in 'Assets and Asset Store' started by korzen303, Jun 18, 2016.

  1. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Screen Space Fluids (SSF) is a set of high-quality shaders for rendering the surface of particle-based fluids with real-time performance and configurable speed/quality.

    SSF Pro provides higher quality and more features (fluid translucency, refractions) than the free version of SSF. See screenshots for comparison.

    The SSF method is not based on polygonization and as such circumvents the usual grid artifacts of marching cubes. The shaders smooths the surface to prevent the fluid from looking "blobby" or jelly-like. It only renders the surface where it is visible, and has inherent view-dependent level-of-detail. All the processing, rendering and shading steps are directly implemented on graphics hardware.

    SSF Pro


    SSF


    QuickStart video:


    SSF provides only fluid visualization that can be used, for example, with Unity's Particle System. However, SSF works best with third-party fluid simulation library such as uFlex.

    SSF requires GPU with ComputeShaders support (e.g. DX11).

    SSF is under development. Any bug reports and feature requests are more than welcome.
     
    Last edited: Jun 29, 2016
    jugadorgl4 and nxrighthere like this.
  2. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,146
    Very very nice ! I like it.
    6R
     
  3. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,258
    Can i use this in some way to render imported particle animations from other 3D software in mdd, pc2 or another format?
    I think i read some time ago that there are point cloud import formats for unity in the asset store.
    Maybe i have to read more about what a particle is in unity.

    Edit:
    Would love to use it with this asset and animated objects/particles from my animation programms from where i can export pc/pc2 files.

    https://www.assetstore.unity3d.com/en/#!/content/21869
     
    Last edited: Jun 18, 2016
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,643
    Is there a refraction/transparent version?
     
  5. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Of course, you just need to slightly modify the fluid renderer script to read the particles positions from the particle cloud rather than Unity's particle system. Half a minute job.

    Yes, however it will be part of SSF Pro (i.e paid version), which will be coming to the asset store this month.
     
  6. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    Very cool plugin.
    I got a small bug. Incorrect intersects a very large particle with objects in scene.



     
    Last edited: Jun 21, 2016
  7. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Thanks for reporting this, will have a look into this.
     
  8. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    Question. Is it possible to do so, to draw particles in different colors separate?
    In SSF_FluidRenderer colors are sent through the m_colors array, but in the end all particles are colored in the color specified in SSF_ComposeFluid.
    Question2. Perfomance Pro version than free: better, lesser, equal?
     
    Last edited: Jun 28, 2016
    yty likes this.
  9. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    SSF Pro v0.1 is now live on the AssetStore! v0.2 supporting fluid transparency with refractions coming very soon.

     
    sjm-tech likes this.
  10. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Yes, I will have a look to add colouring per particle in the v0.3 release

    It will get faster, I will focus on shader optimizations in the next releases
     
  11. kosowski

    kosowski

    Joined:
    Jun 19, 2014
    Posts:
    10
    Hi, do you have any approximate schedule for the refractions?
     
  12. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    I've submitted v0.2 to the AssetStore an hour ago. Hopefully, should be live this week.
     
  13. kosowski

    kosowski

    Joined:
    Jun 19, 2014
    Posts:
    10
    Great, just bought both SSF and uFlex.
     
    korzen303 likes this.
  14. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Awesome, have fun!
     
  15. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,643
    You need a orc bathing in mud and drinking beer demo scene ...





    I mean it's the same quality anyway!
     
  16. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Thanks Neoshaman!
    Will think about it
     
  17. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
     
  18. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    korzen303,
    can i get the latest Pro version if i already bought it? assetstore updated too long ( i downloaded 0.1v)
     
  19. mdotstrange

    mdotstrange

    Joined:
    Sep 23, 2013
    Posts:
    213
    This looks great! :) For optimal usage what does one need?

    Uflex + SSF Pro?
     
  20. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Sure, just please drop me your email (preferably gmail) address.

    First, try out uFlex as it comes with HQ shaders from SSF Pro included for free. Getting full version of SSF Pro will give you, at the moment, fluid translucency and rafractions.
     
  21. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    korzen303,
    i sent.
     
  22. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    SSF Pro v0.2 with fluid transparency and refractions is live on the AssetStore now

     
  23. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,643
    OMG you will blow people mind if you have a throw back to a known CG movie lol

    Currently can't buy it, I need to see my banks :mad: you should have my money, I'll make sure you'll get it :cool:
     
  24. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    The mud simulation shouldn't be a problem but I would need a similar scene and rigged Shrek model
     
  25. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,643
    I'll see if I can do or find something, I can't promise anything.
     
  26. DaOndare

    DaOndare

    Joined:
    Aug 7, 2013
    Posts:
    2
    Hi, first off I am really happy with my purchase of SSF Pro. - Works like a charm. There is only one thing i am missing featurewise. Is it possible to get it working with sub emitters correctly?
    cheers
     
  27. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    I hope the development of the plugin continues?
     
  28. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Yes, it continues. I am on holidays at the moment and will release the SSF Pro v0.3 just after I come back
     
  29. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    @korzen303 – Any chance this plugin supports VR? Also, do you happen to know if SSF would work with Fluvio – you said it supports unity particles which Fluvio I think is based off of?
     
  30. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    @macdude2 - I don't have a HMD to test it with VR. NVidia has recently released the Funhouse VR demo which is using SSF in VR so certainly it is possible. It may require some tweaking though for stereoscopy as SSF works obviously in screen-space and is applied as a post-processing effect.
     
  31. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    I decided to test it out – at the moment your effect does not seem to work for VR. It was unfortunately not only extremely slow, but it also seemed to not even render correctly (however, this may have been due to the refresh rate). The particle balls, however, did work pretty well. They definitely look better than standard unity particles and I believe would look OK in a more cartoony game.
     
  32. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    First, I want to polish the SSF for non-VR applications. Maybe, meanwhile NVidia will update flex shaders for VR use, which will ease things out for me.

    The fastest way to speed up SSF is to lower the resolution of the target render textures (from 2k to 1k or even 512x512)
     
  33. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    So, when will we see 0.3? ;)
     
  34. sebastien-barry

    sebastien-barry

    Joined:
    Dec 18, 2013
    Posts:
    51
    Hi,
    I'm a Uflex and a SSFPro user, I'd like to know where can I get the SSFProFlexFuildRenderer class ?
     
  35. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Hi, please drop me your email. I will send you the integration package. Sorry about this
     
  36. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    a few questions:
    1. How to use m_colorBuffer in FluidRender( Pro and nonPro )? I set a different color for each particle in fluid_render script, but they are still displayed with the color specified in the FluidComposer.
    2.What meen the setting MinDepth in FluidRender? Change it, but do not see changes in the image.

    ps: version 0.3
     
    Last edited: Sep 5, 2016
  37. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Hi SG,

    I am afraid that this is not supported at the moment but I will look at this for the next release.

    Regards
     
  38. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
    korzen303,
    how about my questions? a few the post above
     
  39. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Hi,

    sorry, missed that.

    1. ColorBuffer is currently not in use. I will look how to add fluid colouring in the future release.
    2. I am not 100% sure if it is currently in use (maybe depends on the shader type). Basically, it only affects things when you are very, very close to the fluid surface. Nothing really important though...
     
  40. jugadorgl4

    jugadorgl4

    Joined:
    Jun 11, 2016
    Posts:
    14
  41. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Hi,

    just to confirm that both SSF and SSF Pro work fine with VR except when using Single Pass Stereo Mode. This includes point sprites as well as fluid rendering.
     
  42. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    204
    Hi... I noticed that SSF isn't working properly in the 5.5 beta. I wonder if you can spot what the problem is and if there might be an easy fix? I've attached screens of SSF_GreenGoo in 5.4 vs 5.5:
    SSF_5.4.PNG SSF_5.5.PNG
     
  43. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    Hi, thanks for reporting this will check thisas soon as possible.
     
  44. Fonefen

    Fonefen

    Joined:
    Dec 30, 2012
    Posts:
    8
    Hi, I bought SSF and Uflex, I'm doing a project with Oculus Rift and I have disabled the option single pass stereo rendering in player setting, it does not work, the fluid appears frozen. Please help
     
  45. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    939
    Can I use this with fluid based cloth? Jim mentioned testing your code here with his cloth testing.
     
  46. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    175
    The SSF Pro versions improves the fluid rendering quality and works great with uFlex, if that what is you are asking about.
     
  47. supneo

    supneo

    Joined:
    Jul 29, 2012
    Posts:
    23
    Hello @korzen303 , any way that FlexColliders only takes a specific mesh and not all those that are in the scena automatically? , I put the mesh that interests me but the script automatically puts all of the scene
     
    Last edited: Dec 29, 2016
  48. patchworkx

    patchworkx

    Joined:
    Nov 8, 2014
    Posts:
    19
    HYE ::-- IS THERE ANYWHERE AN TUTORIAL ABOUT THE TRANSPARENT - REFRACTIVE SHADING::-- IS IT POSSIBLE TO ADJUST THE " SSF" IN ANY SCHADEREDITOR -(SHADERFORGE;AMPLYFIED SHADEREDITOR)
     
  49. Martian-Games

    Martian-Games

    Joined:
    Jan 19, 2012
    Posts:
    36
    FYI - in Unity 5.6:
    Shader error in 'ScreenSpaceFluids/SSFPro_ThicknessShaderHQ2': 'UnityObjectToClipPos': cannot implicitly convert from 'float4x4' to 'float4' at line 125 (on d3d11)
     
  50. MatrixNAN

    MatrixNAN

    Joined:
    Apr 11, 2013
    Posts:
    9
    Hi Korzen,

    I just bought uFlex and SSF Pro. I plan on using it for simulating white water rapids in a river. I was wondering what the progress was on the features below?

    -Translucency with volumetric absorption (Beer's Law)
    -Improved lighting support
    -Shadows
    -Surface noise
    -Caustics