Search Unity

uSkyPro – Precomputed Atmospheric Scattering [2.0 Beta]

Discussion in 'Works In Progress - Archive' started by Luckymouse, Sep 14, 2014.

  1. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Wow, glad it is working now. Yes, please lets me know what cause that earlier missing skybox issue.
    [Edit] Not sure what do you mean with "Also is your script Southern Hemisphere friendly?"
    uSky does not have Southern Hemisphere script.

    I think i can add a feature when i advertise uSky that supports Oculus Rift now.;)

    Btw, the new update is coming soon, will submit to asset store in 2 days.
    (It will also needed couple more days for pending review by unity)
     
    Last edited: Feb 27, 2015
  2. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    I mean. Could there be a way to switch from Northern Hemisphere Sun angles to Southern Hemisphere sun angles.

    We do projects around the world, and it would be great if we can just change our location within your script, by providing Lat and Long coordinates.

    The stars are flickering a lot. Is this normal?

    Very excited for cloud features. Looks great in the webplayer.
     
    Last edited: Feb 27, 2015
  3. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Actually rotation of the sun angle in uSky is not related to any Northern Hemisphere, just a basic rotation with both x and y-axis of the sun. Are you referring the Northern Hemisphere from stars position?

    Right now, I'm more focusing for the improvement on the scene lighting, visual rendering quality and performance of uSky. Implementation of real world coordinates will be very low priority for uSky project. I may add that in future but it will not be soon.

    About the crazy star flickering in the video above. It seems the "_Time" speed in the stars shader is different depend on the GPU power, faster GPU may get faster flickering speed. The speed value is hardcode in the shader, so If the stars flickering is too fast that you can edit the stars shader.
    It locates at uSky / Core / Resource / stars.shader

    After you open the file, change the line #35
    (_Time.x * 5)
    to
    _Time.x

    You can even make it slower multiply * 0.5 etc, or remove the "_Time.x" that won't do the flickering at all.
    I may change flickering speed that depend on DeltaTime in further, I need to investigate it more.

    [Edit]
    Try to change the flickering value below, see if that help:
    (_Time.x * 2 + unity_DeltaTime.x)
    [Edit]
    Actually, i'm not sure if i'm using the unity_DeltaTime correctly that way, anyway you get the idea that you can change the flickering speed in the shader.
     
    Last edited: Feb 28, 2015
  4. Andrzej-Skibinski

    Andrzej-Skibinski

    Joined:
    Apr 16, 2014
    Posts:
    13
    i would join the question from SAOTA, about adding longitude/latitude to uSky.
    In my company we also do alot of project around the world, where accurate sun positioning is essential. Currently in unity4 we use one of the ready-made sky/weather solutions, but had to modify it for our use. But we're testing unity5 now, and would gladly buy uSky for us, since it looks soo good. But if it had the long/lat for sun position, it would be even better :)
     
  5. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    Hi Lucky, I want to buy uSky. It looks amazing. But I have some queries : 1) I have Unity 4.6 free. I want to implement it in car race game were my object(Car) is moving & not Sun or any lighting. So can it work perfectly on dynamic objects? I want it for android platform. 2) How expensive is it on draw calls & performance on android devices? Also we would appreciate a video of tutorials just to see it functions before one can buy it.
     
  6. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    If it helps deciding I also would like correct sun position.
     
  7. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @ SAOTA , Andrzej Skibinski, kebrus

    I know many other sky/weather package included the longitude/latitude coordinates for sun position. I will see what can I do. I need to investigate more about it to implement it.

    @djoshi
    I'm not very sure about your question, uSky is just a skybox material, it should work as normally with any objects in the scene, I can not think of why it is not working with dynamic objects. Do you mean about lighting the dynamic objects?
    uSky has total 3 draw calls
    1st draw call: Skybox (skycolor, sun, moon, outer space cubemap.)
    2nd draw call: Stars
    3rd draw call : Sky Cloud (upcoming version)

    I haven't test it on any android devices, which i don't have any of them.
    Following is the test build result with Unity 4.5 on iPhone, you can get some performance idea that compares with equivalent android devices.
    uSky (Night Sky Disabled) on iPhone5 = 60fps
    uSky (Night Sky Enabled - full cycle) on iPhone5 = 50fps (full cycle day/night still need some optimization)
    uSky (Night Sky Enabled - full cycle) and Sky Cloud on iPhone6 = 60fps

    In general, uSky will work on mobile out of the box, but still need more optimization.

    Im also thinking to make a tutorials video later, maybe after i get scatter fog feature completed, then i will make a video.
    Right now, the framework of uSky is very simple, there have one uSkyManager gameobject, and two Directional lights ( Sun and Moon ). Most of the skybox settings are in the Demo Webplayer for you to try.
    uSkyLight controls the Sun and Moon light color. Let me know if you still have anything else want to know.
     
    Last edited: Feb 28, 2015
    Andrzej-Skibinski likes this.
  8. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I updated the package during the pending review, I think it reset the queue for being review. So i think it may take couple more days to be available.

    Here is the change log:

    uSky 1.1.0f2 Change Log
    =======================
    - Renamed Time of day setting to Timeline. Avoid naming confusion from other asset package.

    - Added Ambient Gradient and Ambient Intensity that control the RenderSetting Ambient.
    It can be easily manual predefined Ambient Gradient color for different Timeline.
    In Unity 4, it will show the Light Color gradient only that will be directly use as RenderSetting Ambient,
    This will balance default Light Color (yellowish) and Sky Color (bluish) Ambient lighting even the scene is not using any IBL material.
    In Unity 5, Ambient Gradient will be use as ambient color only if "Ambient Source" set to "Gradient" in Lighting window setting.

    At the current Unity 5, only Ambient Gradient seems work well for update the ambient in runtime build.

    - Introduce a new DistanceCloud beta. It is a sky cloud renderer on the hemisphere mesh.
    Implemented two type of texture mapping of your choice: Rectangular and Polar, both methods can be easily switch within the material setting.
    The cloud color is based on predefined "Light Color" and "Sky color" Ambient Gradient, which not related to skybox color.

    In Unity 5 the cloud will automatically render via any reflection probe's camera inside the Editor and Runtime.
    At the moment, the cloud will not render in skybox reflection (from Lighting window setting).
    So it only affect the object has reflective material in the scene, will not affect the ambient color lighting.

    - Removed Linear Space setting, now it will automatically detect the color space and skybox will automatically switch to correct color.

    - Removed the Density Scale and Sunset Time Offset That combined with single Rayleigh Scattering setting.
    It behaves similar to "Atmoshpere Thickness" from the Unity 5 Default-Skybox and behavior now match the description in the documentation.

    - Renamed Moon Inner Corona Color to Moon Inner Corona and combined Moon Inner Corona Scale into the Moon Inner Corona's alpha.

    - Renamed Moon Outer Corona Color to "Moon Outer Corona and combined Moon Outer Corona Scale into the Moon Outer Corona's alpha.

    - Improved default "Moon Outer Corona Scale" value that now behaves more consistently between Linear/Gamma space and when Tonemapping is using.

    - The Sun and Moon Light will auto Enable/Disable when it has no affect to the scene lighting.

    - Since Unity 5 Beta 22 ligthing changed, so uSkyLight changed the default value of sun intensity from 0.5 to 1.0, and default moon intensity from 0.1 to 0.4.

    - Changed Color correction of the Skybox in linear space that it uses power of 2.0 now instead of 2.2. Slightly more peformance friently.

    - Changed default "Star Intensity" value from 2 to 1, and the default Star flickering speed is little bit slower as well.

    - Since Unity 5 fixed the skybox preview with linear color space issue, now preview has been enabled for Unity 5.

    - Default Sun Size is slightly smaller now.

    Unity 4 Editor:
    uSky_DistanceCloud_Unity4.jpg
    Unity 5 Editor:
    uSky_DistanceCloud_Unity5.jpg
    ----------------------------------------------------------------------------------------------------------------------------------------
    I want to mention couple thing here about the coming update :
    - The cloud texture "clear" that you saw in last page that did not create by me, so i don't have the privilege to distribute it, so it will not include in the package. The other two cloud texture will include as the example how to use the new distance cloud material and give you idea how to create your own cloud texture.

    - I'm still working on the uSkymap with cloud (for scrawk's ocean material) that mentioned last page as well, and I don't want to delay the release date for this update, So I decided not include it this time, but it will be in next update.
     
    Last edited: Mar 3, 2015
    SAOTA and Andrzej-Skibinski like this.
  9. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    Exciting. Is there a way to get a link to the new version before assetstore update. Would love to play with Runtime GI gradients.
     
  10. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    SAOTA , I just sent you a PM.

    For other who own uSky and want to get the new update now, please send me a PM with uSky invoice number. I will reply you with the links. (Or just wait for assetstore update.)
     
    llJIMBOBll likes this.
  11. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Finally, the uSky v1.1.0f2 is on the shelf.

    Another small update v1.1.2 is coming too. That will be the last version that support Unity 4.
     
    SAOTA likes this.
  12. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hey Lucky, could you look into an issue we are having after this latest update? Basically the sky is constantly going black when working in the editor, in play mode everything is fine but it's starting to get annoying having flicker all the time going to black and the only way it renders correctly agin in the editor is by building the GI again
     
  13. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hey kebrus, do you mean the skybox going black, or the cloud? The different from latest update that I added cloud.
    So far i haven't get this issue and I will investigate it.

    [Edit]
    I noticed the cloud will go black sometime in editor, this issue is more obviously in unity 4, that have been fixed next update v.1.1.2 that submitted 2 day ago, pending review now.
     
    Last edited: Mar 12, 2015
  14. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Its not the cloud, its the entire sky. My current scene is using a light probe group, a reflection probe and the GI is on for the prebaked, so basically i have dynamic GI turned on. If I defocus unity window and focus again or if i reopen that scene the sky goes black.

    I wont be able to post anything today but tomorrow i'll try to gather some screenshots of the bug in action, i know that it's coming from usky because the bug stops if I remove usky and use the default sky
     
  15. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I'm still can not able to replicate that issue, but from my wild guess that it might cause by the auto colour space detection codes, that didn't update properly when the sky is not in focus. I just send you a PM with the latest version. Let me know if the black sky bug fixed or not. The upcoming v1.1.2 version should fixed that issue already.

    Here is the change log (with 2 small version updated)
    uSky 1.1.2 Change Log
    =======================

    *************************************************************************************************************************
    NOTE: THIS WILL BE THE LAST VERSION THAT SUPPORT UNITY 4, NEXT UPDATE VERSION WILL SUPPORT UNITY 5 ONLY!
    *************************************************************************************************************************

    - Changed Night Zenith Color color setting to gradient. That give user total control the night sky color from sunset to mid night. Now default night sky color is slightly darker.

    - In Unity 5, Reflection of the skybox Outer Space cubemap has been enabled. Especially when user set the "Outer Space intensity" to very high or apply a bright custom galaxy cube map that it will be reflected in the reflection probe as expected.

    - Added alternative Distance Cloud Cheap shader renders just simple flat shading for the cloud, it has been optimized for mobile usage.
    If The cloud color get too dark when applied Camera Tonemapping in Gamma Color Space, check the "Bypass sRGB Sampling" from cloud texture import settings

    - Improved "Distance cloud" material will always stay color correctly in Unity 4 Editor even if it is not in focus.

    - Improved automatic detection for color space when the color space has changed. Now all sky settings will get refresh and switch to correct color.



    uSky 1.1.1 Change Log
    =======================
    - Changed the Sky Tint color setting to shift wavelenghts range directly instead of multiply the existing sky color.
    The skybox shader has slightly less calculation. Now the neutral value of "Sky Tint" is grey color (128).

    - Added bonus uSkymap Renderer for Scrawk's Ocean material ("Ocean BRDF" and "Ocean White Caps").
    uSkymap will work in Unity 4 (Pro only) and 5. uSkymapRenderer will render and apply the uSkymap RenderTexture to the Ocean Material.
    Note: This update does not include Scrawk's Ocean project and you need to import it and implement it yourself. If you need help, feel free to ask me. If you don't need it, feel free to remove "Bonus" folder from your project.

    - Distance cloud has own default LayerMask at "Layer 18". This setting has not expose in Inspector, but you can change to different layer in the DistanceCloud.cs script.
    In Unity 5, you can add a name "cloud" to Layer 18, it allows Reflection Probe camera set the "culling mask" that render the cloud layer only, or no render it.

    - Fixed some Skybox shader bugs for better "Oculus Rift" support. (Thanks for user SAOTA helped with the issue).

    - Removed uSkyManager's Skybox Preview in the inspector. It has no cloud preview, so it seems really useless.
     
    Last edited: Mar 14, 2015
  16. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Hi there,

    I just purchased uSky, everything is looking great so far. When I put the uSky manager in my main scene where I have a terrain and such, it appears that the clouds are rendering in front of my actual terrain. Here is a screenshot of what it looks like:

    http://puu.sh/gLyYZ/1517b088ea.jpg

    As you can see, it doesn't look very nice. I noticed that it is only the clouds for sure that render in front because when I disable the clouds it looks fine. Any idea on how I can fix this?

    Thanks for your time,
    Matthew
     
  17. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hi Matthew, sorry for the bug. I noticed that uSky version 1.1.2 has this issue. This should be fixed in the next version.

    For the quick fix please open the DistanceCloud.shader and change this line of code:
    Code (CSharp):
    1.         v2f vert (appdata_t v)
    2.         {
    3.             v2f o;
    4.               .
    5.               .
    6.              // uncomment this code ( remove "//" )
    7.             o.pos.z = o.pos.w;
    8.               .
    9.               .
    10.         }
    Please let me know if that fixed the bug for you.
     
    Last edited: Mar 23, 2015
  18. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Yes that fixed it. Thanks!
     
    Luckymouse likes this.
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Looks nice. Interested. But notice moon and space skybox doesn't rotate. Would be nice to configure that :)
    Also do you have a recommendation for clouds?
     
  20. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @Luckymouse Hello, I just bought this asset and so far it looks brilliant! :) I only met one issue; when the night comes, the sky becomes peppered with black squares:



    The squares don't move, as if they were part of the sky dome texture. And then they disappear when the morning comes again. Any idea how to fix this? I'm on Windows 8.1, Unity 5.0.0f4, DX11, Deferred Rendering, Linear Space.

    Other than that, my only other notes are similar to @hippocoder 's: it would be nice to get the moon to move at night, as well as the star field.

    One last note: I absolutely love the simplicity and immediacy of this asset. Drop it in your existing scene, connect your directional sun light and the thing works. Kudos for thinking about user-friendliness!
     
    hippocoder likes this.
  21. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Thanks, As I mentioned in earlier page that the concept of night sky based on Cryengine and they have static night only.
    I think i got enough votes (included Seith and others) for rotatable night sky. I will implement it in future. Actually it is not hard to implement it.

    About the cloud, I think there are no perfect solution for all the different project and needed. Right now uSky has a just old school cloud texture on the dome (hemisphere) mesh. The cloud material is very flexible for different style of cloud texture. Also I think cloud can be generated from other 3D application like Vue or Terragen or from real photo etc, but it may need some extra manual work on the texture to make it look good.

    Hi Seith, Sorry for the bug you got. The black squares are the billboard of stars. There are some reason it was not working on your machine, I'm not sure why.
    When you play the uSky webplayer from the link in the first post, does the stars work for your machine?

    I just submitted new version v.1.1.3f4 to store (pending review now), the stars shader are optimised for Unity 5, see if that fixed your issue. If you don't want to wait, please send me PM with your invoice number, I will reply the new version link.

    Yes, answered for hippocoder too, I will implement it in future.
    Thanks again. Btw, coming new version v.1.1.3f4 will auto connect the directional light when you drag the uSkyManager prefab to a new scene in Unity 5.;)
     
    Last edited: Mar 26, 2015
    SAOTA likes this.
  22. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    I would also just like to add to the praise. This asset is uber simple. The developer is responsive as well. It is very easy to implement and glorious to use. I have been able to recreate many different environmental experiences with usky.

    My VR experiences revolve around realtime manipulation of time for architectural design and presentation reasons. The GI adapts and the clouds looks great.

    +1 for moving moon/stars.
    My only wish beyond that is geolocated solar and lunar angles.

    Also the hints of atmospheric fog is mouthwatering.
     
    Luckymouse likes this.
  23. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks for considering moving moon/stars. Cryengine is simply wrong, because the world will rotate and so will the moon :D but please consider making it configurable and also control (optionally) a second directional light for moon (which I think you do anyway from looking at demo).
     
    shkar-noori likes this.
  24. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @Luckymouse (I've sent you a PM with the requested info). So I did some digging and I've come up with the reason why the stars appear as black billboards in my scene. That's because I use projectors to create cloud shadows moving over the landscape. And for some reason they affect the skydome (no idea why).

    So if there was a way for me to specify a layer for the star billboards (or the skydome itself) then I could exclude that layer from the projectors' influence. And the problem would be fixed.

    On an unrelated note I've also noticed that if I specify a directional light for the moon, then the directional light flips 180 degrees and ends up shooting towards the moon, instead of from the moon. Is that a bug or an intended effect? If it's a feature I'm afraid I don't really understand it...
     
  25. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Glad that you found out the reason of the issue. I think there are easy fix for that. We can just add "IgnoreProjector"="True" in the Stars shader tag to avoid the projector influence the material.
    Code (CSharp):
    1. Shader "Hidden/uSky/Stars" {
    2. SubShader {
    3.             Tags { "Queue"="Geometry+501" "IgnoreProjector"="True" "RenderType"="Background" }
    I just realised that most of the Transparent shader from unity had that tag. I think I will add that in the next version to prevent this issue again in future.

    Sounds like a bug to me, I will check that out.
     
    SAOTA likes this.
  26. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yep, that fixed the unwanted projector issue! Thank you! :)
     
    Luckymouse likes this.
  27. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @Seith
    I figured what do you mean that if you rotate the moon direction from bottom to above, you will still get the moon texture on the night sky.
    The reason that right now uSky uses static night sky, the moon based on just simple (bi-directional) code to position it in the skybox. Most of the case the moon will shine from above to bottom (ground), so in general it is not a problem and i didn't pay attention to avoid this issue.
    After I add the rotatable night sky feature in the future version, I will try better way to fix it.
     
  28. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Sounds great, thanks!

    I have another request; I use Unity's sunShafts post-effect filter on my camera and it works with a transform object. The shafts are then shot from that transform's position. So it would be very nice to be able to get the position of the sun.

    Now I understand that the sun is not a real object, but would it be possible for one of the scripts to output a theoretical Vector3 position that could then be used to set the shafts object's position?

    I hope you see what I mean...
     
  29. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I have been waiting for people to ask this question, finally you did.:) (I assumed they all knew how to do it)
    To get the directional sunshafts that basically you can just modify a line of code in the unity sunshafts script and It will align the sunshafts pivot point to skybox's sun.
    Code (CSharp):
    1. v = GetComponent<Camera>().WorldToViewportPoint ( transform.position - sunTransform.forward / GetComponent<Camera>().farClipPlane);
    Here is a modified script: sunshafts.cs (Attachment below), you can just download it and replace the sunshafts script with this for Unity 5.

    [Edit]
    Actually, this modified directional sunshafts script will work for unity default skybox too, just wonder why unity is still use the old position based vector3 for the sun pivot.
     

    Attached Files:

    Last edited: Mar 26, 2015
  30. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thanks you. So I replaced Unity's sunshafts script with yours, unfortunately it doesn't seem to work. Here are my settings:



    The Sun light is the directional light used by uSky. But there are no sunshafts at all. If I set Shafts caster to none, then the shafts are visible but they're obvisouly not centered on the the sun.

    Would you have any idea how to fix this issue?
     
  31. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yes you are right, seems some problem.....it was working before, i will check. sorry about that.

    [Edit]
    For some reason it works fine again..:confused:

    Try to do the following step;
    1, if there has uSkyManager gameobject, just disable it now now.
    2, reset the Transform component of Sun Light (directional light).
    3, apply the sunshafts to camera.
    4, apply the Sun Light to sunshafts.
    5, Enable uSkyManager gameobject.

    [Edit]
    I think the sunshafts editor script cause some issue before.
    The setup you got is completely correct.
     
    Last edited: Mar 26, 2015
  32. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Mmh. I followed your instructions about 5 times, but that still doesn't work... :(

    [Edit]
    Is there maybe another way to find the sun's approximate position?
     
  33. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Weird, now it keep working fine for me here, even in a new scene (just with default skybox):
    1, apply the modified sunshafts to camera.
    2, apply the directional light to sunshafts.

    Try this attachment project, just a simple scene with sunshafts on camera and directional light.
    It is working on my side.

    [Edit]
    This modified sunshafts script is doing exactly that "find the sun's approximate position".
     

    Attached Files:

    Last edited: Mar 26, 2015
    SAOTA likes this.
  34. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes you're right, the sunshafts are working in this simplified project.

    But I noticed that in the sunshafts component on the camera there's written "Current Camera Mode: Depth". But in my project it says "Current Camera Mode: Depth, DepthNormals". I don't know if that could be the cause of the problem...
     
  35. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @Luckymouse How strange, I just closed unity and switched back to my project, reloaded my scene and lo and behold, it now works!!

    It is a good thing of course, but that is utterly bizarre... :confused:
     
  36. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I know it was strange. Glad that finally works for you.
     
  37. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Indeed! I hope it was just a fluke. Thank you very much for your reactivity, it is very much appreciated! :)
     
    Luckymouse likes this.
  38. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @Luckymouse I noticed a little issue that incurs a lot of unnecessary drawcalls at night: when the Timeline slider is at 0 (or rather as soon as the sun has disappeared behind the horizon) the sun's directional light intensity remains at 0.00195604 instead of being 0.

    This means that all the shadow casters are still casting shadows from the sun's invisible light as everything is still affected by that light. This causes the drawcalls to be much higher than they should be. If the intensity of the sun was completely down to 0 then Unity would stop evaluating that light altogether at night (as it should do).

    Could you please have a look at this?
     
    SAOTA likes this.
  39. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yes, but the sun light will be auto disabled below the horizon, so there should not have any shadow or draw call affected by sun at night. I tested in with "Simple uSky Scene". The draw call have no different if it is 0 or not.

    There are some situation that the sun light will not disable at night when the uSkyManager's moon light field is empty or uSkyLight's Enable moon lighting is off (this should be add in next update). The skybox needs at least one active light to work correctly.

    Anyway, sure that I can make the sun intensity to 0 at night.:)
     
  40. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Oh my, you're absolutely right, I'm sorry! I didn't even notice the light component is actually disabled at night. My most sincere apologies!
     
  41. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    No problem:)
    By the way, I know your project "Ghost of a Tale" developed before Unity 5, so are you porting it to Unity 5 and convert it to physically based materials?
     
  42. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, GoaT started on Unity 4 but recently I ported it to Unity 5.0. Best decision ever! :) And I just finished converting the shaders (using Shader Forge) into physically-based ones (I just made a post about it here: http://www.ghostofatale.com/updated-shaders-and-release-plans/).
     
  43. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Wow, looks great. Love to see if uSky will help for your lighting in this project.;)
     
  44. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thanks. It's still a secret, but I think it will... ;)
     
    Luckymouse likes this.
  45. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's a very lucky mouse that features in ghost of a tale....

    /pun
     
    ZJP, Seith and Luckymouse like this.
  46. willpower

    willpower

    Joined:
    Oct 6, 2013
    Posts:
    53
    Picked this up last night and really liking it! Here's a video of how it looks in my test scene.

     
    Luckymouse likes this.
  47. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @willpower,
    Thanks for the video. Awesome fighting AI. Really enjoy to see uSky uses in variety project.
    Is your project mainly target for mobile game?
     
  48. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @Luckymouse I'm very happy with my purchase I must say. I already had somewhat of a sky system going on, but this asset makes it so much better!! :)

    By the way I noticed a distortion issue when looking directly up at the "top of the sky". At first I thought it was a texture problem, but I found out it's a UV layout issue with the sky sphere itself. So I went ahead and fixed it.

    Here you can see before and after (toward the center of the picture):



    To fix it I just had to split the UVs at the top of the dome (they were all bunched up and caused the distortion):



    And here's the fixed hemisphere file, if anyone's interested (sorry for the fbx file size, it's bigger than necessary but that would only be a problem for mobiles).
     

    Attached Files:

    Last edited: Mar 29, 2015
    kebrus, nxrighthere and Luckymouse like this.
  49. boromir6

    boromir6

    Joined:
    Feb 23, 2015
    Posts:
    21
    bought it yesterday, and I'm pretty impressed so far. Hopefully this should spruce up my outdoor scenes. Cheers mate, and great job.
     
    Luckymouse likes this.
  50. willpower

    willpower

    Joined:
    Oct 6, 2013
    Posts:
    53
    Nah it will be primarily PC