Search Unity

Colorful Fog: A Fog effect with more coloring options

Discussion in 'Assets and Asset Store' started by grahnzz, Aug 29, 2015.

  1. aurel_unity

    aurel_unity

    Joined:
    Jun 21, 2015
    Posts:
    18
    Thanks for the superfast answer Johan, much appreciated : )

    Looking at the script, I sure see how to change a single color, but I never had to change a gradient by script in Unity for now. Can I give a name to a gradient in the inspector then catch it by script ? That would be sweet, and this is what I understand from the "colorfulFog.gradient= someGradient; " line, but I'm still not sure I fully understand how it works.

    So yes, a short example would definitely help. But of course I would understand if you're too busy to do it : )
     
    Last edited: Apr 19, 2016
  2. aurel_unity

    aurel_unity

    Joined:
    Jun 21, 2015
    Posts:
    18
    I found an (ugly) way to achieve the effect I wanted by duplicating the CF script and activating / deactivating the ones I need / don't need. It works very well : )
     
  3. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Hi,

    I just buy colorful fog to sync the fog to my shader forge skybox.
    It's working just great in gamma color space, but i have a problem in linear : fog colors gets slightly mor bright than the colors i choose in the Inspector. I don't have this problem with my sky for exemple
    Is there anyway to fix that ?

    Thanks in advance !

    Jonathan
     
  4. ElusiveJacob

    ElusiveJacob

    Joined:
    Mar 10, 2014
    Posts:
    7
    Hi, im working on an underwater game, and we are using a linear fog effect. I'd love to try and get the effect of lighter fog above the camera, and darker fog below, will this package be able to do that?

    Optimally i would like to be able to input/build a gradient for the fog color above, at, and below the camera, and lerp between several gradients as i move vertically through the level.
     
  5. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    Hey Jonathan, Sorry for the delay in my response. But i have looked into your issue and it apparently i did not think of color correction in case of linear rendering. I solved it though and im gonna submit an update to the asset store package, in the meanwhile UT is reviewing the update you could grab the code below and replace line 152 in colorfulfog.shader.
    Code (csharp):
    1. return pow(fogColor, 2.2);
    This will make the colors correct for linear only, so make sure to switch back in case of gamma rendering build.

    Cheers,
    Johan
     
  6. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    Hey, absolutelly. Direction based fog coloring is what colorful fog is all about. No matter which color input method you choose you can change it via scripting, so lerping the colors is no issue. For example you could choose "Simple Gradient"
    Code (csharp):
    1.   //setting simple gradient colors,
    2.   colorfulFog.skyColor = Color.white; //input your desired up color
    3.   colorfulFog.equatorColor = Color.black; //input your desired horizontal color
    4.   colorfulFog.groundColor = Color.white; //input your desired down color
    Read more about the other coloring options here if you want. Altough i would recommend simple gradient as its pretty straight forward to implement lerping for as opposed to a Gradient input. But its totally up to you.

    Best of luck with your game,
    Johan
     
  7. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Thanks Johan ! Will be very useful ;)
     
  8. cubedparadox

    cubedparadox

    Joined:
    Sep 16, 2014
    Posts:
    16
    I'm interested in using this asset in a vr title my team is working on, but am hesitant to purchase due to performance issues we've had with both unity's native fog as well as the global fog script. Can anyone vouch for this asset's performance with steamvr?
     
  9. dtavares

    dtavares

    Joined:
    Feb 24, 2016
    Posts:
    4
    @cubedparadox I'm currently using it on a VR title I'm working on and the plugin works fine on Unity 5.3 series. Looking at the frame debugger I only see one draw call for the fog and no other noticeable overhead while using this script. I tested it on a Oculus Rift though.

    @grahnzz On Unity 5.4.0b19, with VR enabled and Single-Pass Stereo Rendering (in Player Settings) enabled, Colorful Fog leaves an outline around the edges of the objects when moving the camera around. It seems like the fog trails behind the rest of the scene when you move your head around. See the sections I've artistically highlighted in red on the screenshot. fog_bug.JPG
     
  10. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    That's no good. I have never done VR, but my guess is that Colorful Fog gets wrong position in the rendering queue. I will look into this further as soon™ as i can.
     
    dtavares likes this.
  11. dtavares

    dtavares

    Joined:
    Feb 24, 2016
    Posts:
    4
    They made several performance improvements to VR. Unity 5.4 now has a feature called Double Wide Rendering, which renders an image for both viewports in a single pass. I'd appreciate if you could expedite this. I'm using Unity 5.4, because I really need these performance improvements.

    Thanks!
     
  12. Payne_Lee

    Payne_Lee

    Joined:
    Jul 2, 2016
    Posts:
    11
    I‘m a 2D artsit just started with Unity3D for a short time, and I'm making a scene of paper card style.
    So I made a simple shader like this:

    It makes all the stuff in my scene recieving the default ambient light and fog.
    And I still want to creat a fog just over the floor thinly with this Colorful Fog.
    But the shader couldn't recieve it... like this in the Sample


    So how to set the shader?:(
     

    Attached Files:

    • 115.png
      115.png
      File size:
      115.8 KB
      Views:
      861
    • 113.png
      113.png
      File size:
      66 KB
      Views:
      825
  13. makazu

    makazu

    Joined:
    Jan 2, 2014
    Posts:
    2
    Hi!

    How do you set this up as the screenshot in the asset store?

    I'm using ortho camera and want it only to be shown inside a rectangle like the screenshot.

    1.PNG
     
  14. devravenio

    devravenio

    Joined:
    Jun 9, 2014
    Posts:
    11
    i want to know how it is working on mobile platform.
    is it ok?
    how many fps dropping?
     
  15. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    The fog can't be restricted to an area like in the picture, that's just a logo rendered outside unity.
    I haven't done any real benchmarks or extensive testing on mobile. But i ran the demo scene on an old galaxy core from 2013.

    But its not that simple, depending on whats going on in your game. And how much performance is already used. The only way to be really sure is to try it out in your games scene.
     
  16. Threepwood

    Threepwood

    Joined:
    Jul 23, 2009
    Posts:
    95
    Question for @grahnzz,

    If you are using a CubeMap for a Skybox, and you change the Skybox Tint Color (for time of day changes, etc), the fog color doesn't change. What do you recommend as a fix for this so you can have a tint changing Skybox, but colors match if you are using a Cube Map under Colorful Fog for the Coloring Mode?
     
  17. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    I'm guessing you would like a tint-color for the fog too. If so, that's pretty simply added.

    Let me come back to you with some code :)
     
  18. borkbork

    borkbork

    Joined:
    Jul 5, 2014
    Posts:
    64
    Hi, just bought it and opened the demo scene - this is what I get in Unity 5.6.0f3:

    Screen Shot 2017-05-02 at 9.39.05 AM.png

    Seems like the quad in front of the camera is creating issues (black scene view / purple triangle game view) but I'm not sure how to fix it. Hiding the quad reveals the ugly skybox.
     
  19. borkbork

    borkbork

    Joined:
    Jul 5, 2014
    Posts:
    64
    Bump. If I don't hear back I'll have to leave a bad review as this is unusable.
     
  20. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    Hi,

    I downloaded 5.6.1 and could not find any issues. It works fine with both opengl and d3d.

    Direct3D:
    u56.jpg

    OpenGL:
    u56-opengl.jpg

    You could try upgrading your unity version(if that's an option for you). Otherwise i can give you a refund if you want, just message me your invoice number.

    Br, Johan
     
  21. zakwani

    zakwani

    Joined:
    Mar 25, 2017
    Posts:
    1
    After playing with the settings I noticed that the gradient doesn't seem to be based on the distance, it's more obvious when using a gradient without a blend, as you can see in the attached image.
    fff.png
    Not sure if the there is something wrong with my project or the tool is intended to be like that. But then it says in the description "Distance-Based Fog"?
     
  22. grahnzz

    grahnzz

    Joined:
    May 7, 2013
    Posts:
    46
    Thats intendent behaviour, altough i agree with you that the description could be more clear. It's distance based in fog density, not color-picking.

    But if you think about it, i provide cubemap as an alternative for input. That wouldnt really map in any natural way to distance based coloring.

    If you would like a refund I'll give you one, just send your invoice # to me :)
     
  23. Muppetsaurus

    Muppetsaurus

    Joined:
    Oct 11, 2017
    Posts:
    2
    I don´t want the fog to affect my skybox, any quick solution?
     
  24. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Any word on support for single-pass stereo?
     
  25. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Does this fog works on forward? and in Unity 2017?

    Regards,
    Carlos
     
  26. iain-nicholls

    iain-nicholls

    Joined:
    Nov 15, 2013
    Posts:
    5
    I can't get this to work in VR - Single Pass ? Any updates coming please!!??
     
  27. aler_buffon

    aler_buffon

    Joined:
    Dec 9, 2015
    Posts:
    22
    HI, I'm trying to build on the androd, the editor scene is fine, but on device fog dosn't work. Help to solve this problem. Unity version 2017.3.1p4
     
  28. TheMonkeysaur

    TheMonkeysaur

    Joined:
    May 2, 2017
    Posts:
    52
    Is the dev still around? I have a couple of questions but can't seem to contact him.
     
  29. DantePinto

    DantePinto

    Joined:
    May 21, 2019
    Posts:
    4
    Hi, I am working on a unity 2d pixel art project. We are using background sprites for parallax and our idea is using your plugin to make the fog, consideration de Z transform value of the background sprites. And for that to work we would like to know if the plugin works with orthographic camera? Or if you have another solution.
     
  30. DantePinto

    DantePinto

    Joined:
    May 21, 2019
    Posts:
    4
    I want to know why it doesnt work with the lightweight render package.