Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uSkyPro – Precomputed Atmospheric Scattering [2.0 Beta]

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

  1. WellFiredDevelopment

    WellFiredDevelopment

    Joined:
    Jun 16, 2012
    Posts:
    661
    Hello,

    I just read through the entire thread and didn't see an answer to this, apologies if it's been asked before.

    Is it possible to use uSky with a spherical world?

    I am currently procedurally generating a world and want a pretty sky. ;)

    Regards,
    Terry
     
  2. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hi, Terry, uSky may able to do the spherical sky, but it depends on how your game world set up. I need to modify the shader code for that. I think you also better check out the scrawkblog's GPU gems sky and Proland project for the spherical world. it is free to download :).

    I bet your will need a sky for your 3D spherical game, because of your request, i just made a quick 2D prototype spherical sky (right now it renders on the plane). I think it may not what you want but it is fun to show you with Webplayer, (At the moment how the night fall may not be totally respond correctly with some angle from the sun ) :
    uSky_Spherical.png

    Webplayer

    You may post a screen shot of your game world here, so i have better idea if I can modify uSky to fit your project or not.
     
    Last edited: May 29, 2015
  3. WellFiredDevelopment

    WellFiredDevelopment

    Joined:
    Jun 16, 2012
    Posts:
    661
    Hey Luckymouse!

    Sounds great, actually, my game world will not be too dissimilar from the one you've depicted in your screenshots, it might be a bit bigger, but not by much, glad to hear it's working.

    If I purchase the plugin, could you send me those changes, or is this something you'll implement in the future? Also, I may allow the player to go out of the atmosphere, (this is not decided yet, it won't affect the gameplay, but could be quite cool.), is this something that uSky could support? Rendering the sky from outside of the planets atmosphere. Something similar to this (from GPU Gems 2 : http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html) :



    The world I've generated will not be as detailed as the one on the right, but you will likely be able to view it from such a distance.

    Regards,
    Terry
     
  4. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @ArtOfSettling
    If you decided to purchase uSky, I will send you as separate shader. Before you do that, I just wanna make sure if uSky will suit your need.
    uSky currently will not support outside of the atmosphere. If you really decided to want the player fly through from space to earth, I think scrawk's precomputed atmosphere may better fit for your project. Keep in mind that it requires to load about 16Mb precomputed data before start the game. uSky is designed as lightweight skybox solution for Unity 5 PBS workflow and other IBL framework in Unity 4.

    [Edit]
    runevision made also a Spherical Fog Shader that you may interested.:)

    @wetcircuit
    I will see if I may add more control for the scene lighting in uSky, but I can not promise now.
     
    Last edited: Feb 16, 2015
    wetcircuit likes this.
  5. Deleted User

    Deleted User

    Guest

    wow, looks interesting
     
  6. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @ArtOfSettling
    Because uSky is camera independent shader(do not need to calculate the camera world position), by default it may not work well for spherical world out of the box. However If your spherical world is big enough, due to the nature of spherical ground shape and from the player camera view, we can just lower the horizon level a little bit, the horizon will appear as a curve shape.

    Lets me know if this simple solution will fit for spherical world project.

    [Edit]
    You can give me the radius length of your generated spherical planet, and I can make a sphere in unity to see if that works. This solution assume your player is always near the ground level. For the flight game, I may need to calculate the camera position in the shader to control the horizon level offset. Or if your planet is small and distance from camera (something like previous webplayer), I need other solution for that. I'm not sure yet.
     

    Attached Files:

    Last edited: Dec 9, 2014
  7. gtpdzbiz

    gtpdzbiz

    Joined:
    Mar 21, 2011
    Posts:
    53
    Just wonder does usky have support for scattered fog? And is it compatable with beast light mapping?
     
  8. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    At the moment uSky does not support scattered fog yet, but it will be in my to do list.

    About Beast Lightmapping ( I'm not sure which Unity version are you referring to ):
    In Unity 5, then yes, uSky will work with built-in Beast Lightmapping. Basically you need to do is switch the realtime setting to baked or directly use the bake button in the Lighting window. It is pretty much working the same way as Sky-Procedural in Unity 5.
    [Edit] Sorry for in-correct info, there have no more Beast Lightmapping in Unity 5, and it uses Enlighten.

    In Unity 4 that uSky will not work for Lightmapping out of the box, I believe you can manually enable the IBL option of the Beast settings file, it should work the same way how Skyshop did. If you need the Lightmapping with uSky in Unity 4, please lets me know, i will find out more information about it.
     
    Last edited: Feb 16, 2015
  9. MegsTan

    MegsTan

    Joined:
    Oct 19, 2013
    Posts:
    55
    Hi,

    I purchased Quixel Suite 2 months ago and I think megascan is a separate purchase. Just wanted to know if there
    is also a way I can get those textures that you've got for quixel like those leaves etc. I see that the leave is not included in the material when you purchase Quixel Suite. Thanks! :)
     
  10. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @ MegsTan I just sent you a MP.
     
  11. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hi Lucky, i may have a weird question, I'm considering getting this for learning purposes, I know you started on Eric's work and went from then on but i'd like to know how well documented your package is, or at least how "readable" it is

    as a side question, how is fog reacting to this? is your solution only for the sky? if i put distant mountains will they blend well with the scattering effect?
     
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    This is pretty interesting. I have been using Vue for my realistic sky maps and I wonder how setting up things like clouds will make it easier to set up with your plugin. The skies in Vue are raytraced.
     
  13. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Documentation is basically for how to use the uSky and mainly explain what are the parameter settings for. I didn't explain what's under the hood of uSky. You can check out the documentation links here: _Readme.txt and uSkyRenderer.txt.

    I assembled many different formula to optimized uSky, but the whole structure of uSky still based on the concept how Eric Bruneton did with his sky. I use Preetham's algorithm to calculate optical depth, sun extinction and sky color instead of reading the precomputed sky data. This way allows the user to customize the sky color and the sky can be directly render realtime in editor, so you don't need to click the PLAY button to show the sky, it is very important for IBL workflow.

    Because of they are all physically based, thus both Preetham and Eric share the same BetaR (Rayleigh) and BetaM (Mie) values for scattering calculation.
    Basically Preetham, Eric and Cryengine that they are using all pretty much the same scattering algorithm. However Cryengine's Mie phase scattering calculation is most optimised among all.

    Shader ALU compares in Unity 4:
    Note: The Eric's Precomputed Scattering shader is from Scrawk who ported it to Unity.
    Code (CSharp):
    1. //Eric's Precomputed Scattering :                uSky:
    2. // Stats for Vertex shader:
    3. //        d3d11 : 8 math                         d3d11 : 10 math
    4. //         d3d9 : 8 math                          d3d9 : 10 math
    5. //       opengl : 8 math                        opengl : 10 math
    6. // Stats for Fragment shader:
    7. //        d3d11 : 145 math, 3 texture            d3d11 : 51 avg math (50..53)
    8. //         d3d9 : 225 math, 3 texture             d3d9 : 86 avg math (80..93)
    9. //       opengl : 198 math, 3 texture           opengl : 55 avg math (53..57)
    If you have any question feel free to ask me, i'm happy to share my knowledge and explain how i did it.

    No scattering fog yet, so at the moment it is only the Skybox shader solution. It will be implement to uSky in future.
     
    Last edited: Jan 6, 2015
  14. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    I see, well if you are following Scraw you should also consider the post processing version that automatically adds scattering to every object. If you could get rid of the dx11 dependency it would be awesome.

    Good job on getting away from the precomputed data though, having it more dynamic is always a plus in my book, and thx for the stats.

    I guess i'll have to put my hands on your work and see for myself :p
     
  15. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I never use the Vue yet, I will give it a try and it may give me some new idea for my clouds solution.
    For now here is a some temporary solution (I mention it also from last page):
    The easiest way is that you can always place a simple hemisphere dome or couple planes on the sky for cloud texture map. I believe that using particles clouds may also work well. About the clouds color that you need manually to apply the cloud color for different time of day.

    I'm still trying to figure out the clouds solution with scene lighting here:
    Most of the clouds system out there is not related to scene lighting in Unity 5. So far It seems that it will work only if the clouds renders inside the skybox which acting like a normal skybox texture.
    As you can tell this temporary solution I just mention above that have a hemisphere dome hangs around in the scene, it wouldn't affect the scene lighting neither. In general it is ok for the reflection probes, because the camera will capture the scene to a reflection cubemap, but it wouldn't do any good for skybox based ambient color.
    Some other package use the custom ambient solution (spherical harmonics lighting), however I'm trying to use the native Unity 5 ambient workflow as much as possible.

    In Unity 4, most of the third-party IBL frameworks that should work with any clouds solution for static ambient or it need to have custom ambient solution for dynamic time of day.

    I'm open for any suggestion.
     
    Last edited: Jan 8, 2015
  16. citizen_12

    citizen_12

    Joined:
    Jun 21, 2013
    Posts:
    33
    This looks very cool. Does the sky have to be blue though? For example if I wanted to do a sky over an alien looking world or a Mars-type environment, is that possible?
     
  17. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yes, you can change any color you want via wavelengths parameters. Please try uSky webplayer in the first post. uSky has also a sky color tint parameter that it will multiply the custom color with existing sky color.
     
    Last edited: Jan 13, 2015
  18. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Up coming uSky version 1.0.1 preview:

    Day and Night cycle Webplayer ( Skybox only, webplayer size: 2.3Mb)

    uSky_DayNight.jpg
    uSky_Material.jpg
    uSky 1.0.1 ChangeLog
    ====================
    - Renamed Component uSkyRenderer to uSkyManager.

    - Added Time Of Day and Longitude sliders to control the full Day/Night cycle of the sun rotation.

    - Added new uSkyLight script to manage the Sun and Moon lighting. Single editable Gradient to control the full Day/Night cycle of both Sun and Moon light color. It included two sliders to control Sun and Moon intensity.

    - Added new Night Sky with Moon, Stars Field and Outer Space Cubemap. Also added new Night Sky Parameters in uSkyManager. Included the MilkyWay Cubemap that match up with stars position of new Stars Field.

    - Now the uSky Exposure becomes a global lighting exposure control for the day time. It will affect final output of the Sun and Moon intensity with uSkyLight.

    - New "Night Zenith Color" will replace the "Sunset Zenith Color" through the night sky cycle.

    This new version will be available around at the end of this month in AssetStore.
    Note: Price will increase with this update to $30 for new buyer, who owned uSky already will have free upgrade.
     
    Last edited: Jan 15, 2015
    Charkes likes this.
  19. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    found a bug on webplayer, if you scale up the moon, you can see stars behind it.
     
  20. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yup, because the Moon texture renders inside the skybox, stars render in sprites and in front of skybox.
    I guess I need to find a way to dim the stars in the moon area.

    [Edit]
    Fixed the stars show up in front of the moon issue, updated the webplayer as well.
     
    Last edited: Jan 15, 2015
  21. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    New uSky version 1.0.1f1 is on Asset Store now.

    Also minor updated:
    - Combined the Density Scale and Altitude Scale to single Density Scale setting from range 0 to 4.
    (Updated the Webplayer)
    It works well with Sunset Time offset to create custom atmospheric effect in day time.

    - Included a simple PlayTOD script, it will play the Time of day in runtime.
    (It does not relate to real world time system, just a basic play speed control)
    To use that just apply it to uSkyManager and Play the scene.

    Please read the ChangeLog.txt inside the uSky Folder for detail.

    Note: new uSkyLight works well with built-in lighting in Unity 5. However, If you use Unity 4, it requires third-party IBL framework to get correct lighting.

    [Edit]
    The full Day/Night shader will work with mobile build (tested in iPhone 5 ), but it requires some more optimization in future.
     
    Last edited: Jan 22, 2015
  22. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Unity 5 Realtime Time of Day (Day/Night) Webplayer Test:
    Since the realtime skybox ambient is working still only in Editor, so I adapted more "Cryengine like" control for additional gradient ambient setting that able to change the ambient at runtime. That is using the RenderSetting's Ambient-Gradient, thus not related to skybox color. This method that ambient uses predefined gradient colors.

    [Edit] Webplayer (file size : 37Mb)
    (Requires Unity5 [5.0.0f1] or newer webplayer plugin installed )
    [ Temporary using Gradient Ambient for webplayer demo, so not all the Sky setting will affect the Ambient Lighting]
    uSky_Gradient_Ambient.jpg
    Note: I'm still testing the Ambient-Gradient, and it is not in the current uSky yet.
     

    Attached Files:

    Last edited: Feb 14, 2015
  23. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hi again Lucky, I have another question for you just to make something clear, how well dynamic objects react with your skybox? In standard unity 5 skybox I'm having troubles setting up a simple dynamic scene and have the sun go around it and properly lit objects at different times of the day. I'm guessing that you bake it in realtime, am I right?
     
  24. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hi Kebrus, I'm not sure which troubles do you have with the dynamic objects and dynamic scene? maybe can you provide some screenshots, and what lighting method did you use in Unity 5. It will help.

    Maybe the last Webplayer with gradient ambient that make you to think that I bake the scene for realtime. as I mention above post that this scene is not using skybox-based ambient, and using predefined ambient-gradient instead. So there are some settings to change skybox color will not affect the scene lighting.

    The fact that this webplayer scene is completely done in realtime with both ambient (gradient) and reflection probes, practically nothing was baked. What you see in the webplayer that all the objects set to static, they don't seem to be matter if I set them to dynamic or static, they are still properly lit. (In this case that ambient lighting is depend on the predefine gradient colors.)

    Right now, there are still some tricks to make the lighting work properly in beta. I did not use any "Light Probe Group" in that webplayer. I have tested that behaviour does the same as skybox-ambient that it will update the ambient fine at different times of the day in Editor mode only. However at runtime it does not work correctly, either sometimes works for static objects, or sometimes works for dynamic objects only. The last beta that only the gradient ambient works as expected with both dynamic and static objects at runtime so far. This Ambient behaviour changes time to time with different beta version though.

    Also keep in mind that only the static objects in the scene will have the GI effects, so they may look vary with two identical objects that marked as dynamic and static.

    The rule of thumb that uSky lighting based on Unity 5 IBL framework, the scene lighting itself reacts should be exactly the same as default built-in "skybox procedural". If something is not working properly with default skybox procedural, it will happen to uSky too. Since Unity 5 is still a beta version, I believe that eventually unity team will fix the problems or bugs. Any other bugs cause by uSky, of course I will fix them.
     
  25. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Uhm, i'm very confused right now, if i create a new scene with only a plane for the ground and a capsule for the test object above it, it gets properly lit but if rotate the sun which in turn changes the skybox dynamically the baking process kicks in, which is something that happens in edit mode alone so if my sun is high at a day time when i go into play mode and rotate the sun to a night time both the capsule and plane remain with the baked data and instead of going black they remain blueish

    if i turn off the baked stuff and delete the baked data it works but now i don't have any ambient light in the ground or capsule, which means they get zero contribution from the skybox (default unity 4 behavior) so i'm not sure how can you manage to have your objects be affected by the skybox dynamically when you change the sun direction

    what am i doing wrong?
     
  26. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Which beta version are you using now? In beta 22, Right now the Unity 5 Skybox-Ambient does work with only Static gameobjects in both editor play mode and at runtime build.
    If you use "Light Probe Group" that it seems working now with both dynamic and static gameobjects at runtime in beta 22.

    From the older beta, seems only the Ambient gradient is working correctly for runtime build. The previous webplayer that I used the predefined ambient gradient color for different time of day .

    The sun color is using the "Light Color" gradient from uSkyLight, color is not from the skybox.
     
    Last edited: Feb 6, 2015
  27. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Ok i managed to do it with the light probe group and reducing the intensity of bounce light to zero, but this is really a bad solution since they pick up light from other objects as well and scales really bad for large scenes because you have to add more probes. I then decided to add a reflection probe which you can set to only pick up the skybox and have it update in play mode and discovered that the intensity i previously set to zero doesn't even work if you have a reflection probe.

    Such weird behaviors... i would use the reflection probe alone for performance reasons but results are far from being the same. Right now the settings in the lighting menu seem broken to me, it makes no sense to have settings set to pick the light from the skybox and then have the skybox update nicely but objects are completely wrong
     
  28. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Ligthing in Beta 22 behaves really weird to me too. Even in editor seems working fine, but the webplayer build looks much darker. I temporary removed the old webplayer link for now.

    I believe the upcoming Unity 5 will be a release version, something like RC1.

    [EDIT]
    Re-uploaded the webplayer link in previous post above. Requires Unity 5.0.0f1 installed.
    Still using the Ambient Gradient.
     
    Last edited: Feb 6, 2015
  29. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Hi there Luckymouse,

    About the day/night update, I think there are 2 improvements that you could do:

    Performance: Disable/Enable Day/night light when it have 0 impact on the scene. Actually you only reduce the intensity (and color).

    Logic: Moon is not static at night. If you did it for getting stars on the skybox, I would prefer a material without stars and getting the normal cycle of the moon.

    EDIT: Parenting Moon to Sun Light solved my problem about moon rotation.

    Thanks for this amazing asset.
     
    Last edited: Feb 10, 2015
  30. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Thanks for the suggestion. :)

    1) Yes I can add Disable/Enable Day/night light function when it has 0 impact. Matter of fact I'm thinking to do so already.

    2) I know the real world that the night sky will rotate, not only moon that whole sky should rotate at night.

    Actually, right now the night sky based on how it has been done in Cryengine sandbox, their night sky is static and it will save some resources and performance. If i have a lot of user request the non-static night sky, i will add the rotate-able option to it in future.

    - To get the moon to rotate at night, yes you can parenting it to Sun. However it need to have more shader code to get it fade out properly at horizon. (Right now it will show up another moon at the opposite side when it is exactly at the horizon).
    - The stars is not render in the skybox. They are the procedural stars, it has nothing to do with the moon rotation,
    For a non static night sky that star need to generate a full sphere shape for the full cycle rotation, It can be easily modify in the star script. The current star field is using only hemisphere shape (half amount of the stars).
    - The Outer Space cubemap can be rotate as well, but It also need to sync the rotation with the procedural star field together.
     
    Last edited: Feb 19, 2015
  31. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Cloud Beta Preview Webplayer (Unity 4)

    uSky_Cloud1.jpg
    uSky_Cloud.jpg

    The Cloud texture is using just single Spherical (Polar) Texture, (no normal map).
    Right now the Cloud color shading based on both Light Color gradient and Ambient Sky Color gradient.

    [Edit]
    The sphere and the plane in this webplayer are just using the default Unity 4 "diffuse" material, not IBL material.

    Known issues
    - The cloud does not cover the background skybox properly (Sun, Moon, Stars)...working in process

    Please leave some feed back what do you think.;)
     
    Last edited: Mar 10, 2015
  32. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Upcoming Bonus uSkymap Renderer for Scrawk's Ocean BRDF and White Caps Project.

    OceanBRDF Webplayer preview (Unity 4)

    As you can tell, It doesn't have the sky cloud yet. After I finish the sky cloud from last post, it will be implement in uSkymap as well.
    uSkyMap_Screenshot.jpg
    It requires Unity Pro for RenderTexture. uSkymap will work in Unity 4 and 5.

    I will only provide the uSkymap renderer, and does not include Scrawk's Ocean project and you need to implement it yourself.

    Please leave some feed back about uSkymap as well.:)
     
    Last edited: Feb 11, 2015
  33. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    These look pretty good.... basically the Sun Color Multiplier and the Sky Color Multiplier gradients are being blended onto the cloud slices? I haven't worked with the gradient options yet.... I did get the gui "bug" once, but reloading fixed it.... I think "Night Darken" is misnamed as it adds brightness....

    Are you thinking of allowing us to load our own textures for the cloud layer? Of the 3 used, "clear" probably looks the most realistic. I like them all, but having a variety of mid-range coverage options will probably be necessary

    That ocean demo looks amazing.
     
  34. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    do you have a roadmap for the next updates? we are using it now since we can modulate the time of day and luminosity. but im interested in what you will do next
     
  35. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    1) Yes, right now the cloud material requires both color gradients for cloud shader.

    2) Of course you can apply your own cloud texture for your own level:). It can be easy convert from Rectangular texture to Polar texture in Photoshop's filter: Distort/ Polar Coordinate.

    Key features for coming update (mentioned in previous post above) :
    - Add Ambient Gradient for cloud color and as optional for ambient color lighting.
    The Ambient gradient will be directly use as RenderSetting Ambient for non-IBL material in Unity 4 and also can be use in Unity 5 when Ambient Source set to Gradient in Lighting window setting.
    - Add Distance Cloud beta ( show in the webplayer above)
    - Add bonus uSkymap renderer for Scrawk's Ocean Project.

    Roadmap for uSky:
    - Add Scattering Fog. (may requires Unity Pro)
    - Auto detect color space.
    - Improve some Editor GUI.
    - Improve the overall uSky performance, specially for mobile platform
    - Add 3D Particle Cloud? (maybe, not sure yet)

    Keep in mind that uSky is still a "works in progress" project, the asset store's price may vary when it gets more features.
    [Edit] uSky owner will remain free upgrade.
     
    Last edited: Feb 12, 2015
  36. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    The gradient represents the sunlight angle (time of day)...? Your gradient interface looks much less complicated than the Cryengine. Looking forward to this feature. It would solve my cloud/ambient issue at the top of this page...
     
  37. gbarnes

    gbarnes

    Joined:
    Mar 25, 2014
    Posts:
    5
    This looks very promising. Let me know once you have any update we can test in our project :) Especially interested in the cloud and scaterring fog additions.

    //Edit: Is it possible to alter speed of the clouds?
    //Edit2: Saw the rotate speed update never mind ;)
     
    Last edited: Feb 15, 2015
  38. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    hi Lucky, i finally got your asset, do you have a ETA for the next release? i want to change some things to fit my needs and i would rather do it on the latest version since unity is changing and breaking stuff a lot
     
  39. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yes, It represents the Time of day, see the picture below the representation of gradient keys:
    Gradient_Guid.jpg
    Hey Gavin, I know you are waiting for the cloud and scattering fog, as soon as finish I will inform you:)
     
  40. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Thanks, I hope you enjoy uSky. The next update should be around the end of this month (February):)

    [Edit] Additional info:
    Since Beta 22, Unity changed PBS lighting. Please change the default value of Sun Light intensity to 1.0, Moon Light intensity to 0.4 in uSkyLight. This new default value should give you more correct brightness for the scene. I will update that in next update too.
     
    Last edited: Feb 17, 2015
  41. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    yeah, I knew that already but thank you anyway

    Unity really is misbehaving, using the solution i gave earlier all works just fine but it breaks so easily. Breaks on restart, static and non-static attribution, lighting changes, etc. But when all works looks fantastic.
     
  42. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    we have a strange behavior in our project with usky:
    take an empty scene, add a cube and a sphere tris will be at 784, add UskyManager tris will be * 2 so 2,4 k.
    is it an normal thing or a bug? its a bit hard to have tris count increased that much by Usky
    if i toggle on/off the sunlight (directional light in the Usky prefab) it modify tris count too, but if i add a directional light myself there is no change so it really look like a bug!
     
  43. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hi Damien, I assume that you are talking about Unity 4, am I correct?. The tris count are different because of the directional light has the Shadow ON. You can try out that just add directional light without uSky, then turn the shadow On/Off, the tris count changes too. It really has nothing to do with uSky.

    [Edit] Well, In Unity 5 happens the same way, turn the Shadow ON/OFF of directional light, the tris count changes as well.
     
    Last edited: Feb 19, 2015
  44. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Playing with the RC3, the skybox ambient and reflection will still only update in Editor, not in runtime build.
    Seems the Ambient Gradients solution get more expected behaviour for any platform build and more customize control for lighting.

    I'm testing uSky in heavier scene, which The Viking Village Demo with real time Day/Night. Many Post effects in this demo. I wish I put the SSAO in this demo, however it is already too laggy, so i didn't.
    Nicest thing about this demo that most of the textures are from Quixel Megascans and very well physically calibrated.

    [Edit] Webplayer Link Removed
    Viking Village_uSky_Day.jpg Viking Village_uSky_Night.jpg
    Viking Village_uSky_1.jpg
    Viking Village_uSky_2.jpg Viking Village_uSky_3.jpg
     
    Last edited: Apr 30, 2015
  45. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Create a single reflection probe of type "realtime", refresh mode: "Every Frame", time slicing: "No Timeslicing" and the culling mask set it to "nothing". This will create a probe that captures every change you make on your skybox correctly and lit reflective materials correctly.

    Then create a light probe group, when in good use you should have multiple probe around your scene, but since i have a huge terrain with lots of stuff i simply use for the ambient main color. So I place the probe grid somewhere above the terrain and add/change the probe to a reasonable amount and spacing to cover at least half of the area.

    Finally in the lighting menu turn off the baked GI (optional, i do it because my scene is fully dynamic) in the General GI set the default parameters to "Default-VeryLowResolution" this is because the baking take huges amounts of times for huge scenes and i only need the probes for the general effect. I also set up the sun to the correct directional light.

    Finally hit bake, i usually have the continuous bake option off since it lags a lot. If all went right your skybox should affect and lit the objects correctly and i've yet to see a huge hit on performance. keep in mind that the bake likes to break for whatever reason so you need to turn off precomputed GI, delete your bakes in the optional bake button and then turn precomputed GI on again and bake again.

    Hope it helped
     
  46. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    @kebrus
    I got the pretty much same set up for the realtime reflection probe that render only skybox. It seems the realtime capture the reflection in heavy scene and every frame are too expensive, even capture in small as 16 resolution will still make the game play very laggy. Capturing cost depends on how heavy the scene is.

    A single reflection probe do real time capture the skybox only as a global reflection will work in this heavy scene, which it renders none of the scene objects. However it may not totally correct reflection in some area locally, for instance the objects that under the roof, they should reflect the color under the roof, not the bluish reflection from global reflection. Also the indoor scene may not work well with just a global reflection.

    Good idea to add some Light probe that will help for correct ambient color locally with minimum performance impact.

    Which ambient mode in render setting do you use? How you manage to make your ambient color change in runtime?
    For me, as I mention before that seems Ambient Gradients works in current Unity 5.
     
  47. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    I have it all set to skybox in the lighting window and i simply rotate the sun to see it when in play mode.

    After many experiments the way unity is behaving now is starting to me a lot of sense to me. Just think about, it's not like Unity is release a GI solution that works in dynamic scenes at no cost at all. Instead the cost goes up proportionally to the complexity of the scene and how much visual fidelity you want from it. If you want perfectly lit scenes bake it all with static elements, if you need dynamic stuff to react on it you have to have the light probes and reflection probes for their respective effects.

    An object under a roof should indeed be reflecting the roof and not the sky, but it's not like ambient color is even a real physical concept, it's yet another approximation to make objects feel like they belong to the scene, so between a single color, a gradient or a light probe calculation obvious the last one is the best, if you want the object under the roof to catch the roof color then just put enough light probes to pick it when under it and pick the sky when outside of it.

    Similarly these reflections are not true reflections, they just pick the nearest reflection probe and blend it. While the effect isn't very accurate in comparison to the real world it does a great job of convincing the eye of a reflective material. It's either that or none of if. We have been using specular in games for years and it's such a crude approximation.

    So all in all, I think it's working as intended, if you want more realistic effects just use more probes, at a cost, obviously.

    My problem with it is that i have this idea that, before, it was working by default with the skybox without using any probe at all. It doesn't make much sense to have it selected as using the skybox but then it picks probes.
     
    Last edited: Feb 21, 2015
  48. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    Great asset, excited to start testing in Unity 5.

    I'm having some issues in Unity4.

    I'm using an asset called Hovercast for my VR GUI and its doing the following...



    I've managed to link a slider to the timeofday value, but it only shows the sky when I remove my hand from the view.

    Any ideas?
    It looks like the stars are visible at night, but the gradient still disappears.
     
  49. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    [Edit]
    Skybox disappeared when the hand is on the screen, really strange.

    Have you can try to use other standard skybox to test? does it only happens with uSky skybox material?

    By the way the stars is not part of the skybox, so it renders as normal gameobject.

    [Edit] Just a idea:
    I think I might found the reason. The OVRCameraRig will procedurally create a new camera at runtime that Clear Flag set to soild with black color. I think some how this camera will become active when the hand is on the screen. So it will block the skybox with black color background.
     
    Last edited: Feb 26, 2015
  50. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    It does not happen with the normal skybox.

    It also only happens with the left hand, which is attached to the menu. I can lift my right hand no problem.
    The developer of the menu suggests it might have something to do with how the menu renders transparency.



    EDIT:

    I seemed to have fixed the problem. deleted all 3rd party assets and started from scratch. Will update once I know what caused the issue.


    How would I calculate the longitude value for a specific place.

    For example. How do I convert the following into a value for you longitude slider.

    30.0000° S, 25.0000° E
    South Africa, Coordinates

    Also is your script Southern Hemisphere friendly?

    Good job. Happy with my purchase.

     
    Last edited: Feb 27, 2015
    Luckymouse likes this.