uSkyPro – Precomputed Atmospheric Scattering [2.0 Beta]

Intro
This project is inspired the atmosphere rendering technique by the Eric Bruneton ( ported to unity by scrawk) and cryengine’s time of day.
[Released in Asset Store!]

Upcoming uSky 2.0 Beta (uSkyPro)
You can check it out here the WebGL Demo. (8.5Mb)
Note: Currently no occlusion on WebGL build that due to the limitation of the unity realtime shadow support on WebGL platform. (looking and working around other solution with it.)

For full feature demo please download the standalone version executable player.
uSky 1.0 and uSkyPro Beta Standalone Build Demo Download links




New uSkypro framework: precomputed atmospheric scattering
uSkypro is using most advance the precomputed atmospheric scattering framework that is based on Eric Bruneton atmosphere rendering technique.

The precomputed data can be share on skybox and atmospheric scattering image effect ( clouds too if needed). It doesn’t required to re-calculate in different shaders. Make more sense in practice usage.

This atmosphere scattering method is particularly working well from ground level to high altitude with any camera’s viewing angles.

A single layer of precomputed inscatter data represents as a “3D data” that included the full day/night cycle sky color and earth shadow. It can be included with ground level to high altitude sky data in multiple layers that as known as “4D Data”.

uSky 1.X version

What is it?
uSky is a Physically Based Atmospheric Scattering as a skybox. It will dynamically change the sky color with scattering based on direction of the Light. uSky is not only about nice looking background skybox, because it is a dynamically sky that you don’t need to search for different HDR sky image anymore. uSky can lighting your scene with natural sky light color, and it allows you also to customise how the sky looks.

Because uSky is skybox that it works flawlessly with Unity 5 RenderSettings build-in skybox-based ambient lighting and skybox generated specular reflection cubemap (global reflection probe). Ambient colour and reflection probe will completely and automatically generated with in Unity 5 Editor. So the color of the Scene contents (included both Dynamic and Static game objects) will automatically change according to the color of uSky.
Right now uSky works also currently for any third party image based lighting system in Unity 4. You just need to manually create the convolve cubemaps and set it up.

Features

  • uSky works with Unity indie and Unity Pro.
  • Support Gamma and Linear color space.
  • It is very optimized shader code for low end GPU friendly (Laptop).
  • Working with mobile platform.
  • No dll’s, working seamlessly with Unity Webplayer .
  • No DX11 required. So it is fully cross-platform compatible.
  • Compatible most of the current HDR image based lighting frameworks.
  • Working with the built in Ambient Skylight and Reflection Probes for upcoming Unity 5.

Note:
uSky requires SM 3.0.
uSky is currently working the perspective camera view only.

The Webplayer (File size 1.1Mb - Skybox shader: Requires Unity5 webplayer plugin installed )

Webplayer (Quixel Textures) (file size : 37Mb Requires Unity5 webplayer plugin installed )
[ Temporary using Gradient Ambient for webplayer demo, so not all the Sky setting will affect the Ambient Lighting]
Quixel Textures in Unity 5 Ligthing Test



Here is some IBL lighting test result:









9 Likes

Looking good I can give it a try on my dx11 soon

It works very nicly with dx11

Ah very nice. Is sun flare coming together with system? Also atmosheric effect changes depending on light position or its angle?

Hi,

It’s possible to blend your skybox with a standard one like : Unity Asset Store - The Best Assets for Game Making ?

Nice ! Just tried the lite version ( no HDR right ? ) :


Getting some good results so far !

1 Like

Thanks mathias234, glad to know uSky works well on Dx11.

Yes, the sun flare is coming from skybox itself, so far the uSky only renders 1 draw call only for the day and night sky. Please try out the uSky Lite project, you may get better idea.

[updated]
uSky will only count on the light directionally, it means the rotation only. The position of the light has No affect for the sun flare on the sky.

(By the way)
The 2nd draw call is the stars field at Night time. 3rd draw call is for upcoming sky clouds, Both of this draw call are only in uSky standard version, not in uSky Lite edition.

Yes, you can blend uSky with any other unity skybox material. uSky material itself is just a skybox.

In uSky Lite edition you can easily blend with other night sky. However if you blend with other skybox from uSky standard version, you may lose the original night sky.
In this case, you can modify the shader to add up one more cubmap as the background inside the uSky night sky. I guess I can include that with uSky in the future too.
By the way, After uSky submitted to asset store, all the source code will be included in the package.

