Search Unity

IndieEffects: Bringing (almost) AAA quality Post-Process FX to Unity Indie

Discussion in 'Assets and Asset Store' started by FuzzyQuills, Sep 2, 2013.

  1. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    umm no i should have 2 separate versions, 1 dirty lens and the other one should be my bloom. ill look at the package

    Yes baldinoboy dirty lens bloom works in indie, but at the expense of performance since this bloom and dirty lens bloom isn't optimized well enough.

    if you want proof here
    without
    https://www.dropbox.com/s/gmexz1jiswm1tss/Screenshot 2014-06-16 10.31.23.png
    with bloom
    https://www.dropbox.com/s/q8hkp9hy76aql53/Screenshot 2014-06-16 10.31.09.png
    with dirty lens bloom
    https://www.dropbox.com/s/rh88cnr39bvfpmm/Screenshot 2014-06-16 10.30.31.png
     
    Last edited: Jun 16, 2014
  2. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Next up: Brightness/Contrast Shader With Vibrance, and filmic tone mapping
     
  3. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Last edited: Jun 16, 2014
    Eric2241 likes this.
  4. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Filmic Tonemap, no tonemapping isn't adaption where it can go from dark to bright, like your pupils dilating in the dark.
    if you don't know what tone mapping is, read this - http://en.wikipedia.org/wiki/Tone_mapping
    This effect does work without indie effects, but i will attempt to make it so i can borrow the render tex from indie effects so that way performance can improve if its possible to do that.
    no Tonemap
    https://www.dropbox.com/s/jd4pvhhp7m3vgey/Screenshot 2014-06-16 11.30.36.png
    with Tonemap
    https://www.dropbox.com/s/oc4dh77jz4vfbpy/Screenshot 2014-06-16 11.32.08.png

    download
    https://www.dropbox.com/s/frahmgcll14zgty/FilmicTonemap.unitypackage

    reference
    http://armedunity.com/topic/5537-filmic-tonemap/
     
    Eric2241 likes this.
  5. 0tacun

    0tacun

    Joined:
    Jun 23, 2013
    Posts:
    245
    wow Frostbite23, your shooting rockets with a machine gun! I'm glad to see some contribution of a knowledged man with a noble mind.
     
  6. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    hahaha, thanks 0tacun. BTW beautiful work on the motion blur.

    Filmic Tonemap and Brightness saturation contrast are ported shaders, and thanks to indie effects for such an easy api for porting and making image effects, i managed to port those 2 under one hour :D

    and i still got a bunch of more treats to give out and work on.

    P.S im not actually an adult, I'm a young kid
     
    Eric2241 likes this.
  7. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Man I love you guys:D. You are awesome Frostbite23. You teach yourself all this?
     
  8. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    yes, i actually have a friend over at the amredunity forums and he's known as "Shader God" (his user is willywill) and he taught me shaders, however everything else such as programming, modeling, etc i learned by my self.

    he helped me on the bloom such as helping me set it up and finding the right blurring technique.
    but the ported filmic tone map, brightness, contrast, saturation no lol that was all ported by me under one hour.

    you can view his work on the shaders section, showcase section, or view his profile
    http://armedunity.com/topic/8368-better-soft-shadows-wip/ - one of his work

    you can also find some of my shader work I've done in my signature.
     
    Last edited: Jun 16, 2014
    Eric2241 likes this.
  9. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Cool. I am planning to learn code when I finish the pack I am working on. Thank you for your work. The next release is going to be mind blowing:eek:.
     
  10. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Yep, coming up is bloomFlares (like unity pros bloom flares) technically the same thing as my bloom but with adjustable blurring heights and widths, more optimized, and a dirty lens version of it as well if you want to go JJ. Abrams style with it
     
    Last edited: Jun 16, 2014
  11. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
  12. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
  13. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    My word where are these coming from. FuzzyQuills is going to be crying with joy when you gets back online.

    Since you are on a roll do you think sun shafts originating from a gameobject could be possible in indie?
     
  14. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Baldinoboy you must remember, anything is possible. yes its possible with unity, I'm planning to port or create a sun shafts image effect but it will take a while because i never done one. but right now I'm working on optimization so these scripts can perform well, and if you know coding, do you know how to keep the render texture at a low resolution like 1280x720 while making it still fit to the main screen resolution?
     
    Eric2241 likes this.
  15. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Cool.

    Sorry but as of now I have next to zilch coding skill. I am having trouble really understanding it. I know FXLab down scales the render texture and of course it helps a lot. I also think FuzzyQuills is working on that and might already have it.
     
    Eric2241 likes this.
  16. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Ok im gonna make an attempt to port an XNA god rays shader, hopefully this will work! stay tuned
     
  17. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @Baldinoboy: I actually tried a scale-down, but currently, it also zooms into the bottom-left corner... :confused:

    @Frostbite23: HOLY COW.

    These are the fastest fx ports in history. almost reminds me of my speed-modelling skills in blender! ;)
    And yes, I will consider integrating these. but first, the next release will come out... And I will also release a nightly build with ALL of your current FX in it! :) that way, I will have time to then update the docs to include your FX in them.

    Definitely staying tuned for god rays, as I haven't had time to do it. the reason? exams, tests, other school stuff, etc... :rolleyes:
     
  18. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    make sure you optimize it and clean up the code lol, because I'm not an expert in optimizing code.

    and add a downsampler, that decreases the quality of the render textures being used and try adding a delay so the render textures don't have to be updated every frame.
     
  19. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    and yes the ports were really easy, all i did was copy the shaders from the reference (they were cg code and were unity pro image effects, so no changing or moving around was necessary) i used the same script as all the other fx i made, change it up, set the main texture as render texture and all of that, and that was it.
     
  20. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    i changed my mind, turns out i never used depth textures before, so to ease the pain I'm porting unites godrays shader with of course modifications to it so it can run and look better.
     
  21. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Uh oh...

    DON'T PORT THE GOD RAYS YET! :eek: take this first!
    This is the current nightly build, so if you are going to use a depth tex, use this! my old depth tex used exponential depth, and when I added the new one, most of the depth based effects broke. so to save you pain, take it!

    Use this code as a base. it uses the new API. don't bother porting your other fx, though, as I can do this for you. I also added a texture capture delay, so your first request is almost fulfilled. :)

    BTW, for others waiting for the next version, this one is incomplete, but is useable, so feel free to use it also.
    Link to New Scripts
     
  22. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
    Okay Frostbite23, you truly are amazing at writing shaders for Indie! Just wondering if you could compile them all into one package, just so I dont have to jump around finding all the links. Thanks! :rolleyes:
     
  23. Tauren

    Tauren

    Joined:
    Jun 17, 2014
    Posts:
    4
    FuzzyQuills, Frostbite, thank you very much for sharing these fantastic shaders ! :)
    It's great to see the Refraction shader, can you suggest how it could be modified to get an animated underwater distortion effect ? Also, how would one go about applying these shaders to, say a sprite, in such a way that it only affects the area covered by the sprite and everything behind it.
    For example, having a small underwater area in a side scrolling game where the water region would have the refraction + blur as well maybe. Is it possible ?
     
  24. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @Seth McCumber: I was also thinking about asking frosty to integrate everything into one pack... but who cares, IT'S AWESOME!

    @Tauren: you are very welcome.

    Do you have any way of showing me a screen of a game that uses this effect? it sounds very sonic the hedgehog-like... ;)

    And to do an underwater distortion effect, if you are handy at writing CG shaders... you can use a UV offset in the fragment shader... actually, just use this! (typing out of my head)
    Code (csharp):
    1. half4 frag (v2f i) : COLOR
    2. {
    3. half3 norm = UnpackNormal(tex2D(_MainTex, i.uv));
    4. half4 col = tex2D(_MainTex, i.uv + norm.xy);
    5. return col;
    6. }
    Make sure to replace _MainTex with whatever your main texture property is.
     
  25. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
  26. Tauren

    Tauren

    Joined:
    Jun 17, 2014
    Posts:
    4
    @FuzzyQuills :
    Yes, it's similar to the water as seen in Sonic 4, at 7 mins 55 secs :
    or Limbo at 55 seconds

    The animated effect is confined to the water regions only. So I'm guessing that the performance impact wouldn't be too bad on the PC especially since it's just a few parts of the level. And whenever it becomes possible to downscale the rendered texture, it would be even better!

    Thanks for the code, but I'm an artist and fairly new to unity, haven't really got any experience with coding shaders :( Would be appreciated if you could add "Underwater Effect" as part of your indie effects pack. With basic distortion amount control, and perhaps the option to use a normal map to control the distortion. And the option to confine this effect to a game object's area (water areas/icy cave rocks, crystals etc) or to a particle system (heat haze)
     
  27. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    Eric2241 likes this.
  28. Lemo76

    Lemo76

    Joined:
    Aug 7, 2012
    Posts:
    174
    I'm looking to the moment when all the latest Unity Indie FX effects will be compiled into one large pack. Keep it up y'all!
     
  29. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Lemo, You're back! I am here to tell you, that SSAO was successfully implemented!

    All thanks to Cyrien for help write it!

    @mgear: Wait, you ported shaders for us?! Looks like you're going on the credits! :)

    Both frosty (that is, FrostBite23) and I were having trouble getting those to work, so thank you for having a shot at this!

    EDIT: How come it's a surface shader? Don't worry, I will see what I can do with it!

    EDIT2: I have actually seen that god rays shader before...

    @Tauren: Yes, I have played Sonic 4, and that water effect's easy to achieve in Unity.

    Since My subjects are finished for the term, (only have to wait for exams to come in... ;)) I will have a shot at this.
     
  30. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    OH my god! megar you were my inspiration when i was an indie user! i really loved all the shaders you have done for indie and i thought it wasn't possible until i knew you did it! lol anyways yes I've seen your radial blur shader but i completely forgot about it when doing this godrays shader for indie.
     
  31. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Hey frosty, you may have seen Lemo's post, once we're done, send me the full set of shaders and scripts for me to integrate!

    That way, I can then finish the docs and officially release IndieEffects 2.0! (technically, it is 1.0, but i didn't really set version numbering... o_O)
     
  32. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
  33. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Last edited: Jun 19, 2014
  34. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    HOLY COW!!! Frosty, give meee...! :)

    Just Kidding! And that sun shafts mask looks like a depth texture to me... ;)
     
  35. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    @FuzzyQuills you should open some bitbucket / github.. will be easier to follow up on issues / requests etc. (and easier to get the latest versions)

    btw. there was some improved light shafts here, havent looked how they are done or if could port to this system?
    https://github.com/robertcupisz/LightShafts
     
  36. Lemo76

    Lemo76

    Joined:
    Aug 7, 2012
    Posts:
    174
    Thank you all so much, You fellow shader coders are Amazing!
    You know what else would be pretty cool, a blur effect done on an object or a texture so it blurs the scene behind (e.g. IOS 7 app folders), I'm not sure if this is possible considering it is more or less object based, but yeah it would be interesting to have a try at.
     
    Last edited: Jun 21, 2014
  37. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    that might be easy to do with 2 cameras,
    1st camera view is blurred (but it cannot "see" the selected object)
    2nd camera view is only showing that selected object(s) (using layers).
     
  38. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    It's also possible with just one camera... ;) Just use the RT (aka. renderTexture for older versions) in a script with a blur material attached.

    May build an example in the meantime.
     
  39. pietersmobile

    pietersmobile

    Joined:
    Jan 26, 2014
    Posts:
    11
    Hello all, first of all. Create work!. I have a question. When i don't use any of the effects i get 60 FPS. When i use the Brightness, Saturation, Contrast from Frostbite on its own (//@script RequireComponent (IndieEffects)) this drops to 16 fps. When enabling @script RequireComponent (IndieEffects), the fps drops to 6.

    Any ideas?
     
  40. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
    Yeah, these effects are the fastest around. Thats just the way they are. Maybe 2.0 will have some FPS improvements!
     
  41. pietersmobile

    pietersmobile

    Joined:
    Jan 26, 2014
    Posts:
    11
    Ok thnx, effects are really cool though, to bad it has so big performance penalty :)
     
  42. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    yeah i forgot to notify you about it, the effects i made are performance hungry so yeah expect a performance drop. maybe someone will come around and swoop it up and optimize it for us. because i don't really have time anymore to make more image effects. but i have time now and thanks for the tip.
     
  43. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Refraction, BCS, and Filmic Tonemap have been optimized now.
    V1 - 19fps on an AMD Radeon 5670 512mb
    V2 - 29fps on an AMD Radeon 5670 512mb
    10fps improvement.
    Refraction V2
    https://www.dropbox.com/s/yesq138rhc8sovt/RefractionV2.unitypackage
    FilmicTonemap V2
    https://www.dropbox.com/s/t7o3cvg7x0nvefa/FTv2.unitypackage
    BCS V2
    https://www.dropbox.com/s/7wu3b7j23nknafu/BCSv2.unitypackage

    NOTE: these new V2 effects are optimized and use the new Indie Effects base, so these effects are no longer independent. so they don't use there own render textures now so this saves performance.

    NOTE: this uses the new indie effects, so do not use if you don't have the new indie effects.
     
    Last edited: Jun 24, 2014
  44. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    How did you get those working with one tex? you little genius! :)

    For all to hear: I am also going to integrate a function that turns on depth and normal buffers ONLY if they are needed, that way, if you're only using motion blur, for example, it won't have to capture the DNBuffer every frame, saving performance a bit more.

    And shader complexity can also bring the performance down. and so can the terrain engine... ;) SSAO is the biggest performance hit, due to the bunell disk algorithm Cyrien used when making it. And I still don't have a working texture downscale... :( My only thought is to generate a second camera, but that might bring the performance down too!
     
  45. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    holy crap, big issue guys, with my V2 image effects since they all use the same render texture. you can only use one, because somehow when you use 2 image effects at least 1 image effects must be rendered so technically they all ardent sharing the render textures correctly.
     
  46. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    That was a shortcut I put in to up performance... :(

    And also, is it possible to put texture2D.Apply() on a separate thread? that might fix some performance issues... :)

    And also, my laptop is doing something weird... the fx used to run at 60fps on my PC, but now the bloom effect drops the framerate to 16fps. and this is on high performance power plan! :eek:
     
  47. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Note that the bloom effect hasn't been optimized as well, and i tried to optimize but it wouldn't work. and turns out bloom needs 2 render textures.
     
  48. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    (Havent read all the pages..) what is the Resize() used for?

    tested this, still works (and faster), for the default motion blur at least:
    Code (CSharp):
    1.    
    2.    DepthCam.camera.Render();
    3. //    DNBuffer.Resize(camera.pixelWidth,camera.pixelHeight,TextureFormat.ARGB32,false);
    4.     DNBuffer.ReadPixels(Rect(camera.pixelRect), 0, 0, false);
    5.     DNBuffer.Apply(false);
    6. }
     
  49. Cyrien5100

    Cyrien5100

    Joined:
    Oct 17, 2012
    Posts:
    145
    Did you try to desactivate Anti Aliasing ? It uses many performances because for each pass, rendered content will be anti aliased.
    Also, yes my Bunell Disk SSAO have a big performance hit (from 3ms to 8ms on my GTX570), but another techniques needs a blur pass, which needs another rendertexture, so not worth.
     
    Last edited: Jun 24, 2014
  50. Gogin

    Gogin

    Joined:
    Nov 9, 2013
    Posts:
    60
    Guys? Can you post me some scene (upload) where you use these effects and looks nice? When I tried use some of these effects, It went wrong for me :( Lots of errors and purple/black/white screen...