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

Graphics Azure[Sky] - Dynamic Skybox

Discussion in 'Tools In Progress' started by DenisLemos, May 1, 2015.

  1. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    Unfortunately, Azure[Sky] Lite is not recommended for mobile devices, I have never tested on latest generation devices. Here in Brazil, it is impossible to purchase these devices because they cost absurd values up to 10k.

    When I sent the first version of Azure[Sky] Lite to the Asset Store I tested it on a Motorola g2 which is an old and outdated device and the performance was:
    • (40-45) frames per second just the sky, without clouds and fog scattering.
    • (25-28) frames per second with clouds.
    • (10-12) frames per second with clouds and fog scattering.
    Due to the complexity of the sky system, I think it was an excellent performance, but not good enough for real productions on mobile games. As the Motorola g2 is an outdated device, it does not mean that you will perform much better on a high-end device because the specs may be better, but the screen resolution will also be larger and consequently more expansive for performance.
    I did the same tests on a Samsung J7 Prime which has superior specs and performance has only improved a few (5-10) frames due to the J7's resolution being 1920x1080 versus 1280x720 from Motorola.
     
  2. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    108
    Just wanted to say thanks a lot for all your help, Denis!

    I'm still working through all my options, but your help has been fantastic, on the forums, and in personal messages.

    Thanks again!
     
    DenisLemos likes this.
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    @DenisLemos For the thunder/lightning effect is it only available through scripting? I noticed if I set the weather profile to Storm that it never has any thunder/lightning. I would have thought it would randomly occur when in storm profile.
     
  4. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    @DenisLemos I just installed the latest Gaia into my project and now Azure Sky is suddenly throwing a bunch of errors even when in editor mode.

    NullReferenceException: Do not create your own module instances, get them from a ParticleSystem instance
    UnityEngine.ParticleSystem+EmissionModule.set_rateOverTime (MinMaxCurve value) (at C:/buildslave/unity/build/artifacts/generated/bindings_old/common/ParticleSystem/ParticleSystemBindings.gen.cs:370)
    UnityEngine.AzureSky.AzureSkyController.Update () (at Assets/Azure[Sky] Dynamic Skybox/Scripts/AzureSkyController.cs:586)

    Any ideas what's going on?

    [EDIT]
    It seems that closing and restarting Unity makes it go away. If it comes back I'll let you know.


    [EDIT 2]
    Yep, it started coming back again.
     
    Last edited: Nov 21, 2018
  5. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    To trigger a lightning effect during gameplay it is necessary to call the "public void PlayThunderEffect (int element)".
    In this particular effect, it is the user who must determine when it is the best time for the effect to be reproduced. The effect does not play automatically because it is almost impossible to predict every use situation of the weather system.
    If you need lightning effect to play automatically, simply create a timer to call the "PlayThunderEffect ()" method and then set a random time for the effect to play again.



    I could not reproduce this error, for me Azure[Sky] and Gaia are working very well together. I also can not imagine a reason for this to happen, because the error seems to be related to the particles emission of Azure and Gaia deals only with the creation of terrains and should not interfere with the operation of Azure[Sky].
    I am using Unity 2017.4.15f1 LTS maybe this is related to some version of Unity.
    Gaia - Azure.jpg
    To create the terrain I followed this video tutorial. At the end of the process I removed the water and the post-processing effect from the camera, then dragged the Azure[Sky] prefab onto the scene and added the fog scattering effect to the camera. From the import of the assets to the creation of the scene I did not get any error message, not even warning message.
     
  6. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    65
    Hi, just got Azure and everything looks good. I have created a new profile but during the night on the first day cycle the profile used switches to the standard profile. What am I doing wrong? Is it possible to remove the moon?
     
  7. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi, Thank you for supporting Azure!

    This is because the sky controller has changed to the next calendar day.

    You can set a different profile for each calendar day in a one-year cycle and if any calendar day does not have a defined profile, the sky controller will randomly choose a profile from the "Standard Profiles" list of the Options tab, by default, only the standard profile is defined in the list.
    From what I understand you want the sky controller to always repeat the same profile. To do this, simply change the "Repeat Mode" to "By Day" in the Options tab.

    To remove the moon, simply set a completely black color to the "Disk Color" and "Bright Color" properties of the Deep Space tab of the profile. In this case you will also need to reduce the intensity of the directional light at night on the Lighting tab of the profile.
     
    anpd03 likes this.
  8. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    65
    Perfect, that did the trick! Thanks for the quick reply and support :)
     
    DenisLemos likes this.
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    It turns out that the second time I saw an error it was not related to this same issue and I resolved it with removing a Gaia script. So all is well. Thanks for trying to reproduce it.
     
    DenisLemos likes this.
  10. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Playing with Aquas Water.

    As with any transparent shader, by default Aquas Water is also ignored by the fog scattering effect and it is necessary to make some simple modifications so that the water works properly with the Azure fog effect. It was necessary to add only two lines of code in the Aquas Water shader to make the fog scattering effect interact properly with water. The instructions on how to modify the water shader to work with the fog effect are on the first page of the forum.
    Aquas + Azure.jpg Aquas + Azure2.jpg Aquas + Azure3.jpg
     
  11. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    108
    Not sure if I'm doing something foolish, but...

    I've popped Azure Sky into a new project, dragged in the Azure[Sky]Controller, and added the Fog Scattering script to the camera, but the fog scattering script doesn't seem to do anything.

    I tick it on and off, and it doesn't change.

    In my other project, where I'm using Azure, it is working fine, and when I tick it on and off on that camera, I can see the fog turning on and off.

    I can't figure out what the difference between the two scenes are.

    I've been over the documentation again, and I seem to have done everything right.

    Could I be missing something simple about why the fog scattering is not working in my new project?

    Any common mistakes for why fog scattering doesn't turn on?

    =-= Well, speaking of human error, I think it is working fine, I was just testing it on a "Clear" weather profile, where it basically has no effect, but when I tried it with more foggy/overcast settings, I can see it now. Silly me! =-=
     
    Last edited: Nov 29, 2018
  12. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    108
    A different question:

    How does one get the weather to not "flick over instantly" between each day?

    Each time a new days starts, I want the new weather to ease in over say 30 seconds or something.

    Is there any sort of "automatic" way to have each day progress with a smooth weather / profile transition?

    Or is it best (/essential?) to do it in code instead?

    Wondering what is the best way to set up a smoothly moving day/night/weather system.
     
    Last edited: Nov 29, 2018
    ftejada likes this.
  13. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    @DenisLemos I join that question of @muzboz

    I've been wanting to ask for a while but for lack of time I had not done it ...

    It seems a small problem that when you go from one day to another at 12 o'clock at night, the profile changes completely to the next day in a single frame instead of doing it so that it does not feel abrupt. When there is a lot of difference between profiles this is extremely annoying and unreal
    It would be good an option in the inspector in which each of us can decide the time it will take to change from one profile to another when the day changes ...

    Another thing that I did not notice when I saw this problem, is if the position of the moon when it has realistic time, it changes abruptly to adapt to the new calendar date ... If so, I suppose a solution should be sought

    regards
     
    muzboz likes this.
  14. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    I know you've already figured out the reason for this, but I'll complement it if anyone needs further clarification.

    The profiles have been configured in an aerial perspective scene, the same scene used for demonstrating the weather system available in the package description in the Asset Store.

    So by default the profiles are with fog distance set between 3500m and 5000m and if the scene size or the camera's viewing distance is less than the fog distance, the fog may not appear and you need to set a smaller fog distance.

    A tip for everyone using Azure, save a copy of your custom profiles. So you can use them in other projects, but the most important thing is that you do not risk them being replaced when you import a new package update, otherwise you can spend a lot of time having to configure them again.
     
    ftejada and muzboz like this.
  15. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    @muzboz @ftejada Regarding the transition from one day to the next, this feature is not yet available because until then, I had not found a good way to implement this functionality.

    I was planning to implement this functionality in a way that would be too complex to do, but as I read the posts from you I came up with a completely different idea that makes things a lot simpler and now I wonder why I had not thought of it before.

    I'll try to implement this feature in the next update that should arrive soon.

    PS: The position of the moon in realistic time mode fits smoothly when switching to the next calendar day.
     
    ftejada likes this.
  16. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    108

    Ah! Yes, that seems like pertinent and useful info!

    Thanks!
     
  17. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    108
    Sounds promising!

    It's always good when you suddenly think of a "simple solution" approach. :)

    Hope it works. Cheers!
     
  18. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Maybe for the NO realistic mode something should be included to soften that change?

    Although I do not really care since I always use realistic mode ... But it's always better to have a problem of this style fixed in both modes.

    regards
     
  19. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    I believe not, because for me everything is running smoothly in both simple and realistic time modes. I do not quite understand, are you getting some problem with the moon position when it changes to the next day?
     
  20. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Playing with water from Gaia.

    As with any transparent shader, by default the water shader is also ignored by the fog scattering effect and it is necessary to make some simple modifications so that the water works properly with the Azure fog effect. The instructions on how to modify the water shader to work with the fog effect are on the first page of the forum.

    Original water shader: The fog scattering don't hit the water.
    Screen1.jpg

    Now, with the modifications to work with fog scattering:
    Screen2.jpg
    Screen3.jpg
    Screen4.jpg
    Screen5.jpg
     
  21. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hey I'm getting a lot of banding when overlooking large open areas of terrain. It seems to be the global fog. It looks fine in areas with lots of gameobjects, but once I reach overlook areas, the banding becomes very apparent

    Running Unity 2018.1.2f1 and provided post-processing profiles
     

    Attached Files:

    Last edited: Dec 3, 2018
  22. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    These bands are generated by the results of the equations of the sky model. They are generally imperceptible, but they become more visible if the scene or sky setting has a high contrast, this causes the banding effect to appear in the transition from bright to dark.

    I set up the post processing profile that comes with the package using a dense forest scene, so the banding were not visible to me. You can try using another sky setting or post processing that the banding should reduce or disappear completely.

    For example, this is the standard day profile setting, I just set the fog closer to look like your screenshot.
    The banding effect are almost imperceptible.
    They are a bit apparent only in the upper right corner, where the sky is darker.

    Screen1.png

    When using a proper post processing effect, the banding effect disappear completely. This is from post FX created automatically by Gaia using Post Processing Stack 2.0.
    The Grain effect is on.
    Screen2.png
     
  23. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    No. I really have not seen any problem in the change of the position of the moon between different days ... I only spoke on the assumption that there was that problem ...
    Since in the comment you made that "in realistic mode the change of the moon went smoothly", it seemed that the NO realistically if this problem was generated

    Regarding the abrupt change between different configurations when going from one day to the next at 00: 00h if I have seen problems, as I told you.

    regards
     
  24. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Nice!
    Regarding the transition when the sky controller go from one day to another at 24 o'clock, this feature has been implemented and the update has already been sent to the Asset Store and is under review by Asset Store team.
     
    ftejada likes this.
  25. crimn

    crimn

    Joined:
    Jan 8, 2013
    Posts:
    27
  26. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    Check in the Lighting window if the "Auto Generate" option is enabled, otherwise Unity will not automatically generate the scene lighting data when something changes in the lighting system.
     
  27. crimn

    crimn

    Joined:
    Jan 8, 2013
    Posts:
    27
    yeah thank you :), that was it.
     
    DenisLemos likes this.
  28. holdingjason

    holdingjason

    Joined:
    Nov 14, 2012
    Posts:
    135
    Hi love the product and thanks for the help on Crest, fog looks great now.

    Another issue has popped up that is pretty easy to replicate. I am getting flickering (I think it shadows/lighting issue) on objects when using AzureSky and those objects/cameras are positioned a decent distance away from world vector zero.

    To easily replicate. Use any new scene with azuresky in it (big sun works fine). Create a plane 100 in size (does not really matter) and set its position to 100000, 0,0 (we are getting the issue a lot closer then that on a large terrain but I know this works). Set the camera to 100000, 0,0 as well. Rotate around and you will see random flickering on the plane. Notice really bad with terrains we are working on an open world sailing/trading RPG https://www.play-crittercove.com and notice the issue with one of our island at -8, -30, -4255.

    shot of the issue using big sun and plane set at 100000, 0,0 No idea what is causing these shadows only the camera, plane, azure are in the scene.
    upload_2018-12-14_15-47-17.png
     
  29. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Sorry for my absence, again a thunderstorm causing problems, but this time it was much more serious and maybe it slows down my frequency here for a while.



    Hi!
    I could easily replicate the bug, but this is not a bug in Azure because I replicated this issue in a blank project using a default scene without having imported Azure[Sky] into the project.
    LightingBug.jpg

    Unity does not deal very well with large-scale worlds and you're going to have problems with float point precision as you venture far from the origin. I do not have enough knowledge to point you to a solution because I've never worked on projects with large-scale worlds, I always try to limit my ideas of games and projects to use small worlds just to avoid these kinds of problems.

    In this case, the first thing I would try is to reset the camera position to zero whenever the camera reaches a certain distance from the origin and also change the position of all GameObjects in the world according to the relative position from the camera.

    Some useful links:
    http://wiki.unity3d.com/index.php/Floating_Origin
    http://davenewson.com/posts/2013/unity-coordinates-and-scales.html
    Google research

    Take a look at this asset, I'm not entirely sure, but maybe it can be useful in that case.
    World Streamer

    PS: Your game looks amazing!
     
  30. holdingjason

    holdingjason

    Joined:
    Nov 14, 2012
    Posts:
    135
    Arggg I am a bone head. Yeah I remember all this from my days of working on an open world voxel game. Just thought its effects were a bit farther out. I was able to test that in the game and even at 4000 units out you start getting the effect and have to modify the near clip plane of the camera to fix it. It was at 0.1 now had to move it to 0.3 and the effect goes away. Obviously not a real solution so will need to start streaming and moving things back to origin (thanks for the link).

    Thanks for reminding me and appreciate the kind words about the game.
     
    Last edited: Dec 17, 2018
    DenisLemos likes this.
  31. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Capture.JPG
    It's been almost 20 days since I sent the update to version 4.3.7 and the package is still under pending review.

    I think there was some problem during the upload process because I did not receive the confirmation email that the package was sent successfully for evaluation.

    It usually only takes 1 or 2 days for the update to be accepted, I will resend the package this weekend.
     
    ftejada likes this.
  32. TheGDX

    TheGDX

    Joined:
    Jul 24, 2017
    Posts:
    1
    Hi, I bought this asset a few days ago and I must say I'm really impressed with its quality - it's absolutely stunning and highly configurable.
    I am, however, having some trouble integrating fog scattering with Go Ocean Toolkit - I've followed the instructions regarding transparent shaders but I still haven't managed to get it to work. (I've got other shaders working following these instructions)
    Any help would be much appreciated, thanks.
     
  33. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    First of all, thank you for purchasing Azure[Sky].

    Unfortunately, I do not own this asset, but if the developer allows you to send me the shader by private message so I can analyze if it is possible to make the modifications needed to work with the fog effect, I'll be happy to help you.
     
    TheGDX likes this.
  34. The-Creature-Queen

    The-Creature-Queen

    Joined:
    Jan 19, 2017
    Posts:
    24
    Hi. Are there custom actions for Playmaker for changing the weather yet? Or a step by step guide to work Azure Sky with it somehow? I've wanted this sky system for so long but it still isn't Playmaker supported yet.

    Someone mentioned prefabs? Can you just hook a weather preset created in the inspector as a prefab and spawn and destroy it to change the weather? Or can you use Playmaker's set property action to change the preset of azure sky? That would also work.

    _______________
    In my experiences...
    The interchange between Playmaker customer and asset developer usually goes like this:

    Author: It's just a couple scripts, it's easy. Just call this. You can -probably- do that in playmaker. (Do you have any idea how long I spent making this easy? It's REALLY easy. Custom actions aren't needed.)
    Customer: Just make a custom action. It's easy, just paste that call into the Playmaker template and include it in the third party plugin package or upload it on the ecosystem. It takes like 8 minutes tops!
    Author: I mean you can probably just paste that yourself, it's 1 line.
    Customer: You know you'd sell more, right? That is easy for you and hard for me.
     
  35. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    108
    Can't wait to check out the update (with smooth day-to-day transitions) when it goes through the approval pipe. :)
     
  36. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    As far as I know, you can change the Azure's weather easily using PlayMaker.

    To change the weather in Azure[Sky] you do not use prefabs, but profiles. The sky customization is done by profiles similar to the Post Process Stack v1 profile system. You can create as many profiles as you want and achieve different scene lighting and sky settings with each profile and use it as a weather type.

    The climate system is very easy to use, in the Climate tab of the sky controller there is a list where you can add or remove all the profiles that you want to use as a weather type.
    Climate Tab.JPG
    Next to each profile in the list is the field to set the transition time and the "Go" button for fast test in the editor.

    When you change the weather, the sky controller blends the current profile in use with the new profile applying a smooth transition from one profile to another according to the transition time set in the target weather profile.

    To change the weather in your game, you just need to access the sky controller and call the method...
    public void SetNewWeatherProfile (int target)...
    and pass as parameter the target profile number in the "Weather Profiles" list.

    I know that it's possible with PlayMaker to access other scripts and call public methods using the Call Method action. The PlayMaker developer has already answered about this here in the forum.



    It is taking a long time for a simple update to be accepted, I sent the update on Dec 3, 2018 and 20 days later it still had not been accepted.

    To make sure there was no error during the upload process, I sent the update again on Dec 23, 2018.
    Capture.JPG
     
    ftejada likes this.
  37. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Hi,

    I just purchased Azure and I have a few questions, sorry for the bombardment in advance.

    First, what is all in the new update? Anything game breaking that I should hold off on for now? I tried searching back a few posts, but I wasn't able to find anything.

    Second, does changing the weather have to be called by script, or is there something in Azure that does that already? (Currently, just the default profile is set under the Standard profiles). Based on the documentation it is the former, but just want to double check.

    Third, what should I be looking at to reduce the close fog scattering, just the overall Density, or Distance under Global Fog? This is what I am seeing, I like the general distance of the fog, but it is also having a slight gray sheen on the camera up close, which is what I'm trying to reduce or eliminate.



    Lastly, say I want to use the Realistic time mode with a Lat and Long for the Sun and Moon. Assuming I want every day to be the "same" with regards to profiles (tying in with me directing the weather from question 2), is there anything special I need to do? Assuming that the Default profile is set up as I want it, and that's the only option under Standard Profiles.

    So far it's been super easy to get up a working basic system, and I really do appreciate the effort that went into making that possible. It's so much nicer being able to get a quick visual without having to spend hours digging through things, so it's a great purchase.

    Oh, I also noticed that for the Moon's color, it is spelled as "Disck Color" while the Sun is "Sun Disk".

    Thanks!
     
  38. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi @Acissathar!
    First, Thank you for purchasing Azure!

    Are you talking about the recent updates or about the update that is currently under pending review? To view the history of each update, simply click on the package version number on the Asset Store page.

    What's new in the next update that is waiting for review by the Asset Store team:
    • Smooth transition when the day changes from one profile to another at 24 o'clock. This can be enabled or disabled in the Options tab of the sky controller.
    • The fog scattering effect can now be viewed in the Scene window.
    • Fixed a bug with the latitude and longitude of the simple time mode that causes the night sky and moon moving wrong when the sky controller is rotated on the y-axis.


    The sky controller does not come with automatic climate behavior because it depends on each game and each game is a different case. You need to call the public void SetNewWeatherProfile (int target) somewhere in the logic of your game every time you want to change the weather. In the previous post, I replied to another user in more detail how the climate system works.

    Do not confuse the "Standard Profiles" list with the "Weather Profiles" list from the Climate tab because each one has a different functionality.


    In this case, you must play with the "Distance" and "Blend" properties.
    • Distance: The distance works in real scale(meters) and if you set the distance for example to 500 meters, anything beyond 500 meters will be completely covered by fog.
    • Blend: This controls the fog "gradient/transition" and is useful for controlling the fog transition between the areas where the fog begins to where it is completely covered by the fog.
    To reduce the amount of fog close to the camera, simply reduce the "Blend" value to shorten the fog transition distance. This issue can also be caused by the height fog, so to make sure, set the height fog density to zero, this will completely remove the height fog from the scene. Once you have set the global fog, then start setting the height fog if you need this feature.


    If you want to always use the same profile every day, you have two options:
    1. Set the same profile on every day of the calendar. This will be very labor intensive and not the best option.
    2. Add to the "Standard Profiles" list only the profile you want to use every day and leave the calendar days without any profile. When the sky controller changes to the next calendar day and does not find a profile in the calendar, it randomly chooses a profile from the "Standard Profiles" list. If the "Standard Profiles" list contains only one profile, the sky controller will always choose the same profile for every day. You will still be able to change the weather whenever you want because the climate system works with the profiles defined in the "Weather Profiles" list of the Climate tab.
    Let me know if you still have any questions.
     
    Willbkool_FPCS and Acissathar like this.
  39. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Yep, the pending update is what I was meaning. I appreciate you answering everything and look forward to playing with things now that I know for sure where to go.

    Thank you!
     
  40. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    Hi There @DenisLemos !

    Quick question. Has Azure Sky been tested with desktop VR? Does it support single-pass stereo rendering? It looks excellent and very full featured. Thanks!
     
  41. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    Unfortunately, I do not have a VR device for testing. I already read reports from some users talking about Azure running on VR, but I can not guarantee it will work. If it does not work I will not be able to give support because I have no way to test it.

    Some time ago I followed Unity - Manual to make the fog scattering effect compatible with Single Pass Stereo Rendering, but for reason already explained, I have never tested it. Reading the manual again, I saw that some things have changed, so I think it will be necessary to adjust the UV of each Tex2D again using the new function UnityStereoScreenSpaceUVAdjust. The fog scattering shader contains only two tex2D definitions to edit.
     
  42. Vaz21011

    Vaz21011

    Joined:
    Jan 12, 2017
    Posts:
    5
    Hi,
    I have a question. How do I make a white night, when the sun is always above the horizon? I tried to use calendar, but it didn't help me. Do I miss something? Or maybe I should just rewrite "simple time mode"?

    By the way, I'm bad with reading someone else's code, so could you please explain me why you use Sun transform besides sun direction light?
     
  43. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    I think the best way is to use the realistic time mode, so you just need to set a latitude, longitude, time zone, and date somewhere on the planet where the sun appears at night. If you use the realistic time mode, it is likely that you will also need to change each curve mode of the day profiles to sun elevation instead of timeline(see the documentation for more details).


    In previous versions, two directional lights were used, one for the sun and another for the moon, and on certain occasions, the two directional lights were active at the same time reducing the performance a lot.

    So I removed one of the directional lights(I forgot to change the light name to "Directional Light" instead of "Sun directional Light") and now the prefab is using two transforms, one for the sun and another for the moon. The directions/positions of the sun and moon in the sky are calculated and applied only to the transforms.

    The sky controller checks if the sun transform elevation is above the horizon line and in this case set the direction/position of the Directional Light to be the same as the sun's transform.

    When the sun transform is below the horizon line, the Directional Light automatically changes to the direction/position of the moon's transform.
     
    ftejada likes this.
  44. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Azure[Sky] Dynamic Skybox v4.3.8 is available!

    For some reason version 4.3.7 got lost in the evaluation queue and was not released, meanwhile, I was already working on the next update. Now the version 4.3.8 is already available for download, bringing also the new features implemented in version 4.3.7.

    What's new!
    • v4.3.8
      • Added full compatibility with Lux Water. Just double-click the "LuxWaterFogImplementation.unitypackage" located in the shaders folder to replace the original fog scattering shader with the new modified shader.
      • Minor bug fixes.
    • v4.3.7
      • Bug fixes.
      • Now you can enable the fog scattering effect to be visible in the Scene view.
      • Added transition effect when the sky controller changes from one day to another at 24 o'clock. You can set a custom transition time or disable the effect on the options tab of the sky controller.
     
    Baldinoboy, ftejada and Acissathar like this.
  45. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    WIP - A new approach to implementing the fog scattering effect to work with the transparent shaders.

    Current Implementation: In the current approach, the fog scattering is a post-processing effect that is rendered to the screen after the opaque geometries and before the transparent geometries. This seems to me to be the most correct way to render a post-processing effect based on the depth buffer, but as a consequence, the effect does not affect the transparent materials in the scene.

    The solution found for temporary use was to create a shader that calculates the fog data and stores it in a RenderTexture, that texture is then sent to the modified transparent shaders and applied using a projection technique.
    • Pros:
      • It works!
    • Cons:
      • The fog calculations are performed twice, the effect is calculated once in the post-processing, and once in the creation of the RenderTexture used by the modified transparent shaders.
      • It uses a full-screen RenderTexture to calculate and store the fog scattering data, and the higher the screen resolution, the more calculations are needed.
      • Requires some modifications to be made in the transparent shaders.
      • Requires two extra texture coordinates to the shader, one to store the vertex world position and another to store the projection uv.
      • The fog projection on flat surfaces such as water is broken if the "Mie Distance" of the Sky Controller Options tab is different than zero.
      • Some artifacts may appear on the edges of objects because the projection technique is not accurate for this purpose.
    WIP Implementation: In this new implementation that I am currently working on and that should be available soon, it is no longer necessary to use RenderTexture to store the fog scattering data because the calculations are now made direct within each modified transparent shader using the information available in the vertex mesh.
    • Pros:
      • It works better!
      • Fog calculations are performed only once for each pixel affected by the fog, unlike the previous approach in which the calculations are performed twice.
      • Better performance because a full-screen RenderTexture is no longer used.
      • The extra texture coordinates in the shader were decreased to one.
      • Fixed the issue with the "Mie Distance" on flat surfaces such as water, it is now possible to set any value to "Mie Distance" without breaking the fog on that surface.
      • No artifacts on the edges of objects because the projection technique is no longer used.
    • Cons:
      • It still requires some modifications to be made to the transparent shaders and an extra texture coordinate to store the vertex world position.
    Future implementation (under study): The new approach should be available soon and I have already prepared another approach for the future that could be a big step forward. This approach is still under study and is intended to completely replace Unity's standard fog by the Azure[Sky] fog scattering. In this way the Azure fog scattering will automatically work on all materials in the same way as the Unity's fog without having to use any post-processing effects and can also be turned on and off by the fog toggle in the Lighting window.
    • Pros:
      • Works even better!
      • Better performance because it does not use post-processing.
      • It requires no modification to be made to transparent shaders because it will be fully integrated with the Unity system.
      • It should probably work with any other asset or shader in the Asset Store without having to make any implementation as long as those assets give support to the Unity's fog.
    • Cons:
      • So far I could not find any.

    Thanks for reading this far!
     
    angrypenguin, ftejada, Hormic and 5 others like this.
  46. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Hey Denis,

    Thank you for this Asset, it is very nice!
    Bought it a few years ago and today i tried it the first time.
    I use it to have a realistic Day Night Cycle in an Apartment in VR and it works very well so far.

    Two questions:
    I use the realistic time mode and want to adjust the apartment direction like in the real world.
    - Is the arrow for the wind direction east? (the same as the sun is rising?)
    - Is it easier to adjust the apartment or the Azure Controller, how would you do it?

    My second question is about the light level.
    It is also in the night very bright and i don't know where i can dim down the overall light level.
    - i can't alter the Environment Intensity Multiplier, so do you have an idea how i can achieve a darker night?

    Thank you very much.
     
  47. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    Hi!
    To find out the cardinal points you can use as a reference a camera or a directional wind with the rotation set at zero, the direction they point is the "north".
    See the screenshot below. The arrow is facing the north and the sun is rising at the right(east).
    RealisticTimeMode.jpg
    In simple time mode the sun rises in the north and sets in the south to face the camera's default direction, but in this mode, it is also possible to change the longitude to control the direction in which the sun will rise.

    You can adjust your apartment to stay in line with the cardinal points by rotating the apartment. Or you can rotate the sky controller on the y-axis to rotate the entire sky and consequently change the position of the cardinal points.

    To achieve a dark night, you can change the following properties from the day profile in use by the sky controller.
    Scattering Tab
    • Night Intensity
    • Rayleigh Color
    Lighting Tab
    • Directional Light Intensity
    Note: You should only change the values for the night time because the same properties are used to customize the entire day at different times.

    Let me know if you still have any questions!
     
    Hormic likes this.
  48. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Hey Denis, Thank you for your answers!
    Ok, i can manage the cardinalpoints with this info thanks.
    Maybe I'm wrong but i have noticed, that my apartment is actually in the right position,
    and when i have all rotation set to 0 on the azure controller, it will rise in the south and not in the east in realistic mode.
    But its no problem i can adjust that easily.

    Also the darkness problem is solved more or less, the night is still very bright and at the most in the middle of the night, but i think i can also adjust this with the settings somehow.

    But i have a bigger problem with the instant lightning changes, i guess from the directional light 2 times in the circle.
    Here i have a picture where it is 8 am and all is fine the transition from night to day seems over it looked good

    Unity_2019-01-22_19-39-12.jpg

    until 8.23am and then suddenly the lighning changed to this:

    Unity_2019-01-22_19-39-24.png

    The same again at around 4.30PM
    Can you help me with this?
    What can i do, to avoid such jumps suddenly in the lightning?

    edit: and another problem, i set the profil to my custom profil, but when i hit play the standard profil is assigned. I don't know if this is a unity bug or the controller resets it automatically.
    And does the controller block the Environment Lightning Settings?
    Cause i can't adjust the multiplier nor change the color from the source and so on.

    Thank you very much for your time and support!!

    edit2: In the meantime i tried the old version 4.1.0 and there is the next problem.
    My Main Player VR-Camera is fixed at y297.93. so i have to start from very high.
    How can i deactivate this behavior?
     
    Last edited: Jan 22, 2019
  49. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Ok, i want to use the old version it is much better from the lightning i expect out of the box,
    the transitions are nice and there is no sudden lightning change alos i don't need clouds.
    But i can't use it when my MainCamera is tied to the controller 300 meter over the ground.
    So if you can help me with that, hopefully i'm ready to set up the rest bymyself.
    Thank you!
     
  50. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    777
    This is because you are using realistic time mode and have continued using the curve mode of profiles based on the timeline. You should change the curve mode next to each profile property to "sun elevation".
    CurveMode.jpg

    When using realistic time mode, the properties customizations cannot be based on the timeline because if you set a property value at 8 AM, depending on the date and location this may be daytime or may still be night time and the sky customization will come out of sync with the time of day.

    You are using a profile based on the timeline and it is set to sunrise at 6 AM, but according to the location you are using the day only dawns after 8 AM.

    Using the curve mode based on the sun elevation will fix this issue because of no longer matters the location, date and time. The sky customization will be based only on the elevation of the sun in the sky.
    • The left end of the curve (-1 curve time) represents the position of the sun at the lowest point of the scene at 270°.
    • The right end of the curve (+1 curve time) represents the position of the sun at the highest point in the scene at 90º.
    • The middle of the curve (0 curve time) represents the position of the sun on the horizon line at 0º.
    In this case you customize the properties according to the altitude that the sun is in the sky. See the demo scenes in the "Realistic Time Mode" folder to learn more about how this works and use the profiles that are in this folder because they are already set up the right way to work with realistic time mode.


    The sky controller updates the sky using the profiles defined on each calendar day. If the calendar day does not have a profile, it uses a random profile from the "Standard Profiles" list located in the Options tab.
    It is likely that you have set the profile on a different calendar day, or the day has changed to the next.

    Sorry, I did not quite understand this issue. I suppose you are using the precomputed sky model, if this is the case, then you should change the "Altitude Mode" to "Automatic" instead of "Manual" in the Scattering tab.

    This version is already deprecated and I no longer recommend using it.

    Best,
     
    Hormic likes this.