Thanks for sharing your testing image, it looks great.
The both version of uSky is HDR shader. However after i saw your testing image, I’m just thinking that uSky itself has been HDR tone mapped already. Right now it is good for using for diffuse as Image base lighting. It may be not really good enough for HDR lighting for specular, it may be even better that if it renders another HDR cubemap without the tonemapping. In this case it will work for SkyShop and Unity 5 as well. Anyway, I will do more research how uSky works with other physical based material and HDR lighting in the future.

Works flawlessly in my place with Dx11, my only comment is the sky color really show differently in Linear space and Gamma space. But that’s only my nitpick :), for the rest it works great

Yes, I noticed it too, i will add the different gamma space option soon.

Some update:
Just did some more GI testing with uSky in 5 beta. Seems the HDR tone mapped that i mention earlier does not matter how it light up the scene, the brightness can be adjust by skylight intensity setting. I will post some image in the future.

Makes sense, I was having color cliping in my specular and diffuse cubemap. Would be nice to add an option to deactivate the tonemapper if some others like me use an image effect tonemapper.

Thanks and great work !

Amazing work, was the Unity 5’s Procedural Sky’s shader used as a base for this shader?
and btw definitely gonna buy

When will the first release be?

In the very beginning, it was thinking about that already, since you mention it, you just remind me again. Yes i will definitely make the sky tonemapping able to turn ON and OFF. In this case make more sense to have full HDR lighting for the scene, so user can turn on the camera HDR option and apply tonemapping image effects.

I guess many people may have same thought as you, but the true is uSky is NOT based on Procedural Sky from Unity 5 at all. I start it very early on and i finish it before i even know the Procedural Sky in Unity 5. uSky is mainly based on Eric Bruneton and cryengine technique. Do you know the Atmosphere Fog from unreal 4 is based on Eric Bruneton source code as well?. In my option Epic did NOT do the good job for that. original Atmosphere from Eric Bruneton looks much better.

uSky is based on:
// --------------------------------------------------------------------------------
//PHYSICAL MODEL REFERENCES
// --------------------------------------------------------------------------------
//RayleighColor : Preetham
//MieColor : EricBruneton
//Scattering : CryEngine
// --------------------------------------------------------------------------------
//OTHER REFERENCES
// --------------------------------------------------------------------------------
//NightSky : CryEngine

The reason I pick them as reference:

  1. Preetham gives nice physical blue sky in simple and practical optical depth algorithm, 2) Eric Bruneton’s physical sunset sky gives the best and realistic result that i ever see so far, 3) CryEngine’s physical scattering gives good result and optimized performance. 4) CryEngine’s night sky just looks good, simple and practical for game. Specially the HDR Stars from cryengine, I just love them.

Unity 5’s Procedural Sky just make me realized that I need to convert uSky from skydome to skybox, thats all.

By the way, the sun glare looks like from cryengine too, but I implemented by myself. it has better natural look than the one from Unity 5’s Procedural Sky.

I know mixed up all this formulas sound crazy. I Just felt like created a monster by myself too.
[Edit] monster = Frankenstein :slight_smile:

Should be around 3 to 4 weeks. Need to finish up the sky clouds first and do some more testing before ship it.

More info:
Just tested uSky run on HTML 5 WebGL nicely.
Can’t wait for the iPhone 6 to test, uSky is running already 60fps on iphone5 ( not iPhone 5S, it is just iPhone5 ) :slight_smile:

1 Like

this asset as it looks like will be something that should live in every dynamic game. waiting for release on U5.

It doesn’t matter as long as the monster still under control and not going frenzy in the whole village it’s still a good solution

Hi man i have one question, since your shader is working with skybox which is awesome, when the sun is down it render the bright on the opposite side of the sun too, it’s normal or…?

It happen because of physical scattering throughout the sky, It is physically accurate and correct when the sun is above the horizon. so yes it is completely normal.

By the way if the sun fall down, the earth should cast the shadow which I didn’t implement that earth shadow algorithm yet. The code of this physical shadow will not be cheap, at least for mobile platform. I will keep looking for cheaper method to fake the earth shadow in future.

1 Like

Um, why is windows saying something about encrypted folders when Unzipping?

EDIT: This is AMAZING! keep it up!

1 Like

Looks get great! :slight_smile:

Awesome :).