Search Unity

ProFlares - Ultimate Lens Flares for Unity3D [RELEASED]

Discussion in 'Assets and Asset Store' started by ProFlares, Nov 3, 2013.

  1. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    ProFlares is really of the highest quality. Its over my price range, but dont take that as a disrespect to your work, the price is right! Us indies have to carefully plan our budget, especially when most of the time we're not getting back our investment. I've sold a couple of assets on the store, i priced them according to my own view... and they actually sold decently, but far less than what i expected (or invested).
    Respect your time and work people, don't sell for peanuts!

    Great work! Keep it up!
     
  2. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Purchased!!

    I've been playing with this for the last hour :) very nice indeed.

    I can see you put a lot of work and care into this.

    @nukeD it's not about him selling for peanuts, it's more about him making more money by lowering the price a bit. I'm not even talking for myself as I'm willing to spend a fair amount on my project and I don't have a small budget so to speak.

    Anyway I'm pleased with the purchase :)

    keep up the great work
     
  3. s3an

    s3an

    Joined:
    Jun 7, 2013
    Posts:
    7
    I love lens flares, they are one of my favorite effects. So this is my absolute favorite asset by far! Great work man and I look forward to the updates!
     
  4. NexGen

    NexGen

    Joined:
    Sep 10, 2013
    Posts:
    51
    Congratulations on the release! This is a must-have for me :D

    Keep up the good work!
     
  5. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Couldnt resist the beauty of this asset and purchased... why do i love lensflares so much (since the ps1 era with wipeout, tunnel B1, etc)

    Thanks for the really good work!
     
  6. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Hey guys, help! i cant make it work :p I follow the simple explanation, yet i'm missing something (sorry for the vague explanation, but i dont have any reference point, in order to explain better). The objects are in my scene (the setup and the flare), they share the same atlas... and nothing happens. I checked the example scenes which work perfectly fine and couldn't find any differences in the setup. The 8th layer is used and named in both projects i tried, nevertheless it doesnt affect the example scenes (they work).
    Please guide me through this examle: I have a directional light which represents the SUN, how do i ad the flare to it?

    Thanks!
     
    Last edited: Dec 15, 2013
  7. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,
    Sorry your having an issue, hopefully I can get you up and running quickly. One thing to mention is that proflares doesn't require any kind of link between lights and flares.

    The basic concept is you add the flare setup and assign an atlas. Then add a flare either by the menu or adding the 'ProFlare' component to a game object. Then assigning it the same atlas as the one the flare setup used. This should automatically connect the flares and the 'ProFlareBatch' component.

    If this is the case you can see that a flares batch is in 'Rendered by' list. Also on the batch node you can see the flare listed. If this is correct you should be ready to start creating your flare. Just hit the add element button to add your first element. It just picks the first element in your atlas.

    If you can't see any connection, something might have gone wrong. First check your flare batch is setup correctly and it has your game camera connected and the flare camera. Also check that the depth of the flare camera is higher than your game camera.

    If all seems correct with your flare setup, try disabling and enabling the game object that your flare is connected to. Inside the OnEnable function inside the ProFlares script it attempts to connect to a batch node if none is connected. Going in and out of play mode should also do the same thing.

    Other simple things to check is the flare being culled by the distance check to camera. Or is it actually inside the Cameras frustum.

    Hope this helps, if not contact me over email proflaresunity ( at ) gmail.com and I will be happy to work out your issues.

    David.
     
  8. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    David,

    Package looks great. Purchased it. I think have everything set up correctly... But how do I connect flares? It shows no connected flares to my setup object.

    Regards,

    Gary
    $Screen Shot 2013-12-15 at 10.21.56 AM.png
     
  9. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    As soon as you add a flare with the same Atlas it should automatically connect to the ProFlareBatch.

    If your dragging in one of the presets they use the "Mega Atlas", which you will need to use on the ProFlareBatch also.

    You can change a flares atlas by hitting editing, then drag dropping the new atlas while its in the scene. If the elements all have the same names everything will be wired up. If not it only takes a moment to reassign the elements.
     
    Last edited: Dec 15, 2013
  10. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    David,

    It is not automatically connecting anything...

    $Screen Shot 2013-12-15 at 10.34.01 AM.png
     
  11. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Any chance to have you contact me on Skype? For a quick hand? I know its asking a lot... but this does not seem to work.

    Iksnoo is my Skype name
     
  12. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Not a problem at all, I will add you now.
     
  13. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Thanks for responding on Sunday man! The issue is understanding it :D

    This part works as intended (i see 'rendered by' and by pressing select i jump to ProFlareBatch, from there i can see 'connected flares' and jump back to the flare). so i guess this part is in order!

    OK, you lost me here. Can i use one of your flares from the demos without having to recreate it from scratch?

    Do you have the time to do a quick and dirty video? A cube a light and 1 flare setup?

    Thanks for your time David!
     
  14. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    David,

    Thanks so much for responding on Sunday and for helping me through the issue(s)!

    Great help and great response!


    If you need lens flares(PRO quality) BUY this asset!


    Regards,

    Gary
     
  15. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    It's really not a problem. Keeping you guys happy is extremely important to me. :)

    Yes, you can just drag and drop one of the example flares into the scene. You just need to make sure that your ProFlareBatch is using the same atlas as the flare you want to use.

    I have noticed a slight usability quirk when dragging in the presets, which is causing them not to be visible immediately. If you drag the flare into the scene then make sure it is inside the cameras view. Then hit play, the flare will appear, when you exit play mode it will still be visible and can now be edited. This isn't the correct behaviour, I will improve this right away.

    I plan on making a series of video tutorials shortly. I will try and get one covering the basics done asap.
     
  16. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    No luck so far. I must be overlooking something really simple. I'll wait for the video, dont worry, i have to finish a model, so there is no hurry.

    Thanks!
     
  17. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    I think I have found the root of the issue, I don't think you have been doing anything wrong. I will submit an update right away, but in the mean time I have a hot fix which will patch the issue and you won't have to wait for the update to go through the asset store approval.

    Add the following line to the Awake function of ProFlare.cs

    Code (csharp):
    1. DisabledPlayMode = false;  
    Also I have found a strange behaviour inside of unity that is worth bearing in mind when dragging presets from the project to the scene. Before dragging, select the prefab ( so it shows up in the inspector) then drag it into the scene. This seems to changes the update behaviour of the script.

    Apologies for any inconvenience caused.
     
  18. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Dont worry, you've been working your ass off! We're grateful!
     
  19. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Code (csharp):
    1. DisabledPlayMode = false;  
    That finally did it!
    I'm beginning to understand ProFlares, amazing work man!
    After adding the flare i have to play the scene so it can become visible in the scene view. Sometimes it works (i can see wireframe planes), sometimes it doesnt, and i cant edit the flare properties without seeing it, also the unity ui becomes a little messy :p That might be Unity's fault not ProFlares, i ve had some stability problems recently. I use Unity Free


    Thanks again for this great tool David.
     
    Last edited: Dec 16, 2013
  20. order66

    order66

    Joined:
    Apr 17, 2012
    Posts:
    150
    Looks promising.

    Are the demo scenes or any other examples included?
     
  21. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Yes, there are the two web player demos included. Also two extra examples one for a split screen setup and also one demonstrating how to use it with a multi camera setup.
     
  22. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,519
    Any progress on this?

    Curious about Rift support for some long term compatibility I'd like to have next year.
     
  23. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Nothing official but initial tests have gone well, all be it with some possible considerations when designing the flares. I plan on spending some time on this over the holidays so I should have more information on this shortly.
     
  24. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi guys,

    I've submitted an update that makes the automatic setup a lot more robust, so flare setup should super smooth.

    Here are the full patch notes.

    ProFlares - v1.02 :
    - Improved automatic setup reliability.
    - Added basic multi select editing to flares. (More properties to be added soon)
    - Added Z position in ProFlareBatch, useful if using same camera as a GUI.
    - Added 'Force Refresh' button to ProFlareBatch. Finds all the flares in the scene and reconnects them.

    Thank you for your support.

    Any issues, just ether pm me or my email is proflaresunity ( at ) gmail.com
     
  25. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Hello David,

    I was wondering about something similar to "dirt on the lens" but to do with the camera lens getting steamed up and then fading out when out of range of an object. is that possible to do? animated?

    oh I'm not making a request just wondering if it's possible with your mad skills :)

    Keep up the great work David
     
  26. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    I guess it would be possible, if you parent the flare to the game camera they won't move when the camera does. The flares use an additive shader but you could swap that out for an alpha blended one. It would just need to use vertex colours as that's how the color data of the flares is set.

    As for animating it you can use the brightness controls as that's just linked to the flares alpha. You could just askes it via the public var using something like HOTween. But it might be easier to just parent a particle emitter to the camera and do it that way.

    One other interesting effect I've found is to add one large flare thats just off screen to add a grade like effect. You can see this in the night setup of the island demo. There is a flare just above the camera that gives the scene an almost volumetric lighting effect. It's also slightly none uniform and subtly rotates.
     
    Last edited: Dec 17, 2013
  27. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Quick heads up,
    The v1.02 update just went live. :)
     
  28. angelodelvecchio

    angelodelvecchio

    Joined:
    Nov 15, 2012
    Posts:
    170
    hi proflares! how are you ? thx for this great asset , folks you can close your eyes and buy this, really worth it!,

    there is just one thing i would like to ask,

    there is anyway you implement a new tab ? for flickering element? would be great !,

    Many thanks
     
  29. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Works perfectly!
    Here is a scene i made with some lensflare overkill :p And i noticed that i don't know how to make the occlusion work. Can you explain a little about that (my models doesn't have colliders).

    Thanks for the update!
     
  30. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Thank you for the kind words. :)

    Yeah I can add that, also I plan on adding the ability to link to a light. Eg, Brightness and color.


    Awesome so glad. :)

    I can't check out your demo yet, I'm away from my computer.

    But I can run through the occlusion system.
    First thing to mention you will need colliders, occlusion works via physics ray cast.

    In the occlusion settings you can use a layer mask, so you can easily set which layers cause a flare to be occluded.

    More occluded options are in the pipeline. Let me know if there is anything inperticular you need.
     
  31. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi guys,

    I have just spent a little bit of time and made a helper script that allows you to flicker the brightness of a flare.

    Download - FlareFlicker.cs

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class FlareFlicker : MonoBehaviour {
    5.    
    6.     public ProFlare flare;
    7.    
    8.     private float tempBrightness;
    9.    
    10.     public float Amount = 0.5f;
    11.    
    12.     public float Speed = 1f;
    13.    
    14.     public AnimationCurve curve = new AnimationCurve(new Keyframe(0,0f),new Keyframe(0.2f,1f),new Keyframe(0.4f,0.2f),new Keyframe(0.5f,1f),new Keyframe(0.7f,0.2f),new Keyframe(0.9f,0.5f),new Keyframe(1,0f));
    15.    
    16.     void Start () {
    17.         flare = GetComponent<ProFlare>();
    18.        
    19.         if(flare == null){
    20.             Debug.Log("No Flare Connected");
    21.             this.enabled = false;
    22.             return;
    23.         }
    24.        
    25.         curve.postWrapMode = WrapMode.PingPong;
    26.  
    27.         tempBrightness = flare.GlobalBrightness;
    28.     }
    29.    
    30.     void Update () {
    31.         flare.GlobalTintColor = new Color(flare.GlobalTintColor.r,flare.GlobalTintColor.g,flare.GlobalTintColor.b, tempBrightness-(curve.Evaluate(Time.time*Speed)*Amount));
    32.     }
    33. }
    34.  
    Just attach it to the same GameObject as your flare, when you go into play mode, the flares brightness will flicker. Use the animation curve to design your style of flicker then adjust the speed a amount for easy adjustments.

    Hope it comes in useful, I will integrate this into the main product in the next update :)
     
  32. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Hi, I just bought your package and I love it but there's one feature missing that prevents me to use it in our project.

    We have a camera that use a Render Texture , how can I apply the lensflares on it?

    I think you could do it with;
    1. A shader that takes 2 rendertexture inputs and overlays them into one material
    Or
    2. Using blit (http://docs.unity3d.com/Documentation/ScriptReference/Graphics.Blit.html) ?

    We don't have a shaders guy in our team and I thought other people might need this feature to use your package.
    Could you provide a solution?
     
  33. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    I'm glad you like the product, but I'm sure I can it working with your setup.

    How are you displaying the final render to texture? If its on something that uses a material/shader option one will be the fastest, and I can knock you up a quick shader. :)

    If you have a barebones scene with your camera/rendertexture setup please PM it me, as it will be really useful for me to have a test case.

    I had a look at some of your development art work, I must say it looks very cool. Cant wait to see it with some nice Sci Fi lens flares. :D

    Merry Xmas.
     
  34. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Hi, thanks for your help and merry Xmas to you too!

    I could make you a repro project but I think this picture explains it better?

    Here is our situation with all its issues (including one I haven't mentioned yet);

    $LensflareIssues.jpg

    First of you need to know we have 3 cameras; One for the world, One for the weapon and one for the scope.

    The texture applied on the lens of the scope is actually a render to texture from the independentscope camera.

    So to be able to use your lensflares we need to overcome 2 problems;
    1. Be able to have lensflares on the scope camera.
    This can be done by having a secondary ProFlareSetup dedicated to the scope camera and apply the lensflare on the rendertexture with a shader like you mentioned above. (On a side note perhaps there are some possible optimisation regarding the 2 proflare setups running for 2 separate cameras?)

    2. Be able to turn on and off a lensflares if it is behind the gun camera (see Exibit B).
    Maybe we can point with the apropriate X+Y values on our weapon camera depth buffer and know if it has a pixel or if it's empty and then enable/dissable the lensflare acordingly? (see Exibit C).

    While 1 is probably not something complicated to achieve, I have no idea if 2 can be done in a cheap way or done at all?

    What do you think?
     
  35. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Firstly here is a shader that can take in 2 Render Textures and outputs a combined image. It's quite simple, one thing I found that you need to change in your setup is on the ProFlareCamera, change its Clear flags to solid colour and pick black. Using this shader and a separate flare setup you should be able to fix problem 1.

    Code (csharp):
    1. Shader "ProFlares/Combine Render Texture"
    2. {
    3.     Properties
    4.     {
    5.         _MainTex ( "Texture", 2D )  = "black" {}
    6.         _OverlayTex ( "FlareLayer", 2D )    = "black" {}  
    7.     }
    8.    
    9.     SubShader
    10.     {
    11.         Tags { "Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" }
    12.  
    13.         Pass
    14.         {    
    15.             ZWrite On
    16.            
    17.             CGPROGRAM
    18.            
    19.             #pragma vertex vert
    20.             #pragma fragment frag
    21.             #pragma fragmentoption ARB_precision_hint_fastest
    22.  
    23.             #include "UnityCG.cginc"
    24.  
    25.             sampler2D   _MainTex;
    26.             sampler2D   _OverlayTex;
    27.  
    28.             struct VertInput
    29.             {
    30.                 half4 vertex    : POSITION;
    31.                 half2 texcoord  : TEXCOORD0;
    32.                 fixed4 color    : COLOR;
    33.             };
    34.  
    35.             struct Verts
    36.             {
    37.                 half4 pos       : SV_POSITION;
    38.                 half2 uv        : TEXCOORD0;
    39.                 fixed4 _color   : COLOR;
    40.             };
    41.  
    42.             Verts vert ( VertInput vert )
    43.             {
    44.                 Verts v;
    45.  
    46.                 v._color        = vert.color;
    47.                 v.pos           = mul ( UNITY_MATRIX_MVP, vert.vertex );
    48.                 v.uv            = (vert.texcoord.xy);
    49.                
    50.                 return v;
    51.             }
    52.    
    53.             fixed4 frag ( Verts v ):COLOR
    54.             {
    55.                 return tex2D ( _MainTex, v.uv ) + tex2D ( _OverlayTex, v.uv );
    56.             }
    57.  
    58.             ENDCG
    59.         }
    60.     }
    61. }
    As for problem 2, I have no experience testing against depth buffers so I may need some time to work it out if this is the only option. But first, do you do anything strange with your world position of your gun and world camera? If not you could add some colliders to your gun and use the normal ray casting solution. These colliders don't have to be used for anything else, as you can use the layer masking feature so they only affect the lens flares.
     
  36. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160

    Hi and thanks for your quick answer and the shader!
    Unfortunately the solution you propose for the second problem is not possible for us.
    The gun is moving all the time (it is hold by springs) and some of them even have animated parts. Any Inaccuracy will have really bad consequences visually ( like what you see on exhibit b.).

    The only possible solution I could think about would be one where we can query the content of a pixel of the rendered frame and if it's 0 you let the flare appear. It's quite hacks and a wired way to put post processing to use but If it's possible it will probably be cheap even with many flares not to mention it will be pixel perfect.

    I suppose to get an answer it will requires someone with shader/post processing knowledge... our weak spot ><
     
  37. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    I've been looking into getting a pixel based occlusion working for your particular problem, and initial tests look positive. :)

    I will PM you a beta version when I have something that is ready for you to test.
     
  38. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Great!

    Can't wait to see this baby working it and know how you did it :D

    Thanks you for your support.
     
  39. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    True, but like you said it's not required in every game so $100, I feel, is a bit expensive for something that isn't really required, it's just eye candy.

    At a lower price I would of bought it without thinking too much about it but at $100 it's hard for me to justify on something I want but don't really need.

    Looks great though.. damn. :)
     
  40. angelodelvecchio

    angelodelvecchio

    Joined:
    Nov 15, 2012
    Posts:
    170
    Many thanks !

    This product worth every penny, and as I can see about this thread, it will get even better !


    Many thanks once again
     
  41. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi guy,

    Hope everyone had a good new year!

    I've just uploaded the first of many videos.

    This one covers the basics of how to add pro flares to a scene.


    Hope this should get everyone started a little quicker.
     
  42. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
  43. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    SOLVED! David helped AGAIN!!! Not the fault of the ProFlares set. It was an order of execution thing. I believe he said he will do a write up!


    David,

    I am requesting a bit of help in regards to using an FPS camera that has bob/shake on it. The Proflares positioning lags behind the main camera causing the Proflares to 'shift' from their correct position. I am attaching a link to a video that showcases the problem. Please let me know if you could help me out either with any ideas you have here or perhaps via Skype, or even if you need a copy of the scene(for testing purposes only) I would greatly appreciate any help.

    Regards,

    Gary Haus
     
    Last edited: Jan 3, 2014
  44. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi Gary,

    This is due to UFPS updating the cameras position after the flares position has been calculated. Both update in the LateUpdate part of the monobehavior.

    To fix this issue you need to modify the script execution order.

    First go to Edit -> Project Settings -> Script Execution Order

    Then hit the plus icon in the bottom corner of the inspector and add 'ProFlaresBatch'.

    Then position it after 'Default Time', If you have any scripts that move the camera already set in this area please make sure 'ProFlaresBatch' is the last in the list.

    As the Script Execution Order is part of a projects settings this couldn't be included in the package. I will add it to the documentation.

    David.
     
  45. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Another quick update.

    Here is a new video covering the Dynamic Triggering features of ProFlares :)


     
  46. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Love it and haven't seen this anywhere else. Nice work!

    No pressure intended, but do you have some news concerning the pixel based occlusion for 2 camera setups?
     
  47. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    David I had this dream last night that you was making an awesome dirty lens filter!!

    is there any connection with my dream and reality? :p
     
  48. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    If you could PM me a little demo of your cameras and render texture setup? As it would help me understand exactly what you exactly require, plus we can talk more in depth.


    It is true, and its looking very cool!

    I've also managed to put some of the math in the vertex shader so it should be really nice and fast too. :)

    I do need to spend some time creating some great looking lens dirt textures that I have rights to distribute.
     
  49. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Alright great, I'll prepare this for you tomorrow.
     
  50. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    143
    hi David,
    any words on oculus integration ? :)