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

ProFlares - Ultimate Lens Flares for Unity3D [RELEASED]

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

  1. Braddas

    Braddas

    Joined:
    Jun 9, 2013
    Posts:
    25
    Hi David,

    Loving the improved performance in the latest update! However, I'm having a slight issue with flares appearing briefly (just a frame, I think) when I turn my camera towards them, even if they are occluded. I can see on page 3 of this thread that you solved a similar issue already, however that code does seem to be in place in the latest version so not sure what the issue might be.



    Any ideas?
     
  2. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    I'm currently working on an update that has a number of fixes. If you could make me a demo scene of your example I can't test the issue an make sure it fixed in the latest update?

    In the mean time if you turn off the culling system on the ProFlareBatch does the problem go away?

    David.
     
  3. Braddas

    Braddas

    Joined:
    Jun 9, 2013
    Posts:
    25
    Hi David,

    Having the same issue with or without culling I'm afraid. Will try to get a demo scene up and running later if I get the chance.

    Cheers,
    Brad
     
  4. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Thank you, David!
     
  5. Alcolepone

    Alcolepone

    Joined:
    Jan 28, 2013
    Posts:
    30
    With the latest version we seem to get console spam.

    "Shader wants normals, but the mesh doesn't have them".

    with the pro flare setup disabled, the spam goes away. The pro flare shader doesn't need normals, so we're not sure where the spam is generated from. Anyone had similar?
     
  6. mitchtheriault

    mitchtheriault

    Joined:
    Aug 4, 2013
    Posts:
    27
    I love me some optical flares. Can't wait to check this out
     
  7. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154

    Hi,

    Make sure that your ProFlareBatches are using the provided ProFlares shader as this doesn't use any normals.

    Let me know if you have any more issues.

    David.
     
  8. Alcolepone

    Alcolepone

    Joined:
    Jan 28, 2013
    Posts:
    30
    yeap we're using the default pro flares shader
     
  9. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    The only time I get that issue is if I'm searching in the hierarchy, this causes unity to do some kind of overlay on the scene view that requires normals.

    I get the same warning when using NGUI.

    This might be what your experiencing?

    David.
     
  10. Dwarf-Cavern

    Dwarf-Cavern

    Joined:
    Apr 7, 2013
    Posts:
    8
    Hello David,
    I'm a happy ProFlares user, but I'm not a happy puppy these days, because I am in a crunch time and I need access to ProFlare.cs tint color, scale and max distance, but since the site is down for maintainence (for quite a while now) I am unable to access the SDK or manuals to recollect how I can access these parameters via script. So I'm stuck :(

    I'm using JS and I have tried:
    GetComponent(ProFlare) - Unknown identifier
    GetComponent(ProFlareBatch) - Unknown identifier

    So, I'm really stuck and I really need this info rather quickly if possible :( Any help or nudge in the right direction would be greatly appreciated. Or maybe access to the SDK?

    Thanks in advance,
    Best Regards,

    Voja
     
  11. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hi,

    I'm really sorry about the website, the Wordpress install got hacked and my host took the site down. So I think need to do a full Wordpress reinstall.

    I generally try and avoid mixing csharp and js like the plague so I don't have much experience with it, but I think you need to move the ProFlares directory into a plugins folder so unity compiles it before your java script and you can access it.

    I hope this helps a little, if your still having issues let me know and I can try and help.

    David.
     
    Dwarf-Cavern likes this.
  12. Dwarf-Cavern

    Dwarf-Cavern

    Joined:
    Apr 7, 2013
    Posts:
    8
    Hello David,

    Thank you very much for a quick reply and for helping me solve my problem! I've been working long hours so I completely forgotten about the Plugins directory rule. That's what I get for dabbling into the dark arts of mixing JS and C# :/
    Anyway, that solved my problem, I'll just add a clarification exactly what I did for anyone else out that might need it:

    "Dear traveler from the future,
    If you wish to access ProFlare.cs from a JS script, please do the following:
    1. Move "ProFlare.cs", "ProFlareAtlas.cs" and "ProFlareBatch.cs" to the projects PLUGINS folder.
    2. Reference the component as you would any and be a happy puppy.
    3. If you are looking for a specific variable name I find the DEBUG option in the Inspector to be a super fast tool. Helped me find out that "Tint" is actually "GlobalTintColor" in the ProFlare.cs. Or you can simply glance over the Script in question and find your desired variable. This tip is only for rare occurrences when it is not possible to access the ProFlares SDK and you can't wait :)

    P.S. Did we get self-tying shoes yet?"

    Thanks again David for great support and above all, for a fantastic product!

    Voja
     
  13. Alcolepone

    Alcolepone

    Joined:
    Jan 28, 2013
    Posts:
    30
    Ok, we have another issue. This one is quite serious as it causes crashes. :(

    The problem occurs when a ProFlareSetup is made a prefab, and the prefab settings are applied when a Flare is connected to the ProFlareSetup .

    when the ProFlareSetup is then instantiated without the connected flare, a null exception occurs. and the game crashes.
    I can provide a example package if that helps, but it seems to be due to not having correct Null-pointer checks in the code
     
  14. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Hopefully we can work this out, I will pm you a beta version shortly.

    David.
     
  15. Alcolepone

    Alcolepone

    Joined:
    Jan 28, 2013
    Posts:
    30
    No, the beta doesn't fix the issue. :( .I can send you a unity package with a prefab setup in such a way that shows the issue.
     
  16. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    ok, package it up with some instructions on how to replicate the issue and I can hopefully take a look. Hopefully it won't take too long.

    How critical are your time frames?
     
    Last edited: Oct 9, 2014
  17. Alcolepone

    Alcolepone

    Joined:
    Jan 28, 2013
    Posts:
    30
    very critical on the time frames, as we are very near completion of the project.

    I can send you the local code changes we've made to fix some of the issue, to show you where the issues are.
     
  18. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Hi ProFlares,

    I have a serious problem with Brightiness update ...

    I use a LeanTween function to modify Brightness in runtime.

    ""
    LeanTween.value(gameObject, updateHeadlightFlare, 0, 1, 2);
    // LeanTween.value (gameObject, onUpdateFunction, from, to, time)

    void updateHeadlightFlare(float value) {
    headLightFlare1.GlobalBrightness = value;
    }
    ""

    In my case, editor was updated but in game brightness didn't change...

    Any solution please?
     
  19. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi David,

    brought your package, great work.

    An additional Optimization option would be great. "ProFlareBatch (xxx)"

    1) Cab Flare Behind Cam Far Distance [X]
    This should prevent raycasting of flares previously before they came in rage into the far distance.

    Why:
    The raycast works generally out of the far cam distance.
    If you have 10000 flares in front in a large outdoor scenery and the cam is set to 500 meters, all 10000 flares are raycasted.

    Kind regards,
     
  20. jasonoda

    jasonoda

    Joined:
    Sep 7, 2012
    Posts:
    67
    Hey David,

    I am doing a lot of work creating and destroying flares and switching cameras. I frequently use forcerefesh to avoid errors. I also use the switch camera frequently. I had things working for a while, but right now I am constantly getting:

    IndexOutOfRangeException: Array index is out of range.

    ...which always refers something being wrong with the FlareOcclusionData.

    I tried patching things with a if(FlareOcclusionData != null){

    ...but it just cascaded into other problems. Any tips on how to get around this?

    Thank you, great work.
     
  21. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Thank you for pointing this out, I have a fix for this ready for the next update.

    Hi jasonoda,

    I'm really sorry your having this issue.

    Would it be possible for you to send me an example project/demo of the issue? So I can test it with your code and try and get to the bottom of the problem. If you PM me a link to it that would really help me fix the problem.

    Regards,
    David.
     
  22. JulianButler

    JulianButler

    Joined:
    Nov 17, 2013
    Posts:
    15
    Hi David,

    I bought and started using Proflares in a new Oculus project. I see the current Oculus support was built around the 2.5v SDK. Oculus have since renamed the cameras and parent rig in their Unity integration - I managed to update the ProFlaresOculusHelper script to correctly assign the batching regarding the etc but it seems there are other issues during runtime that I can't fix/understand.

    Are you planning on updating your VR support? I'd LOVE to use it in my dev work.

    thanks! And ProFlares kicks ass BTW.

    -julian
     
  23. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    I am also having some difficulties with the new camera in Oculus getting the ProFlares to work.
     
    Last edited: Nov 11, 2014
  24. jasonoda

    jasonoda

    Joined:
    Sep 7, 2012
    Posts:
    67
    Hey David,

    I finally got around to squashing that bug I mentioned earlier. It's rare, but maybe you'll want to take a look at it to improve future versions.

    If you do the following, you get an error.

    make flare 1
    make flare 2
    make flare 3

    turn off flare 2 (using SetActive() on GameObject with Proflare component)
    turn off flare 3 (using SetActive() on GameObject with Proflare component)

    function changeFlare(){

    //Destroy flare 1

    //Make flare 4​

    //ForceRefresh() in proflares batch​

    }

    turn on flare 2 (using SetActive() on GameObject with Proflare component)
    turn on flare 3 (using SetActive() on GameObject with Proflare component)

    function changeFlare(){

    //Destroy flare 4

    //Make flare 5​

    //ForceRefresh() in proflares batch-----> Error here: IndexOutOfRangeException: Array index is out of range. FlareOcclusionData[F]​

    }

    The fix: Under Update Geometry

    add--> if(Flares.Count <= FlareOcclusionData.Length){

    for(int F = 0; F < Flares.Count; F++){

    Then...after Destroy flare 4, forcerefresh, wait a frame, and make flare 5....weird.

    But seriously, proflares is awesome. 5 stars.
     
    Last edited: Nov 13, 2014
  25. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    David... Hope all is well, and wondering if you had a chance to see a few of our questions?

    Thanks for your time.

    Gary
     
  26. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    When using the Unity 5 beta, ProFlares appears to be conflicting with the minimap asset KGFMapSystem.

    If ProFlares Batch is active, some of the KGF map icons are not appearing. At first I thought it was an issue related to flare culling, but it occurs even when there are no flares in the scene. As soon as ProFlares Batch is deactivated in the Inspector, the icons are visible again.

    Any pointers as to what could be causing this? Will ProFlares be supported under Unity 5?

    Also, as the ProFlares website is down, is there an alternate URL for the documentation?
     
  27. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    I ran into similar issues animating Pro Flares values by code and by the Unity Animation system. It looks like the issue is that the custom GUI code for the editor inspector in Pro Flares rewrites updates that value based on the slider position every OnInspectorGUI(). You'll probably need to modify his code (or request a feature) to account for external modifications to this value.

    IMO this is an awesome tool, but it would be even nicer if it played well with the Unity Animation paradigm out-of-the-box.
     
  28. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    Hey guys,
    does anybody know how to make proflares gizmo smaller?
    those opaque spheres block everything for me to see in the editor. I'd like to make them smaller somehow
    Thank you
     
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Doesn't seem updated or cared for been well over a month since last reply ;)
     
  30. sajberek

    sajberek

    Joined:
    Dec 14, 2013
    Posts:
    14
    Just bought it, and it's awesome. But I need it to work with Oculus 0.4.
    Anybody got it working with new Oculus?
     
  31. JulianButler

    JulianButler

    Joined:
    Nov 17, 2013
    Posts:
    15
    No not yet. I want it too. I managed to modify the assignment script to detect the new names for the cameras, but then at runtime things go a little bad. I'm betting David's just taking a break or something and will be back soon - at least I hope so! Or maybe someone with more experience than me can contribute and help us get it working again with the latest SDK etc.

    -j
     
  32. sajberek

    sajberek

    Joined:
    Dec 14, 2013
    Posts:
    14
    Ok... but, on the oculus rift camera scenario, on the flare batch script, the flare camera slot should point to the oculus camera not the flare camera right?
     
  33. sajberek

    sajberek

    Joined:
    Dec 14, 2013
    Posts:
    14
    I guess it's not going to work any time soon ;/
     
  34. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    ProFlares works again under Unity5.0.17
     
    Last edited: Dec 13, 2014
  35. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Still haven't had an answer to my question from November 20 and the developer website is still down.

    Looks like abandonware... :(
     
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    If you haven't yet, PM the dev.

    But yeah ... not looking good. :(
     
  37. ProFlares

    ProFlares

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

    I really do apologies for my absence, Due to some really major changes in my life I've haven't been able to dedicate anywhere near the amount of time to ProFlares as I would like.

    I also know that ProFlares.com has been down for a while, this was due to hacker attacking the site after I requested a ProFlares be taken down from a share file sharing site. They damaged a number of the documents and I haven’t had time to rebuild them.

    I will do my best to get to all of your problems as soon as I can. Starting with updated oculus rift support and official support for 4.6/5.0.

    Again I sorry I’ve let you guys down.

    Best regards,
    David.
     
    OnePxl, daisySa and hopeful like this.
  38. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Hi ProFlares,
    Hope you're doing fine at the moment and glad to see you're back:)
    There are a few good asset store publishers in my book you being one of them.

    It's wonderful to hear that you'll be supporting Unity 5?
    Do you think Unity 5's new deferred path (new G-buffer)brings anything interesting for ProFlares?

    Thanks
     
  39. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    I've had on my wish list for a long time, is to use a depth buffer to do flare occlusion instead of using physics engine. So maybe.
     
    hopeful likes this.
  40. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Yeaaaaa!!!!. The dev is here.
     
  41. JulianButler

    JulianButler

    Joined:
    Nov 17, 2013
    Posts:
    15
    Thanks for letting us know!! Greatly appreciated. Likewise, hope things are ok.
    -j
     
  42. sajberek

    sajberek

    Joined:
    Dec 14, 2013
    Posts:
    14
    ProFlares, do you have any knowledge about when will you make a fix to support Oculus Rift?
     
  43. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    It looks like oculus have made some major changes to the SDK, I will have some time christmas day and boxing day to try and get it working. Hopefully it won't be too tricky.

    I only have the DK1 do you know if its still compatible with the latest oculus SDK?
     
  44. JulianButler

    JulianButler

    Joined:
    Nov 17, 2013
    Posts:
    15
  45. ProFlares

    ProFlares

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

    Here is a new Oculus VR Helper script that should work with the latest Oculus SDK.

    Select your OVRCameraRig, and run the script via the menu - "Window/ProFlares/CreateVRSetupOnSelectedOVRCamera"

    This then creates a single ProFlareBatch, just connect your atlas as normal.

    I still have some more work to do before I can publish an update to the store but I wanted to get this to you ASAP.

    Let me know if this works for you guys,

    Merry Christmas,
    David.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. using System.Collections;
    4.  
    5. public class ProFlaresOculusHelper : MonoBehaviour {
    6.     const int menuPos = 10000;
    7.    
    8.     static int FlaresLeftLayer = 8;
    9.     static int FlaresRightLayer = 9;
    10.  
    11.  
    12.     [MenuItem ("Window/ProFlares/Create VR Setup On Selected OVR Camera",false,menuPos+30)]
    13.     static void CreateVRFlareBatchCamera () {
    14.  
    15.         OVRCameraRig _OVRCameraRig = null;
    16.         GameObject OVR_GO = null;
    17.        
    18.         if(Selection.activeGameObject){
    19.            
    20.             _OVRCameraRig = Selection.activeGameObject.GetComponent<OVRCameraRig>();
    21.            
    22.             if(_OVRCameraRig == null){
    23.                 Debug.LogError("ProFlares - Please Select Your OVRCameraRig");
    24.                 return;
    25.             }else{
    26.                 OVR_GO = Selection.activeGameObject;
    27.             }
    28.         }else{
    29.             Debug.LogError("ProFlares - Nothing Selected");
    30.             return;
    31.         }
    32.  
    33.         Camera[] cameras = OVR_GO.GetComponentsInChildren<Camera>();
    34.        
    35.         Transform CameraLeft = null;
    36.        
    37.         Transform CameraRight = null;
    38.  
    39.         for (int i = 0; i < cameras.Length; i++)
    40.         {
    41.             if(cameras[i].name == "LeftEyeAnchor")
    42.                 CameraLeft = cameras[i].transform;
    43.            
    44.             if(cameras[i].name == "RightEyeAnchor")
    45.                 CameraRight = cameras[i].transform;
    46.         }
    47.  
    48.        
    49.         GameObject batchGOLeft = new GameObject("ProFlareBatch_VR");
    50.        
    51.         batchGOLeft.layer = ProFlaresOculusHelper.FlaresLeftLayer;
    52.        
    53.         batchGOLeft.transform.parent = CameraLeft;
    54.        
    55.         batchGOLeft.transform.localPosition = Vector3.zero;
    56.        
    57.         batchGOLeft.transform.localRotation = Quaternion.identity;
    58.        
    59.         batchGOLeft.transform.localScale = Vector3.one;
    60.        
    61.         ProFlareBatch batchLeft = batchGOLeft.AddComponent<ProFlareBatch>();
    62.        
    63.         batchLeft.FlareCamera = CameraLeft.camera;
    64.        
    65.         batchLeft.FlareCameraTrans = CameraLeft;
    66.        
    67.         batchLeft.GameCamera = CameraLeft.camera;
    68.        
    69.         int layerMaskLeft = CameraLeft.camera.cullingMask;
    70.        
    71.         batchLeft.mode = ProFlareBatch.Mode.SingleCamera;
    72.        
    73.         batchLeft.SingleCamera_Mode = true;
    74.        
    75.         batchLeft.zPos = 1;
    76.     }
    77. }
    78.  
     
  46. JulianButler

    JulianButler

    Joined:
    Nov 17, 2013
    Posts:
    15
    Hi David, yes thank you very much the new helper script worked just fine. It only created the setup on the leftAnchor - I presume this is as it should be.

    We all really appreciate you taking the time to address this, especially at this point in the holiday! I'm home and stuffing my face with christmas food items, ready to test stuff as you get to it.

    -j
     
  47. sajberek

    sajberek

    Joined:
    Dec 14, 2013
    Posts:
    14
    I have a small problem (Oculus).
    I have a scenario with a distant sun flare... Well the sun is really distant :)
    It looks like the mesh is in the place of a flare, and it's size is maximum 2000 (the flare is within the max distance). In my scenario the mesh is so far away that camera don't see it. It works with a flare which is close to the camera.
    Any solutions?
     
  48. ProFlares

    ProFlares

    Joined:
    Nov 1, 2013
    Posts:
    154
    Yes only one ProFlareBatch is required, I'm still experimenting with the new Oculus SDK.

    Hi, If it's only a scale issue with the flare being so far away, you can go into the ProFlare editor script and remove/increase the limit of 2000 to what ever you need.

    In the next update I've added a flag on each flare for its size to be multiplied by the transforms scale which makes it easier to scale up flares when necessary.

    David.
     
  49. hobstob

    hobstob

    Joined:
    Dec 18, 2013
    Posts:
    20
    Any ETA on this update. This helper script is not producing the desired effects...
     
  50. hobstob

    hobstob

    Joined:
    Dec 18, 2013
    Posts:
    20
    Nevermind I was able to get it to work without the helper script posted on this form. I click on the LeftEyeAnchor and went to windows, ProFlares and click on Create setup on selected camera, I also did this for the RightEyeAnchor. Applyed my Atlas, to both right and left ProFlareBatch, and setup for the Pro FlareBatch Mode to Single Camera for both. Placed a flare preset and it worked. If 2000 flare scale is not high enough and you know nothing of how to edit scripts you can still change the scale to a higher number then 2000 by right clicking on the inspector tab and going into the debug settings for the flare. In there you will see Global scale and you can place any value you want. Hope this helps.