Search Unity

Azure[Sky] - Dynamic Skybox

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

  1. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    I'm sorry, this code snippet with the error is from the Lux Water support and I just forgot to look at this when create the new version. Just change the "IN" by "Input" in the line 406 of the shader with the error.

    Change from this:
    Code (CSharp):
    1. half4 fogMask = tex2D(_UnderWaterMask, UnityStereoTransformScreenSpaceTex(IN.uv));
    to this:
    Code (CSharp):
    1. half4 fogMask = tex2D(_UnderWaterMask, UnityStereoTransformScreenSpaceTex(Input.uv));
    Note that the asset was not designed to work on mobile devices, the precomputed sky model is even less suitable for mobile devices because it is the most complex and expensive for performance and it uses Texture3D that is not supported by some platforms.

    I do not recommend using Azure on mobile devices.
     
  2. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    533
    I leave a couple of videos to show a little bit of Azure [sky]. They are very basic tests but I think they reflect the power of this asset if you work properly. Enviroment Lighting -> Source is in Gradient
    As a water I use Crest.




    a greeting
     
    DenisLemos likes this.
  3. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Amazing!
    Many thanks for sharing your feedback, Crest is amazing too and seems to be constantly improving.
     
    ftejada likes this.
  4. Ali-Nagori

    Ali-Nagori

    Joined:
    Apr 9, 2010
    Posts:
    138
    i'm still using unity 5.6 pro for licensing reasons.

    regarding the AQUA water fog scattering edit

    i checked your front page and noticed the shader modification code , unfortunately, i received this error

    Shader error in 'AQUAS/Desktop and Web/Double-Sided/Triple-Textured Bumpy': 'ApplyAzureFog': cannot implicitly convert from 'float3' to 'float4' at line 316 (on d3d11)
     
    Last edited: Jul 30, 2019
  5. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Sorry for the delay, I did some testing first, but couldn't replicate the problem.

    I followed the first page step-by-step using the latest version of Azure (v5.0.0) and also using the old version (v4.4.0) that comes with the package within a sub-pack and everything is working very well.
    Screenshot of Azure v4.4.0 test from Scene view.
    AzureAquas1.png

    Note that the instructions on the first page are for newer versions of Azure. I think you should be using an even older Azure version.

    Older versions of Azure required an extra argument in the "ApplyAzureFog" function to compute the projection:
    ApplyAzureFog (float4 fragOutput, float4 projPos, float3 worldPos)
    The package should contain a text file explaining how to edit transparent shaders to support the fog scattering and how to compute the projection (projPos).

    Newer versions no longer use the projection technique, so I recommend using the latest Azure[Sky] version. If I remember correctly, I successfully tested Azure version 5.0.0 and 4.4.0 on Unity 5.6. The only thing that should break is the transparent support for the Standard shader that I editted to work with the fog scattering because I used the shader from Unity 2017 and some shader features didn't exist in Unity 5.6.

    If you don't want to download the new version of Azure so you don't risk Unity overwriting the old package and you can no longer use it, I can send you the new version package by private message.

    While I was testing Azure and Aquas to find a solution to your problem, I ended up finding a issue with the step-by-step from the first page and already edited the post with the fix.

    The issue with the step-by-step from the first page is regarding the Aquas "FORWARDADD" pass. The same changes from the step-by-step should also be made in the "FORWARDADD" pass, but instead of using the following line of code:
    finalRGBA = ApplyAzureFog(finalRGBA, i.posWorld.xyz);
    You must use the following code:
    finalRGBA = ApplyAzureFog(finalRGBA, i.posWorld.xyz, float4(0,0,0,0));
    This is a variation of the "ApplyAzureFog" function with 3 arguments, this variation is special for handling additive passes.

    Without applying the same modifications to the Aquas "FORWARDADD" pass as well, the fog scattering will not affect point and spot lights over the water surface.
    AzureAquas2.png
    Now with the modifications also made to the "FORWARDADD" pass, the fog scattering properly fades the lighting over the water surface.
    AzureAquas3.png
     
    Last edited: Jul 31, 2019
    Ali-Nagori likes this.
  6. Quique-Martinez

    Quique-Martinez

    Joined:
    Oct 1, 2013
    Posts:
    105
    Apparently Azure locks the IntensityMultiplier of the environment lighting. Is it a workaround for it?
     
  7. Ali-Nagori

    Ali-Nagori

    Joined:
    Apr 9, 2010
    Posts:
    138
    i actually tested the new version in the 2019 version of unity and frankly i decided to use newer version of azure since the weather profile Data was much more better and less complecated
    however i had to change up some code to make it work

    in file
    AzureSkyManager.cs
    @line 66
    Code (CSharp):
    1. private Vector2 m_currentEventTime = Vector2Int.zero;
    2. private Vector2 m_previousEventTime = Vector2Int.zero;
    to

    Code (CSharp):
    1. private Vector2 m_currentEventTime = Vector2.zero;
    2.         private Vector2 m_previousEventTime = Vector2.zero;
    in file
    AzureSkyFogScattering.cs
    @line 19
    Code (CSharp):
    1. private static readonly int FrustumCorners = Shader.PropertyToID("_FrustumCorners");
    to

    Code (CSharp):
    1. private static int FrustumCorners;
    2.  
    3. private void Start()
    4. {
    5. FrustumCorners = Shader.PropertyToID("_FrustumCorners");
    6. .....
    7. .....
    and somewhere instead of AnimationCurve.Constant i passes the keyfram array instead

    you also used Vector3Int in some Vector3 operation
    for that i included this file as an extension for 5.6


    after this Azure was perfectly working in 5.6 and edited AQUAS shader and now every thing looks natural.

    Edit:
    i also followed your new instruction about the forwardadd
    and i tested it out with fire which uses point light and the result is perfectly natural.
     

    Attached Files:

    Last edited: Jul 31, 2019
    DenisLemos likes this.
  8. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    You cannot modify this property directly from the Lighting window because it is constantly being updated by the "AzureSkyManager" script as well as the environment colors.

    Instead you must set this property on each day profile, more precisely in the "Environment Lighting" section from the Lighting tab.
    EnvironmentLighting.PNG
    Note that to see the changes in real time, you need to edit the day profile currently in use by sky manager. Other properties of the Lighting window are also handled by Azure to allow you to set different values for each day profile and thus integrate with the weather system.



    I'm glad you managed to make everything work fine.
     
    Ali-Nagori likes this.
  9. Quique-Martinez

    Quique-Martinez

    Joined:
    Oct 1, 2013
    Posts:
    105
    Cool!
    Thanks
     
  10. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    14
    Hi there and firstly thank you for this excellent asset.

    I am trying the event system and cannot seem to get the event to have an affect. I have set Day, Month, Year to -1 and have set Hour to 12. My understanding is the event should then fire at 12:00 every day.

    The event action is your SetNewWeatherProfile, I have tried various values in there (0, 1, 2 etc) and nothing happens. I would assume the weather profile should change at 12:00 when the event fires? I know the event is triggering because if I put a large value in for the parameter an exception is thrown in the log (index out of bounds) at the expected time.

    Finally, I'm a bit confused, what does SetNewWeatherProfile do compared to SetNewDayProfile (I've tried both in my event by the way).

    Anyway, thank you once again, I'm enjoying playing around with your creation.

    John
     
  11. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi!
    Thank you for using Azure[Sky].

    I just tested it here and everything is working fine. As you mentioned that the event is firing, so the problem should not be with the Event System.

    This is the setting I used for the test.
    EventSystem.png

    Event Action 0: It fires every day at 12:00 and changes the weather to profile number 4 (storm) from the "Global Weather Profiles" list.

    Event Action 1: It fires every day at 14:00 and replaces instantly the profile currently in use by the sky manager. There is a variation of this method that you can set a transition time, but for some reason it is not showing in the Unity Event pick list.

    Some possible causes of the problem that I can think of right now:
    • The "Global Weather Profiles" list does not have the index you are setting in the "SetNewWeatherProfile ()" method, this explains the exception thrown on the console.

    • Maybe you are changing the weather for a profile already in use, so you don't notice any changes in the sky. To find out if a weather transition is currently in progress, just check the "Transition Progress" bar.

    • You cannot see the weather changing if you are within a local weather zone. Local weather zones are prevalent and you can only see if the global weather has changed when you leave the local weather zone.
     
    ftejada likes this.
  12. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    14
    Thank you sir for helpful response. I started again and it is now triggering as expected, must have been something I had not correct.

    Can I ask another question though, I'm quite confused with the difference between a weather profile and a day profile. In your example above for example, what would be the difference between setting a weather profile to "Storm" and setting a day profile to "Storm", isn't it the same thing?

    I have noticed that unless the weather profile is set to "Default" then the day weather won't change to a random day profile after midnight. Is this right.

    They're my last questions I promise (he says) :)

    thanks again

    John
     
  13. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    I'm glad it's working now.

    Yes, basically everything is the same thing!
    I just call "Weather Profile" a profile that is being used as a weather type in the "Global Weather Profiles" list.
    And I call "Default Day Profile" a profile that is being used as default by each regular day(@ Default). You can use the same profile in both cases.

    The system is designed to choose a random profile from the "Default Day Profiles" list and set it to the default day profile field(@ Default) whenever a new day starts regardless of the weather in use. But it's happening exactly as you said, the default day profile is only chosen randomly if the weather is set to default. Looking at the source code, I found that something is missing.

    Just add this line of code to the Update() of the AzureSkyManager.cs:
    Code (CSharp):
    1. profileController.defaultProfile = m_nextDayProfile;
    After this line:
    Code (CSharp):
    1.  
    2. // Make the transition to the next day only if the profile is different from the current profile and there is no weather profile in use.
    3. m_nextDayProfile = profileController.defaultProfileList[Random.Range(0, profileController.defaultProfileList.Count)];
    4.  
     
    Last edited: Aug 7, 2019
  14. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    14
    DenisLemos likes this.
  15. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    14
    I can't seem to be able to set Day Length and Timeline value via code. If I use the sliders in the Editor and then run they work fine, but trying to change those values in code at runtime has no effect. After changing daylength for example at runtime, the property value does change in the editor but it has no effect. I tried calling UpdateCalendar() after the change but that did not help.


    Thank you
     
  16. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    You need to call UpdateCalendar() always when you change the date by script to sync the calendar from inspector with the new date, it is not required if you want to change only the time.

    Changing day length will not take effect because it is only used to calculate the time progression step when starting the scene. So if you want to change the day length, you also need to recalculate the timeline progression step based on the new length value.
    Code (CSharp):
    1. if (Input.GetKey(KeyCode.Return))
    2. {
    3.     // Set the new timeline and day length
    4.     timeController.timeline = 19.0f;
    5.     timeController.dayLength = 10.0f;
    6.  
    7.     // Recalculates the progression step to move the timeline
    8.     m_timeProgression = timeController.GetTimeProgressionStep ();
    9. }
     
  17. Snark-s

    Snark-s

    Joined:
    Aug 2, 2019
    Posts:
    5
    Looks like I found an error.

    When changing the longitude, the starry sky changes twice as fast as necessary. When the longitude changes from -180 to 180, the Sun, as expected, makes one revolution, but the starry sky - two.
     
  18. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Thank you for letting me know.

    I could replicate the error and it only seems to happen when using realistic time mode. I'll take a look at this and try to find a solution.

    [Edited]
    @Snark-s I have already discovered the cause of the error and an update will be sent shortly to fix this and other bugs.

    Just need to change this line in the Update() of the AzureSkyManager.cs: It's located at the "switch" that checks the time mode, inside the case AzureTimeController.TimeMode.Realistic:
    Code (CSharp):
    1. m_starFieldMatrix = Matrix4x4.TRS(Vector3.zero, timeController.GetCelestialRotation() * Quaternion.Euler(options.starFieldPosition), Vector3.one);
    by this:
    Code (CSharp):
    1. m_starFieldMatrix = Matrix4x4.TRS(Vector3.zero, timeController.GetCelestialRotation() * Quaternion.Euler(options.starFieldPosition - new Vector3(0.0f, timeController.longitude, 0.0f)), Vector3.one);
     
    Last edited: Aug 12, 2019
  19. Snark-s

    Snark-s

    Joined:
    Aug 2, 2019
    Posts:
    5
    Thank you!
     
  20. ellisthemiracle

    ellisthemiracle

    Joined:
    Jul 4, 2018
    Posts:
    8
    Hi,
    I see a lot of skybox and weather simulation asset on the store page, and it's a really hard decision to choose one.

    I'm making a small exploration, walking sim kinda of game. I'm looking for a sky/weather asset that :
    1. Have automatic day/night cycle and random weather system.
    2. A system that I can add (random) events based on time of day (eg: shop close at night and open when daytime).
    3. How good the indoor lighting is?

    AzureSky by far is the most beautiful looking sky for me, that is a plus. Do we have a comparison list between other sky/weather asset so I can see the differences?

    Can I have opinion from anyone currently using the asset? Oh by the way, does AzureSky has light shaft (godray)?
    Thanks!
     
    Last edited: Aug 26, 2019
  21. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi!
    Yes, you can set automatic day/night cycles and some other time fetures, see the Time Controller tab in the image below.

    The package does not come with an random weather system feature because every game will require different mechanics to control and change the weather, so it is impossible for me to create a automatic/random weather system that works for every kind of game. On the other hand, you have complete control over the weather and you decide when and how to use it. The weather system was developed in order to make the use of the system as easy as possible, all the artistic customization of the system such as lighting, climate, fog settings, cloud settings, etc... is made using profiles.

    You can create as many profiles as you want and set different customizations for each one, you can use each profile as a default day profile, global weather profile or as a local weather profile. See the Profile Controller tab of the image below.

    You can switch (with a smooth transition) from one weather to another using the profiles added to the "Global Weather List" just by pressing the "Go" button for quick tests in the editor or by calling the "SetNewWeatherProfile(int index)" method from your script, so you just need to implement your logic to control the weather however you want it anytime you want.

    The local weather zones works automatically and uses a similar approach to the volume system from Unity's post-processing v2.
    Screen1.JPG

    You can do this very easily using the Azure's Event System.
    Screen2.JPG
    You just need to create an event action, to each event action you can:
    • Set a date and time to run the event.
    • Add as many UnityEvent as you want to control anything in your game.
    I don't know very well, I think it depends on your level design skills. Azure provides support for setting the directional light used to simulate the light from the sun and from the moon as well as some ambient/environment lighting control from the "Lighting" window.

    Unfortunately at the moment Azure does not support sun shafts.
     
    ellisthemiracle likes this.
  22. ellisthemiracle

    ellisthemiracle

    Joined:
    Jul 4, 2018
    Posts:
    8
    Thank you for the detail reply.
    I will consider to buying this asset, the Event system is really promising and the sky and effects are beautiful.
     
    DenisLemos likes this.
  23. ellisthemiracle

    ellisthemiracle

    Joined:
    Jul 4, 2018
    Posts:
    8
    I bought the asset, wonderful stuff.
    I have a question to ask though. Is there a way to scale up the rain particle? Because my map is bigger than the current particle. Also, is there any way to sync the sky and weather setting between scene?

    Thanks!
     
  24. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi, firstly thank you for purchasing Azure!

    The sky manager only handles the particle emitter and colors, you are free to change every property from the particle system, just play with the particle settings to get the behaviour you want.

    To sync the sky settings from one scene to another the best way is working with profiles. So, you need to get and store the current profile in use by the the sky manager before change the scene to be used later when the next scene starts.

    Exemple script: Note, this script will not work, it is for explanation only.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.AzureSky;
    3.  
    4. public class Exemple : MonoBehaviour
    5. {
    6.     public AzureSkyManager azureSky; // Drag the sky GameObject here
    7.     public AzureSkyProfile tempProfile;
    8.     public float tempTimeline;
    9.  
    10.     // This method returns the current sky profile in use by the sky manager
    11.     public AzureSkyProfile GetCurrentProfile ()
    12.     {
    13.         return azureSky.profileController.currentProfile;
    14.     }
    15.  
    16.     // Before you change the scene
    17.     public void Update()
    18.     {
    19.         // You need to store the current profile in use by the sky manager...
    20.         // and find a way to save this profile to be used in the next scene
    21.         tempProfile = GetCurrentProfile();
    22.         tempTimeline = azureSky.timeController.timeline;
    23.     }
    24.  
    25.     // In the start of the next scene, just get the profile stored from the previous scene...
    26.     // and set to the sky manager
    27.     public void Start()
    28.     {
    29.         azureSky.SetNewDayProfile(tempProfile);
    30.         azureSky.timeController.timeline = tempTimeline;
    31.     }
    32. }
    You can create a simple scriptable object with a public field to store the AzureSkyProfile, save to it the current profile in use by the sky manager before change the scene. As the scriptable objects are stored in the disk, it will not reset when change the scene, so when the next scene starts, you just need to acess the scriptable object to get the previously stored profile and set to the sky manager of this next scene.

    Let me know if you need help to create the scriptable object.
     
    ellisthemiracle likes this.
  25. ellisthemiracle

    ellisthemiracle

    Joined:
    Jul 4, 2018
    Posts:
    8
    Programming isn't my strongest suit so yes, I will need your help creating these script. Thank you.
     
  26. JalalGurbanov

    JalalGurbanov

    Joined:
    Sep 30, 2017
    Posts:
    5
    Hey there. The asset looks pretty good and what I'm looking for. I just have one question. Will it support URP (previously known as LWRP)? That's really crucial for me.
     
    Last edited: Aug 31, 2019
  27. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    To create a scriptable object you just need a script like this: You can add to it how many variables that you want to store and use it to manage all the things of your game.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.AzureSky;
    3.  
    4. [CreateAssetMenu(fileName = "Game Stats Profile", menuName = "New Game Stats Profile", order = 1)]
    5. public class GameStatsProfile : ScriptableObject
    6. {
    7.     public AzureSkyProfile azureProfile;
    8.     public float azureTimeline;
    9.     //public int score;
    10.     //public int playerHP;
    11. }
    12.  
    With scriptable objects you can make your classes work totally independently of each other, you just have to make each script read the variables of the same scriptable object. See this great article for a better explanation.

    Now with the script done, just create the scriptable object profile from the menu: Create>New Game Stats Profile.
    The profile Inspector should look like this with all the variables null by default.
    Capture1.JPG
    We are going to use this scriptable object to store and transfer the data from one scene to another.

    This sample scrit writes the current sky settings to the scriptable object before change the scene.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.AzureSky;
    3.  
    4. public class WriteData : MonoBehaviour
    5. {
    6.     public AzureSkyManager azureSky; // Drag the sky manager GameObject here
    7.     public GameStatsProfile scriptableObject; // Drag the scriptable object here
    8.  
    9.     void Update()
    10.     {
    11.         // In the event you use to change the scene
    12.         {
    13.             // Save the current sky setting to the scriptable object
    14.             scriptableObject.azureProfile = azureSky.profileController.currentProfile;
    15.             scriptableObject.azureTimeline = azureSky.timeController.timeline;
    16.         }
    17.     }
    18. }
    And this script read the data from the scriptable object and send to the sky manager when the next scene starts: Note, this script should be placed after the AzureSkyManager.cs in the Script Executtion Order, otherwise the code from the sky manager Start() will prevel. The sky manager aways starts the scene using the first day profile from the "Default Day Profiles" list.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.AzureSky;
    3.  
    4. public class LoadData : MonoBehaviour
    5. {
    6.     public AzureSkyManager azureSky; // Drag the sky manager GameObject here
    7.     public GameStatsProfile scriptableObject; // Drag the scriptable object here
    8.    
    9.     // In the event you use to load or start the new scene
    10.     void Start()
    11.     {
    12.         // Get the data from the scriptable object and set to sky manager
    13.         azureSky.SetNewDayProfile(scriptableObject.azureProfile);
    14.         azureSky.timeController.timeline = scriptableObject.azureTimeline;
    15.     }
    16. }



    Hi!

    I already have a version of Azure[Sky] Lite with LWRP support ready to send to the asset store and the fog scattering is currently integrated with post processing v2, but this is still a test and I will hold this update for now. In the LWRP is missing a very important feature used to render the post processing effect before transparent objects. I can't do that without using a custom "Render Feature", that I'm trying to figure out how this works for a better integration with Azure.

    Now the scriptable render pipeline will change again and the LWRP will be the new Universal Render Pipeline, so I will wait until the new render pipeline is alive to try to integrate Azure with it and forget the LWRP for a while.

    I hope the new URP will support rendering a post processing effect before transparent objects so you don't have to create a Render Feature to use the fog scattering.

    I plan to support Azure at least for the Legacy Render Pipeline and also to the new URP, but I don't want to have to learn a new engine again and again and again...

    Keep an eye on this forum, if the support for any new render pipeline is implemented, I will announce it here.
     
  28. JalalGurbanov

    JalalGurbanov

    Joined:
    Sep 30, 2017
    Posts:
    5
    Thanks. I will definitely keep my eyes on this. I really liked the asset and am looking forward to using it.
     
    DenisLemos likes this.
  29. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    14
    Hi there, I'm wondering if it's possible to change the level of the horizon on the skybox (or whatever it is that creates the sky).

    I have a terrain with a camera that is high and pointing down at an angle on the terrain. The trouble with that though is the stars and sky cannot be seen. I thought if the entire sky/horizon could be lowered I could have my downwards camera angle and also see the stars.

    Is this possible?

    Many thanks

    John
     
  30. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi, I'm sorry for the delay!

    I don't quite understand why you need to lower the horizon level, but the only way I know to do something like this is by moving at same time all the vertices of the mesh that Unity uses to render the skybox.

    Open the shader variant that you are using and try to add this line to the vertex shader:
    Code (CSharp):
    1. Output.Position.y += _ProjectionParams.z * 5.0; // Try a different multiplier
    Add the code above right after this line:
    Code (CSharp):
    1. Output.Position = UnityObjectToClipPos(v.vertex);
    Before:
    Screen1.png
    After:
    Screen2.png

    Note: This will move the entire skybox down and will cause the fog scattering to not blend properly with the background sky.
     
  31. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    14
    thank you for the reply and the help, yes my request was a bit strange I know :)
     
    DenisLemos likes this.
  32. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    241
    Hello i have same question to that System, have it Playmaker Support, will it work on top down game Template. And can i change on runtime the daytime. I looking for a sleepsystem how the player can sleep on a bed and change the daytime and the date, is that possibel with that System. Thx for your answers.
     
  33. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi!
    I have never tested Azure with PlayMaker or any other visual scripting, so the package does not come with built-in support, but that doesn't mean it won't work.

    Azure should work in any game style that uses camera in perspective projection mode.

    Yes
     
  34. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    241
    Thx for your answer, i will buy it and test it out.
     
  35. technomar

    technomar

    Joined:
    Nov 24, 2016
    Posts:
    1
    Azure and Crest don't seem to be compatible. That glowing horizon line is terrible:
    Capturar.PNG
     
  36. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi!
    I'm sure that Azure and Crest are compatibles. This glowing line at the horizon is from the Unity fog, just disable the Unity built-in fog on the Lighting window.

    Try the instructions I made in the first page to implement the Azure fog scattering support with Crest Ocean System.
    This is the result I got:
    Azure and Crest - Screen1.png Azure and Crest - Screen2.png Azure and Crest - Screen3.png
    I used the "ClearSky" profile and reduced the directional light intensity a bit because it was too bright for this scene.
     
    technomar likes this.
  37. Snark-s

    Snark-s

    Joined:
    Aug 2, 2019
    Posts:
    5
    Good afternoon!

    Now starFieldTexture is set as a 2D texture. Can it be set as a cubemap? How to do it?
     
  38. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi!
    Why do you need the starfield texture as a cubemap?

    You can even change the texture format to work as a cubemap, but unfortunately that won't be easy at all.
    This would require:
    • Changes the texture type from Texture2D to Cubemap in some scripts and editor scripts.
    • Changes in all the shaders the starfield sampler type from sampler2D to samplerCUBE and likely redo the uv calculations.
    • Convert the texture from equirectangular to cubemap, you can use the free asset Panorama to Cubemap for this task.
    I consider using the texture in equirectangular format the best option because:
    • Only one texture is required instead of six.
    • The texture resolution of each cube slice is limited by Unity.
     
  39. Snark-s

    Snark-s

    Joined:
    Aug 2, 2019
    Posts:
    5
    Artifacts at the poles appear in equidistant projection
    2019-09-23_16-47-20.png
     
  40. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    That's weird, I tried to rotate the starfield in all directions, but couldn't reproduce these artifacts even by setting the texture max size to 512p in the texture import settings.

    The equirectangular uv distorts the texture in some regions depending on the rotation because the Unity's skybox mesh is very low poly, but I couldn't see artifacts like in your screenshot.

    Try to play with the starfield position parameters located at the Options tab of the sky manager, maybe you can place the poles with the artifacts in a region of the sky not visible at night. If nothing works, I can go back to using a cubemap in a future update. I am thinking of starting a new version from scratch to add support for the new URP.
     
  41. Snark-s

    Snark-s

    Joined:
    Aug 2, 2019
    Posts:
    5
    [QUOTE = "DenisLemos, post: 4993961, member: 831167"] That's weird, I tried to rotate the starfield in all directions, but couldn't reproduce these artifacts even by setting the texture max size to 512p in the texture import settings.
    [/ QUOTE]


    Artifacts are not visible because the sky is black with few details. If you make the stars brighter or change the texture to a brighter defect, it is visible in the region of the polar star. Because of this, the star itself is not visible at all, and the nearest ones are distorted, this is especially noticeable with the daily movement of the sky.
     
    Last edited: Sep 24, 2019
    DenisLemos likes this.
  42. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    That makes sense, I had not tested with a starfield texture other than the default. If I can't fix this issue, I will use the cubemap again in the next version that is currently under development.
     
  43. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    241
    Is it possibel you can give me that Profile for the Mars ? I have look on the screens but something will not work on the new Version and some settings i found not anymore,that will help me alot. Thx
     
  44. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    502
    Hi @Pandur1982!
    I made 3 different profile settings to try to simulate Mars, I did it in a few minutes using an aerial perspective view, so you probably need to make some adjustments to fog distance and lighting.
    MarsScreenshot.png

    I set Mie's brightness and the directional light based on the timeline to remove the moon's lighting at night, because I don't know what the moons in Mars look like, so I chose to completely remove the moon from the sky.

    The profiles are attached to this post.
     

    Attached Files:

    Pandur1982 likes this.
  45. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    241
    Big Thx for your help i will test it out :D