Search Unity

Space Graphics Toolkit & Planets

Discussion in 'Assets and Asset Store' started by Darkcoder, Aug 18, 2012.

  1. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    You can set the "Height" of the atmosphere from the inspector, and hover over for more details, or click the SgtAtmosphere component's documentation button to see documentation for the whole component. You can also control it from code as seen in the "Atmosphere/04 + Customize" demo scene, which calls the SgtAtmosphere.SetHeight method, which can also be done from code.
     
  2. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Does your atmosphere work with very large planets? I manage to work out the radius, but I am not getting very good results because my planet is very large, even with scattering and no inner fog. It has a radius of about 96000 units.
     

    Attached Files:

  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    It should work fine with planets of this size. Are you sure the "Inner Mesh Radius" setting of 96000 is correct? Keep in mind this radius is in local space.

    Also keep in mind a "Height" of 0.04 is incredibly small relative to the radius of the planet. A surface to atmosphere ratio this close will cause the atmosphere mesh to clip into the planet. You can replace the "Geosphere40" mesh with "Geosphere100" to improve this, but it may still clip into it. To fix this you would have to use an atmosphere mesh with a high vertex density at one pole, and to point that pole at the camera so there are always lots of vertices there. This kind of extreme scenario isn't something I considered in the design though, so there's no built-in mesh or component that can do this.
     
  4. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    So basically you can't use the Atmosphere component for large planets? Only small planets?
     
  5. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I am using Scaled Space and my Camera flags are set to Depth Only. I am doing this to overcome the planet size. However the atmosphere is clipping through the planet. Any idea on how to overcome this?
     

    Attached Files:

  6. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    So far I am a little bit disappointed. There is no clear documentation and the atmosphere component is somewhat too complex for me to work out, especially in regards to large procedural planets. The planets that you use an atmosphere on are incredibly small.
     
  7. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I am trying to make the Atmosphere transparent, I have set the inner fog to 0.9, still no good results? I have followed your tutorial on youtube. I just can't get this atmosphere to work?
     

    Attached Files:

  8. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    This is really disappointing man. I am sorry to be a disgruntled customer, but the atmosphere seems to only work on tiny little sphere that Unity creates. The sphere that I am trying to get it to work on isn't even that big. I have changed the inner fog and the outer fog and I am not yielding any results whatsoever. Just a pure white sphere? There is no documentation on how to get this to work. I have only managed to get the atmosphere to work on a 3D object sphere that you can create in Unity? I have gone through your examples. I am just getting total whiteness with the atmosphere. I am really disappointed considering the price I paid for this asset.
     
  9. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Earth has a radius of 6,371 km, and an atmosphere of around 100km (depending on how you define it), which means the atmosphere extends 1.56% above the surface. Your planet as you've set it up has a radius of 96km, and an atmosphere of 4cm, which means the atmosphere extends 0.0000416% above the surface. I don't think this is realistic, and so no it doesn't render correctly without some special code. In the next version I will include some code to improve the visual results for thinner atmospheres, but your settings are too extreme.


    You can adjust the opacity using the alpha slider of the color.
     
    hopeful likes this.
  10. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Ok I have adjusted the opacity of the color slider, however it is still looking very blurry and unsatisfying. I am not getting the results you get in your examples.
     

    Attached Files:

  11. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I also see that you do nothing to your colours opacity in your examples? I just don't understand why I can never get my atmosphere to look like any of your examples. I am using scaled space which means I have scaled the planet down. So the planet is no longer large anymore but for the life of me, I can't yeild any good results with your atmoshpere. Changing the opacity of the colour, just makes it blurry.
     
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Which example planet are you referring to? You can just copy+paste the atmosphere GameObject you want to use. To make the atmosphere look thinner I recommend you adjust the SgtAtmosphereDepthTex settings, particularly the OuterAlphaSharpness. The SgtAtmosphere.Color.a changes the overall opacity/transparency which is what you originally asked for, but I don't think it looks particularly good, but it doesn't make anything blurry.
     
  13. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Have a look at my settings and tell me what I am doing incorrectly because I am not yielding any good results, copying and pasting doesn't seem to yield any good results either. Can you please look at the screenshot and tell me how to adjust the setting to get at least some good results. The example scene I was referring to was the Terrestrial Planet 1k
     

    Attached Files:

  14. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I am also getting a very low FPS rate as I approach the planet. I am thoroughly disappointed in this asset, I had such high expectations but after messing around with it for last 6 hours. I just cannot produce any good results with your atmosphere.
     
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    You shouldn't reduce the alpha of the SgtAtmosphere.Color unless you want to hide the atmosphere or similar. You should use a higher InnerAlphaSharpness value like 2 to reduce the inner fog, and a higher InnerColorSharpness value like 1.5 so you can still see some color. I recommend you play with the settings one at a time from the example atmospheres so you get familiar with what the visual change will be.
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The atmosphere code is incredibly optimized and has very little overhead. Either your GPU is very weak, or some other code is slowing it down. Check the profiler to see.
     
  17. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    20
    Is there anyway to use the old simple orbit script? or at least use it with no floating point system?
     
  18. gaiastellar

    gaiastellar

    Joined:
    Nov 8, 2013
    Posts:
    57
    hi,
    i'm considering buying this just for the planetary LOD component, as this is in short supply on the asset store - however, can you answer a few questions:

    how big can the planets go - can they be real (-ish) sizes? maybe 1000000 units/ 1000km? or even 100km?
    can the terrain generation noise be customised for different terrain types?
    the atmosphere looks great but appears no where thick/ high enough to be even close to realistic? can this be altered?
    I would like to be able to use megasplat for shading the terrain (which does work on meshes). can i change the material on the terrain?

    many thanks

    paul uk
     
  19. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Sure, I've attached it.


    The mesh generation works up to 100km or more, but the shader rendering starts to break down around this point due to the UV tiling. I will be investigating solutions to this soon.

    The terrain generation is based on heightmaps and splat textures, so you can fully customize it. I will be enhancing this soon as well to allow for more biomes and feature types, as currently there are only two per planet.

    The atmosphere height can be altered by changing the "Height" setting. You're the first to say it doesn't look thick enough, as I tend to make the atmospheres extra-thick so they look more obvious in screenshots.

    You can change the material on the terrain by changing the "Material" setting, and it will automatically be applied. However, the terrain generation doesn't write any vertex colors, which I think megasplat uses. You would have to modify the code that writes the vertex data to write this data to your needs.
     

    Attached Files:

  20. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    20
    Thanks!
     
    Darkcoder likes this.
  21. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Can the Planet terrain handle Real scales?
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    As I said in an earlier reply, currently you can simulate planets up to around 100km. I'm still working on the planet terrain feature and this will be increased. I'll try to get to around 1000km with good results, as this is above 1:10 Earth scale and is more than enough for most projects.
     
    hopeful and killer1171090 like this.
  23. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Sorry must of missed it. Any Estimate on when it will be able to handle 1:1 scales?
     
  24. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    1:1 scale of what, and with what level of detail? If you're talking about 1:1 scale Earth with detail like in Outerra, then that will never be possible in SGT. If you just mean cranking the settings up to get a 1:1 scale Earth with minimal detail up close, then you can already kind of do that.
     
    killer1171090 likes this.
  25. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    104
    Regarding detail on a 1:1 scale planet - being able to use the terrain object spawner to tile a low-poly-mesh with high detail LODs that get their object from the planet's texture could be an alternative approach?
     
  26. ViniciusSanctus

    ViniciusSanctus

    Joined:
    Jan 23, 2016
    Posts:
    9
    DarkCoder friend,

    Is there a way to make the cloudsphere mesh to render both sides?

    Thx
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    How high detail? I need specific examples with images. 1:1 scaled Earth with "high detail LODs" up close is't happening though.

    I sent you a private message with a dual sided version.
     
    ViniciusSanctus likes this.
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    If somebody wanted a 1:1 scaled planet, they could do it in two (or more) stages, right? Use the SGT model for the space view, and then during zoom in, fade out the SGT model and fade in the 1:1 scale model. Because whatever the pre-built or procedural scheme is for the 1:1 world, you can only hold so much of it in memory at a time. You'd want to be mostly showing views from orbit or landed, and not a lot in-between.

    I think the tricky part might be transitioning from the SGT sky to the 1:1 sky, but this might be finessed by very quickly zooming from planetary view to ground view, and then looking up at the sky (clouds, etc.) that is associated with the ground view.

    Does this sound about right?

    SGT would be very good for making a realistic 1:1 comet or asteroid landing, but unless it is a very small planet, a 1:1 scale planet would need staging.
     
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Yes, this is the best approach, since it would allow you to then use the many terrain and cloud assets on the store to make really good looking surfaces up close. Expecting 1:1 Earth that looks high detail up close (even if it's just a low-poly look) is expecting too much of SGT, as it would require me to write not only the code all these other popular assets do for up-close landscapes, but to do much more because it would have to extend to thousands of km, wrap around a sphere, be seamless, be way more optimized than any of those, and there's no way I'm doing that amount of work for $100. My goal is to make small to medium sized worlds that look good, and that's it.
     
    neodorus and Wavinator like this.
  30. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    20
    May I have a copy too please?
     
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Sure, if you enable private messages/conversations.
     
  32. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    20
    Ok I should have it enabled now thanks!
     
  33. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Sent!
     
  34. nicocrazy

    nicocrazy

    Joined:
    Jan 13, 2018
    Posts:
    3
    hello

    I've got 2 questions about this pack :

    1 - With the planet lod function, is it possible to assign a collider to the ground in order to use planets like terrain ( walkable ??). is it possible to put other assets on the ground (like trees or rock). When you say 100 km planet are you speaking of diameter ?

    2- package is said to be compatible with 2017-3 or higher. is it really fully compatbile with unity 2018-2 ??

    Thx a lot
     
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    1 - You can set the "Max Collider Depth" setting to automatically generate colliders. The "Terrestrial Planet 1k" demo scene shows this. When I say 100km I refer to the radius.

    2 - As far as I've tested it, it works fine in 2018.2.0 and 2018.2.5. It doesn't fully support the LWRP and HDRP though, only the legacy pipeline.
     
  36. Phelan-Simpson

    Phelan-Simpson

    Joined:
    Jan 1, 2014
    Posts:
    31
    @Darkcoder

    What exactly are the compatibility issues with HDRP/LWRP?

    I am interested in the system, but was wondering which features work with HDRP/LWRP.

    Thanks,
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Most SGT features will work just by changing the shader tag and changing minor bits of code due to the few difference between Cg and HLSL, but notably the SGT Planet shader uses a surface shader, and therefore won't work unless ported to use Shader Graph. I plan to port this sometime after the next update, because there are some big improvements to the code I want to make first.
     
  38. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    hello awesome asset you ve done i have question inner atmosphere with act like volumetric does not work on other planet terrain there is way to make work the volumetric effect on other planet mesh ?
     
  39. michaljabrzyk

    michaljabrzyk

    Joined:
    Apr 15, 2013
    Posts:
    57
    Gas gigant's like for me .. real good. But for planet's with surface better will be some mixer based on color terrain. About FPS ... hmm ... my computer is a simple PC with 8GB RAM and GF GTX 1050Ti so is not so good. Panet scale is 2e+07 SgtFoatingCamera => SnapDistance = 1000f. So like for a flight with speed 50-100 km/s and active LOD eement 10 .... 20-40 FPS is not bad. White lines on surface fixed for now ,it was my fault ... to much LOD elements. Floating Point script's work's greate.
    . :) RGDS
     
    Last edited: Jan 7, 2019
    HeadClot88 likes this.
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    If you want to apply the planet atmosphere to a different mesh then you must add your other renderers to the SgtSharedMesh component's "Renderers" list. This component is automatically added alongside the SgtAtmosphere component on the same GameObject. If you're applying this material to a lot of GameObjects then it may be faster to manage the material yourself, so you can get it from SgtAtmosphere.InnerMaterial from C#.

    As for the FPS, are you sure you don't have VSync enabled? Your editor stats show the CPU is taking 10ms, try running the Profiler to see what's taking up so much time. As you can see, the rendering time is very quick.
     
    Utopien likes this.
  41. daliang2018

    daliang2018

    Joined:
    Aug 22, 2017
    Posts:
    10
    I want to use Backdrop as a background for a 2d (top-down) space design game, because your work is amazing, I think they will be great as a background!
    I have encountered a few troubles:
    1. I don't set up the camera. When I move the camera as I used to, the background doesn't change. This makes my plane feel like it is not moving and it becomes weird.
    Here, the background movement I am talking about is like a picture. When the plane moves, the camera can see different parts of the background.
    2. If the background movement problem can be solved, then I only use your plugin as the background part of the Android mobile game, then what optimizations can I make to improve performance? In terms of memory and textures.

    If the background is always static, then it won't work for my 2d game.
    It would be a pity that I am not distressed to pay for the money, but really want to bring such a good picture to the players.
     
  42. michaljabrzyk

    michaljabrzyk

    Joined:
    Apr 15, 2013
    Posts:
    57
    You right VSync was enabled,now it's much better. If I move faster frame rate going down ... but for me it's nothing bad. Ship in atmosphere flight can't move faster then 15km/s (if faster he will burn like hell) and to this speed FPS rate is 90 - 100 so it's good. Of course FPS rate in object with the same scale but without atmosphere is much better, like for me...perfect 15km/s - 35km/s is maximum what i need, up this speed ship will jump in warp couse it's imposible to move around big planet with speed 35 km/s, that's why ... https://en.wikipedia.org/wiki/Escape_velocity. Like you see Escape velocity for Jupiter is 60km/s but Jupiter don't have surface ... so it's not a problem :).
    Loot of CPU/GPU get's script's and camera..what is natural for rendering real huge object's with using floating piont scripts. Unity3D not support double precision and your script's fix that problem... that's 1. If you will look to other project's like this..you will see they working good but only in editor mode... in play mode it's little complicated.
    I will send you some details of my job. For me SGT is the best. :)
    Tomorow I will try to catch process what get's loot FPS. But first I have to check LOD's couse they are active to 0f from camera so in planet object all time active is flare + surface + asteroids + etc, but that's tomorrow.
     
    Last edited: Jan 8, 2019
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    1 & 2 - The SgtBackdrop component generates a high performance static mesh, like the stars in the sky. If your game is 2D then I assume your camera doesn't rotate, so it will always show the same part of the sky no matter how much you move the camera. To fix this you need to use a different component, the SgtStarfieldInfinite component is what you want. This component generates a non-static starfield that moves with the camera, creating an endless seam of stars. The "04 Infinite Stars" demonstrates this, and you should be able to copy+paste the starfield for use in your 2D game.


    SgtTerrain performance depends on your camera distance and camera speed, because the closer you are, the more triangles that needs to be rendered, and if you move fast then all of those triangles need to be updated all the time. If you look at your video there are over 1 million triangles when you get close to the surface. There is code there to spread the updates over multiple frames, and you can adjust this with the SgtTerrain.Budget setting, but it's also important to slow the camera down as you get closer. The SgtCameraMove component comes with code to slow the camera down based on terrain distance, but if you're not using this then you should add it yourself too.

    SgtJovian doesn't change anything based on distance though, so there are no restrictions to camera speed, the performance just depends on your GPU performance and how many pixels of the screen it fills up.

    I will be improving the mesh generation soon to fix mesh cracks caused by floating point issues. I think I may have to change the planet mesh generation code to use doubles to fix this.
     
  44. ViniciusSanctus

    ViniciusSanctus

    Joined:
    Jan 23, 2016
    Posts:
    9
    Hello friend I posted a question but it vanished (probably forum bug)

    I wanted to know if is there a way to control number of rings, and how do i make its shadow on planets more dimm.

    Thx and sry for bothering you once again. =D
     
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    No problem. To change the amount of rings you need to change the SgtRing.MainTex setting to a texture that has more rings. To make the shadow dimmer you need to adjust the SgtShadowRing.Texture to be brighter. If it's a high detailed shadow texture then you can use the SgtShadowRingFilter component to blur the shadow, which will make it softer. To make this easier I'll extend the SgtShadowRingFilter component to have more settings.
     
    ViniciusSanctus likes this.
  46. michaljabrzyk

    michaljabrzyk

    Joined:
    Apr 15, 2013
    Posts:
    57
    Day after day I see loot of changes in Unity3D like new packages for eg. Shader Graph. Personally am waiting for Visual Scripting package, that will be moust usefull package.

    Do you think about mesh terrain generated from icosahedrone?
     
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Actually I think supporting SRP will be easier than I expected. I upgraded one of my other assets with it (just vert + frag shaders) without issues, in a way that supports all 3 pipelines. I also experimented more with Shader Graph and found that it's possible to have a graph with the same shader name as a surface shader (though annoyingly you can't do shader groups/folders with them!), and that Unity will pick the shader graph over it in the browser. Annoyingly, Unity doesn't automatically switch old shader references to shader graph ones even if they have the same name though, so I don't think I can make it automatically work, but we'll see.

    The reason why I use a cubed sphere is because of how simple the logic becomes to traverse the tree, there are also some benefits to if you want to apply a cube map texture to it. Icosahedrons have better triangle distribution and I guess some of the code could be simpler.
     
  48. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    hello there,

    is there a way to increses the subdivision level of sgt terrain it limited at 3 to bring all the detail of the standard height (grayscale map) made on zbrush and is there way to smooth height map artefact with noise or something ?

    also when the planet size get bigger lthe collider seems too became not precise any idée ?
    and do you have documentions for component witch details all variable ?
    thanks for any help
     
    Last edited: Jan 14, 2019
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    You can increase the amount of LOD levels by clicking the "Add Distance" button at the bottom of SgtTerrain, or by manually modifying the distance list.

    The next version of SGT will include cubic interpolated heightmaps, which will make them look better, as well as some noise options. You can already use the detail maps to add nose though, this is demonstrated in the example scenes.

    The physics system doesn't work too well with large coordinates, so you shouldn't scale your planet up too large (e.g. above 10,000 units). You can follow the "Universe" pack examples to integrate the origin shifting system to improve this, but there are still some limits there. I plan to improve this in a future version.

    You can click the documentation button at the top right of each component to view the documentation for each setting.
     
    Last edited: Sep 24, 2022
    Utopien likes this.
  50. stickycube

    stickycube

    Joined:
    Dec 3, 2017
    Posts:
    1
    Hey there,

    I was just wondering if anyone knows of a way to achieve realistic keplerian orbits using the SgtFloatingOrbit? I have sort of fudged it by creating a child GameObject of the original parent point and adding an SgtFloatingPoint component to use as a new parent point for the orbit, then offsetting it until it looks about right:

    upload_2019-1-17_0-12-0.png

    However, in a real keplerian orbit, the tangential speed of the planet increases as it gets closer to the star. Any ideas?

    Thanks!

    (Great asset btw, wish i had found it sooner)