Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Azure[Sky] - Dynamic Skybox

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

  1. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Work in Progress... (actually ready)

    While the version 4.3.4 remains under pending review by the asset store team, I will now show the lightning effect that has been implemented for the version 4.3.5 that will be sent to the Asset Store shortly after the version 4.3.4 is accepted.

    See full screen and preferably use a headset. The quality of the video is not so good, but you can get an impression of how the new feature works.

    • Instead of just playing the sound of thunder as in the previous version, you can now set the frequency and speed of the lightning flash, which makes it possible to synchronize the flash light with the audio clip.
    • In the "Weather" tab of the day profile, you can set the intensity that the flash will affect the scene and the clouds.
     
    Last edited: Oct 12, 2018
    Quique-Martinez, magique and ftejada like this.
  2. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    486
    Very good Denis! I'm very happy to see the versatility Azure is taking ...
    It is increasingly simple to use and with greater features ...

    a greeting
     
    Quique-Martinez and DenisLemos like this.
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,156
    Can you make it so the lightning flash occurs a second or so before the thunder sounds? That would be more realistic.
     
  4. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Just informing that version 4.3.4 is already released, who downloaded version 4.3.3, please update to fix the fog bug.


    Of course, it's already done.
    You just need to adjust the "Audio Delay" slider to set the audio clip delay time.
    ThundeEffectsList.PNG

    I'm going to send version 4.3.5 to the Asset Store this weekend.
     
    ftejada and magique like this.
  5. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Just to inform that version 4.3.5 is already available in the Asset Store.
    Asset Store Link

    v4.3.5
    • Added thunder effect.

    • The public void "PlayThunderAudioClip(int element)" has been changed to
      public void "PlayThunderEffect(int element)".

    • The public void "PlayThunderAudioClipRandom(int element)" has been changed to
      public void "PlayThunderEffectRandom(int element)".

    • Added in the "Weather" tab of each profile two new properties to control the intensity that the flash of the lightning will affect the scene and the clouds.
     
    Last edited: Oct 17, 2018
    ftejada and Quique-Martinez like this.
  6. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    486
    What is this Denis?
     
  7. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,156
    ftejada and DenisLemos like this.
  8. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    It is the new thunder effect, I always get confused in the translation because in my language there is a word for every stage of thunder and in English, it always translates only to "Lighting or Thunder".
    I changed the post description to "thunder effect" so as not to confuse anyone else.
     
    Quique-Martinez and ftejada like this.
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,156
    It's also because you sometimes write Lighting instead of Lightning. If you forget the n then you are talking about something else entirely.
     
    hippocoder, ftejada and DenisLemos like this.
  10. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    11,042
    Only just saw the post I've quoted after being linked from another thread. I'm partly writing this post so you can bring their attention to this feedback in the future if need be. :)

    Broadly speaking I agree with this - their store, their rules. In principle I completely agree with the requirement that vendors have a portfolio and some way to provide support.

    But, two things.

    First, for providing support, I'd rather come here and use my existing Unity account than have different sites/logins/whatever for every vendor. I understand where they're coming from, for sure, but if they don't want it in here (the forums) then I'd like to see a support ticket system in the Asset Store itself so that, as an Asset Store customer, I've got one place for that. As a bonus, that would allow Unity to directly see how vendors are handling support (not the contents of issues, but whether they get looked at / responded to).

    Secondly, as a customer of the Asset Store, I don't want them stopping you from providing me with support. Refusing your update until you'd followed some rule changes doesn't just effect you, it effects us. And we're not just your customer, we're their customer too. I completely agree with them forcing vendors to follow (reasonable!) rules, but they should find a way that doesn't objectively make things worse for everyone.
     
    Metron, christoph_r, ftejada and 2 others like this.
  11. thunderdawn

    thunderdawn

    Joined:
    Sep 30, 2017
    Posts:
    15
    Hi! Just asking, was the Tropical setup changed in the new version? It looks kind of different (with both the sky profile and the post processing stack profile applied).
     
  12. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Hi!
    I did not make any changes, but it is possible that something has changed automatically in the setting of the Lighting tab.

    In earlier versions there was a directional light for the sun and another directional light for the moon, now only one directional light is used for both the sun and the moon. The properties that controlled these directional lights have been replaced with new properties and the previous setting has been lost and probably need to be set again.

    I tested with the profiles of the older version(v4.2.0) and it seems that nothing has changed, just the color and intensity of the directional light that needed to be configured again, because as the variables have been replaced, they are now using default values. I'll attach the profiles of the old version in case you want to use it.
     

    Attached Files:

    ftejada likes this.
  13. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    160
    I've made some huge changed to mine project, but now when I import the Azure[Sky]Controller prefab I get

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.AzureSky.AzureSkyController.Update () (at Assets/Azure[Sky] Dynamic Skybox/Scripts/AzureSkyController.cs:318
    Looks like It can't find or follow the Main Camera but is present, it's parented inside a GO


    [SOLVED]
    I was missing "MainCamera" tag. :)
     
    DenisLemos likes this.
  14. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    1,780
    Having an issue with global fog. It starts kicking in at like 15% or so of the distance. I'd like it at more like 50%.
     
  15. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    I didn't quite understand your question. To control the distance of the global fog, just set the "Distance" property on the Fog Scattering tab. The distance is in real scale, and if you have already set the distance and the fog still seems very close, the problem may be related to the "Blend" property.

    The "Blend" property controls the fog blend with the scene based on the distance. And the higher the blend value, the smoother the transition from where there is no fog to the part of the scene completely covered by the fog. So if you set a very high blend value, the fog transition will be very smooth and it will appear that the fog is starting very close to the camera.

    While you set the global fog, set the height fog density to zero so that it does not interfere with the result since setting the global fog and height fog at the same time can be confusing.
     
  16. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    1,780
    I have blend at 0. With a distance of say 2000, fogging is kicking in at like 150 or so. It's subtle but it's enough to wash out colors.
     
  17. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Got it!

    What you need is to do the reverse smoothing effect, in which case you would have to set a negative value to the "Blend" property, but the curve has been set to limit the minimum value to zero.

    I just modified the script editor that controls the profiles inspector to make it possible to set a negative blend value, you just need to import and replace the script that I'll leave attached to the post.
     

    Attached Files:

  18. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    1,780
    Great! Thanks again for the awesome support!
     
  19. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    160
    I can't get to turn lights on when the night fall...
    Here is my code


    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.AzureSky;
    3. public class TurnLamp : MonoBehaviour
    4. {
    5.     public AzureSkyController skyCtrl;
    6.  
    7.     public bool LightOn = false;
    8.     public GameObject[] Objects;
    9.  
    10.     public bool earlyValue = false;
    11.    
    12.     void Update()
    13.     {
    14.         if (skyCtrl.timeOfDay.GetTime().x > 18 && skyCtrl.timeOfDay.GetTime().x < 4)
    15.             LightOn = true;
    16.         else
    17.             LightOn = false;
    18.  
    19.         if (LightOn != earlyValue)
    20.         {
    21.             earlyValue = LightOn;
    22.             ShowHideObjects();
    23.         }
    24.     }
    LightOn still false, but in console I can see the correct value of skyCtrl.timeOfDay.GetTime

    What I'm doing wrong?
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,156
    Change your && to ||.
     
    DenisLemos likes this.
  21. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    160
    yep got it one minute after the post :D:rolleyes:
    Thank you :)
     
    magique likes this.
  22. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    @MaximilianPs You can instead of check the time of day, create a curve output to control the intensity of the lights. This way you do not have to activate and deactivate the Light components of each light because when the light intensity is zero it is automatically ignored by the lighting system and does not affect the draw calls count. You can put a light on the scene and compare the draw calls count when the intensity is 0 or 1.

    Exemple:
    • First, create a curve output in the sky controller.
      CurveOutput.PNG
      In this example, I'm going to use element 0 of the list, so I've already set the curve with a value of 0 between 6h and 18h and with a value of 1 between 18h and 6h.
      CurveSetting.jpg


    • After that, just create a simple script that will grab the value of the curve output and apply to the light intensity.
      Code (CSharp):
      1. using UnityEngine;
      2. using UnityEngine.AzureSky;
      3.  
      4. public class LightController : MonoBehaviour
      5. {
      6.     public AzureSkyController skyCtrl;
      7.     public Light myLight;
      8.     private float m_lightsIntensity;
      9.  
      10.     // Update is called once per frame
      11.     void Update ()
      12.     {
      13.         // Get value of the element 0 from the curve outputs and apply to light intensity.
      14.         m_lightsIntensity = skyCtrl.GetCurveOutput(0);
      15.         myLight.intensity = m_lightsIntensity;
      16.     }
      17. }
      If you change the "myLight" variable to an array or list, you can control all the lights in your scene with the same script.
    With this method you have more control over the intensity of the lights and can make the intensity increase smoothly as it gets dark, you do not have to worry about turning the lights on or off and still use less code.
     
  23. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    160
    Thanks :)
    But mine was just a test 'cause I'll have an NPC that will walk on each lantern and will turn on and off each candle ;)
     
  24. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    160
    Weirdo question:

    could be used a Sun like this one ?

     
  25. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Yes, you can set a custom texture for the sun and also for the moon. The background color of the texture should be completely black and the background should be larger than the colored area. Your texture, for example, needed to be edited so that the colored part was not too close to the edges of the texture.

    The color of the sun texture will also be influenced by the color of the sky and the sunlight scattering, so the custom sun will not show exactly the same color as the original texture. And depending on the time of day, the texture may be upside down or inverted.
    CustomSun.jpg
     
    MaximilianPs likes this.
  26. Alcyone

    Alcyone

    Joined:
    Nov 15, 2013
    Posts:
    13
    What about LWRP?
     
  27. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Hi, good question!
    For now, it is recommended to use Azure[Sky] only in the default template.
    • LWSRP: The sky is running smoothly, but the fog scattering effect is not working, it seems that post-processing effects work differently with LWSRP and HDSRP, and the fog effect for some reason is not being rendered on the screen.
    • HDSRP: It is not working for now. It seems that with this template the skybox is not used, and instead Unity uses another technique to render the sky in the background.
    One of the next steps in my to-do list is to add support for LWSRP and HDSRP. But so far I'm not sure what to do. I'm completely in the dark here, I have not found any documentation or some material that explains what needs to be modified in the custom shaders so that they work correctly with the new rendering templates. All I have so far are the sample scenes that come with each template, but unraveling all those scripts and shaders to try to figure out what's going on will be a terrible headache.
     
  28. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    11,042
    Are the HD and LW SRPs far enough along to be effectively supported yet? I would hope that once they're reasonably stable they'd provide documentation for that stuff.
     
  29. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    I think that's exactly it, from my research on the forums, the reason for not having much information on how to work and modify the custom shaders to be compatible with SRP is because the Scriptable Render Pipeline is still a preview and a lot of things will change until the official release.

    Creating documentation and material for a resource that is still premature, at the moment it seems like a waste of time and maybe supporting LWSRP and HDSRP at this stage of development is not a good idea.

    I was hoping to start developing my game using HDSRP, but I think I'll change my mind because my project will have many custom shaders and will also use many assets from the Asset Store and almost all of them are currently not working with HDSRP.
     
  30. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Hello, just purchased this. Looking good! Nice documentation.

    I was wondering...

    I'm trying to also use Ceto Ocean in my project, because I have it, and understand it reasonably well.
    It reflects the skybox nicely, and generally integrates fine with Azure Sky, but the Fog Scattering doesn't seem to work with it.

    Here's a screenshot that displays the issue I'm having.



    Does anyone else suggest a fix or an alternative solution, preferably not involving buying another asset, but I'm open to hearing options.

    Perhaps using a different type of fog? Height fog instead? Or something?

    Or a different type of water/ ocean?

    Or just by tweaking some settings on the script on the camera, or something?



    Cheers!
     
    Last edited: Nov 8, 2018 at 9:20 AM
  31. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Does anyone have a favorite WATER / OCEAN solution they like to use with Azure Sky?

    I've actually not even tried the built in Unity Water, is that a good option these days, with good compatibility with Azure Sky?

    Cheers.
     
  32. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Also, it might be my settings [YES! See below! :D], but I'm finding that the sky sometimes dramatically POPS from day to night (utterly changing color from, say, orangey to bluey, in a single frame... instead of there being a transition.

    [EDIT: My mistake! I had "Light Speed" set very low, so that transition was happening too quickly, especially as I had a 4 minute day cycle, so the sun was also moving relatively quickly. I bumped the Options > Light Speed setting up to 0.25, and it's transitioning nicely between day and night].
     
    Last edited: Nov 8, 2018 at 8:38 AM
  33. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Also, how does one enable Height Fog?

    I couldn't find mention of it in the docs.

    And I searched for it on this forum, but only found people talking about it, not how to actually turn it on or adjust the settings. :)

    [EDIT: Ahhhhhh! I finally found it. It's a setting inside a Weather Profile. I noticed it in a screenshot in the documentation, but hadn't been able to find it at all by searching for the term "Height" in the PDF. Might be nice if you add some text into the documentation for future users explaining something like "You can edit the settings for the fog in each profile, including the Height Fog, etc" so that it is searchable, as I would have found it straight away, if so.]
     
    Last edited: Nov 8, 2018 at 9:27 AM
  34. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Is there anywhere with a full description of each of the Profile settings (Scattering settings, Deep Space settings, Fog Scattering settings, Cloud settings, etc)...?

    There are a lot of them, and often I don't find the names and value ranges all that intuitive just by looking at them.

    It would be great to have them explained in more detail, even if it's just a sentence for each value.

    There are names like "Distance", but it's not always clear whether that means Starting Distance, or End Distance, etc.

    Also, how do the Colors work in the various settings? Do the keys along the Color span over the duration of a day?

    [I think I'm partly just a bit slowed down because it involves a lot of opening and closing curve editor windows, which can be quite jarring compared to just sliding a number, and sometimes it's hard to see if it's taking effect immediately in the game window. I might get used to it after a bit more poking around. :)]
     
    Last edited: Nov 8, 2018 at 9:51 AM
  35. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Hi @muzboz!

    The fog scattering is a post-processing effect and therefore only affects the screen pixels that draw in the depth buffer. It is likely that your water system does not draw properly to the depth buffer or if it draws to the depth buffer, perhaps this information is being generated after the fog is rendered. The fog scattering is rendered after the opaque geometries and before the transparent geometries(after a long time, I discovered that this is the best way to apply the fog in the scene).

    Ceto is no longer available in the Asset Store and since I do not have this asset, I can not support or make modifications to make it compatible with Azure[Sky]. Azure[Sky] comes with a text file that explains how to modify your transparent shader to work with the fog scattering effect, this modifications worked with the simpler transparent shaders that I tested and also worked fine with Crest Ocean Render as you can see in this post, maybe it works with Ceto as well.

    One of the most promising water systems I had the opportunity to use was Ultimate Water System, but unfortunately, this asset was also removed from the Asset Store.

    Now I'm putting my hopes in Lux Water, I bought this asset yesterday and I'm trying to make it compatible with the Azure's fog scattering. Actually, Lux Water already works with the Azure's fog scattering, but not in the best way. The depth buffer information of Lux Water seems to be being generated in the transparent queue or after the fog scattering is rendered, so it is necessary to remove the [ImageEffectOpaque] attribute from the fog scattering script so that the fog affects the water, but it is not the best way to work with the fog and this action will generate strange behavior of the fog with transparent objects that do not draw to the depth buffer.

    Regarding the curves and gradients, once you get used to them, you'll realize how much better they are than simple sliders. The curves and gradients allow you to set different values at different times of the day, and as the time of day changes, the values automatically adjust to the values defined in the key points.
     
    Quique-Martinez likes this.
  36. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Finally I managed to make Lux Water work with the Azure's fog scattering the right way. Only a few lines of Lux Water shader code needed to be added or modified.

    Spoiler: Only $9 for a water system of this quality is practically free.

    Just as it was with Crest Ocean Render implementation, for the fog to work properly on the surface of the water it is necessary to set in the "Options" tab of the sky controller the "Mie Distance" to 0.0, otherwise, the scale of the fog over the water will be wrong and will not work properly. Or open the "fog base" shader and change that line of code:
    float mieDepth = saturate(lerp(1.0, viewDir.y * 4, _Azure_MieDepth));
    for this:
    float mieDepth = saturate(lerp(1.0, viewDir.y * 4, 0.0));

    This is the default scene of Lux Water demo.
    DefaultScene.jpg

    This is a sunset screenshot of Lux Water scene using the water shader modified to work with the fog scattering.
    EditedScene.jpg

    This is a night screenshot.
    EditedSceneNight.jpg

    Underwater effect is also working like a charm with Azure[Sky] fog scattering.
    UnderwaterScene.jpg

    I'll send the edited shader to the author of Lux Water to see if it can be included in the package.
     
    ftejada and angrypenguin like this.
  37. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Looks promising! I've bought a copy of Lux Water, as it does look to have some cool features.
    I like that it supports underwater mode. Nice!

    Would you be able to post a list of the changes you needed to make, so I can make them at my end in the Lux Shader?

    (I'll also ping the Lux developer to ask if I can get the Azure compatible shader from them, as that might speed things up on that front).
     
    Last edited: Nov 9, 2018 at 12:24 AM
  38. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Checking out Lux Water now.

    The foam is not that great looking, but maybe I can fiddle it to look better.

    I think it does the underwater effect quite nicely. But overall, it's not looking very good as water, from above, in my opinion.

    I'll keep working at it! Need to read the manual more, and tweak away on it.
     
    Last edited: Nov 9, 2018 at 12:21 AM
  39. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Gonna keep fiddling with Lux, and see if I can get it looking nicer.

    Also gonna check out Crest.

    And maybe I can try updating the Ceto shader to work with Azure, but it looks like a bit to get my head around. :)

    And maybe I can combine elements of them (maybe using Ceto above water, and Lux underwater) to get the results I want, but to be honest, it's the challenge of combining different packages that I find rather difficult (as I'm a just a game designer who can do a bit of gameplay programming). :)

    We'll see!
     
    Last edited: Nov 9, 2018 at 12:22 AM
  40. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    The Lux Water shader is a surface shader and therefore the editing process differs from that shown in the text file with instructions on how to make custom transparent shaders compatible with the fog scattering.

    Follow these steps and you'll be able to make the necessary modifications, but just save the shader and return to the editor when all the modifications are done because the shader for some reason takes a lot of time to compile. It took me a long time to do the implementation because every modification I needed to save and test, and each time it took about five minutes to compile.
    1. Open the LuxWater shader and change this line:
      Code (CSharp):
      1. #pragma surface surf StandardSpecularLuxWater vertex:vert   novertexlights   nometa   keepalpha   nolightmap   addshadow   nofog
      to this:
      Code (CSharp):
      1. #pragma surface surf StandardSpecularLuxWater finalcolor:ApplyFog vertex:vert   novertexlights   nometa   keepalpha   nolightmap   addshadow   nofog
    2. Add this line of code along with the other #include files. This will import the fog data to be used in the shader.
      Code (CSharp):
      1. #include "Assets/Azure[Sky] Dynamic Skybox/Shaders/Transparent/AzureFogCore.cginc"
    3. Add this to the Input struct.
      Code (CSharp):
      1. float4 projPos;
    4. Add this lines to the void vert just after the line: UNITY_INITIALIZE_OUTPUT(Input, o);
      Code (CSharp):
      1. o.projPos = ComputeScreenPos(UnityObjectToClipPos(v.vertex));
      2. COMPUTE_EYEDEPTH(o.projPos.z);
    5. And finally add this void anywhere between the void vert and the void surf.
      Code (CSharp):
      1. void ApplyFog(Input IN, SurfaceOutputStandardSpecularLuxWater o, inout fixed4 color)
      2. {
      3.     color = ApplyAzureFog(color, IN.projPos, IN.worldPos);
      4. }
    6. Save and wait a few minutes until the shader is compiled.

    This method uses a texture containing the fog scattering data, the texture is projected onto the transparent objects of the scene that are using the modified transparent shaders. Because the fog data is stored in a texture, the projection will not work properly if the "Mie Distance" of the Options tab from the sky controller is greater than zero.

    The temporary workaround is:
    • Set the "Mie Distance" to zero, or...
    • Or open the "fog base" shader and change that line of code:
      float mieDepth = saturate(lerp(1.0, viewDir.y * 4, _Azure_MieDepth));
      for this:
      float mieDepth = saturate(lerp(1.0, viewDir.y * 4, 0.0));
    I'm going to try a new approach to make the fog scattering effect work with the transparent shaders for instead of using a texture projected onto the scene, do the calculations of the fog directly on each shader in the same way that the Unity does with the standard fog.
     
    Last edited: Nov 9, 2018 at 3:54 AM
    ftejada and muzboz like this.
  41. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Thanks! Trying this now.
     
    Last edited: Nov 9, 2018 at 4:07 AM
  42. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Sorry!
    My English is very bad and I ended up writing the finalcolor:functionName completely wrong. When you fixed the name it generated this error because it already contains a function with the same name and the error did not appear for me because I wrote the function coincidentally with different names.:oops:

    I updated the previous post with the instructions, now it should work.
     
    Quique-Martinez and muzboz like this.
  43. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Haha, ok, thanks.
     
  44. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    I'm still getting an error "Shader error in 'Lux Water/WaterSurface': Too many texture interpolators would be used for ForwardBase pass (11 out of max 10) at line 166"

    Not really sure what I'm missing.
     
  45. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Did you leave the original "#define FOG_EXP2" enabled in the water shader?
    Or have you commented that out?
    (I have it enabled).

    Also, do you have "#define LUXWATERMETALDEFERRED" on or off?
    (I have it enabled).
     
  46. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Also, in the Lux Water documentation, it explains that if you want to use Deferred lighting, you have to make some changes to the shader, and add a scipt to the scene camera "LuxWater_CameraDepthMode"... so that might all make a difference to the integration between the two assets??

    (There is reference to these things in the last 2 pages of the Lux Water manual).
     
  47. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    Maybe you have added an extra texture interpolator in the Input struct instead of just the "float4 projPos", or maybe the shader, when compiled on your system, needs an extra texture interpolator. Pixel shader 3.0 only supports 10 texture interpolators and the error message is reporting that the shader has exceeded the limit.
    Change #pragma target 3.0 in the shader to #pragma target 4.0 should solve the problem but this will only work if your video card supports pixel shader 4.0.



    I have changed only what is shown in the instructions of the previous post, the rest of the shader is totally original.



    It did not make any difference to me.
     
    Last edited: Nov 9, 2018 at 6:03 AM
  48. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    31
    Have you tested AZURE SKY much with the standard Unity Water? Does it work well with that?

    I'm sort of just looking for anything that works with it for now, and I can come back to some of these other options later..

    Without having to mess around, what is the best option that supports Azure's day, night, weather profiles, and fog? :)

    Or do all options involve some pretty serious tinkering...?
     
  49. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    400
    It's been a long time since I've used Unity's standard water, unless they improved it in some recent version of Unity, that would be my last option.

    Currently, Lux Water seems to be the best option that I found in the Asset Store, lacking to add few features for this to become the ideal water system currently available in the Asset Store.
    • A procedural mesh must be added to simulate infinite ocean.
    • Improve the foam effect and normalmap.
     
    Last edited: Nov 13, 2018 at 4:57 PM