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

[Open Source] TC Particles: millions of GPU particles

Discussion in 'Assets and Asset Store' started by pvloon, Feb 28, 2013.

  1. smnerat

    smnerat

    Joined:
    Sep 23, 2012
    Posts:
    35
    @p v loon I was having a problem that was mentioned earlier with the turbulence force, but since I've switched over to Unity 5 everything seems to be working now. My project in Unity 4 - 4.6 was really buggy, I was having problems with a few other packages as well. It might have been on my end, I just have no idea what it could have been.
     
  2. niraj

    niraj

    Joined:
    Feb 14, 2013
    Posts:
    56
    We have grabbed this amazing tool, but during a Test it's always throwing this comment in Console:

    Set material is using a shader not fit for TCParticles! Please select a shader from the TCParticles menu. (Or did you not turn on DX11 in player settings?)
    UnityEngine.Debug:Log(Object)
    TC.Internal.ParticleRenderer:Start()
    TCParticleSystem:<Start>b__3(ParticleComponent)
    System.Collections.Generic.List`1:ForEach(Action`1)
    TCParticleSystem:Start()


    Also the Particles are not generating properly. Please help to identify what's the Problem. Using Unity Pro 4.5

    Thanks and Regards
     
  3. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    The update is up now! So there now just is one version, with the source, 85$, woooh!

    To reiterate for indie users: Be careful when you upgrade! See the readme for an upgrade guide.


    @markefus: See above :)
    @Cynicat: Alright, Ive done the first things on depth buffer collisions, hope to let you know more soon. The backface depth is intresting as it can help to define a shape better, basically, but it would mean doing an additional geometry pass - whereas in modern deferred you already have a depth buffer anyway. I think I can just use that.

    @AuntiJamima: Yeah Ill poke around on the oculus forum a bit - they are aware and I'm not sure why they are not fixing it, it's a big problem with their implemntation that breaks more than TC Particles. Tutorial videos: Noted :)

    @smnerat: Good to hear!

    @niraj: Mmh, as the error says make sure DX11 is enabled. Go to edit-project settings-player, and in Other Settings you can enable DX 11 mode. If that doesn't help, it means the actual shader is not compiling :( Let me know!
     
  4. niraj

    niraj

    Joined:
    Feb 14, 2013
    Posts:
    56
    I have already enabled the DX11 and also in Unity Window Title - DX11 is visible, that means DX11 is running, but still this error is coming.
     
  5. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hey PVLoon, thank you for coming back...

    I got rid of my error messages... but i am running into 2 issues :
    GFX.WaitForPresent ...

    I have a simple Cannon turret, that fires projectiles.
    At first i was instantiating those projectiles ( they contain 3 TCParticle system, Start,during move loop, explode). That was killing my fps and the GC...
    So i made a pool of projectiles. It made things better, but after a few shots, the GFX.WaitForPresent destroys the fps again, and it goes worst and worst over time... Any idea what i am doing wrong ?

    Second issue : The Play() or Stop() clears the particle completly. so i switched to using TCParticleSystem>().Emitter.DoEmit = false. I want to stop the system, not clear everything. But now the issue is when changing the trans.position of the system : i put the emitter at false, move the system, put the emitter to true : It starts emitting from where it was previously ... Any advice ?
     
  6. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    @niraj: Intresting.. What is the material set to for the system? That material, does it show pink? If so, what shader is it using (if any) ? I wonder if something went wrong as the package is for unity 5, and you're on unity 4.5. You might need to select the shader on the material again manually


    @Feydwin: Im glad to!

    GFX.WaitForPresent means vsync - so it's just a sympton but not a cause. If it gets worse over time - seems you're maybe leaking systems? I will try to optimize instansiations / reactivations of systems regardless though - was on my list anyway.

    As for Play / Stop - for Stop() it's intended behaviour. The interpolation you're seeing from DoEmit though... not so much. I can see why that would happen, need to think how to fix that best. Thanks for the input!
     
  7. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    A few updates :
    The GFX.WaitForPresent issue : This is actually a bug... I know that the first answer is to put the blame on VSYNC. I have checked quite a few post on that, and it is not because of VSync. But, it is not coming from TCParticle either. The interesting thing is that i did not have that issue before, it suddenly came in my project. And the last thing i did was playing with Alloy Shader, and setting up their custom deferred shader... Seems like something broke, and i have no clue what that is, must in relation to DX11 and unity 5. Just to prove it s not VSync, i made a screenshot :
    http://s8.postimg.org/c9hprtd3p/not_VSync.jpg

    It destroys my FPS with more than 4 units shooting... Right down to 1 fps ...
    http://s9.postimg.org/q467uuiv3/Slow_Down.jpg

    It does the exact same thing even vectrosity, which also a GPGPU dx11 plugin. I have a glitch somewhere that i can t figure out.

    When i was instantiating the projectile, during the same GFX.WaitForPresent moment, i was having the GC going over 5Mo...

    Regarding the interpolation , i made you a screenshot of the code and the effect :
    http://s14.postimg.org/ybkv4u429/Decay.jpg

    The only thing i am not showing in the screenshot , lack of space, is the OnTriggerEnter, that stops the coroutine Run and Start the coroutine Hit.

    If it me doing something wrong, please let me know.

    In any events, thanks for your help.

    Edit : Just thought about posting my hardware to get that out of the way :
    core i7, gtx 970 sli, 16 g ram, latest nvidia drivers.
     
    Last edited: Mar 20, 2015
  8. JonTuque

    JonTuque

    Joined:
    Sep 16, 2014
    Posts:
    3
    Hello,

    As some before, I've ran into a problem using TC Particles in conjuction with SSAO. My problem is a bit different though, using SSAO on my camera makes TC Particles appear on top of everything. Here's how it looks: http://i.imgur.com/q4vAbKY.png

    Earlier in the thread you proposed to comment out [ImageEffectOpaque] from SSAO, doing that makes it look as it should be: http://i.imgur.com/LsgIcc7.png
    But it also makes unwanted SSAO artefacts appear when there is stuff hidden behind something that is using a transparent material.
    http://i.imgur.com/vvN1GO8.png
    http://i.imgur.com/48fzixR.png
    These outlines aren't there when [ImageEffectOpaque] is present.

    Any clue as to what we could do to fix this issue?
     
  9. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    Hi Arthur,

    I've made a couple of attempts to update my TCP Pro to the latest release, but I've ended up having to restore from my disk backup to regain functionality. I started off getting an error related to the have two files TCOffscreenRenderer.cs and TCOffscreenRenderer 1.cs that were interfering with the global namespace due to duplicates. So, I delected the TCOffscreenRenderer.cs file and renamed the TCOffscreenRenderer 1.cs to the first name, since the 1.cs file had a 3/16 date on it. That got rid of the namespace error, but I now have my TCP extension computeshader not working correctly. I end up with my particles rendered as they look after my extention initialization, but updates are not happening in subsequent frames. Have you by any chance modified the particle class such that the extension particle structure no longer matches? I've had that happen before. The basic symptom is that I'm not able to update the particles positions and age in later frames after initialization.

    I do not see a readme update file.

    edit: By the way, I am using Unity 5.

    Thanks,
    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
  10. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    @Feydwin: And similair symptons show up in a build? Profiling in the editor can be really misleading as so much other stuff is going on that is interfering with the measurment. I will fix the GC and interpolation though

    @JonTuque: mmh I guess the SSAO would do that yeah... darn. The problem is is that there is no way for me to hook into unity's rendering order. I can only render at the _very_ end of the frame. Unity's command buffers are the proper solution, but they dont support DX11 stuff yet - Ive bugged them about it, and they are adding it, but... soon, hopefully.

    I have an idea however how I maybe can abuse that same attribute though... it would require adding a script to your camera.... Ill keep you updated! Would be great to _finally_ have this working.

    @knchaffin: The offscreen renderer was removed actually - I think what went wrong is that you installed the package over it, and it didnt delete the old files properly.

    For the extension shader issue: the structure wasn't changes, but I did do an optimization to the binding that maybe could influence this. How are you dispatching your extension shader? The built in method should use the new binding code. If you're using that and it doesn't work - it's definitely a bug. Ill take a look
     
  11. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    I bind the buffer(s) each frame and then dispatch.

    //First bind the buffers
    tcParticleSystem.Manager.BindParticleBufferToExtension(TCParticlesExtensionComputeShader, "MyExtensionKernel2");
    //Then dispatch
    tcParticleSystem.Manager.DispatchExtensionKernel(TCParticlesExtensionComputeShader, "MyExtensionKernel2");

    In my compute shader:

    #define TCGroupSize 128

    //global parameters

    // KNC copied this from TCParticleManager.cs
    struct SystemParameters
    {
    float3 constantForce;
    float angularVelocity;
    float damping;
    float velocitySampleScale;

    float particleThickness;
    float deltTime;
    uint offset;
    uint maxParticles;
    };
    StructuredBuffer<SystemParameters> systemParameters;

    //Note: Never read directly from DTid.x, but use GetId() in case there are multiple TCP particle systems
    uint GetId(uint id, SystemParameters syst) { return (id + syst.offset) % syst.maxParticles; }

    [numthreads(TCGroupSize, 1, 1)]
    void MyExtensionKernel2(uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID )
    {
    SystemParameters syst = systemParameters[0]; //Always read the system first, handles bunch of stuff

    uint id = GetId(DTid.x, syst);
    ......
    }

    Have you changed how the systemParameters must be read or DTid.x read?

    Thanks,
    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
  12. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    mmh yeah that should be fine. Compute shader wise nothing should have changed, so it has to be a bug with with the binding for extensions shaders. Ill take a look
     
  13. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    @pvloon :
    I figured out the GFX wait for present and what changed.
    i switch from a pro unity version to a personnal version. And somehow, if you do that while you made your project in pro, pretty much breaks the rendering... and the profiler with it.
    I put back my license, and everything ran well again.

    With that said, I still have have some pretty wild spikes when i spawn more than a dozen particle effects. 3 - 4 systems with around 5000 particles each is fine... ( The spawn, run up and explode ). Repeat that for 4 - 5 times ( so spawn a few turrets with the same effects, and i get fps freeze at the enabling of the systems. What funny is the that lowering the number of particles does not really seem to change anything.

    PS : I had a look at PopCornFx, and their systems seems pretty good, but also very expensive. Might i suggest you take the same approach ( " External Editor, with export to unity ") with TCParticles ? Although that might be big amount of work involved.
     
    Last edited: Mar 23, 2015
  14. smnerat

    smnerat

    Joined:
    Sep 23, 2012
    Posts:
    35
    I'm wondering if anyone has thoughts trying to recreate an effect. The effect can be seen here at the 30 second mark in the video below. Now I know that obviously I won't be able to recreate that effect, but I'm looking to get that sort of motion. The Krakatoa render at the 23 second mark seems to show whats really happening. To me at least, it looks like the particles of the jet make their way to the front of the sphere, and then move out and backwards to form a sphere, and the particles end up curling back on themselves towards the jet.

    I've been messing TC quite a bit but I can quite get there. I can create the jet and even the sphere to some degree, but everything falls apart once I try and get the particles to flow from the front of the sphere back on themselves.

    Again, I know this is effect was done with 5 million particles using multiple professional editing tools, but I'm looking to try and fake it. Has anyone tried to do something similar?

    Link:
     
  15. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    If I was going to try to duplicate this, I would use a mathematical torus rather than a sphere. This is normally called a vortex. A vortex can propagate across large distances. On top of the vortex you would need to add turbulence. This almost has to be a physics based simulation usually called an n-body or fluid simulation. You would probably need to write a TCP extension shader if you have not done so already. There is going to be a lot of calculations and particle position updates going on, necessitating GPU parallel computing. You could possibly try to fake this by doing it all in 2D rather than 3D. Over the years I've done things like that for game engine SFX programming.

    Edit: Looking back at your posts I see that you are using the TCP turbulent force functionality. So, Arthur or someone might have a better idea of how to do your simulation totally in TCP without writing an extension shader.

    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
    Last edited: Mar 28, 2015
  16. smnerat

    smnerat

    Joined:
    Sep 23, 2012
    Posts:
    35
    @knchaffin Thanks! To be honest though, your suggestion is a bit out of my skill set. I actually bought Mega Flow in the asset store for another project a while back and forgot about until now. You can make or use various shapes out of splines and then put them altogether and generate a vector field. I used a ring that had vectors pointing out at the same tangent all the way around and then I placed 8 of those to make a larger ring. I was able to create the vortex part of the simulation that kind of looks okay. The problem is everything is too smooth, I think with a little tweeking and adding some turbulent noise from TC Particles I should be able to make a reasonable fake.
     
    Last edited: Mar 30, 2015
  17. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I think you mean Mega Flow. I haven't used it with TC Particles yet because I am still saving up to buy TC Particles, but its good that it has a mode that can spit out the stuff TC Particles needs.

    I expect the very richest solution to your 'too smooth' problem would involve using a different part of Mega Flow - i.e. not spline-based vector field generation, but import from external tools that can use a much richer variety of simulations to create a more varied vector field. Or potentially, if anyone figures out how to write a bridge between them, even a Unity 3d fluid simulator such as Fluidity rather than any external tools/simulations. Thats certainly on my list of things to try one day.
     
  18. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    a field created by fumefx into megaflow gives you enormous options, i think thats the kinda ideal route, although elbows' suggestion of getting fluidity data would be brilliant, particularly mixing the particles within fluidity's own rendered volumes. hmm, this should happen, soon
     
  19. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Well I just bought TC Particles and I already own MegaFlow and Fluidity, so as soon as I've familiarised myself with TC particles I shall start work on that.

    I'd like to report a typo. In the renderer section it says 'Sprite Speet' instead of sheet.
     
  20. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    @Feydwin: Good to hear! I have done some work on it and reduced garbage generated by particles when instantiated a factor 20, and reduced the execution time about 4-5x :) Instantiating systems should be really snappy now

    @smnerat: Doing an exact fluid simulation is tricky ofc but yeah you should definitely be able to get a similair effect with TC Particles.

    As for using mega flow or similair packages: There is a straightforward API to create a force field from a Vector3 array- that just takes a 3D array of values. That should work as a bridge between the packages.

    @elbows: Woops, fixed! :)
     
  21. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    Hey all, quick update, I've just pushed version 1.4.1 to the asset store. Change log is:

    1.4.1

    -Optimized instantiating systems ~4-5x. Generates ~20x less garbage now
    -Optimized update of systems by being more careful about what properties to bind when
    -Added a MaxSpeed property to particles


    -Fixed an issue where enabling / disabling a system would still interpolate the positions.
    -Fixed extension templates, removed explicit bind call, handled when dispatched now
    -Cleaned up some code

    NOTE: You need to update your extensions, as the system parameters have changed
     
    John-G likes this.
  22. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Thanks PVLoon !

    I can't try them again right now, as i am focusing on making a Multi-platform build, but i will go back to them for my special DX11 version.
     
  23. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    Hi Arthur,

    Since TCP 1.4.1 is available in the asset store now, I am working to adapt my computational neuroscience simulation to 1.4.1 . I am still getting the following error, even though I totally deleted TCP from my project prior to updating:
    Something to do with CompactAttributes missing... the error is gone now as I mention below.
    It appears this is due to the folder Assets/Plugins/TCParticles/Implementation/Attributes being empty. My backup copy has the files CompactAttribute.cs and SliderAttribute.cs in this folder. Any ideas what happened? Would you suggest that I copy the Attributes folder files from my backup to my project?

    Actually, I went ahead and copied the 2 files from backup and the project builds without errors now. Looks like my TCP extension shader is working okay now.

    By the way, it looks like you have not changed the SystemParameters structure in your extension shader example. I changed it in my extension shader to match your new source code and it seems to be working.

    Actually, seems like I have a problem with the particles disappearing if the camera is too far from my neural array. Did something change in this code? I do not see anything in my TCP ParticleSystem game object that would explain this. I'm moving the camera after the initial TCP particle system setup, if that matters.

    To get this far, I had to manually delete all TCP folders from my project before importing version 1.4.1 or I was getting duplicate global namespace errors.

    Thanks,
    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
  24. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    Hi Arthur,

    Everything is now okay. I had some material issues related to not having imported your sample asset package. As near as I can tell now the particle sizes are behaving with camera distance changes.

    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
  25. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502

    MegaFlow can already do it - it can bake a 3d texture that can then be used with TC Force scripts turbulence texture. No scripting required.

    Meanwhile I've been investigating two different methods for using fluid simulations with TC particles. The first method just involves baking a 3D texture from the simulator at one specific moment in the simulation, then using that with TC particles in the same way a baked 3d texture from MegaFlow can be used.

    The second method is far more fun, because it involves sharing the live velocity 3d texture between the fluid sim and TC particles. I got it working using Fluidity, and the results are rather nice indeed. Unsurprisingly all this use of the GPU requires some fairly beefy hardware to run at nice fluid grid resolutions with several million particles, but it is practical for certain special-case scenarios (probably not for games much yet to be honest, but that's sort of true of 3D fluid sims in general).

    I'll be sure to post some demo videos by Sunday at the latest.
     
  26. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
  27. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Well it won't work on OS X until Apple update the version of OpenGL used there to at least 4.3 to give compute shader support, but Linux yes in theory I would think.
     
  28. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey if this works out would you be able to make available here or the asset store, ether/or -i would love this
     
  29. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Sure, once I figure out how best to do that. Because at the moment my method requires changes to the source code of both TC particles and Fluidity, which creates some issues with sharing the code. Especially as I disabled all the Fluidity raymarching stuff to get as much performance out of it as I could. I know you expressed an interest in using fluid-driven particles at the same time as the ray marched fluid rendering, but I don't think that works too well due to depth rendering issues.
     
  30. smnerat

    smnerat

    Joined:
    Sep 23, 2012
    Posts:
    35
    @elbows I already tried using MegaFlow to create a 3D texture for TC particles. It didn't turn out too bad either, but I agree with you in thinking that using the live data from something like Fluidity would be much cooler. This is for a personal project that seems to have no end in sight. So as of now I'm working on some different smaller projects to release them and get them off my mind. It will probably be a few weeks (or months...) before I come back to this. Do you happen to have any videos of your simulation? I'd like to see how it turned out since it will be a while before I can do it myself.
     
  31. kite3h

    kite3h

    Joined:
    Aug 27, 2012
    Posts:
    192
    It is realy great particle system.
    I wonder if there is a way to save fillrate in full deferred rendering.
    I develop consol game , and consol's fillrate is not good.
     
  32. kite3h

    kite3h

    Joined:
    Aug 27, 2012
    Posts:
    192
    I saw unity3d's CommandBuffer sample project.
    There is no GrabPass Blurrefraction.
    If use commandbuffer . should I draw particle to G-Buffer and comibe to frame buffer?
     
  33. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    Hey all

    @Feydwin: Yeah that's great news! I'm so happy unity is going this direction, and yes it'll mean TC Particles support on more platforms :) As it's looking right now, high end tablets will run it, and linux runs it experimentally. OS X is still too much behind unfortunately :( They really really need to upgrade to more moden OpenGL standards and it'll run. I'm probably gonna pick up a Nexus 9 soon to test openGL TC Particles! Exciting times


    @elbows: Sounds like awesome stuff! Can't wait for some results, be sure to post em here :)

    @kite3h: I've experimented with offscreen rendering for TC Particles, but as it turns out that just doesn't save that much or look all that great. Other than that, avoid Additive particles, use Opaque one's, and that'll also help a ton.

    As for the GrabPass blurrefraction: This is due to a longstanding bug in TC Particles, where the render order just isn't quite correct. However! The good news is that unity after my badgering finally added a crucial function, commandBuffer.DrawProcedural(), that'll finally allow me to fix this. I've started implementing this, and when unity 5.1 comes out I can push the update right away.


    Other than that, patch is on it's way with a few bug fixes, most notably fixing visualize in editor
     
    ctp likes this.
  34. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    121
    Hello,

    I am using Tc Particles with unity 5 personal addition and I am getting a ton of errors. I am using the plasmaShot prefab from the samples package as a projectile. Here are the errors I am getting:

    "DestroyBuffer can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function."

    "MissingReferenceException: The object of type 'TCParticleSystem' has been destroyed but you are still trying to access it."

    I am not sure what the problem is, I would appreciate any help.

    Thanks
     
  35. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    My Game is using a ton of particles and effects.
    @p v loon : Please let me know if you make it run successfully on other platforms. If can use GPGPU Particles, i'll be able to push my water effects and all by quite a bit.
    Also, i am using the "Blend" Particle shader from Alloy. If you could put a similar shader in TCParticles, that would just be awesome.


    @cmart : What i ended up doign when i was playing with TCParticles : Instantiate the system, then launch the emission via code. When you need to destroy the object, stop the emission first.
     
  36. pajamajama

    pajamajama

    Joined:
    Oct 22, 2012
    Posts:
    66
    Awesome system! Been using it for some time.

    I'm working on a project now where I have a Vector3[] updating every frame (point cloud from an infrared camera). I would like to use this array as spawn positions to emit particles. Is this amount of emission control possible with TCParticles?

    Thank you!
     
  37. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    If you cannot use the Vector3[] as an emission control array, you can certainly use the Vector3[] as a structured buffer inside of a compute shader in parallel on the GPU. I do this with a web cam video image and adjust particle positions based on the video frame pixels in the TCParticles extension compute shader. I also use textures as structured data buffers in some cases. When I am doing this, I just emit as many particles as I will need up front and then just modify the particles' position and age in the compute shader. You can tie the age to a color curve or to a size curve if needed. I'm currently doing a similar thing where I convert MRI image slices into point cloud and then TCP particle cloud.

    I love TCParticles!

    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
  38. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    Hey all,

    @cmart: Mmh, try the latest patch, it does fix some of those errors, but I haven't seen those pop up in a normal context when spawning objects. Is this still bugging out?

    @Feydwin: For sure! I've ordered a tablet with a tegra K1, always nice when you can play with some toys for the sake of buisness hehe. I'll take a look at the blend shader (I'm actually on the team that makes Alloy, have writter the editor for it :) ).


    @pajamajama: A. Spelling you're username was quite the experience! B. What Ken Chanffin said :) I should maybe look into a way of doing this generically, but it could be quite slow. GPU particles have a lot of advantages, but these kinds of things are made harder :) How many particles are we talking about btw? If it's in a somewhat sane range I should just make an API and warn people not to try it to spawn a million particles, but for just spawning a handful it's fine really. Another option is to have people set a bunch of points to emit from, and then randomly distribute particles over them. Mmmh. Let me know what you're use case is and I'll think about something!
     
  39. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    @p v loon : The blend shader : That would be just awesome.

    I have actually decided to redo my effects using only TC Particles for my first release. Mainly because i got DX11 shaders and effects that i can t do without ( Ocean rendering and all ). So i told myself the results will be worth it and i ll do it at some point anyways, too bad for the linux / mac release. This DX / OpenGL fight since the last 10 years really got on my nerves...Anyways...

    Might i add something to my shader request .. :
    Heat / Distortion : using a normal map as input for the distort effect. It really adds some eye Candy to many effects, without asking too much out of the GPU.

    Gimme some blending, some distortion, GPGPU computed fire, and i ll make some really nice explosions for my game !
     
  40. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    @p v loon :

    So i just reinstalled TCParticle package. downloaded from asset store.
    I loaded the GrenadeSplode prefab into my scene, and launched the visualize window. But i got this in my console :

    "
    NullReferenceException: Object reference not set to an instance of an object
    TC.Internal.ParticleManager.Update () (at Assets/Plugins/TCParticles/Implementation/internal/TCParticleManager.cs:234)
    TCParticleSystem.UpdateAll () (at Assets/Plugins/TCParticles/Implementation/TCParticleSystem.cs:363)
    TCParticleSystem.EditorUpdate () (at Assets/Plugins/TCParticles/Implementation/TCParticleSystem.cs:351)
    TCParticlesVisualizeWindow.OnGUI () (at Assets/Plugins/Editor/TCParticles/Visualization/TCParticlesVisualizeWindow.cs:97)
    "
    Can 't close the visualize window... i have to ALT F4 unity. Tried again with a new scene : same result.
    Did i miss something ?
     
  41. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Sorry for the delay on this one. I've switched the fluid simulation to use something other than fluidity. It's still early days but I should be able to post the most basic of video examples later today.
     
  42. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Not really ready to demo properly but I made a brief test video anyway.

     
    ctp, lazygunn and John-G like this.
  43. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    @elbows: That.... is incredible. It doesn't even look like particles anymore. The turbulence in the middle is super sexy. I'd love to know more about how you achieved the effect. Is it a fluid simulation of your own? And that's just an additive shader I imagine? Performance looks pretty good, what kind of fluid grid is this? How many particles? And the final velocity is applied by a turbulence force? Sorry for all the questions, again, just... awesome work :D


    @Feydwin: Are you on the last patch? What if you import the latest from the asset store into an empty project?
    As for distortion: There actually is something to render particles as distortion :) It's a bit confusing to setup though... It comes back to a question whether TC Particles should be a more general VFX system, or just "here's GPU particles". I definitely like the first one, but it's hard to say how exactly that would look

    Thanks all
     
  44. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    I agree, this looks fantastic! I'm also curious if you are using a a TC-Particles extension compute shader or even a CUDA plugin. I would love to know more about how you are doing this.

    K.N. Chaffin - Texas Tech University Informatics Media Lab
     
  45. smnerat

    smnerat

    Joined:
    Sep 23, 2012
    Posts:
    35
    @elbows Wow, that is awesome! I wasn't really sure what to expect, but I definitely didn't think it would turn out like that.
     
  46. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Glad you like it :) I'll be attempting to get some more done on it today and hope to post more videos this week.

    I'll answer the questions a bit at a time too....

    The starting point of the fluid simulation is the excellent Unity DX11 compute shader implementation of the classic GPU Gems fluid article, which Scrawk so kindly shared with the world on his blog early last year:

    http://scrawkblog.com/2014/01/09/gpu-gems-to-unity-3d-fluid-simulation/

    I've rewritten it to use 3D textures rather than compute buffers. I then feed the velocity texture into TC particles via some small modifications to the existing turbulence texture stuff that TC particles already supports.

    I'm working on various other additions and changes to the fluid simulation. Providing I manage to add enough extra value to it then I have permission from Scrawk to share it, sell it etc. I'm not exactly sure what my plan is yet, but one possibility is that I try to sell it for a fairly low price on the asset store, perhaps bundled with its own very basic DX11 particle system, but with the option for TC Particles owners to use TC particles instead.
     
    ctp and lazygunn like this.
  47. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That is absolutely beautiful elbows, strangely as soon as i saw it i thought it might have scrawks work behind it, im pretty familiar with his stuff after having adapting several of his articles for my own uses and loving his directcompute tutorials. That guy is a treasure to unity

    I cant wait to see what you come up with
     
  48. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    @p v loon do you have access to the Unity 5.1 beta? It's into release candidate phase and at the moment your compute shader crashes the unity shader compiler!
     
  49. Research_3DVAL

    Research_3DVAL

    Joined:
    Jun 26, 2014
    Posts:
    15
    I'm glad to see that development hasn't dropped of the face of the earth, and there are some pretty amazing implementations here! Haven't revisited in a bit, with Oculus rift problems apparently resolved now begins the process of reintroducing TC particles to our builds. Might ping the question about depth buffer collisions again to see if there have been any updates (and tutorials at some point, even if they are rough!)
     
  50. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    So, are the Oculus Rift problems resolved? I have not tried an Oculus build with TC-Particles in several months. I somehow missed that the problems are fixed.

    K.N. Chaffin - Texas Tech University Informatics Media Lab