Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Planets Earth, Mars and the Moon Shaders

Discussion in 'Assets and Asset Store' started by vercetty00, May 15, 2014.

  1. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41


    Hi !

    I just released this planet earth shader on the asset store :

    Planet Earth, Mars and the Moon

    As the title suggest, with this pack you'll be able use a 8K (8192*4096) earth texture (one of the shaders wrap four 4K texture to achieve this). This is for the main texture, others like normal or specular still use a single texture.
    The description on the asset store explains what the asset conains and some screenshots ;)

    Here is how it looks "out of the box" :



    Then here's the web player demo (but textures are heavily compressed, so it doesn't looks very good)

    Web Demo

    And finally the documentation that show how it works and the credits :

    Documentation


    The purpose I try to achieve with this is to make an earth that looks as close as possible as these kind of photos :

    http://news.bbc.co.uk/1/hi/8547114.stm

    To do that I spent a lot of time playing with the color curves on Paint.NET :p I'm quite happy with the current result but it's still far from perfect ( green lands are "too green" , the Sahara desert is a bit too bright with some reddish tints etc..)


    In the next updates, I plan to do the following :
    - Keep working on inproving the global rendering (especially the colors)
    - Adding the Moon (i've already done it in a game project, i just have to implement it in this pack)
    - Doing something about the clouds (normal mapping, shadows, make their movement more elaborate than just continuously rotate on one axis)

    This is how it could looks in a game (that's the game project i'm working on) :
    Please note that in this video the game use an "older" version the earth (no sun reflection, atmosphere too gray..)


    Just one note: I haven't test it but I'm pretty sure this is NOT mobile friendly ;)

    Any suggestion, feedback, remark, question, bug report or complaint are very welcome,

    Thanks!
     
    Last edited: Jul 10, 2015
  2. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi,
    I've just submitted a little update on which I've modified textures a bit, especially the ground texture, in order to get an earth as close as those pictures :
    http://news.bbc.co.uk/1/hi/8547114.stm

    Here's the NASA blue marble "true-color" pic :


    And here is the earth from this version


    Starts to look like something but there's still place for improvement :
    - Atmosphere is way too bright
    - Clouds are somehow "warmer" with some kind of yellowish tint. And some of them should be brighter.
    - Amtospheric gradient on the edge within the circle doesn't look exactly the same.
     
    Last edited: May 24, 2014
  3. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi,
    A new update - 0.3 - has been released :


    8K Earth, Mars and Moon Shaders

    (And the name has changed to fit better to what the package actually provides)
    An update in which, among other things, I've added Mars and the Moon:





    And here's a short presentation video :




    One other improvement is that now the planets prefabs work on themselves without the need to set anything.
    In that way you can instantiate them dynamically.
    The only prerequisite is that the sun object (or any object that serves as the main light source) must have a given tag ("Sun" by default, but of course you can change that string in the code).
    This is necessary for the outer atmospheric effect (so the Moon is not concerned)

    Now i'm working on Saturn, but I'm facing some big challenges, especially with shadows and transparents shaders of the rings..but "hey"

    Any feedback is welcome, thanks !
     
    Last edited: Jun 17, 2014
  4. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    wow very nice work, on the second post your pretty close to the result, i would make the scatter a bit bigger and more softer, and looking at the result again and your result the dark side has a really smooth falloff while and most people have a falloff like most shaders in unity, and your clouds seem sharper then the reference. but overall really awesome work!
     
  5. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Thank you !
    Yes you're right, for the outer atmosphere it's due to the scatter algorythm itself (from the nVidia GPU gems) I havent really touched it: the atmosphere gets brighter and more "white" as the angle between the atmosphere and the light direction tends to zero. It's smoother and looks much better on "crescent phase" (see 1st pic or the mars pic), but on "full phase", there is that white edging that screw the global rendering a bit..
    The only solutions I have in mind are either make the inner tint brighter and whiter to reduce the contrast, or directly touch at the outer scatterring algorythm.. but there is some nebulous maths in there :)
     
    Last edited: Jun 17, 2014
  6. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi !
    I've made a little update :
    First, there's a new shader that fakes cloud shadows to add some reliefs in clouds rendering, it looks like this :


    Of course there are options to change shadow layer opacity. And you can play with the altitude of the cloud layer by changing the scale of the sphere on which the cloud material is applied.

    Secondly I replaced all textures of Mars, which looks much better now (on previous version, there were some weird optical effects that made some craters look like hills, and hills look like valleys (Mount Olympus looked hollow :/ ). Now it looks like this :

     
  7. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi !,
    A new update has just been released, it significantly improve the earth rendering.
    I applied the 8k texture present on the earth surface texture to the earth normals, city lights, clouds and clouds normals (which is new, too). So yes, it's quite demanding now (but still OK for most rigs), so I leave the previous shaders in case you got performance issues.
    I also updated the demo scene which gives more options to move the camera.
    Here's how it looks now :
    ( If you can, please watch it in 1080p60fps in Chrome ! )



    And some screenshots :





    And here's the link :

    https://www.assetstore.unity3d.com/en/#!/content/17593
     
  8. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Does the sun really reflect like that on the earth? Maybe it does, but it stood out very strongly to me.

    Anyway, amazing work! I love seeing stuff like this because it makes me want to find a way to use it in a game. :)
     
  9. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    I just noticed this asset also has a Milky Way skybox along with it. Is the star field basically accurate? Or is it artistic? (Looks nice either way.)
     
  11. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi!
    The Milky Way skybox uses an ESA panoramic photograph, so it's accurate :)
    Consequently it's not a super hi-def skybox, so it doesn't fit super well with narrow FOVs, say under 50°. Above that it's perfectly fine though.
     
    hopeful likes this.
  12. Darkling420

    Darkling420

    Joined:
    Apr 20, 2013
    Posts:
    27
    Looks good but I'm guessing ii's not intended for Unity 5. Unity 5 supports 8k textures now but this only includes 4096 textures except the main earth texture. The clouds flicker badly as well using Unity 5. Otherwise nice looking planets. Hope to see a Unity 5 update.

    Edit: Lowering cloud shadow strength fixed the flickering.. Great asset. They do look very good.
     
    Last edited: Mar 27, 2015
  13. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Thanks !
    Well yes it's been made for Unity 4, though it runs ok with Unity 5 (I just noticed that the clouds are somehow darker in Unity 5 using the same luminosity settings).
    I plan to make a Unity 5 version that uses single 8k textures. I also thought about publishing a 16k earth for U5 only, providing a 8k version of the 20 textures used for the Earth, but i'm affraid the package size will be way too huge.. (might be beyond 1GB for just 1 planet..)
     
  14. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    How are you, great asset! However, I'm having trouble while combining it with other assets, here is what's going on. I'm on the latest regular release on Unity 5 and I use Visual Studio tools for Unity 2013. Your asset works fine alone in a new project. The client wants to 'fly into google earth' :| I bring CameraPath3 into the project and I get errors about "Editor... does not contain a definition for..." CameraPath3 works fine in all of my other projects in every situation. I tested another asset, SketchFab Exporter, it also had Editor errors when in the same project as your asset. I suspect it has something to do with UnityEditor.iOS.Extensions.Xcode. as there is a warning icon next to it initially when testing your project but not in any others. I dont know? Where can I start to troubleshoot?

    Also, how would I change where the clouds start? I need several seconds of fly-in and want to be able to see the landmass in a specific area.

    Please let me know if you need any additional information from me, thank you for your time.
     
  15. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi !
    Thank you first ;)
    Well I'm sorry for your troubles.. It's hard to tell blindly, but perhaps it has something to do with the script named "RotateCamera.cs" (attached on the "camera_traveling" object), is it activated in your project ? If so, try to rename the variable "Transform camera" in all that script, it seems that "camera" is a kind of keyword and some conflicts may happend..

    As for the clouds, just rotate the object on which they are on Inspector (there's a separated object -named "Clouds" - for clouds only).

    Hope that'll help
     
  16. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi !
    A new update has just been released for Unity 5:

    Asset Store

    I took the opportunity to add some improvements, including a 16k Textured Earth ! (for Unity 5 only, thanks to the new 8K texture resolution cap in Unity 5)
    To make the Earth a bit more "photorealistic", I also lowered the saturation and contrast of its texture, and turn the night lights color into a more orange tint. Normals are also much softer now, for the same reason.
    This update also come with an higher res normal map for Mars, normal map strenght slider on Earth and Mars shaders (useful when using "tangent spaced" textures directly), clouds luminosity slider, new demo scripts and various fixes.

    Here's how it looks :






    Finally, here's some 8K/16K comparison screenshots :

    Nile delta area
    Western Europe
    Cuba / Florida
    Andes Cordillera
    North Australian coast
     
    hopeful likes this.
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    I just bought this, and it's very nice, but immediately I'm wondering two things.

    1) Can we get a higher detail image of the Moon? Some parts look a bit blurry or double exposed.

    2) Is it possible to add detail maps, somehow, for the Earth?

    Let's say you want to zoom in from space to NYC or any other major city. Somehow you'd want to do a handoff from the current texture - which is nicely detailed for a view from space - to a texture that's more like a super high altitude shot. And then, if possible, maybe even another handoff to a lower altitude aerial shot.

    Any ideas on how to accomplish this?
     
  18. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi,
    First of all thanks for your purchase,

    1) Well the one included in the asset is the "best" I found in term of photo-realistic colors and is artifact-free. (no visible tiling stripes or black squares one can see on some higher-res maps)
    The double exposed thing, particularly visible on poles is due to a misalignment between color and normal textures, I have searched a long time for a solution, but sadly it seems that color textures and high maps available here and there comes from differents lunar orbiters. (Clementine for the colors, Kaguya/Selene for the highmap).
    I know that the Chinese orbiter Chang'e recently released super-hi-res textures for the Moon (around 200k*100k ! ), may be a solution can be found there.

    2) Well, no.
    However, what you describe sounds like virtual texturing (Celestia software uses this technique for example), there's solutions like this : http://amplify.pt/unity/amplify-texture/ to do it on Unity, though I don't know how it can be merged with the Earth of the asset.
    And you will have to provide a super-hi-res texture of earth. The last NASA blue marble textures available here: http://visibleearth.nasa.gov/view_cat.php?categoryID=1484&p=1 are 86400 x 43200 maps, it's really really big, but even then, you won't see the cities as you can see them in Google Earth for example. (the Blue marble texture has a 500 meters precision, Google earth within cities is somewhere around 1 meter..)
    So you'll have to provide more and more detailed aerial shot textures as you get closer to the ground.
    I'm sorry I'm not skilled enough to give you more details than that, hope that'll help though ;)
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Thanks for the response. :)

    It sounds like you understand the problem. I don't want to go with Amplify Textures for this, as I'd like a cheap and low tech solution. While I could probably figure out some way to get around it, like using a visual transition such as a fade to omit the altitudes I can't manage, it would make a great visual to be able to smoothly zoom in and out of specific spots that I'd prepared. And while actual satellite images could be used as a template - especially for large features such as shorelines on Earth or larger Moon craters and such - I can go with faked images as the surface resolution increases. I'd also like to be able to run it in reverse, to simulate a launch into orbit.

    When rising in altitude, I'd also like to be able to show the curvature of the horizon as it becomes visible, and the thinning of the atmosphere on Earth. Which brings up another issue when moving the view in and out, which would be translation from an orbital view to a near Earth view, and from there to a skydome when on the surface.

    So ... the idea of using a well-timed screen fade to finesse this seems pretty good - lol - but it's an interesting challenge to try to solve the problem.

    BTW, one odd thing I noticed in the shader's cloud cover is that as it proceeds from the starting position you get a copy of the Florida peninsula appearing in the clouds. Possibly that effect happens in other areas as well.
     
  20. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    So you want something a bit like Kerbal SP but with photo-realistic graphics right ? Sounds promising :p
    This asset is definitely not intended to do that, I made it as a background planets, on which you can get quite close, but still in space setting.
    As for the atmospheric thing, you can check this : http://scrawkblog.com/2014/05/19/proland-to-unity-atmosphere/. Results are amazing, transitions are totally seamless, but it's quite demanding.

    The cloud thing, yes, I'm aware of it, it's due to the fact that to simulate cloud motion, the cloud texture just rotates.
    Problem is, if you look at the texture itself, some clouds are drawn as they follow coasts, it's also very visible over Cyprus for example.
    I don't know if it's because clouds are really located that way, or if the NASA cloud texture have somehow merged with some coasts shapes. To solve this I guess I'll have to rework the texture by hand by removing or replacing those clouds pattern (those that share coast shapes) by other one..
     
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Well ... first you figure out what you want, then you figure out what you can actually do. :)
     
    vercetty00 likes this.
  22. HugoZandel

    HugoZandel

    Joined:
    Mar 11, 2014
    Posts:
    52
    A mobile friendly version would be a great addition to the package!
     
  23. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi !
    A new update has been released, here's the change log :
    - Earth normal map has been reworked. (for both 8K & 16K). The previous one was exaggeratedly soft, and looked just weird on some place.
    - Fixed a bug with the Earth specular map that caused black artifacts on the dark side of the Earth.
    - Fixed a flickering/artifacts issue on the clouds shadows shader when using DirectX 11.
    - A brightness parameter has been added on the Earth shader.

    Yes I agree, it's gonna be tough though, at its current state it pretty memory demanding ( even without additional settings). Making a mobile friendly version would mean lowering the details significantly, which are a great part of this package.
    I keep it in mind though ;)
     
    hopeful likes this.
  24. ANTARES_XXI

    ANTARES_XXI

    Joined:
    Dec 23, 2014
    Posts:
    141
    Very nice, but

    modern iOS devices support only 4k textures, so

     
  25. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    All right all right :D
     
  26. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi,
    A new update has been released !
    Here's the copy-pasted change log (because I'm super lazy.) :
    Regarding the city lights here's a before/after comparison :




    And as the change log says, now you can change the color tint of the city lights through the shader inspector.

    I also made a new video to show how it looks now :



    As for the mobile version, still working on it :p
     
    Last edited: Jul 13, 2015
    hopeful likes this.
  27. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    This is incredible! I'm so happy you made this. Best looking real-time 3D Earth I've seen to date.
     
  28. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Well thank you ! Really appreciate it.

    There's still many rooms for improvements though, especially regarding how the atmosphere is rendered..
    Things like Proland do it much better :


    And some have managed to port it to Unity :
    http://scrawkblog.com/2014/05/19/proland-to-unity-atmosphere/

    I don't know if it's possible to make something similar while keeping the versatility and the relative lightness of the package in its current state, but I'd say I won't be totally pleased until it has this kind of rendering. :)
     
  29. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    I think your atmosphere looks at least as beautiful! And it seems versatile enough to use it to create more exotic planets as well with a little bit of tweaking.

    I think the Proland atmosphere looks very similar to yours. When he starts descending into the atmosphere you can't really compare it any longer, because planetary landings with ground atmosphere, dynamic LOD, noise-based procedural surfaces etc is a totally different undertaking, which might even require a custom game engine. But from ISS distance and above, which is what yours is designed for, I think yours does an excellent job!

    The only minor things I noticed is that the hi-res sphere has a different alignment (z-axis is up rather than y-axis) and different scale compared to the built-in sphere (its scale in the Inspector doesn't correspond to meters). But that's a very minor issue.

    I also noticed that clouds don't receive shadows from the outside, but that's a known issue with Unity itself: that semi-transparent objects can't receive shadows. I don't think there's a simple solution to this yet until Unity reworks its shadow system. I was thinking that it might be possible to overlay the cloud layer directly on to the ground sphere shader, so it works more like a decal, but that will likely lead to a bunch of other problems. In either case, this is a also a minor issue, as large shadow-casters are not so common near atmospheric planets with clouds.

    Will surely buy your Saturn package as well once I'm done playing around with Earth. So far, I'm having lots of fun. :)
     
  30. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Some screenshots of me playing around.

    Screenshot 2015-09-16 21.23.32.jpg Screenshot 2015-09-16 21.20.54.jpg Screenshot 2015-09-16 21.10.42 crop.jpg Screenshot 2015-09-16 21.29.29.jpg Screenshot 2015-09-16 20.13.34.jpg
     
    exon101, GameTechnix and vercetty00 like this.
  31. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Thanks for all your kind words and these terrific screenshots (your white sun flare fits particularly well ! Btw would you allow me to use one of them for the asset store page ? (I really like the 4th one))
    Of course I also think it renders globally good, I wouldn't sell something I don't like ^^ , but working on it dozens and dozens of hours has made me see all the tiny flaws.. One that makes me sick is particularly visible on your 2nd picture, where the light from the atmosphere goes further than it should over the dark side. This isn't present on the proland rendering where the atmosphere feels much more "linked" to the planet light, like they're one.. And as I pursue the goal of being as photorealistic as possible, if you look at some real pictures or footages from space..well I think you get the idea.

    As for the shadows on the clouds, well, I spent dozens of hours facing this problem to render the planet shadow on the rings of Saturn, without full success.. I ended up modifying the blob projector shader to force it to project a texture on semi-transparent objects (thankfully a planet is a sphere, made things a bit easier), but yet I found no way to make it blend well with the alpha channel of the object texture(I think i tried every single blending mode..), so the shadow is actually opaque (well not exactly, it takes the alpha value of the projected texture only) ... But in deep space setting, it looks fine :)
     
  32. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Of course, you can use them however you like!

    I see what you mean. From an artistic stand-point, I kind of like that effect of the atmosphere "bleeding" to the sides, so I tweaked the settings and made the atmosphere bigger, but you're probably right that it's not super-realistic. I think many movies and 3D renderings enlarge the atmosphere and let it bleed for a more dramatic effect. Now that I look at photos from the Deep Space Climate Observatory (such as this), it seems like the atmosphere is hardly visible at all from that distance, so your original values should be more realistic.

    Yeah, shadows are really tricky! I'm impressed by what you did with Saturn, looking forward to try it out.

    Another minor issue I noticed is if you put a point light inside the Earth (to fake global illumination), it seems like the night lights are rendered even on the day side. Not sure what's causing it, but it's probably a shader issue (maybe it believes that the point light is the sun?).
     
  33. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    I tried to replicate NASA's Deep Space Climate Observatory photo of Earth:
    https://www.nasa.gov/press-release/nasa-satellite-camera-provides-epic-view-of-earth

    Here's the result:
    Screenshot 2015-09-17 14.19.52 crop.jpg


    NASA's photo for reference:
    187_1003705_americas_dxm.png


    Side-by-side comparison:
    Screenshot 2015-09-17 14.19.52.jpg


    I'm pretty happy how it turned out.

    I turned off night lights and turned down the outer atmosphere to almost non-existant in the script. Removed background stars, added post-process desaturation effect to reduce colors to better match the photo, and tweaked the atmosphere color, falloff and other settings in the Earth shader.
     
    Last edited: Sep 17, 2015
    vercetty00 likes this.
  34. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Wow nice job !
    For a second I thought your 1st screenshot was a photograph..

    Actually it seems that the bleeding atmosphere does exists from a low orbital point of view, you can see it in some of these famous ISS timelapses..But indeed it should disappear as you get further from Earth.

    I don't know about point light, but you could try to add some emission within the shader code ? ( just add something like o.Emission = 0.2; at the end)
     
  35. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Thanks :) Desaturation is pretty effective at giving it that photo-realistic look. But I imagine the Earth would appear much more colorful to the naked eye, considering that our eyes have a much higher dynamic range than cameras.

    About the point light, I think my explanation was a bit poor. What I'm actually after is to put a blue point or spot light inside the planet sphere, which doesn't affect Earth itself but objects outside it, such as an asteroid or spaceship. That way, an asteroid would get a blue tint when it approaches the Earth, to simulate light bouncing from Earth. The problem is that when I add such a point light, it messes up the night lights on Earth, and renders them in daytime as well as night. But now that I think about it, I can probably fix this by putting them into separate layers.

    Nice idea with emission though. Although it doesn't light up external objects, it can be used for extra atmospheric effects. I tried emission 0.01 and that actually looks pretty nice as the night side gets lit up slightly.
     
  36. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    There :



    Update incoming :D
     
    Sir-Spunky likes this.
  37. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Wow, very very nice :D
     
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    In the pic above, it looks like there's some cloud cloning going on near the Yucatan Peninsula. Since it's near the center of the pic, it really catches the eye (at least for me). And it looks like similar cloning is happening just to the SW, in the Pacific, and in the Pacific right below the Yucatan.

    On the whole, though, the clouds look lovely. :)
     
  39. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Well thank you both ^^
    Yes it's a well known one on the NASA cloud map (there's only one pattern available), the guy who made the famous "blue marble" pic few years ago have wrote about it :)
    The other ones are not as evident as this one tough. (or I missed them).

    Anyway I still have all the doc and screenshot stuff to do and I'm good to submit the new package.
    I keep this cloned cloud pattern problem in mind for the next one ;)
     
    hopeful likes this.
  40. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    The update is online !

    https://www.assetstore.unity3d.com/en/#!/content/17593

    Here's the changelog :

    So, as mentioned, I kept the possibility to force the atmosphere light to go further over the dark side, thanks to the 2 new parameters, which also give more options to tweak how the atmosphere effect looks.

    Here's some screenshots from the store page, in better resolution :






    Please note that the difference in rendering between those pictures and the ones from the previous versions are mainly due to the color space setting. These screenshots has been taken in linear color space, while the previous were taken under gamma setting. If you change your player setting to gamma, planets will look more like the previous screenshots (like the very first one on this thread), but with a better-looking/more-realistic atmosphere :)
     
    Sir-Spunky likes this.
  41. treelander

    treelander

    Joined:
    May 7, 2013
    Posts:
    2
    Thanks for this very nice asset.
    I bought it yesterday after trying to accomplish what you already did month ago.
    Great job!
    However, I was wondering if there is any way to support point lights, without adding a C# script to pass the lights direction relative to the planet (normal dir + atten)?
     
  42. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi and thank you !
    Well after reading your post I tried to make an atmosphere script that works with point light, so here it is :
    https://onedrive.live.com/redir?resid=BAC86DB1E2B50E!699&authkey=!ADjvFTmPngIuXPw&ithint=file,cs
    I made this quite quickly so it's far from perfect (the atmosphere tends to bleed over the dark side on crescent phases, and the "sun through atmosphere" effect is not well aligned) so it would need some adjustments and optimisations. But it's a start and at least it does takes into account the real position of the sun light object in the world space, instead of the rotation used for directionnal light.
    So in your planet prefab, replace the "Atmo.cs" script by this one, change the light type of your sun by "Point", and don't forget to massively increase the "range" value of the light, depending on the distance between it and your planet.

    FYI the piece of code I added is in the InitMaterial() function (plus the variables initialisation at the start) :

    Code (CSharp):
    1.  // Calculate the sun position relative to the Earth position to render the atmosphere in point light mode
    2.         sunvec = this.gameObject.transform.position + m_sun.transform.position;
    3.         distance = sunvec.magnitude;
    4.         direction = sunvec / distance;
    5.         mat.SetVector("v3LightPos", direction);
     
    Last edited: Jan 14, 2016
    hopeful likes this.
  43. treelander

    treelander

    Joined:
    May 7, 2013
    Posts:
    2
    Thanks for the quick response.
    It works to the extend that I consider it working very well.

    Thanks and best regards!
     
    vercetty00 likes this.
  44. digitaljohn

    digitaljohn

    Joined:
    Aug 14, 2012
    Posts:
    8
    I cannot seem to get the atmosphere showing on Mars? I'm using Unity 5.3.1p4 in linear color space.

    Any ideas?
     
  45. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hi,
    Only on Mars ?
    Could you send a screenshot ?
    Hard to say just like that. You might check if there are several instances of Mars prefab in the scene at the same time (there shouldn't), check if your camera is in perspective mode..
     
  46. DizzyWascal

    DizzyWascal

    Joined:
    Jul 16, 2015
    Posts:
    19
    Hello,
    In Unity 5.3.4p3 in linear color space and gamma color space, the atmosphere doesn't seem to be rendering in build.

    In editor the edge rim shows, but doesn't show in windows build, 64 and 32 bit.
    (I've made sure there's no other instances of the planet and the camera is in perspective mode, also these screenshots are from the Demo Scene from the asset)

    Earth Atmosphere Comparison Editor vs Build.jpg

    Amazing Asset though
     
    Last edited: Apr 27, 2016
  47. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Hello,
    Sorry for your troubles,
    That's really weird.. I tried to reproduce this, from 5.2 to 5.4 beta, dx9, dx11, deferred, forward etc... with no success.. even on the lowest graphic setting the atmosphere is still rendered.
    I doubt that would work but who knows: if you open the shader in Shaders/SkyFromSpace.shader , then on line 64 remove the "*1.03" from :
    Code (CSharp):
    1. float fCameraHeight = length(v3CameraPos)*1.03;
    to
    Code (CSharp):
    1. float fCameraHeight = length(v3CameraPos);
    Does it change anything ?
    Do you have the same problem with all the prefabs that have the atmosphere ?
    There's no error on console ?
     
  48. DizzyWascal

    DizzyWascal

    Joined:
    Jul 16, 2015
    Posts:
    19
    Hey thanks for the reply.

    I found the problem, the Sun wasn't tagged as "Sun". I thought even though the Sun was dragged into the Atmo script it would still work. My bad.

    I find it weird it would still work in Editor, it was marked as Undefined and when in build that's when it decided to throw null refs when I checked the Output_log.
     
  49. vercetty00

    vercetty00

    Joined:
    Feb 1, 2013
    Posts:
    41
    Oh yes you're right.. the tagged object overrides the object dragged through the UI whether it's empty or not..
    It's very simple to change that behavior in the Atmo.cs script by commenting the findWithTag line (or even change the tag name), but I guess I'm good for an update :D
     
  50. VincentMarin

    VincentMarin

    Joined:
    Sep 10, 2013
    Posts:
    3
    Hello,
    I just bought your asset which is really nice, but I have a problem with the 16K earth, as you can see below, in comparison to the 8k version. The EarthGround16k material is not working. Unity said me that there is a problem with GLSL compilation :
    GLSL compilation failed:
    ERROR: 0:202: 'missing' : syntax error: syntax error
    Do you have an idea about what I'm doing wrong...?
    My version of Unity is 5.3.4f1 with a pro licence.

    Thanks for help :)...

    Vincent

    Capture d’écran 2016-06-21 à 18.00.45.png Capture d’écran 2016-06-21 à 18.00.57.png