Search Unity

True Volumetric Lights (Now Open Source)

Discussion in 'Shaders' started by Michal_, Mar 10, 2016.

  1. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    it is working in 5.6

    thanks again michal for this great asset!
     
    tolosaoldfan and Michal_ like this.
  2. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Sorry for the delay. It is working on my side (unity 5.6.0f3). Can you give me more information?
     
    Alverik likes this.
  3. sloopernine

    sloopernine

    Joined:
    Nov 13, 2012
    Posts:
    9
    Cant get it to work in 5.6 either, works with playmode in editor but not standalone build
     
  4. Dor770

    Dor770

    Joined:
    May 25, 2015
    Posts:
    7
    I am having trubles with bouth the volumetric lighting (master) and the light shafts (master) in the Unity 5.6.0f3.
    I can't use them iven in the editor..
    when I load any example scene in the volumetric lighting foulder, and run it; the effects can not be seen, and I get these errors:

    RenderTexture creation error: D3D9 only supports 2D or CUBE textures


    UnityException: SetTexture failed
    UnityEngine.ComputeShader.SetTexture (Int32 kernelIndex, System.String name, UnityEngine.Texture texture) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ComputeShaderBindings.gen.cs:109)
    VolumetricFog.SetUpForScatter (Int32 kernel) (at Assets/VolumetricLighting-master/Assets/VolumetricFog/Scripts/VolumetricFog.cs:461)
    VolumetricFog.Scatter () (at Assets/VolumetricLighting-master/Assets/VolumetricFog/Scripts/VolumetricFog.cs:505)
    VolumetricFog.OnRenderImage (UnityEngine.RenderTexture src, UnityEngine.RenderTexture dest) (at Assets/VolumetricLighting-master/Assets/VolumetricFog/Scripts/VolumetricFog.cs:550)


    And for the light shafts:
    If I add the light shafts component to a light in the scene, I get an error in the Inspector and in the Console.
    In the inspector it says: "Render texture support (including RFloat and RGFloat) and shader model 3.0 required."
    and in the console:

    LightShafts' Hidden/Coord didn't compile on this platform.
    UnityEngine.Debug:LogError(Object)
    LightShafts:ShaderCompiles(Shader) (at Assets/LightShafts-master/LightShafts.Resources.cs:253)
    LightShafts:CheckMinRequirements() (at Assets/LightShafts-master/LightShafts.Resources.cs:274)
    LightShaftsEditor:OnInspectorGUI() (at Assets/LightShafts-master/Editor/LightShaftsEditor.js:96)
    UnityEditor.DockArea:OnGUI()


    and:

    LightShafts require above shaders. Disabling.
    UnityEngine.Debug:LogError(Object)
    LightShafts:CheckMinRequirements() (at Assets/LightShafts-master/LightShafts.Resources.cs:281)
    LightShaftsEditor:OnInspectorGUI() (at Assets/LightShafts-master/Editor/LightShaftsEditor.js:96)
    UnityEditor.DockArea:OnGUI()


    It is really important to me to get it working.
    Can anyone help me solve this???
     
  5. Dor770

    Dor770

    Joined:
    May 25, 2015
    Posts:
    7
    I didn't mention it, but everything worked just fine in previuse vesion, wich is the 5.5.0f3 version of Unity.
     
  6. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Are shaders included in build? Check readme for more details.

    That's an interesting error. What platform, rendering API are we talking about? Because D3D9 isn't supported. Are you sure you have Windows/DX11 player?
     
    Alverik likes this.
  7. Dor770

    Dor770

    Joined:
    May 25, 2015
    Posts:
    7
    the platform I'm using and working on is windows, and I have the Direct X 12 installd on my computer.
    Do I need to install the 11 version aswell??
     
  8. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Are you trying the project from github without any modifications? If you look at the unity editor window title, there should be "<DX11>" at the end of it. And your platform should be "PC, Mac & Linux Standalone" in build settings. Is that all true?
     
  9. Dor770

    Dor770

    Joined:
    May 25, 2015
    Posts:
    7
    It is on PC,Mac..(etc).. but for some reason it says <DX9> . But I have the direct x 12 on my computer...? so how can I fix this???
     
  10. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    Go to the Player Settings (Edit -> Project Settings -> Player Settings) and see if in the Other Settings tab (https://vgy.me/eMXow2.png) the Auto Graphics API for Windows checkbox is active or if it's not, then add the API's you need. The auto setting will get it right most of the time. DX12 in Unity is still considered experimental, so it's best to use DX11 for now.

    Keep in mind that changing this setting will trigger reimporting at least all shaders in your project.
     
  11. Dor770

    Dor770

    Joined:
    May 25, 2015
    Posts:
    7
    Ok. I have found it, just before you told me. and I've changed it. everything is working just fine, ivan the light shafts assets. Thanks alot!!!
     
  12. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    wip of my new project
     
  13. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    NullReferenceException: Object reference not set to an instance of an object
    VolumetricLight.Update () (at Assets/Scripts/VolumetricLight.cs:202)

    NullReferenceException: Object reference not set to an instance of an object
    VolumetricLightRenderer.OnPreRender () (at Assets/Scripts/VolumetricLightRenderer.cs:278)

    Invalid pass number (3) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Scripts/VolumetricLightRenderer.cs:340)

    Invalid pass number (5) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Scripts/VolumetricLightRenderer.cs:343)

    Invalid pass number (2) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Scripts/VolumetricLightRenderer.cs:337)

    And many more in spotlight demo scene. Unity 5.6.1p1
     
  14. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Shaders didn't compile. Are you sure you're on a supported platform?
     
  15. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    I found a render issue with the volumetric light effect and Unity3D stack image effect with fog enabled.

    http://imgur.com/NLetlTd

    It appears that the volumetric light is being rendered behind the fog. Does someone know how to fix this?
     
  16. sanya26

    sanya26

    Joined:
    Jul 19, 2014
    Posts:
    1
    For earlier I want to apologize for my English.
    I have a question, True Volumetric Lights Can I use it in my projects? And whether he is free, Because the license requires the author's written permission. And in the end I would like to understand whether it makes sense to use True Volumetric Lights In his project Or to look for other options.
     
  17. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    The license does not require written permission to use this asset! It only requires written permission if you want to use the name of the asset or the name of the author to promote your game.

    https://github.com/SlightlyMad/VolumetricLights/blob/master/LICENSE
     
  18. deglet

    deglet

    Joined:
    Feb 4, 2016
    Posts:
    14
    Hello,
    I have a dozen volumetric lights in my scene, when I add a new one it doesn't seems to work (light go through the objects). Is there a setting in unity for max light, or could it be something else ?
     
  19. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    again your volumetric lights
     
    Johns_Art and Alverik like this.
  20. cgarchitekt

    cgarchitekt

    Joined:
    Jan 15, 2017
    Posts:
    26

    can you tell me which assets from the VolumetricLight_Master project are necessary only. Are these the scripts from the Scripts folder only? Or do I need to import other assets into my own project as well?
     
  21. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    199
    Can any kind soul please help... Please. :)

    I have posted on another forum on Unity about Kode80 Clouds, with no replies.
    So thought I would try again. I am new to Unity, But I have (As yet) not come across another plug-in / asset that I couldn't figure out, with the help of tutorials, and or playing with it.

    But this program has no tutorials, zero.. anywhere. I have looked and searched, for days.

    I thought it would be an "add the Prefab to the hierarchy" type deal. But there is no prefabs. And I have downloaded it about 4 times, from the official Kode site.
    I then read about "adding the AtmosphericScattering" script to the camera." But neither do I have an AtmosphericScattering script.

    In all my reading, and posting (on other places as well. including Youtube) As well as asking 2 "clued-up" guys, one on Steam who is a game developer, and one on here, whose a really helpful bloke. And still no answers.

    I have seen a few people ask for tutorials, but every time they are put off with... "its not that hard, or its all explained.. and it really isn't. lol.

    This has to be one of three things..
    1, I'm doing something so fundamentally wrong that Ill kick myself.. (which I dont think is the case.)
    2, I'm missing some piece of the puzzle and it should have a prefab.
    3, It needs some jiggery-pokery that I'm not used to doing yet. And I really did need a tutorial after-all.

    Please if anyone can spare the time, I would really appreciate it.
     
  22. Johns_Art

    Johns_Art

    Joined:
    Dec 9, 2015
    Posts:
    40
    JamesArndt and IronDuke like this.
  23. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Woah!:eek:

    Dat's purty!

    Do you know, I think that's what I want in my projects.:D When it comes time, I'll try this thing out.:cool:

    --IronDuke
     
    Johns_Art likes this.
  24. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    199
    @IronDuke

    Well I honestly hope you know what you are doing, I really mean that.
    Because you will get exactly zero help from the dev, or community of this plug-in.

    I have never come across this before on the Unity forums, which are usually helpful, encouraging, and considerate.
    Its very strange.
     
  25. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Isnt your message a very strange and wrong thing to say here given that:

    a) you seemed to be asking about kode 80 clouds which is not the subject of this thread at all, so I dont know why you would either expect help here or complain when you didnt receive any.

    b) the helpful history of this thread speaks for itself.

    If you were not in fact asking about kode 80 clouds here and were actually asking for help with true volumetric lights, then you worded your post in a confusing way.

    Apologies if I've got some facts wrong but thats what the situation looks like to me and as such I find your criticism to be completely baffling.
     
    Alverik likes this.
  26. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    199
    @elbows

    Firstly let me apologise that I mistakenly thought this was a Kode80 thread... My bad, sorry about that.

    But secondly, I asked a simple question, I have asked it everywhere I know, (Or thought) had anything to do with Kode80 plug-in. In the hope that someone would spend 5 minutes giving me a few pointers. Even a "Here's a link to some help," would have been appreciated, because search as I have I cannot find any instructions to this asset.

    But now you- (and very politely I might add.) -have let me know I was on the wrong thread, again, mea culpa.

    Regards.

    Andy.
     
    elbows and neoshaman like this.
  27. thehosse

    thehosse

    Joined:
    Nov 29, 2013
    Posts:
    35
    I love the red laser effect in the demo, how did you create this Michal?
     
    MarkusGod likes this.
  28. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    Hey guys,
    Is it hard to make a VR support of this plugin ?
     
  29. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    It was a hacky extension of the volumetric effect. It uses the same technology as volumetric spotlight only the spotlight is very thin.
    Instead of rendering spotlight's cone and ray-march in it, I rendered a plane and took one raymarch step.
    It also detects where the plane intersects with world geometry to add the red highlight.
     
  30. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    just another one
     
    Pecek, Michal_ and KarelA like this.
  31. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
  32. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    So pretty!:D

    --IronDuke
     
  33. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    246
  34. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Interesting. I'm ok with it as long as he doesn't claim to be the author. I guess that's not the case based on the product description. Hopefully the original licence is still there.
    Thanks for letting me know.
     
    Alverik and customphase like this.
  35. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    I hope you are, considering the license you chose ;) As long he's including license and copyright, and not changing his asset's name to something like Volumetric Lighting Box, i don't see any problem (with the license).

    However, i think it would be polite to mention this thread or github in description, or at least make it clear that VolumetricLights is not from Unity, as it's easy to understand from description; "While these effects(Post Processing Stack, Volumetric Light) are free".

    That's my opinion, because VolumetricLights makes a quite big difference with visuals, and his asset is about improving visuals.
     
    ZiadJ and Alverik like this.
  36. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    he is stating this! he mentions michal as the author and says he is just integrating it
     
    Alverik likes this.
  37. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    Not sure why you would say that, while that is not true. I just double checked asset store page, and also the forum page description; no mentions about michal. Although there was a mention about integration, and link to this thread in forum post. However, asset store is the place he is sellings this asset, so it would be polite and transparent to say it in desc.
     
  38. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    just checked forums - and yes you are right he should do so in the asset store!
     
  39. Filhanteraren

    Filhanteraren

    Joined:
    May 14, 2014
    Posts:
    47
    Bought the asset and had a quick look, it does not seem to be any licence file at all included.

    A question abut the Volume Light though, is it possible to have it working in the editor when not in play mode? Maybe I am missing something? It very hard to tweak light and all that in play mode since it wont save the changes. Thanks,
     
  40. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    :(
    You're not missing anything. It wasn't possible when I made it (in older versions of Unity). I assume it would be possible now but I'm not implementing it. I'll do bug fixes at best.
     
  41. Filhanteraren

    Filhanteraren

    Joined:
    May 14, 2014
    Posts:
    47
    Ok, thanks for the clarification. Are you done with the project or do you plan doing any updates? As far as I know this seems like the best solution for volumetric lights and would love to see it developed further.
     
  42. PleaseEnterYourName

    PleaseEnterYourName

    Joined:
    Feb 11, 2015
    Posts:
    11
    Hi,
    I am trying to use this asset for a project with spot lights and split cameras, and I am experiencing discrepancies in the way lights are rendered in the different cameras :
    VolumetricLights_SpotLight_splitcam.PNG
    The two camera have the same settings and a volumetric light renderer attached to them.
    If I disable the left camera, then the light is correctly displayed on the right one.
    Any clue to have the same render on split cams ?

    Cheers,
     
  43. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    You can tweak any component in play mode, and use (right click the component) Copy component and when back in edit mode (right click the component again) Paste component values.
     
  44. Filhanteraren

    Filhanteraren

    Joined:
    May 14, 2014
    Posts:
    47
    Yes of course, but when doing changes to more than one component you cant do that
     
  45. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    I'm pretty much done with it. I implemented two different volumetric light solutions in one year (the other at work). I had enough of volumetric lights :). I don't have much free time this year anyway. I'm sorry if you paid for this expecting support or further development.

    There indeed was a bug. But I think it should only affect shadow rendering... Anyway it is fixed now. Maybe it will help you. This is what I get now with two cameras:
    Screenshot (2).png
     
  46. PleaseEnterYourName

    PleaseEnterYourName

    Joined:
    Feb 11, 2015
    Posts:
    11
    Thanks a lot Michal, works like a charm !
     
  47. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    volumetric light shines! ;D
     
    chelnok likes this.
  48. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    I don't know what I'm looking at but it looks great. I love how the music builds up atmosphere until finally nothing happens :)
     
  49. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    203
    Using 2017.1.1p2 I got this error:

    Invalid pass number (5) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at Assets/VolumetricLights/Scripts/VolumetricLightRenderer.cs:343)


    Edit: SOLVED upgrading to last release. TNX !
     
    Last edited: Sep 19, 2017
    JamesArndt likes this.
  50. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Would it be possible to have the volumetric lights working in Single pass stereo VR? It works in multipass, but it goes bad in single pass...