Search Unity

Foggy Lights

Discussion in 'Assets and Asset Store' started by DavidMiranda, Apr 8, 2014.

  1. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Any ideas author? I cant get past these errors... Also unity 4.6.1
     
  2. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Im not having any issue. I have tested with 4.6.1 and a new empty project, everything works fine. What's your OS?
    2015-01-25_11-00-46.jpg

    Have you tried deleting and reimporting again?
     
  3. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Ive reimported and deleted many times...win7. The demo scene works with no issues, it must be conflicting with something else. Ill have to go through one by one and see whats causing it.
    Foggy lights are too awesome to not figure it out, its actually a big part of my games look :)
    Thanks
     
  4. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Its odd... the sample plays fine. I add foggy lights to a scene, I get the errors. I delete everything but the new foggy lights, still errors. any ideas? The sample folder is in the same project...
     
  5. Korok

    Korok

    Joined:
    Dec 19, 2011
    Posts:
    179
    this thread reminds me of Silent Hill somehow :rolleyes: BTW great effect I'm gonna buy it
     
  6. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I've got a problem when trying to use Foggy lights with Unity 5 beta 21. It works ok if I am in DX 11 mode, but if I switch off the DX11 flag I get the following shader compilation error:

    Shader error in 'Hidden/FoggyLight': variable 'o' used without having been completely initialized at line 47 (on d3d9)

    Compiling Vertex program

    I'm not sure which beta this error first started with, since I only recently had cause to disable DX11 mode. Any ideas?

    Cheers
     
  7. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Looks like i accidently got it working by deleteing the folder, opening a level with existing foggy lights, importing foggylights asset and fix a foggylights missing script.
     
  8. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I'm seeing this in Unity5 Pro, dx11.. any ideas?
    thanks

    Shader error in 'Hidden/FoggyLight': variable 'o' used without having been completely initialized at line 47 (on d3d9)
    Compiling Vertex program
     
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    I would try with "UNITY_INITIALIZE_OUTPUT" and also the DX11 syntax is a bit more strict, so you have to explicitly declare sizes etc, so check also for non explicits
     
  10. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Any chance that could be fixed up and released? Im not a shader programmer...
    Thanks!
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    I dont have the asset, so i cant provide an exact solution.
     
  12. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    No problem, hopefully the author will see it. Thanks!
     
    nasos_333 likes this.
  13. zbrusher

    zbrusher

    Joined:
    Dec 12, 2012
    Posts:
    19
    Yes same here !!! I would love this little issue to be fixed.
     
  14. kasulogamestudio

    kasulogamestudio

    Joined:
    Mar 22, 2012
    Posts:
    130
    We are also using this plugin. We have another problem: if I put the FoggyLight in a object, a prefab one, and I apply this prefab to change, all other prefabs that exists on scene copies the foggy light, but with no material (foggy light has that damn "hidden material" or something, it does copy from prefab to prefab). The only way to fix this is if I copy the object by hand and position again on scene...
     
  15. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Hey guys,
    Sorry for not being active. I've had some holidays after the GDC madness.
    Its fixed now on dx9

    Obviously, parameters will be applied to every instance. It has nothing to do with material but with script parameters.

    Asset submitted, stay tuned.
     
  16. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I just updated to the latest version, Im in unity 5.0.0f.
    I just have to say what an awesome piece of art tech this is, its amazing what it can do for my game.
    Thanks!

    Any ideas? I can still editor play and build but getting these after export. (not seeing them in editor play)

    NullReferenceException: Object reference not set to an instance of an object
    FoggyLight.OnEnable () (at Assets/FoggyLights/FoggyLight.cs:63)
    UnityEditor.HostView:OnGUI()
     
  17. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    What do you mean with "export"?
     
  18. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I meant post build. When I do a build, I see these asserts/errors in unity, I can still Build.
     
  19. Speedrun-Labs

    Speedrun-Labs

    Joined:
    Aug 1, 2014
    Posts:
    16
    I noticed it says "requires Unity Pro" on the store page. Does it still require pro in Unity 5?
     
  20. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    I don't know if _CameraDepthTexture is still a pro feature. If so, then yes.
     
  21. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    It probably does not, all image effects are now available in Unity 5 Personal.
     
  22. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    That sounds good!
     
  23. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    I have made some build today and Im not getting any error.
     
  24. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    ok thanks, I'll dig deeper and see if its a conflict in tools. Thanks for looking into it!
     
  25. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    Hi David. When I place a large foggy light source in a scene with the sun shafts image effect and place the foggy light between the camera and the shaft caster point I get a strange artefact. Large glowing shafts of light seem to be emitted from the foggy light. I don't want the sun shaft image effect to interact with the foggy light at all.

    Any thoughts on why this may be happening?
     
  26. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Sun shafts as a postprocess is.... a bad thing. Try Sunshine ;)
     
  27. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    Quick question: in Unity 5.1, are Foggy Lights visible though default Unity fog? Or do they only shine through the Fog Volume asset?

    It seems some people earlier in the thread had problems with foggy lights showing through solid objects as well, though I don't know if that's been fixed (either in the asset or in Unity 5).

    Anyway, just curious if foggy lights will show in the distance through default Unity fog, or if they require Fog Volumes.
     
  28. STARFLEETJUNKY

    STARFLEETJUNKY

    Joined:
    Feb 18, 2013
    Posts:
    7
    foggy lights.jpg
    HI

    We have an issue with foggy light s passing through solid objects. We have tried altering offset, though by the time it is no longer visible through the walls it in no longer has much of an effect.
     
  29. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Hi David_MG, is this asset able to create black light or a volume of shadow/darkness? I remember you mentioning before that your Fog Volume can be made dark but I am wondering if this is a better option.
     
  30. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    It is visible through default Unity fog but not faded by distance. Maybe I should add an option to fade them by distance?

    What kind of shader are you using for the wall and lamp?

    Ah, its not possible because the shader is additive. I would have to add an option to render it as alpha blend so you can use black color. Do you need that?
     
  31. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    I have found many posts on Unity Answers/Forums asking for how to achieve blacklight, or a volume of shadow. If you could pull something like this off I think you would find many happy customers. I haven't seen any other asset that can achieve this yet.
     
  32. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Thanks for the idea. I have included an option to switch between these 2 blend modes. You can get now black ones.
    2015-10-29_12-54-03.jpg
     
    Hamesh81 likes this.
  33. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Great work! I will be purchasing this :D
     
  34. thog

    thog

    Joined:
    Dec 9, 2012
    Posts:
    4
    I too am seeing the lights through objects. The objects are using the standard opaque shader. I see that it depends on the distance between the light and object (I'm just using primitive cubes to test). At a certain distance relative to the light's offset, the light begins to show through. Version 1.04.
     
  35. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Are you sure? I don't see any isue with distance
    foggy-light-distance.gif
     
  36. D-Coy

    D-Coy

    Joined:
    Jun 2, 2013
    Posts:
    16
    Hi David, this looks like an awesome tool, I am wondering, however, if youre any closer to enabling this with spotlights? I know this has been mentioned earlier, but not sure if youre working on it.
    thanks!
     
  37. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Hi,
    It should be possible. The main problem is to find the time for it :) I have accumulated work for the rest of the year o_O
     
  38. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Hi David, just a quick question in regards to the alpha blended functionality. I would like to create tall shadow volumes (like a beam of light except a beam of shadow). I have managed to create the exact look that I need by stacking multiple foggy lights on top of each other. Please see below:
    Screenshot - 06 04 2016.png
    This is fantastic except that each foggy light adds another set pass call. Is there anyway that I can scale one foggy light along the y axis to create an effect similar to the above? Using the properties in the component I can make the foggy light larger on all axes, but that would darken the entire room, instead of creating a narrow volume.

    Any ideas on this?
     
  39. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    The idea is that (in my opinion) that's not the correct approach. I would go for a fog cylinder.
     
  40. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Ok sure, is it possible to do such a cylinder with foggy lights? Or can it be done with your fog volume asset for example? I really like the gradual falloff that the foggy lights shadow has, and previously when I used volume/shape based fog it created a fairly hard edged shape.
     
  41. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Maybe you can simply write a shader that does: sceneDepth-pixelDepth so you get fog from a geometry shape.
     
  42. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579

    im getting this white sphere instead of normal effect, what should i do?

    also this error

    NullReferenceException: Object reference not set to an instance of an object
    FoggyLight.OnWillRenderObject () (at Assets/FoggyLights/FoggyLight.cs:101)
    UnityEditor.DockArea:OnGUI()

    im on Unity 5.4.b22
    i added
    Renderer = GetComponent<Renderer>();
    before line 101, error gone, however the foggy light doesnt show anything now,
    not even the white sphere. just nothing.

    Ok now i can see the foggy light ONLY if i move reaaaaally close to it, otherwise it doesnt show anything.
    It is really frustrating that in your scene it works perfectly, but if i literally make a prefab and put into my scene it doesnt.
    Like whats the deal there?
    ok i had to clear lightmap data (HOW IS THAT EVEN)
    and now it works. I took a look at the code and you do getcomponent all the time where you could cache it once at the start of the method, not that it matters for editor code but still.
     
    Last edited: Jun 25, 2016
  43. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    Oh man. Ok now this is something you have to fix - if i create a prefab out of foggy light and put a lot of them in scene, and then i change one and hit apply - it goes haywire. Errors, lags, pink colored spheres instead of lights.

    After unity restart it works, but you know, thats not a good thing.
    Basically any change of prefabbed foggy light = broken


    Alright so its is unusable in production due to following:

    1.seems to have fundamental flaw with serialization, because prefabs with it become randomly corrupted.
    2.
    DOES NOT WORK WITH LIGHTMAPPED LEVELS.
    which basically means its not usable.
    Its a shame, since it looks good.
     
    Last edited: Jun 25, 2016
    AlteredPlanets and hilllo like this.
  44. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    to avoid error messages add a check if the Camera.main exists, because in my scene it doesnt, since all cameras are isntantiated on runtime.
     
  45. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Hi. I have made the camera field public. If your camera is deferred, then you shouldn't put anything in there. This is only to tell it to generate the depth texture. You can also forget this and add a script to the camera to do that. If you have shaderforge, you will find a script designed for this.

    About the prefab thing, I have tried to break it, but it works for me every single time. Well, lets see if if you still have the problem with the next update, Im about to upload it. Stay tuned and mail me if you have any problems.

    I have added some stuff for 1.06:
    • Adjustable intersection range
    • Optional tonemap
    • MainCamera is assigned by default (if found). Otherwise, does nothing.
    Requests are welcome.
     
  46. flywoof

    flywoof

    Joined:
    Oct 18, 2016
    Posts:
    2
    Hi, Just wondering why the foggy light can pass through the wall. Iam using version 5.3.3
     
  47. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Is the camera generating the Depth Texture?
     
  48. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Hi, I have found this well done foggy lights, but I wonder if this can be used for mobile games, as I do not think that it could be possible, as it might get many resources probably.

    Please, Have anyone tested it on mobile?

    Thanks for any help
     
  49. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Hi, I used it in a project. Tested on a weak samsung S5 and worked pretty well. Foggy Lights is not specially expensive, it is just a transparent shader with few operations and one texture sampler (Scene depth)
     
    SpaceRay likes this.
  50. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Thanks for your help and for the news that you have tested it on mobile and it did work, at least on a Samsung S5.

    I will read the documentation, but I wonder if these foggy lights needs and is required to have active the unity fog (the one on the lighting window) or how is the fog of the foggy lights works?

    thanks for your help
     
    Last edited: Nov 9, 2016