Search Unity

[Released!] Sci-Fi Damage FX

Discussion in 'Works In Progress - Archive' started by unityuser94, Aug 3, 2015.

  1. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Hi,
    I am a 3d modeler, programmer, and shader writer. I have been using unity for ~4 years. I was Inspired by this video:

    and have set out to create something similar that other game developers can use.

    Latest progress demo/video/update:


    Previous videos:
    Oldest:



    Webplayer Demo:
    http://vectorforgegames.com/Sci Fi Damage FX Demo/

    Released thread:
    http://forum.unity3d.com/threads/released-sci-fi-damage-fx.354775/

    Right now it works with unity's standard surface shader, and supports all of the texture maps.

    I am posting this in the WIP section to get feedback, and see if there is an interest for something like this on the asset store, so please leave your thoughts and suggestions :)

    Launch Features:

    *Heat damage affect as shown in progress video.
    *Fade in damage texture for damaged areas.
    *Adjust normal's based on damage, to add depth.

    I will document my progress here.

    Thanks,
    -Patrick
     
    Last edited: Oct 10, 2015
    moure, rebit, LeftyRighty and 3 others like this.
  2. Zakkon

    Zakkon

    Joined:
    Sep 22, 2013
    Posts:
    1
    Saw your tweet, I must say this is something I have asked myself again and again how to do.

    Your prototype looks sweet, but I would like to see it work with advanced geometry. Then you got something you could use as a shield impact effect.
    Would be cool if we could use seamless impact textures, for example an hexagon pattern or something to give the shields more personality (like this: http://static.tvtropes.org/pmwiki/pub/images/BubbleShield.jpg)

    Keep up the good work! This is something that I think alot of games (including mine) could benefit from.
     
  3. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Thanks Zakkon, yes It could definitely work with advanced geometry. I should have showed the affect on something more complex then a stretched box; It is actually a volumetric affect; if you were to look behind the box in the demo video, you would see the heat spreading through.

    It could be used for a shield, (of any shape too!) but since its simulating an entire volumetric space, it would be rather inefficient...though..hmm actually that might work well too.

    The hexagon pattern looks really cool, would love to create an affect like that, might be possible too, I have some ideas that might work utilizing current code.
     
  4. CastleIsGreat

    CastleIsGreat

    Joined:
    Nov 10, 2014
    Posts:
    176
    This is pretty cool.
     
  5. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Thanks!

    Updated the original post with a new video. It shows the affect working in 3d instead of just on a 2d surface.
     
  6. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Updated the original post with a progress video.
    The affect can now modify the normals, giving a liquid metal appearance on the plain cube and sphere.
    Actually had to go into the code generated from the surface shader to make this work; but only had to make a few small changes :cool:


    The next step is to add some distortion, make half of the affect persistent, and the other half fade out. So the heat would fade out, but the normals might stay perturbed for example. Which affects are persistent would be able to be changed.
     
  7. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I have no use for this - but I had to comment on how cool it is to see an advanced 'thing' like this being worked on in Unity.
    It makes me want to - create something that could use this for visual wow-ness.

    Awesome work!
     
  8. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Hi, thank you!

    Nearly finished the initial release; all that's left is the ui (it uses a custom inspector to make things easier) and the shader variants. I plan to have it in the asset store this week, if all goes well :)
     
    FreakForFreedom likes this.
  9. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    This looks really great and could provide itself useful, will keep an eye on it :)
     
  10. Johnny-Casual

    Johnny-Casual

    Joined:
    Oct 7, 2014
    Posts:
    20
    Looks really cool, and i wound definitely buy it once it hits the store, keeping an eye on this one, good work!
     
  11. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    I posted a new video showing the UI progress and some improvements. The affect can now dynamically change the vertices positions to help with the indented affect.

    There is also now a pre-optimize toggle. What this does is cause only the voxels near a surface to be updated, and can significantly speed up computation for objects with a lot of empty space in the bounding box.



    Some notes:
    If you look in the video you can see the custom inspector and the shader properties. I plan on adding some more properties, but I would like to hear suggestions for any specific properties that you would like to see that are not already there.

    There are still things I can do to improve the performance, for example; currently there is no multi-threading.

    I plan to add a transparent version of the shader; this would allow a shield affect and other cool affects; I hope to include this in the initial version.

    Thanks for all the positive comments :)
     
    Last edited: Sep 2, 2015
    FreakForFreedom, rebit and Mister-D like this.
  12. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    looks really good, could it be used as a blood hole effect on skinned meshes?
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I like this too. I can see using it, depending on whatever restrictions it has. :)
     
  14. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    I would like to make that possible; currently its not; unless the "skin" doesn't stretch or deform at all. That is one of the limitations: its best used on solid, non deforming meshes. So for example, it would work on a handheld shield; but it is unlikely to work well on skin. I have some ideas for making it work; but they are complex, may/may not work and would take time to implement, but its not out of the question :)
     
    Mister-D, rebit and theANMATOR2b like this.
  15. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    yes unity is missing a good gore system. if u ever decide to implement it u got a customer ;)
     
    ElectroMantis and rebit like this.
  16. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    I decided to have a go at implementing shields using the same infrastructure; its not quite like what @Zakkon posted, but I like it, and at release it should be customizeable enough to produce the affect in the pic zakkon posted.
    Screenshot:


    Keep in mind that this is using the same infrastructure as the demo videos, so that means you can do all the same affects.

    At the current rate of development, it should (hopefully) be ready on monday; then just have to wait for unity to review it and then it will be on the asset store : )
     
    rebit and hopeful like this.
  17. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Here is a quick gif of the shield affect:
     
    Mister-D and hopeful like this.
  18. ElectroMantis

    ElectroMantis

    Joined:
    Sep 15, 2013
    Posts:
    78
    I'll be watching this thread. The effect looks amazing.
     
  19. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    New video is up, and will be submitted to the asset store shortly.


    Submitted! Now just waiting for review.
     
    Last edited: Sep 13, 2015
    FreakForFreedom and ThunderTruck like this.
  20. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    I've already got my money ready to throw at you :D
     
  21. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Looks nice :)
     
  22. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Its released! Its currently only available cleansourcecode.com, as I am still waiting for unity to approve it. 40% off for the first two weeks! Thanks everyone for the comments and support!

    Here is the link: https://www.cleansourcecode.com/index.php/sf-realistic-damage-fx.html#
    I will post another update when it becomes available on the unity asset store.
     
    Last edited: Sep 13, 2015
  23. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    It really does look awesome! But isn't 100bucks (or even 70) not a bit too much? (It is for me at least :S)
     
  24. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
  25. IndieAner3d

    IndieAner3d

    Joined:
    Oct 20, 2014
    Posts:
    77
    That's definitely impressive *-*
    thumb up, I stay tuned ;---)
     
  26. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    really nice stuff :) love it
     
  27. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    @Ironmax @IndieAner3d @FreakForFreedom
    Thanks for the comments everyone :)

    Got multi-threading working properly, it works well enough to remove the experimental label. In my tests it improved performance by a factor of around 10 on my quad core 3rd gen i5. With 8k voxels being updated 3 times per frame (at 60 fps), there was a ~0.7 ms overhead, without multi-threading, there was a ~7.2 ms overhead on the main thread.

    Heard back from the unity asset store, they said I had to change the presentation and a few other minor things, so I changed those, fixed the few bugs I had found, and added in the improved multi-threading.
     
  28. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    IndieAner3d likes this.
  29. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Tried implementing some raymarching and got this working:

    Definitely still wip, but when finished could allow for some really awesome affects.
     
    Last edited: Oct 15, 2015
  30. Nimred

    Nimred

    Joined:
    Nov 1, 2014
    Posts:
    46
    Looks very cool. I'm making just the type of game that could use a tech like this. But if this is using vertex displacement in the shaders, does this mean that colliders will be out of sync with the visual deformation?

    It would be nice to see a demo with a textured object, like a big spaceship :)
     
  31. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    The released version uses vertex displacement in the shaders, this does mean that the colliders will be a bit out of sync with the visual deformation unfortunately. Modifying the colliers at run-time is a bit tricky, but is possible to implement.

    The raymarching gif is not vertex displacement, it uses a teqnique called raymarching, which is a bit like raytracing on the gpu except much less expensive. This will also not be synced with the collider, though for raycasts, the collision point can be faked allowing say, tunneling.

    It would be cool to see a demo on a large fully textured spacecraft :) Haven't had the time to make one yet though, and my texturing skills are not great.
     
  32. Nimred

    Nimred

    Joined:
    Nov 1, 2014
    Posts:
    46
    There's an aircraft/spacecraft in the unity 5 standard assets:
    https://www.assetstore.unity3d.com/en/#!/content/21064

    It doesn't seem to come textured with Unity 5 but it looks like you get the textured version if you download this - and I've seen one other asset on the store that uses this textured ship for sci-fi asset demo purposes, so I guess it's ok to use it.
     
  33. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Ah awesome, didn't see those, Ill try making a demo using the spacecraft/fighter.
     
  34. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Here are a few quick screenshots of the effect when used on the aircraft:

    If I have time this weekend, I could probably make a separate demo scene with the aircraft and add it to the webplayer demo.
     
    Nimred likes this.
  35. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Raycasts can now affect the raymarched surface.


    Essentially it raymarches the impact till it hits something solid.
    Next step is making it emit another raycast if the original passes through, then optimizing, ui, etc.
    Also have to make the raymarching write to depth so shadowing and mesh intersection is handled correctly.
     
    Last edited: Oct 19, 2015
    FreakForFreedom likes this.
  36. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    I dropped the base price of the asset to 50$ USD. As I make changes based on user suggestions, and add features (like the raymarching shown in the above post), I will raise the price accordingly.

    Again, the asset can be found both at the unity asset store:
    https://www.assetstore.unity3d.com/en/#!/content/45933
    (Due to the way the unity asset store works, it will take some time before the price is updated there.)

    And clean source code:
    https://www.cleansourcecode.com/index.php/sf-realistic-damage-fx.html

    Remember, I am always open to suggestions, comments, etc, so don't hesitate to contact me or leave a post here.
    :)
     
  37. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    cough suggestion cough, blood damage on skinned meshes cough :D
     
  38. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
  39. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    i could not open the webplayer, sorry, my idea was a damage effect with displacement on a skinned mesh renderer. and maybe even a blood stream flowing down the mesh based on world position.
    so u have EG. a bullet hole with blood squirt particle and an actual hole displacement and stream down bullet hole effect.