A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Works In Progress - Archive' started by Luckymouse, Sep 14, 2014.
Hi Luckymouse, any updates coming up soon? ;D
I believe at the moment the uSky image effects won't support "single or multi pass stereo VR"..
(Only the basic skybox setup support VR)
I'm investigating this issue now.
Please tell me more detail information about your VR project:
1) Which unity editor version?(5.5 or 5.6 beta?)
2) Which target platform? (PC, mobile: Sunsung Gear VR, mobile: Google Cardboard..etc?)
3) Which VR SDK? (Google Cardboard, Oculus or other?)
Tested on 5.5p2 und 5.6b6 on Oculus Rift and PC Target, in forward as well as deferred.
Also, is there a way to increase the night skybox resolution? 512x512 does not look good in VR.
Thanks pojoih for info, I'm currently also developing the VR for Samsung Gear VR Oculus. Because it is a mobile platform, I did not use any image effects stuff from uSkypro.
My office have a Oculus rift, I'm going to try to fix it for PC platform, right now I just can not promise any time soon or when will be fixed.
As unity document said that many of the image effects won't work for VR at the moment, it is quite tricky to fix. Also there have several different VR API for different stereo camera rig.
Here is the download link 1024 x 1024 resolution milky way skybox, it was originally from uSky 1.0, I believe it is little brighter, since I didn't modify the contrast.
Would it be possible to invert the X and Z direction of the world when using Realistic uSky Timeline? Blender exports everything in the OpenGL orientation while Unity uses Microsofts' weird orientation.
I have a huge project with many different chunks of the world and many code based assets like traffic systems. I would be an absolute nightmare to re-import everything. Also GPU instancing gets inverted normals if any Transform is flipped on any axis.
I would incredibly grateful if Z and X sun orientation axis swizzling was possible when Realistic uSky Timeline is set.
Also I noticed that the uSky atmospheric camera effect appears to get applied after the Unity post processing effect, regardless of component order. If I set the sun brightness really bright (As you should if you use tonemapping). The atmospheric scattering gets very blown out, with the Unity eye adaptation completely ignoring the uSky scattering brightness.
If invert the x and z, the whole equation of the coordinates will be broken completely. Day time will become night time. so timeline will not work correctly either. Because the Realistic Timeline calculates with tilted of earth's axis, the realistic timeline equation are fairly complicated.
By invert x and z just does not make any sense any more for the realistic sun and moon position, do you have to do it that way? I think the "Default" type is better in this case.
At least right now I have not find a solution for working inverted axis for Realistic Timeline equation.
I'm not sure why your GPU instancing get inverted normal, are you using unity standard shader, or custom shader? you should report the bug to unity team. Also you can easy to flip the normal in shader as well.
by "sun brightness really bright" Do you mean the directional sun light? or the sun spot (sun disk) in skybox, or the mie scattering?
Can you send me the project with uSky assets, unity post processing effect assets and scene file via private message (or email: firstname.lastname@example.org) for debugging?
Thank you for your answer.
I can send you a scene, but it's fairly simple. Just set sun light to 8. Sky exposure really high so that it looks good with the sun light. Add the Atmospheric Scattering Camera script. Download the latest Post Processing Stack from the GitHub page. Notice how post processing tonemapping ignores the scattering brightness.
I'm fairly sure that this might very well be a problem on Unity's end, and the solution might be to simply wait until the Unity post effects work smoothly with other image effects. But it might be worth to take a look.
Pweh, took a while to figure this out. If anyone's having problems with Single Pass Stereo and the Atmospheric Scattering Camera Effect, replace Line 56 in uSky\uSkyPro Beta 2\Shaders\AtmosphericScattering_Camera.shader
o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST);
o.uv = UnityStereoTransformScreenSpaceTex(v.texcoord.xy);
Nice, Thank you. My code was based on the early image effect from 5.6 beta, recent unity beta seems updated it to work with single pass stereo rendering.
I love the lighting results I'm getting with uSky. They're the best I've achieved in Unity ... and I've tested almost every store asset, even comparing it to Azure [Sky].
I would like to know what improvement plans have for uSky 2.0 and if it will include any new features?
I would like to show some captures of my test scene with the results of uSky. I hope it does not bother you ... I hope you continue working on this asset because it is very worthwhile and it is very cheap:
Now I would like to ask you some questions since I am having some problems
1) How can I make the moon have a "uSky light shaft" and that it works correctly?
2) Currently the "uSky light shaft" is shown even when the sun is behind a mountain ... How do you solve that? I leave a photo:
3) Another problem that is occurring to me is that the "Atmospheric scattering" does not seem to affect the sea and I think neither to the sky.
I use Unity 5.5.0
4) I would like to put another star map of the night sky, but I do not know if it can be done or how to do it. Can you tell me something?
5) Another question, will you implement any update for uSky to work on Dx11?
Nice looking clouds, are the clouds integrated in uSky?
Sounds great, thx ftejada.
My Single Pass quickfix does not do the whole trick, there is still some subtile discrepancy in the scattering because the sun origin point seems to be not positioned on same spot in both images, I suspect something in the "InScattering" function in athmosphere.cginc has to be rewritten for sinle pass stereo as well, but sadly my knowledge of this is too limited to fix myself. Help, please .
Maybe this can be fixed as well?
Another thing I'm looking at ...
Could you tell me where in the code I can change the update time of "Refresh mode" of the "Reflection Probe"?
So that instead of updating in each frame put it to be updated every 5 sec or 15 sec, etc etc ...
I have been looking at the uSky inspector some option to be able to change it, but I have not seen it
1. Add a debug.Log to the reflection probe updater to debug every render.
2. Notice that it doesn't render every frame. But only every timestep interval of the timeline.
I'm having trouble changing the density of the 2Dclouds. The part of the script in uSkyInternal that changes the 2DClouds shader is completely commented out. Yet the script still work. What is going on?
EDIT: I see now that you created a custom MaterialEditor.
I think I noticed a bug. If you change the Sun intensity the sun doesn't become brighter in the sky (skybox shader). This is obviously wrong. You can see the correct behavior with the Unity default procedural skybox.
Could you please fix this, since I use a high brightness for the sun and it looks completely broken with this bug. (Things that the sun shines on are brighter than the sun to the camera.)
The past year nothing really happens with uSky. Unfortunately too much issues in basic stuff.
Advertising new features and trying to earn money doesn't work if the basis are too buggy.
Ppl are not stupid and rate bad.
For a good working Sky asset I would play 100$ or more if it would updated to the latet Unity version continuously.
I really hope the author fix the issues in the first row, otherwise uSky is on my depreciated list.
Hi! There hasn't been any replies from the developer for over a month. Anybody knows if this asset is still being supported? Thanks!
In theory yes
I sure hope it's still being developed. It has the best looking lighting/atmosphere that I've seen and was good performance-wise as well.
I really hope so too. The sky looks fantastic
I'm getting the problem of clouds rendering on top of the terrain. There was a fix for this posted on 23rd March 2015, changing a line in the DistanceCloud.shader. I can't find this in the current version. Any ideas how to fix this in the current uSky please?
I have found this in uSkyPro Clouds 2D.shader:
OUT.pos.z = OUT.pos.w; // render behind all other objects on dx11, no affects on other platform
Lines 103 to 105. Patently mine is not rendering behind all other objects. But I have no idea what to do with this code (if anything).
Never mind - increasing the camera clipping plane fixed it. I noticed that the clouds were over distant cliffs but not nearby hills. No idea what's going on, but at least it fixed it.
Anyone has problems with Sun Shafts in Unity 5.6?
The problem was this basically: https://docs.unity3d.com/Manual/SinglePassStereoRendering.html
Getting errors in the UnityStereoScreenSpaceUVAdjust
Add half4 _MainTex_ST; as a var in the shader and it will work.
Looks fine to me. The origin point for sure is not the same, and the difference of the scattering position depends on the wrong setup of your VR camera eye distance simply.
Hi Luckymouse and folks,
I am a newbie in Unity and uSkyPro and I am just wondering if I can use uSkyPro to produce light scattering for indoor environment. I am making a pretty big platform and want to use uSkyPro to produce scattering light effect, but I also need to add extra lighting for the indoor environment. I find difficulty in managing the lighting on objects, sunlight is cast on the ground even the ground is completely covered by ceiling. I also try to add some extra lighting and I find the shadow cast by the extra lighting cannot be matched with the shadow cast by sunlight. Is there some tricks that can help? Or I just can't use uSkyPro in this task?
Hi guys, very sorry for the long absent in the forum here. Lately I'm extreme exhausted with my work, we have contract with Oculus, we just passed the milestone and submitted our first prototype vr game. So I can take a breath for little while now. Also during this time I have some personal issues to deal with. I know all of that should not be the reason to be absent for so long. Deeply apologise.
Because our vr project is using a custom static sky and environment shader for samsung gear vr. So we do not use uSky for that, thus uSky have not been update for quite some time now. I noticed many things have been broken in new unity editor version. I'm going fix them. I don't have the date when it will be done, but I will definitely will post update news here.
Please be little bit more patient, I will be back and answer all the question here. uSky will continue support.
Thank you Luckymouse for the update! Hope your personal issues gets resolved soon, I know it's sometimes very hard what we do as game devs! Goodluck wish you the best!
Sorry for all user that I have been absented for a while. Now I am going to answer all the previous questions here. I know the answer was late but I hope it will still help.
Current LightShaft is only work in Sun light as a single light source and Moon light will not count as a LightShaft source at the moment .
I will consider to add moon light that able to do the LightShaft at night in future version.
Try to tweak the LightShaft Occlusion Depth Range to higher valve, which mean it can occlusion far away object.
The maximum Depth Range will be same as your main camera far clipping plane
How the Atmospheric scattering works now is use the sky color to do scattering for world objects, That mean the sky color will affect the Atmospheric scattering, and not the other way around.
In most case the Sea shader is missing the z-write function, it needs to enable z-write in the shader to have the depth information for the Atmospheric scattering.
I'm also noticed in some occasional case that the Atmospheric scattering does not render as desire result for sea or ocean material. That mainly due to scattering is not really acting as fog function right now.I'm looking for better solution for that.
I assume you mean the Milky Way cubemap here, not the stars. You can put any custom cubemap to uSyboxPro material.
Make sure you add some noise to the cubemap texture to get dithering at night, it will avoid some color banding issue.
Also keep in mind that the original uSky Milky Way Cubemap tilted to match earth axis and stars.
Right now I'm not really planning to do implementation specifically for Dx11. However In future I'm considering to update the shader to support higher shader model (SM5.0) for highend graphics card, which capabale of doing some compute shader features.
uSky is multi-platform asset, which compatible with OpenGL or Metal. In future Vulkan will also play very important role in realtime rendering as well. The best part of Vulkan is not only faster rendering and cross platform, also save up easily 40% consumption of energy usage. In theory, your graphic card will get lower temperature to do the same rendering task. Especially good for mobile for less hot and longer play time.
I am totaly agree with you right now the both Image effects Atmospheric Scattering and LightShaft are completely broken for VR. I'm working on them right now to fix VR issues. At the moment only the basic skybox, clouds and lighting function (uSkyPro Basic Scene Demo) are working for VR.
You are right, If you attached the uSkyReflectionProbeUpdater component to the reflection probe that will not update everyframe, which only update if the sky color or timeline has changed. The purpose for that is save the both cpu and gpu calls and better gameplay performance.
Run everyframe solution:
You can set Refresh Mode to Everyframe, and without (or remove) the uSkyReflectionProbeUpdater component on the reflection probe.
This issue solved for you?
Well not really a bug per se, You can increase the Mie Scattering to affect the sun brightness effect in skybox.
Right now the I didn't link the sun intensity to mie, because I think i works better independently.
Lets say you are happy with how the sky look, and just want to increase the direct lighting to the scene. so you can just increase the sun intensity, the sky will still remain the same.
Generally all the main parameters for the skybox in uSkyPro component. Lighting component for the lighting (not skybox).
Well this idea may not make sense to everyone, I see I can come up a better work arround solution for it.
I am totally agree with you as the user point of view. Just remind here that some others sky assets used to sale for over $100 are depreciated already ( most user should known already). To be fair, still some good other sky assets in store as well.
Right now I can only maintain this asset in my spare time.
Yes the camera clipping plane affect the cloud dome size.
I'm looking for solution to fix current clouds dome rendering problem. May render the clouds in the skybox directly in future version, which it will be completely solve this issue.
Older then 5.6, i don't need to define the _MainTex_ST, in 5.6 it does.
Yes, added float4 _MainTex_ST; in the shader will fix this error.
Will update it along with other fix in future update.
In general, uSky and atmospheric scattering uses only a direction light as sun, It should work in outdoor or indoor (with windows) scene out of the box.
In case If you have unwanted scattering in your indoor area, try to increase the Near Scatter Push value in uSkyAtmosphericScattering to avoid it.
If you have light shadow, I'm not sure why the ground receive the light if it got ceiling. Frankly I don't really understand your question how extra light with shadow won't matched with the shadow cast by sunlight.
Maybe post some screenshot that may help me to understand your issue here.
Are you using Linear color space in your editor? It may cause color problem when build to Android. If it is the case I got same problem with that. Not really related to uSky, it is Android driver issue, which I can not do much about it.
Try to use Gamma color space for your android project, you should get the same color on android actual device as in editor.
Hi, I am using uSky in a space game. When setting the camera height to a very large value, the effects just went wrong.
Does uSky support viewing from outer space level? If yes, then how?
UPDATE: I have checked your @Luckymouse replies for the requests of viewing from outer space. I concluded that memory and performance issues are the main reasons. I also notice there is a setting of inscatter altitude sample, and I tried to increase the value to the max value 32, but still got the result I posted above. Both the original implementation from scrask and some other open source projects (e.g. AtmosphericScattering) support the feature. So, can you please include such a feature (viewing from outer space) in uSky? I really like the inspector and other integrations you have made for uSky.
Hey, @Luckymouse ! Does uSky unity2017-proof? I'm creating a new project with uSky imported and console throws me couple of errors:
Shader error in 'Hidden/uSkyLightShaftsComposite': undeclared identifier '_MainTex_ST' 'UnityStereoScreenSpaceUVAdjustInternal': cannot implicitly convert from 'half2' to 'float4' at line 55 (on d3d11)
Shader error in 'Hidden/uSkyPro/AtmosphericScatteringCamera': undeclared identifier '_MainTex_ST' 'UnityStereoScreenSpaceUVAdjustInternal': cannot implicitly convert from 'half2' to 'float4' at line 59 (on d3d11)
Right now uSkypro support up to atmosphere level, not outer space.
I will increase the depth level to 32 which supports with outer space, but I don't have date when will be done yet.
Sorry about that you can add the code uniform float4 _MainTex_ST; on both shader file.
You can add it under the line of uniform float4 _MainTex_TexelSize; (Make sure you added ";" at the end the code)
Then it should work fine again
Thanks for the reply. I finally solved the problem by myself.
For those who also wants the feature, I list the modifications here:
1. Uncomment "X32" in DepthSample enum in uSkySettings.cs, so we can change the value to Inscatter Altitude Sample to 32 in the inspector. Higher value means larger precomputed textures and lower performance. You can still keep to some lower values such as 16, but higher value will give more accurate effects.
2. This step is the most important. Change the Texture4D function in Atmosphere.cginc. Replace
// new 2D lookup.
float u_0 = floor(uR * RES_R)/ RES_R;
float u_1 = floor(uR * RES_R + 1.0) / RES_R;
float u_frac = frac(uR * RES_R);
// new 2D lookup.
// Improve billinear filter by candycat
// The depth axi does not need to be repeated mode. It depends on the height of the camera, so we just clamp it
float u_0 = min(floor(uR * RES_R), RES_R - 1) / RES_R; // Sample the current depth level
float u_1 = min(floor(uR * RES_R + 1.0), RES_R - 1) / RES_R; // Sample the next depth level
float u_frac = frac(uR * RES_R);
Basically, this step prevents applying repeat filter mode on the depth channel. uSky tries to replace 3D texture sampling with a well-layout 2D texture. As a result, uSky needs to simulate 3D texture billinear filters by hand-made codes. However, the original codes will sample to the 1st level when viewing from outer space, giving ugly edges as I posted before. So we can just clamp the depth value.
3. Pass your own Rg/Rt/RL/EARTH_POS/CAMERA_POS values to replace those hard-coded values in Atmosphere.cginc.
Hope these will be helpful. And hope the feature can be included in uSky some day.
wow!! Thank you for sharing Candycat!
Nice work. Wouldn't it be even better to create a multicompile shader that would switch to the more expensive variant at a certain height from the ground.
Rendering things at higher altitudes would be simpler overall since there would be less objects to render, so a more expensive shader variant wouldn't be too harmful.
Of course we can, and may also need to blend the effects of the two variants when switching to get a smooth transition.
Getting lots of compile errors with this asset unfortunately. I resolved this one by deleting the .cs files referenced, but I still get errors even though they don't always prevent builds.
Atmospheric Scattering seems to be impossible as far as I can tell. I read the ReadMe and assigned the correct components to both the active camera and the uSky prefab. Even the naked example scene for Atmospheric Scattering has compile errors which prevent it from running. Unfortunately this was the main reason why we got uSky in the first place.
#1 - Any solution?
#2 - Second question - in the demo scene, is the fog slider modulating Atmospheric Scattering, Unity Fog, or the uSky Unity Fog component? Because that's what we want.
#3 - For uSky's Unity Fog component, is there a way to change density?
#4 - Is the sunshafts component usable yet?
#5 - We are using uSky on mobile and performance seems pretty solid, but we wanted to know if you had any advice in this area.
hi, Color Blindness