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

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,404
    Try opening this file: Space Graphics Toolkit/Features/Atmosphere/Resources/SgtAtmosphereInner.shader, and changing line 46 to: Offset -1, 0

    It looks like the atmosphere thickness is also a little messed up in HDRP, I'll have to experiment with fixing that.
     
  2. afterdark1973

    afterdark1973

    Joined:
    Nov 25, 2019
    Posts:
    10
    looks like that sorted it! thanks for the quick reply, appreciated!
     
    Darkcoder likes this.
  3. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Thank you @Darkcoder I tested it out this evening and it work on editor and VR (GREAT!)

    Will this also work for the ring occlusion as well?
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Nope, rings require some separate code that will also be implemented soon.
     
  5. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Thanks again @Darkcoder . I'll wait for the next update then.

    On another topic, I am exploring the Solar System Pack and am having trouble with the Earth material. The Earth material doesn't render correctly, but Mars and Jupiter do. I compared Mars with Earth, but didn't see any significant difference in how the material was configured. I tried adding the Earth albedo to the Mars material and it worked, but adding the Mars albedo to the Earth material didn't. upload_2020-12-4_21-45-19.png
     
  6. Pixiehorse

    Pixiehorse

    Joined:
    Sep 19, 2020
    Posts:
    1
    @Darkcoder I'm running 3.7.9, my game currently uses Cinemachine to control the main Camera. It looks like when trying to use the Warp function on the main camera. The cinemachine brain brings me back to 0 each time after a warp. I can disable the component, warp fine. Enable the component and get snapped back. Thoughts on using Cinemahine with your toolkit?
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks, it looks like the issue is in the material there is no Height texture set (you can use the example Planet_Height texture), and the default Water Level is too high (you can set it to 0). If I make these changes then it appears to render correctly. I'll look into why this renders differently in SRP.


    The documentation HERE, especially the Handling Snaps section tells you in general what must be done. I haven't used Cinemachine in a long time so I can't give you any specifics, but based on your description it sounds like it's attempting to change the camera's position based on world space coordinates, but with an origin shifting these don't make sense. To fix this you must offset whatever position it thinks the camera is or is going by the delta given to you from the OnSnap event, or you can make Cinemachine work using Transform positions, which can be automatically updated using SgtFloatingObject.
     
    Last edited: Sep 24, 2022
  8. unicornmeister

    unicornmeister

    Joined:
    Oct 3, 2020
    Posts:
    7
    Hi Darkcoder, i tried the last version but i still have a bug with the singularity and single pass instanced. Did you had time to check ?
     
  9. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I'll check it out now. I recently changed the way everything renders, so it's possible I broke something after fixing it.

    [Edit] I think I fixed it, I'll send you a private message with a test build!
     
    Last edited: Dec 6, 2020
  10. unicornmeister

    unicornmeister

    Joined:
    Oct 3, 2020
    Posts:
    7
    Work like a charm! Thanks !
     
    Darkcoder likes this.
  11. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    Purchased the other day and so far, very impressed. Is creating a new planet as easy as creating a sgtshader with a new set of textures for the various components?
    And a take it the diff between the planets is one group is a simple geopsphere with a shader and the others actually use sgtplanet?
    (oh, and should the speed flicker or show smooth numbers?)
     
    Last edited: Dec 7, 2020
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Pretty much! I recommend you duplicate one of the exiting planet materials and swap out the textures, as the default values may not be so great and it may not be so obvious what must be changed to get it to look good, same goes for the atmosphere and other settings.

    If you're referring to the SgtFloatingSpeedometer, you can change the UpdateIn setting as well as your Rigidbody's Interpolate setting and maybe VSync. I don't think there's an automatic way to get the correct speed to display in a stable manner without manually setting these. I thought I set them up correctly though, maybe not.
     
    Soulice likes this.
  13. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    I have gone through the docs and they are well done. One thing missing is for those of us who rarely use assets: here, at a high level, is how you would use this assets pack to make a new game in space.... :)
     
  14. bliesflorian

    bliesflorian

    Joined:
    Mar 11, 2018
    Posts:
    5
    Hi all SGT Fans
    I need you! Trying to put ocean on my planet but i block on a lighting problem.
    When i am on hidden face of the planet , the water is the same... i want her to be "shadowed"
    Please Look at my video for better explanation, because my english is so bad
    thx a lot

     
  15. Hellgeist

    Hellgeist

    Joined:
    Feb 13, 2017
    Posts:
    15
    You can turn the water's emission value down in the inspector (planet material)
     
  16. bliesflorian

    bliesflorian

    Joined:
    Mar 11, 2018
    Posts:
    5
    Thanx, i hadnt the option in the tested shader. So i changed for Lit and saw the emission parameter.
    anyone have a good shader for water URP please ?
     
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    That's the mystery all of us are working on :)


    If you're using the SGT Planet SRP shader then setting Water Emission to 0 should fix this:

    upload_2020-12-9_18-18-57.png

    This looks correct in URP for me:

    upload_2020-12-9_18-19-15.png

    You can try the "Space Graphics Toolkit/Features/Planet/11 Atmosphere" demo scene to see this.
     
  18. bliesflorian

    bliesflorian

    Joined:
    Mar 11, 2018
    Posts:
    5
    Ok i know that Master.
    But i want to create sphere with shader who keep planet shadow too. how to do that?
     
  19. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    LOL @Darkcoder I hear ya. I am more looking for a "here is how you can get started implementing this asset into a new project...kind of a "start here" or "create empty 3D project, and start by adding a planet, or add your ship, then the floating origin, or..."
     
  20. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The SGT Planet and SRP shaders use Unity's built-in lighting system, so as long as your water shader uses this too, it should look the same. It looks like your water is unlit or emissive or something?


    That's what all the demo scenes are for in each of the feature folders. They're designed to be in order of complexity, showing you how to add things one step at a time. Almost all features of SGT are normal components you add to normal GameObjects, and they can integrate and so they can interact with and integrate with any other asset or scene easily. If you already have some kind of game then for example you can copy+paste a planet from an example scene into your game, or paste your game stuff into one of the example scenes. There's an infinite amount of ways you can make a project with the SGT stuff so you'll have to be more specific.
     
  21. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    I think thats good enough. Didnt know if there was a "specified way." I have a project but not sure how to incorporate my ship and its flight controls with SGT, so I think I will start a new project (current one not far along at all anyway) and start building my "universe" and see where it takes me. Again, fabulous asset!
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Great, let me know if you encounter any issues. Any improvements I make to the example scenes benefits everyone :)

    You can also check out "Terrestrial Planet" demo scene in the Basic Pack for a scene with the origin shifting system, a planet, and spaceship with controls already.
     
    Last edited: Sep 24, 2022
    Soulice likes this.
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Hey everyone,

    Version 3.7.10 of Space Graphics Toolkit is now out!
    • Added SgtRing.Occlusion setting.
    • Fixed SGT Planet shader default water level when using SRP.
    • Fixed Singularity feature when using single pass instanced VR rendering.

    Unity's curation team is going on holiday soon, so just bug fixes for now.

    Enjoy :)
     
  24. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    Can the SGTTerrainPlanet have Water with varied level?
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Yes, you can use the SgtTerrainPlanetMaterial component's WaterLevel and ClampHeights settings.

    upload_2020-12-18_22-48-7.png

    Keep in mind modifying these requires the terrain to be rebuilt, and the water surface is part of the terrain so it's solid.

    I'm currently experimenting with a way to render the water separately so it can have its height adjusted without performance penalty. This approach would also allow for the for the camera to travel underwater, and for there to be some kind of separate underwater scenery and gameplay. However, there are many challenges with implementing this in a way that looks good, especially with the way the atmosphere works. If my experiments are successful then this feature will very likely be released as a separate asset.
     
    Soulice likes this.
  26. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    Hello, what is a good start to use that asset in a Space game? Give it some tutorials?
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The demo scenes in each Feature folder are designed to be tutorials that introduce features one step at a time. If you'r having issues with a specific feature let me know so I can expand on them!
     
    Pandur1982 likes this.
  28. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    Thx, at the moment i will create a level how i can fly around :D
     
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    You can check out the "Terrestrial Planet" demo scene in the "Packs/Basic Pack" folder, which has a scene with spaceship controls and a planet you can land/crash on.
     
  30. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    Thx i will look on it.
     
    Darkcoder likes this.
  31. rydewitt

    rydewitt

    Joined:
    Sep 12, 2015
    Posts:
    6
    I have a few errors , prob my fault. It happens after I add the Planets Pack.

    Assets/Space Graphics Toolkit/Features/Terrain/Scripts/SgtTerrainSharedMaterial.cs(25,66): error CS0426: The type name 'OverrideSharedMaterialSignature' does not exist in the type 'SgtSharedMaterial'

    Assets/Space Graphics Toolkit/Features/Terrain/Scripts/SgtTerrainSharedMaterial.cs(16,34): error CS0426: The type name 'OverrideSharedMaterialSignature' does not exist in the type 'SgtSharedMaterial'
     
    Last edited: Dec 20, 2020
  32. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    I was digging through this forum and found where DarkCoder answered a question about zooming with the mouse wheel with the SGTCameraLook script that rotates around your ship. The answer was:
    "If you look at the scenes with the orbit camera, you'll see that I just place the camera as a child of the rotating parent, and use the local z position to set the orbit distance. So to make this distance adjustable you'll need to write a script that changes this local z position based on the mouse wheel or pinch gestures."
    I am having trouble finding the "distance" value. Anyone added zoom to the rotating look camera? I want to zoom in and out from my ship, while rotating the camera around it.
     
  33. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Try importing SGT after the planet pack. It looks like I made some changes to one and forgot to update the other. I'll try and submit a fix, but I'm not sure if Unity can review it right now.


    There is no distance value. As I said, the 'local z position' is used to control the distance, because in this setup the GameObject hierarchy is used to create the orbit:

    upload_2020-12-22_10-34-52.png
     
    Soulice likes this.
  34. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
    How are you all creating your spherical maps/textures for the shaders to make new planets?
     
  35. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    Hi,
    I'm a bit new here. I got the SGT few months back and I am pretty happy with it. Thank you for this

    I could use help with implementing the "SGT Starfield Custom" script into my project.
    I am generating interactable galaxy with my own script and using custom starfield for the rendering since it's looks awesome.
    The problem I am having is that the Starfield will not render unless I toggle the UI dropdown for the "Stars" field for the SgtStarfieldCustom script using the inspector in the Unity Editor.
    upload_2020-12-24_17-8-1.png
    After toggling the field once the stars begin to render.

    Heres the code I use from my Generation script

    upload_2020-12-24_17-11-57.png upload_2020-12-24_17-13-7.png
     
    Last edited: Dec 24, 2020
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The planets that come with SGT were made using Grand Designer, which you can get on Steam. I'm thinking about making a


    After modifying the Stars property you must then call the DirtyMesh() method. I'll add this to the documentation for the next version!
     
  37. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    Thank you very much for the help
     
    Darkcoder likes this.
  38. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    55
    Hey @Darkcoder .. looked into this a while back while exploring, and now that I have a space project, this has come to the 'short list' of assets.

    Saw the point about "Seamless Planetary Landing" .. which is a primary element for one of my cinematic sequences.

    So have couple of small questions:

    1- if I'm in space, see something like a ship exploding.. and then go thru atmosphere to land on planet.. could I still see the explosion in space? .. like .. shooting star stuff in upper atmosphere .. where the camera on the ship landing would see this explosion the whole way down to the surface. (day or night sky)
    (have some ideas how to do this .. but curious how your 'seamless' thing would deal with it .. camera looking up to sky and down at surface)

    2- landing on the planet surface.. flying past tall buildings in city .. are those surface objects also optimized by this system? (will have an earth type planet, some major cities, and want to do a landing and take off sequence beside the city)

    thanks for any info :)
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    1 - It depends on where these objects are and your atmosphere settings. When you land on a planet the atmosphere has usually transitioned to full opacity (opaque), so you can't see anything outside of it. This is done so that the stars outside 'disappear', similar to what we experience on Earth. There are also settings to remove this opacity on the dark side, allowing you to see the stars. Of course this is just an approximation of what happens in real life. In reality the atmosphere just lights up a lot which overpowers the relatively weak light seen from stars, so they appear to disappear. However, this more realistic setup would require high precision HDR rendering with an additive atmosphere, which SGT isn't designed for. I believe HDRP includes this already, and you can also see the vast complexity of the HDRP atmosphere settings required to get this kind of more realistic effect, so it's not a high priority for me to focus on. SGT is more aimed at maximum performance, easy to adjust settings, and getting as close to realistic as possible with these constraints.

    2 - The planet object spawning system just de/spawns prefabs, so any optimizations here would be down to how you set up these prefabs with LOD, texture resolution, billboards, etc. I plan to make some kind of system to directly spawn meshes that are batched to improve rendering speed, but this is more aimed at small objects like rocks and grass. Buildings and other large objects are probably best set up as prefabs.
     
    Swyfft likes this.
  40. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    69
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Forgot to finish that sentence :D I meant I’m thinking of making a tool that uses my other Paint in 3D asset to generate planet textures suitable for SGT. This could be both procedural and also allow manual tweaks/painting. This would be a free release, though it would require both assets.
     
    bliesflorian likes this.
  42. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    55
    Thanks for the detailed response :)

    ok .. so not looking for ultra realistic here.. (yet) ;)
    I could probably make it work on the night side ..
    so take a basic idea that you are on a spaceship.. eject in life capsule .. falling towards planet surface .. watching your ship explode .. seeing the flaming bits of debris spreading out (like fireworks or shooting stars) as you descend on the planet .. and when you land you can still see flame trails in the night sky ..

    actuallly .. during the transition either night or day .. all I really need to do is create new flame trails in the sky .. i don't really need to see the actual burning ship or whatever ..
    just want to see the fireworks ..

    and as for the buildings .. don't need 'walk in detail' .. just need to see that we're on a populated planet .. can spawn building prefabs when we get close .. for this one project, I am basically viewing up the whole time .. falling backwards to land on the surface .. so don't need to have the LOD visuals till we actually fly past the buildings.

    anything else I can work with for my next project / cinematic sequence .. :)

    If anyone that has this asset could take a look at a 'looking up' descent onto a planet with a light source in the sky .. and land beside a building .. and tell me whether it works or not.. that would be great too :D
     
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    For a cinematic sequence or one off effect then what you describe is no issue. If your planet is large enough then the atmosphere will be at least several km high, so you could place it just inside the outer radius so it’s always visible. If for some reason this doesn’t appear distant enough, you can always do a camera track and shrink its scale, and position it away from the camera so it appears as distant as you like.

    As for buildings, the de/spawning code runs fast enough, it’s mostly up to your prefabs and how optimized they are. You can copy+paste them as many times as you need in your current scene and disable static batching to get an idea of what it would perform like with SGT since there would be little difference.
     
  44. Eraile

    Eraile

    Joined:
    Aug 14, 2012
    Posts:
    16
    Sooooo cool!!!
    I wanted to ask exactly that from you!

    Looking forward to your release!
     
    Soulice and Darkcoder like this.
  45. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    103
    Hi @Darkcoder . I was wondering if you are planning to implement sun flares into the SGT kit. I have tried some, like in the beautify, (looks amazing) but they dont work well with floating origin in general.
    Thanks.
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    SGT has the SgtFlare, which can be used with the billboard system seen in most example scenes. I have no idea how this compares to Beautify. You can probably fix this by hooking into the origin shifting snap event and somehow force Beautify to update itself, or change the script execution order so it works after SgtFloatingCamera.
     
    Last edited: Sep 24, 2022
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Hey everyone,

    Tomorrow I'm going to be interviewed by TheMessyCoder on Twitch, check it out if you'd like!

    carlosWilkes.jpg
     
  48. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    418
    Nice interview. Messy Coder is so crazy. :D I like this guy.
     
    Darkcoder likes this.
  49. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    55
    Ended up getting the kit a few days ago .. did a few entry / exit tests..
    I can see the point where the stars fade / appear .. so I should be able to work with that nicely :)

    As for the city .. haven't tried putting buildings on the ground yet .. cuz have to figure out a navigation beacon or something to track to it 'in game' .. cinematic will be easy .. track to the object or point I need.

    Sorry missed the Interview live .. will catch up on Twitch later ..

    Looking forward to working with this kit :D
     
    Darkcoder likes this.
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Fantastic! I'll see if I can add some more demo scenes with objects on the surface. It should make it much easier for everyone to then modify it to include buildings, etc.

    Let me know if you encounter any issues.
     
    ProtoPottyGames, Swyfft and hopeful like this.