Search Unity

  1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

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:
    24
    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. ArachnidJacob

    ArachnidJacob

    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:
    45
    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:
    45
    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:
    24
    Thanks Johan ! Will be very useful ;)
     
  8. cubedparadox

    cubedparadox

    Joined:
    Sep 16, 2014
    Posts:
    10
    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:
    45
    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:
    1
    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:
    [​IMG]
    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
    [​IMG]

    So how to set the shader?:(
     

    Attached Files:

    • 115.png
      115.png
      File size:
      115.8 KB
      Views:
      36
    • 113.png
      113.png
      File size:
      66 KB
      Views:
      36
  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:
    7
    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:
    45
    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:
    73
    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:
    45
    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:
    10
    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:
    10
    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:
    45
    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