Search Unity

ProFlares - Ultimate Lens Flares for Unity3D [RELEASED]

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

  1. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    It's something that I'm still actively trying out, but as hippocoder pointed out that I need to copy the frame buffer into the cpu memory pool to access the information needed to perform the pixel based occlusion. Which would be very slow on mobile and I'm not sure about the impact on desktop. I imagine that it would get slower based on the resolution of the frame buffer.

    One option I'm also experimenting with is using a two camera setup, first camera for the sky and then the second for everything else. I could then use the second camera to occlude the sun lensflare per pixel. This could also work in a FPS style game where the players gun needs to occlude flares per pixel.

    I'm open to suggestions on this one.

    Regards,
    David.
     
  2. insiderrr

    insiderrr

    Joined:
    Feb 24, 2014
    Posts:
    50
    I got a problem using this asset in combination with the oculus rift DK2. When i unzip the oculus file the asset gets broken,:

    Assets/ProFlares/OculusRift/Editor/ProFlaresOculusHelper.cs(21,17): error CS0246: The type or namespace name `OVRCameraController' could not be found. Are you missing a using directive or an assembly reference?

    When i select the pro flare in the menu bar it does not show a VR rift setup for teh camera rig.

    This asset is probably out-dated for the rift, is this going to be fixet ?
     
  3. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    This is because the Oculus SDK changed, I posted a hot fix in the forum here -

    http://forum.unity3d.com/threads/pr...r-unity3d-released.208695/page-7#post-2047922

    This will be included in the upcoming update.

    David.
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    I downloaded the latest update (very happy to see it, BTW!) and on import I ran the demos. Right away I noticed a problem with the ProFlaresLeavesShader:

    Shader error in 'ProFlares/Demo/LeavesShader': variable 'c' used without having been completely initialized at line 208 (on d3d9)
    - and -
    Shader error in 'ProFlares/Demo/LeavesShader': variable 'c' used without having been completely initialized at line 208 (on d3d11)

    Other than that, so far as I could tell the demos were working fine. :)
     
  5. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Wow that went out fast, I only submitted last night. It used to take a few days for updates to get approved.

    I develop on a mac, so the shader error must be to do with a directx issue, I will add a fallback shader.

    Thanks,
    David.
     
  6. Aberdyne

    Aberdyne

    Joined:
    Mar 17, 2015
    Posts:
    64
    I've just tried ProFlares on iOS by building the demo from the package. I was surprised not to see any flares, am I doing something wrong?
     
  7. ProFlares

    ProFlares

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

    I've just looked into this and there does appear to be a problem with flares using occlusion when used outside of the editor. I will sort this ASAP.

    Really sorry for the inconvenience.

    David.
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    There is no need to add fallback shaders for a trivial issue of syntax. It just means you should set the variable fully including any properties you don't use. As I understand it your fallback would be inferior for no reason?
     
  9. ProFlares

    ProFlares

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

    I realise it wasn't ideal, I just didn't have the ability to test the fix. So it would be a fail safe to avoid pink trees.

    David.
     
  10. Aberdyne

    Aberdyne

    Joined:
    Mar 17, 2015
    Posts:
    64
    Ok thank you for the quick answer!
     
  11. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    No Problem, a fix is now live on the asset store.
     
  12. Aberdyne

    Aberdyne

    Joined:
    Mar 17, 2015
    Posts:
    64
    ProFlares I wanted to thank you for saving my day. I actually only had the time today to test your fix which indeed solved the problem of no flares on iOS. By the way, this is the first time I use it and am very pleased with the result. Nice work!
     
  13. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    3 question please ?
    it's use canvas ?
    it's can be use for make laser ?
    or lifebar ;)
     
  14. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    For something like flare occlusion you could actually use a pretty low resolution buffer- no real need for a full resolution buffer to figure out your occlusion.
     
  15. Aberdyne

    Aberdyne

    Joined:
    Mar 17, 2015
    Posts:
    64
    Is there something special to do when you change your viewing camera except from changing the Game Camera on ProFlareBatch? Currently I'm trying to do just that so that flares works correctly with the other camera but raycasting still seems to be done from the previous camera position. I tried to call ForceRefresh but it doesn't seem to be the solution. Meanwhile I'll dig in the code...
     
  16. Aberdyne

    Aberdyne

    Joined:
    Mar 17, 2015
    Posts:
    64
    Oops I must call SwitchCamera for the cached transform to be updated!! Sorry for that...
     
  17. Konst

    Konst

    Joined:
    Aug 26, 2013
    Posts:
    78
    Hello everyone! I have a question: Does ProFlares have "Directional" toggle or option like standard LensFlare? Image attached
     

    Attached Files:

  18. RubyLux

    RubyLux

    Joined:
    Apr 24, 2014
    Posts:
    5
    I got this package and i've been using it with unity 5.1, but i'm a bit frustrated trying to animate flare components (scale/size/tint/rotation/fade) to go with choreographed events and animations.

    *When keyframing specific flare editor components, they dont tint red in the inspector as expected, so things like color picker to adjust global tint color don't update anim keys. Inspector changes for your flares don't update into anim keys.

    *I have had cases where a flare will suddenly break and no longer render in the scene or game view that I was trying to assign animation properties+keys to.
    Removing the animator component+animation from it doesnt make it render normally again. There seems to be a failure someplace failing to rebuilding the flare geometry correctly.

    Q: Are some of these flare components not meant to be animated? If so could the reasoning on that be explained and document which are/aren't allowed?

    Q: Is there an area in a source where I can just force the flare geometry to be rebuilt if I want to animate the global settings or specific flare subcomponents at runtime?

    At the moment I have very mixed feelings about this plugin since its acting strangely or breaking when I try to animate it.
    I need to be able to reliably control its parameters in an animation w/ dopesheet+curves to sync it up with animated models.
     
    Last edited: Jun 12, 2015
  19. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Yes ProFlares supports directional flares, it also has way more controls for adjusting the flare base on angle to the camera and distance to the camera. Plus way more check out the dynamic triggering video that shows of how flares react to the edge of the screen.





    Hi Xira,

    You wouldn't need to do a force update to have the flares animate. The GlobalFlare settings can be animated as they control the overall look of the flare and are processed every frame.

    To try and get an idea on what might be going wrong. I tried to recreate it in unity5.0, and it looks like Unity animation systems have been updated without me realising. I will do a little more research and get back to you.

    David.
     
  20. Konst

    Konst

    Joined:
    Aug 26, 2013
    Posts:
    78
    Thank you for the answer, but i still dont get how to make flare follow directional light. In my scene i have a directional light as a sun, and id like to use the flare on it. Unity's original lens flare provide a toggle to make it work, so can you please explain how to do same effect with ProFlare. I believe it must be simple.
     
  21. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    I now understand your requirement, if you parent the ProFlare to your directional light. Zero it's Position and Rotational values. Then move it in negative Z until it is further from the camera than any of your objects. This should get you result you require.

    I will look into adding a simple option for a 'Sun Mode'.

    David.
     
    Konst likes this.
  22. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi again Xira,

    I've been looking into issues. If your animating scale use GlobalScale, but if your wanting to adjust its brightness target the alpha of GlobalTintColor instead of GlobalBrightness as this just gets plugged into the tint alpha.

    ProFlares uses custom inspectors to make editing flares manageable, this makes it difficult for the inspector to react to the animation keyframes. If you turn the inspector into debug mode(control next to the lock to right of inspector) it disables the custom inspector and shows you all the raw data and highlights animated properties.

    Let me know if your still having any problems and I can try and help.

    David.
     
    RubyLux likes this.
  23. crudeMe

    crudeMe

    Joined:
    Jul 8, 2015
    Posts:
    92
    ProFlares likes this.
  24. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    Looks very clean and professional, but still way, waaaaaaay too expensive friend.
     
  25. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    143
    Asset is amazing.
    You think it's expensive, i think it's cheap.....
    Many assets are not updated to U5, this one have full dev support, it's worth the money ;)
     
    ProFlares likes this.
  26. fiercebrosnan

    fiercebrosnan

    Joined:
    Aug 3, 2015
    Posts:
    1
    Hey guys, I used ProFlares on a game last year and it ran like a dream. Now that our studio is running Unity 5 on a new project however, I'm having issues getting the flares to display in runtime.

    I'm using a default setup with the basic atlas and flare - the flare shows up fine in the game window and can be tweaked to hell, but upon hitting "play" it vanishes. I have played around with culling, layers, depth and pretty much everything I can think of but to no avail. I thought perhaps the camera was being turned off by a script but that doesn't appear to be the case.

    Unfortunately I can't share anything about the project as it's in early development but I was wondering if somebody had experienced this and knew of a fix? Cheers!

    EDIT - in this case (as an FPS) the player collider surrounded the camera and was culling the lens flare. Possibly something to watch out for!
     
    Last edited: Aug 5, 2015
  27. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    143
    Got some black screen problem in builds. ( deferred/linear, VR support enable). work fine in foward mode...
    Using 5.1.2f1 + OculusUtilities_0_1_0_beta.
    Do you have any idea ?

    Also got lag problem on lens flares position. ( but ProflareBatch script execution order seems good ( before OVR manager))
     
  28. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    I will take a look, is it only a problem with vr support enabled? Oculus love changing their sdk, might have broke something again.
     
  29. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    143
    Hi,
    have you been able test last oculus sdk ?
    vr enabled work fine in foward, but not deffered.
    Havn't test without vr ...
     
  30. MalcolmWashington

    MalcolmWashington

    Joined:
    Jul 16, 2015
    Posts:
    12
    how can I put ProFlares effect to directional light's flare field.

    I did the directional light the sun. directional light rotate like the sun. because of that I just have to use Prolight's flares.
     

    Attached Files:

  31. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    I've been having problems with my DK1 with the latest sdk so I will bite the bullet and order a DK2.

    It looks like your just using standard flares. It's possible to make ProFlares work like a sun by parenting the flare to the directional light and then moving it away from the origin in negative Z.

    It's on my list to implement a sun mode that will make this much easier.
     
  32. f4lke

    f4lke

    Joined:
    Dec 29, 2013
    Posts:
    35
    Hello there,
    i just imported the newest version from the assetstore in a vanilla project and your demo scenes don't have any flares in it. Also, the shaders are broken: The trees are pink, the rock white. Is this a known bug with 5.2?
     
  33. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,
    I will check into any issues with 5.2, out of interest are you running on windows or OS X?

    Also are you just having problems with the demo scenes?

    David.
     
  34. jocyf

    jocyf

    Joined:
    Jan 30, 2007
    Posts:
    288
    Hi,

    Does the flare occlusion works with 2d colliders? I wanna use it in a sprite made world.
     
  35. Nimred

    Nimred

    Joined:
    Nov 1, 2014
    Posts:
    46
    Hi, I'm wondering if this asset is right for my game, but I haven't been able to reach the asset developer to answer a few questions.

    Perhaps someone else here can help?

    Basically I can't use Unity flares or EasyFlares Pro because they don't support setting flares in different layers, or rendering different flare layers in different cameras at the same time. I'm making a space game with distant stars as little flares, and nearby stars as big flares, so this is necessary for me. Does ProFlares support it?

    Another question is how performant ProFlare is with 4000 little (similar) flares simultaneously. Unity flares seem to be OK rendering wise, but they trigger 4000 raycasts a frame that cannot be disabled, for some reason.

    Michael
     
  36. Gozdek

    Gozdek

    Joined:
    Jun 21, 2015
    Posts:
    356
    Very nice work!
     
  37. ddf

    ddf

    Joined:
    Jul 9, 2011
    Posts:
    54
    So I've just updated to Unity 5.2.1p2 and have started using the integrated VR support. I'm having trouble configuring the settings to get it looking right. It seems like using Standard mode makes sense here, but flare positions are not correct in that mode. Has anyone been able to get this to work yet? I should also note I'm still on V1.05.
     
  38. kypo9

    kypo9

    Joined:
    Oct 5, 2015
    Posts:
    6
  39. kypo9

    kypo9

    Joined:
    Oct 5, 2015
    Posts:
    6
    any one else in the same position you need to change the vert function name so they don't conflict:

    Shader "ProFlares/Textured Flare Shader"
    {
    Properties
    {
    _MainTex ( "Texture", 2D ) = "black" {}
    }

    SubShader
    {
    Tags { "Queue"="Transparent+100" "IgnoreProjector"="True" "RenderType"="Transparent" }
    Pass
    {
    ZWrite Off
    ZTest Always
    Blend One One

    CGPROGRAM

    #pragma vertex vert
    #pragma fragment frag
    #pragma fragmentoption ARB_precision_hint_fastest
    #include "UnityCG.cginc"
    sampler2D _MainTex;

    struct VertInput
    {
    half4 vertex : POSITION;
    half2 texcoord : TEXCOORD0;
    fixed4 color : COLOR;
    };
    struct Verts
    {
    half4 pos : SV_POSITION;
    half2 uv : TEXCOORD0;
    fixed4 _color : COLOR;
    };
    Verts vert ( VertInput vertData )
    {
    Verts v;
    v._color = vertData.color*(vertData.color.a*3);
    v.pos = mul ( UNITY_MATRIX_MVP, vertData.vertex );
    v.uv = (vertData.texcoord.xy);

    return v;
    }

    fixed4 frag ( Verts v ):COLOR
    {
    return tex2D ( _MainTex, v.uv ) * v._color;
    }
    ENDCG
    }
    }
    }
     
  40. indeterminatus

    indeterminatus

    Joined:
    Jun 4, 2014
    Posts:
    2
    I'm on the latest version of both Unity3D (5.2.2f1) and ProFlares (1.081).

    Overall, your asset works like a charm and I certainly do not regret my decision to get it!

    Recently, I am stumbling across several exceptions (both in Editor mode and in Play mode).

    (13:48:02.2110)
    Exception:
    NullReferenceException: Object reference not set to an instance of an object

    StackTrace:
    ProFlareBatch.UpdateGeometry()
    Assets/ProFlares/Scripts/ProFlareBatch.cs: line 1169
    ProFlareBatch.UpdateFlares()
    Assets/ProFlares/Scripts/ProFlareBatch.cs: line 354
    ProFlareBatch.LateUpdate()
    Assets/ProFlares/Scripts/ProFlareBatch.cs: line 344

    It may be worth noting that the Island Demo appears to be broken as well (but I cannot tell since when exactly). The LeavesShader yields flat purple (no errors in the log), and no flares are visible at all. The other demo scenes appear to be working just fine. I already did a fresh import (i.e., deleted the asset's folder, imported again), but to no avail.

    Unfortunately, I cannot send you my scene or current setup, but I am quite willing to help you track this issue down. Do you have a suspect, is there anything in particular that I could try (like logging something) to get to the root of this?
     
  41. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi,

    1) I have so trouble after compiling any script in Unity 5.3.0f4.
    A lot of warning occur each time.
    Untitled-1.png

    2) "ProFlares/Demo/LeavesShader" Error: variable fixed4 c; was not initialized
    Cause pink trees after a fresh ProFlare project init. fixed4 c = 0; fixed it.
    Line 195;

    Untitled-2.png

    3) Linear vs gamma cause pretty dramatic flare difference. Flares become weak and pale. You can fix this in your shaders via pow(rgba, 2.2) (or elementary faster with pow(rgba, 2.0)) or pow(rgba, 0.454545) depending on the current lightning mode. I'm very sure this will compensate the linear trouble.

    gd.png

    4) forward vs deferred cause the scene to become completely white. Seems _ControlsCamera = disable seems to fix this. But I have no idea if its cause any other issue or fail.

     

    Attached Files:

    • def.png
      def.png
      File size:
      86.5 KB
      Views:
      1,322
  42. ProFlares

    ProFlares

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

    1, I'm looking at dropping Unity 4 support soon as its becoming to time consuming to support. As you can see some deprecated undo functions are needed. Also supporting the updated VR modes is becoming increasingly difficult.

    2, Thanks for the fix, strangely this shader compiled fine for OS X which is my only development platform.

    3, I will look into adding a linear shader.

    4, The shaders are quite old for these demos, As soon as I update the package to unity5 I will update the demo scenes to use the standard unity shaders.

    Regards,
    David.
     
  43. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    I cannot believe after all this time it's still $80 my man. It's.... lens flares. Very, very good looking lens flares, but lens flares. You put this up years ago - Do you really feel like you'd be losing out if you listed it for $20?
     
  44. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    @DivergenceOnline : It's the price he believes it's fair. Not everyone needs to race to the bottom. If it's too expensive for you, don't get it., simple :)
     
    adhdchris and ProFlares like this.
  45. knotFF

    knotFF

    Joined:
    Apr 13, 2013
    Posts:
    66
    I am interested in your asset, but I have a question.
    Is it possible to implement this asset into a dynamic sky system?
    For example, having a flare for mourning, maybe increasing the effect at midday and let's say changing the flare by night? (Also a cloudy day should have a different composition to the effect).
     
  46. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    Does this have any problems with Unity 5 or is it just not updated to take advantage of any new features?
     
  47. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    It's possible to link the flares to a dynamics sky system, It doesn't do it out of the box though. You would have to position the flare to match your sun. You can animate via scripts, brightness, size and colour quite easily. If you want a totally different style of flare you could have two or more flares setup and blend between them.

    The package works with Unity5, there are no features that require it. I do need to update the demo scenes to Unity5 shaders.

    I plan on dropping unity4 support soon, as Unity3D are putting out the last version of it soon. I will still be able to supply Unity4 versions via email.
     
  48. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    So I did a quick search on ProFlares and Cardboard(VR), I see Oculus Support, and I've tried setting the relevant layers for the cameras that are used by cardboard, but I can't get them (flares) to properly show up, they show up behind the rendered / left right eye. A Quick Tutorial would be nice, you can get the .unitypackage here : https://developers.google.com/cardboard/android/download and you don't need a cardboard to test it, it will play in the editor, and you can look around while using the "alt" button on the keyboard.
     
  49. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    Thank you for the link, I've had a play with the demo scenes that they provide. It's quite simple to get it working. I tested it unity 5.2.2. You don't need the Oculus extras for this to work.

    1. Select the Main Camera, under the CardboardMain.
    2. Then from the menu bar select, 'Window > ProFlares > Create Single Camera Setup On Selected Main Camera'
    3. Select the newly created ProFlareBatch, drag and drop a atlas into the Flare atlas slot.
    4. Change Mode from single camera mode to VR mode. (This allows you to control the depth of flare elements)
    5. You can now drag flares that belong to correct atlas into the scene.

    Let me know this helps.

    Regards,
    David.
     
  50. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    Confirm, that works :D Thanks !