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

glareFX Dirt Lens Effect (Battlefield 3 like)

Discussion in 'Assets and Asset Store' started by reddotgames, Nov 26, 2012.

  1. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    We would like to proudly present
    our new post process effect known from big AAA titles, first seen in Battlefield 3.

    glareFX Dirt Lens Effect
    Link to Asset Store

    WEB PLAYER 1 (complex scene from screenshots 60 MB)
    WEB PLAYER 2 (simple scene 20 MB)



    glareFX lets you access onscreen lens flare postprocess effect seen in latest AAA games.

    Pack includes 3 shaders :
    • Glare classic
    • Glare with chromatic aberration (configurable)
    • Glare for shader model 2.0 with cheap and not so effective highpass method
    + 8 Lens textures

    Params to play with :
    • Blur Samples
    • Glare Threshold
    • Chromatic Aberration Formula
    • Halo Intensity
    • Lens Texture*

    *effect also works without lens texture

    Works on Unity 3.5 and Unity 4.0











     
    Last edited: Jan 23, 2013
  2. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Very nice. Is there to change the effect that is applied? Or walk around?
     
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Great this is just what was needed to spice up the post effects!
     
  4. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Hmm I'm trying to understand your question but its hard :)

    Glad you like it. IMHO that was missing from beginning of Unity effects :)
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Nice this could be interesting.
    Off topic : did you post any pic in this thread, because i didn't see any pic? Just curious if a picture is loaded or not since my connection kinda weird today.
     
  6. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    looks amazing!
     
  7. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    yes there are 5 images on post. My fault is that these are PNG so can load long time :)
    try load in webbrowers http://reddotgames.pl/unitystore/glareFX/s0.png (replace 0 with range 0-5)

    thanks!
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ah isee it's loaded now. Looks awesome
     
  9. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Unity goes superfast on this submission (3 hours) :) Thanks Unity!
    Effect is now available on Asset Store

    ASSET STORE LINK
     
  10. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Looks amazing!
    I do have several suggestions though :

    1. Make a smaller web player demo. 130MB is kinda ridicules for a web player demo because Unity is notorously slow loading through the web. (Something like 1~5 mb web demo is sufficient enough) We only wants to see how the flares look like in a simple context...so something very simple to illustrate the case would suffice.

    2. Your web player demo link on Asset Store is broken. It can make your product look unprofessional if can't get your link to work properly. Right now It goes to : http://u3d.as/content/red-dot-games...fect/\\www.reddotgames.pl\unitystore\glareFX\ ..... to fix it just remove the http://u3d.as/content/red-dot-games/glare-fx-dirt-lens-effect/\\

    3. PNG is slower to render in web browser and much bigger in file size for download. People usually don't have patience and if they see some topic with no picture for more than a few seconds they usually move on. It will be quite a shame for this amazing kit not getting much attention if people are just waiting for your images to load and run out of patience! :D So save your images as JPG (Quality of 8 in Photoshop is sufficient enough that's almost indistinguishable to human eyes compare to Quality of 10 or even 12) and the size should be 1/5 to even 1/10 allowing much quicker download and rendering.

    4. Again, do some speed optimization. Right now it feels like not only is this thread loads very very slowly (slow PNG images! BTW - I have 20 mbits connection) and your web player demo is enormous and loading extremely slowly (internet connection is a factor too - I am not sure what connection you are using for your host but I have been trying to load this web player demo for the past 30 minutes and its not even 1/3 of the way through)... these factor can reflect poorly on the product for any prospective buyers.

    EDIT : LOL, its been an hour and the web player is only loading half-way! :D
    EDIT 2: After trying 5 times and waited for over 5 hours, I give up. The web player demo is just loading too slowly.
     
    Last edited: Nov 27, 2012
  11. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    nice, mobile?
     
  12. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    1. I will make another small demo
    2. Ive checked few times and all works good here....
    3. Yes I know PNG is not perfect for web - my bad - I just like to have cristal clear shots. I will convert it on JPG.
    4. Done

    I dont have idea how to check it - Ive got only iOS/Android Basic
     
  13. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    I've added simple scene webplayer and optimized complex scene from 140 to 60 mb :p
    Links in first post
     
  14. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    The screenshots look beautifull. Cant test player now. but looks very promissing.
     
  15. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    This is an issue that unity needs to address, developers just wanting to test assets for release without needing to buy iOS pro or Android Pro.
    You can off course try the 30 days trial of Unity Pro, but once that's over your left with expensive or illegal options.
     
  16. Grizzzli

    Grizzzli

    Joined:
    Sep 28, 2012
    Posts:
    8
    Look cool! This effect should be buildin inside Unity 4
     
  17. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Thanks!

    Any feature requests guys?
    I was thinking to make another shader without halo - sometimes halo is what we don't wanna in this effect.

    I will add it in next update for sure.
     
  18. Quickfingers

    Quickfingers

    Joined:
    Aug 29, 2009
    Posts:
    268
    Just bought this, very nice asset :)

    The built in dirt textures are cool. Any tips for creating our own?
     
  19. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687


    Gonna buy it as soon as Unity Tech pay me this month.
    Could you please show off a demo of how this work together with all other image effects built by UT?
    I am using Unity 4 Pro, does this run just fine over there?
    Also, can the effect be faded in/out?
     
  20. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Buy/find free photos with lens light (start tip : search "bokeh" word in google images) - than work on image levels in PS - and this should simple make its job. Remember that black color in image mean full transparency and white none. Effect is painted on screen in additive blend method.

    Both demos use bloom, antialiasing, color correction and something more so dont worry all works great on top of unity image effects.
    Unity 4 ... really I dont know but should work without problems. If there will be any - I will try to fix it - I only got Unity 3.x Pro

    And yes effect can be faded in/out.
     
  21. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    I'm sold... Gonna buy now before you think about rising the price ;)

    Edit: works just fine on Unity 4, thanks for this cool effect.
     
    Last edited: Dec 2, 2012
  22. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Im glad all works OK :)
    Version 1.1 is going to be available in few days. In new release you can adjust HALO intensity separately.
     
  23. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Version 1.1 is on Asset Store
     
  24. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Any features request? :p
     
  25. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521


    Anamorphic lens flares ?
     
  26. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705


    Horizontal and vertical variations?
    Those can be done - but I think as a separate postprocess effect.
     
  27. Fernando-Pepe

    Fernando-Pepe

    Joined:
    Nov 12, 2012
    Posts:
    4
    Anamorphic lens flares! Very useful.
     
  28. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    OK I will look deep into this
     
  29. Fernando-Pepe

    Fernando-Pepe

    Joined:
    Nov 12, 2012
    Posts:
    4
    hehe, thanks!
     
  30. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    First approach :


    Effect need a lot of work still and because there is no papers for this - I need to figure out all by myself.
    But first step is done :) Now few more and effect will be usable I hope :p
     
    Last edited: Dec 10, 2012
  31. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Ive changed link to image on last post becasue attached image didnt show up :(
     
  32. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Cool to see your progress on the anamorphic flares, one thing that I would add is a custom color correction on the flares, so that for example the flares can be slight blue or purple coloured.
     
  33. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Making flares colored is 5 seconds of work in shader - so be sure this will be available, but first I need make it look very good and easy customizable :)
     
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
  35. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    But doesnt unity already have a hollywood like lens flare effect?? Since 3.5 or so??
     
  36. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Have but compared to glareFX unity ghosting flares look bad ... and have no real usability

    Anamorphic flares which I started now - will be more useful and more easy to setup + will be nice addon to glareFX cause it will use same lens dirty texture to boost gfx effect.
     
  37. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Amm, certainly I wasn't aware of this feature being so limited, never used, just saw the propaganda at release time, but you know what I believe you, this story isn`t new related to new features in Unity.
     
  38. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    comparison between our approach and unity postprocess (which is part of bloom shader)



    Is it look better on screenshot?
    Of course you have few parameters to play with (length of lens, color, texture blend, vertical sharpness etc)
     
    Last edited: Dec 11, 2012
  39. Fernando-Pepe

    Fernando-Pepe

    Joined:
    Nov 12, 2012
    Posts:
    4
    This exemple is perfect!

    Nice progress reddontgames. attempt to create effects parallel to the lens effect. See Look at the video posted 46-49 sec.
     
  40. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    I added some parallel effects - but you cant see it so much on static images. Besides I use blurred texture to avoid post process heaviness (separate texture for halos) so results of this parallel effects are not so spectacular.

    Here is sample blended with dirty lens texture (from glareFx modified)



    Vertical example (parallel effects are red here to illustrate where they are appear):



    Working together with glareFX :



    Post process is quite massive so if I decide I need to place is on asset store as separate product.
    Is it worth to place it out there?
     
    Last edited: Dec 15, 2012
  41. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Now this is interesting, will it be possible to lock the ghosting effect so it moved on X axis only?
     
  42. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Hmmm ok I will think how to do this.
     
  43. Diegoale2000

    Diegoale2000

    Joined:
    Sep 16, 2008
    Posts:
    71
    Whenever I place this script on my player's camera, the camera turns upside down... any idea why that might be happening?
     
  44. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Yes its a know thing. Camera flip in shaders in Forward Rendering and AntiAliasing. I will look into it tomorrow.

    Meanwhile you can just turn off AA and all will be good for now (temporaty fix until I will look into shader).
     
  45. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Its a directx-opengl difference issue, not antialiasing. If you want to fix it, you must add the below check to your vert function
    #if UNITY_UV_STARTS_AT_TOP
    float scale = -1.0;
    #else
    float scale = 1.0;
    #endif

    and multiply your pos.y with the scale value;
    float2(pos.x, pos.y*scale)

    thats it.
     
  46. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    yes I know that and I just forgot to put this in shader, but if you turn off AA the problem will not appear. Thats why I give this fast tip at Diegoale2000. Becasue I need send new version of shader in asset store and it will take some time.
     
  47. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Ive uploaded version 1.3 on asset store. Will be available in few days I hope.
    I added 3 new dirt textures and make shaders more optymized!
     
  48. piercew102

    piercew102

    Joined:
    Dec 24, 2012
    Posts:
    9
    Amazing work on this effect! Just want to make sure before I buy, will this work in unity indie?
     
  49. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    Nope - its post process that uses render to texture so sorry no unity basic. need pro
     
  50. piercew102

    piercew102

    Joined:
    Dec 24, 2012
    Posts:
    9
    Bummer. Aw well, thanks for the quick reply! Seriously considering getting pro for this :)