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. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Bruh, I did this:
    Screenshot_20230202_183451.png Screenshot_20230202_183456.png
     

    Attached Files:

    Darkcoder likes this.
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    It's a realtime LOD system for a realistic sized Earth, of course it won't work well on old mobile phones. You can try dialing back the Detail setting and it may work. The demo scene settings as-is are designed for mid level desktops.

    As for the banding, I'm not sure. Perhaps it's an issue with the camera draw distance, or the z-buffer. You can try a different graphics API like Vulkan.
     
  3. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    You mean like this?
    Screenshot_20230203_185354.png

    This even doesnt work. When I make a new script and the distance will be shown in the Console, its working, the distance will be calculated, but why does the object not deactivating or activating?
    Screenshot_20230203_185354.png
    Screenshot_20230203_185957.png
    Screenshot_20230203_190011.png

    When I move, the calculation is working.
    Screenshot_20230203_190029.png
     

    Attached Files:

    Last edited: Feb 4, 2023
  4. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    When I add deactivating and activating System, its working. On my Octree Script it doesn´t work. Screenshot_20230204_170701.png Screenshot_20230204_170709.png Screenshot_20230204_170715.png
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    You're multiplying two distances together? Shouldn't you be subtracting them or something?
     
  6. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    No, "-", "+" and "/" doesnt work. Even when I do that with SqrDistance and Distance. At the start its working, but for the Objects that are spawning, its not working.
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Oh I see, you're squaring the distance here, and then comparing it to a non-squared distance (range):

    upload_2023-2-8_10-31-36.png

    This makes no sense, because you can't compare a squared distance to a non-squared distance. You should remove the * and everything after it so you're comparing two non-squared distances.
     
  8. Phobos10

    Phobos10

    Joined:
    Sep 9, 2021
    Posts:
    5
    Hi i was wondering if the script SgtDynamicPlanetObject still exists? im trying to get my character to stick to the planets surface so the player can walk around. I noticed the above script may help to do this on a youtube video. I cant find the above script inside my project files or any mention of it inside the documentation. Could it be that it has been re named ?
     
  9. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Its working. But when new Stars spawn, than they are not de- and activating...
     
    Last edited: Feb 8, 2023
  10. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Screenshot_20230208_191038.png
    The camera starts from the bottom left corner. The blue Circle Gizmo is the camera disabling range. When I move until I reached where the camera is in the picture, the stars are not de- and activating.

    Here is the script:
    Screenshot_20230208_191233.png
     
  11. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Ehm yes, the stars are in a new position, after they are activating... At the start they are in a perfect Position.They are instantiate and if they are out of range, they will be disabled, not destroyed. They are activating, they are sometimes in a new Position, when I move very fast I guess. The stars needs to spawn outside btw.
    Screenshot_20230208_191401.png

    Here is a script, how the obejcts are spawning:
    Screenshot_20230208_191833.png
     
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The terrain system was rewritten into SgtTerrain___ components. For planet objects you can use the new SgtTerrainObject component, which should have similar features.


    Not sure if there was a question there, but this looks really cool! Good job :)
     
  13. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Thx, they should be one, but I forget to put it. Does SgtPosition.Distance() work really like Vector3.Distance()? Still doesnt work for me.
     
    Last edited: Feb 9, 2023
  14. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Thx, they should be one, but I forget to put it. Does SgtPosition.Distance() work really like Vector3.Distance()? Still doesnt work for me.
     
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Yes it should, you can see the code for it, it just adds the difference between the LocalXYZ and GlobalXYZ * GlobalScale.
     
  16. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    And why it doesnt work for me? When new stars are spawned they are not activating or disabling.
     
  17. TheGonzoGamer

    TheGonzoGamer

    Joined:
    Apr 24, 2019
    Posts:
    35
    Having some issues setting up DebrisGrid for an asteroid field with a floating Origin.
    Using the same settings as in the example scene (Debris Grid).

    The prefab has the SGT_Debris component
    Debris_Grid Target is set to player ship. (Camera follows ship)
    Cell Count 60
    Debris Count Target 50
    My scale is a bit bigger than the demo scene so my show/hide distance is 3000-3100

    These values give me a total number of debris objects of 615.

    Issue 1b - Minor ) Does it makes sense to use LOD objects are debris? If you fade them out anyways I wonder if it wastes performances loading the LODs for an object that will fade out on their own.

    Is there an easy way to make the asteroid field surround the player more closely? I guess I could tweak the scale settings but that causes fidelity issues with the textures.

    EDIT: I scanned the class and didn't notice. Is there any way to pause the creation of new debris? I have an animation that plays and would need to pause any new pool manager gets for the debris object.
    Think of it like pausing the recycling of new debris (or stars in the case of Starfield Infinite) for the purpose of emerging from or leaving the debris field.
     
    Last edited: Feb 12, 2023
  18. PsigenVision

    PsigenVision

    Joined:
    Nov 18, 2020
    Posts:
    25
    So... this will be kind of out of pocket, but I'm sharing this here because coming upon this asset is what gave me the confidence to even feasibly try to make a space game...
    This might possibly be too personal for a forum like this, but I got sick about 2 years ago... and my whole life got turned upside down... a lot of opportunities I worked hard for were taken away by something out of my control... and I got stuck....
    While l've been stuck in this unwelcome, unexpected period of my life... this game became my saving grace
    It was the outlet for a sick man searching for meaning, honestly... and it was done in private... where I was too self-conscious for anyone to see... but I think that's enough of that now.

    Introducing Revelation! It's so so so early on... but it will be a guided open universe, story-driven, scifi adventure game. It will feature space combat, first person exploration, mystery, and voice-acted immersive dialogue. This is an early gameplay video (and I mean exTREMELY early), and it is powered by, among other things, Space Graphics Toolkit!



    There are still a lot of challenges... and a lot of features I need to figure out (like vegetation, water, clouds, stuff like that), but I'm forming a team slowly but surely! And a company too (PsigenVision)!

    So... thank you for making this asset, thank you for inadvertently giving me a way to get through some stuff, and thank you for helping me make something I love.
     
  19. MAVG

    MAVG

    Joined:
    Feb 22, 2018
    Posts:
    41
    I have an idea... had you thought about adding ring worlds? or dyson spheres (hollow planets things)?:)
     
    Last edited: Feb 17, 2023
  20. Darkcoder

    Darkcoder

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

    In continuation with the Modular Backgrounds asset series, I introduce:

    upload_2023-2-18_0-8-58.png



    This is a collection of incredibly high detail gas giant and ring prefabs that can be added to the background of your scenes.

    Just like before, there is a 2 week super duper special discount for owners of SGT :)

    10 points if anyone can guess what the next asset in this series will be.




    No idea, debug it and see.


    Does it work as expected with these settings when not using the Universe feature? These components weren't designed to be used together, so if your debris grid origin is very far away it might break.

    LOD can still make sense, but you should test performance of both to be sure.

    You can either increase the DebrisCountTarget to add more asteroids, or reduce the CellCount & Show/HideDistance so they only appear nearby.

    There is no way to pause creation of prefabs. This component is designed to be fairly simple.


    Looking really cool! I wish I had the time to work on a game :)


    Not really, because they would be a lot of work to implement, probably have many small edge case bugs which make it difficult to maintain, and not many people would want to use it. Basically, the worst combination for any Asset Store product :D
     

    Attached Files:

    PsigenVision, raydekk and dmenefee like this.
  21. Spenser_R

    Spenser_R

    Joined:
    Apr 19, 2018
    Posts:
    1
    How long until SGT supports Unity 2022? I got Better Shaders 2022 earlier and tried to do a rough conversion of the shaders to 2022 and got a few errors in console, I was just curious about if support is coming soon.
     
  22. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    How can SGT Floating Spawner save Positions without JSON?
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks, I wasn't aware a new version of Better Shaders was out. I'll look into it now.

    SgtPosition is marked as serializable and it just contains doubles+longs, so it should work with any serialization system that supports these types.
     
  24. PolarEclipse

    PolarEclipse

    Joined:
    Oct 11, 2021
    Posts:
    16
    Hi @Darkcoder,
    I noticed something strange with the stars I created, based on the one of the Suns you provided in the Solar System Pack.

    When viewed from a very long distance, the majority of the star disappears, as if only the Corona remained, as you can see on the screenshots below.

    First screenshot : Sun seen from ~16000 units away
    Second screenshot: Sun seen from ~23000 units away
    Third screenshot: Sun seen from very far away after turning into a red giant (the "hole" is quite visible there).

    Seems like the star starts glitching around 20000 units.

    My camera's far clipping plane is set to 1 000 000 so that shouldn't be the cause.

    Any idea how I could fix this?

    Here is the star's hierarchy:
    • Star
      • Sphere
        • Corona
          • SgtAtmosphereModel
      • Point Light
      • Billboard

    upload_2023-2-25_3-9-34.png

    upload_2023-2-25_3-10-39.png

    upload_2023-2-25_2-53-49.png

    Thanks in advance !
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    If I modify the Sun 3 demo scene so the camera has a 1,000,000 unit range, and place the sun 500,000 units away, then it renders fine for me:

    upload_2023-2-26_9-54-32.png

    At least in Unity 2020.3.0f1 with the built-in render pipeline under DX11.
     
  26. PolarEclipse

    PolarEclipse

    Joined:
    Oct 11, 2021
    Posts:
    16
    Hi again @Darkcoder,

    I've reproduced your modifications on the Sun 3 demo scene, and everything worked well as long as there's no Skybox.
    As soon as I showed a Skybox, I ended up with this :

    upload_2023-2-26_4-53-42.png

    I've tested with several skyboxes, ended up the similar results for all of them except the black one from your asset.
    The shader for the one I use on this screenshot is a "Skybox/6 Sided" type.

    Is there something I could change to make this type of Skybox work, or should I stop using it entirely?

    FYI I'm on Unity 2021.3.3f1 with the built-in render pipeline under DX11
     
  27. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    The nebulae are gorgeous!

    Quick question: how do I combine the background starfields (for example) with the planets from the SGT planets asset? When I combine them, placing a planet inside the background g.o. (so it also follows the main camera), the starfield is rendered in front of the planet, so there's a sorting issue. I'm guessing I need to add a component to the planet...
     
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    From what I recall, skyboxes are rendered at some non-customizable distance or clipping range ratio from the camera, so a scenario like this could exist. You may be able to fix this by changing the skybox material's RenderQueue to something lower so it renders before the sun surface.
     
  29. PolarEclipse

    PolarEclipse

    Joined:
    Oct 11, 2021
    Posts:
    16
    RenderQueue for the Skybox is already at 1000, lowering it didn't work.
    I'll switch to using backdrops instead.

    Thanks for everything!
     
    Darkcoder likes this.
  30. DethKwok

    DethKwok

    Joined:
    Mar 13, 2017
    Posts:
    15
    Update to my project using SGT.
    https://reactiveentertainment.itch.io/stardust/devlog/495146/update-00250-released

    Summary:
    Improved orbit generation, with support for multi-heirarchal orbits.
    More detailed Celestial bodies, read about formation of supernovas and immerse yourself in the inconsequential nature of existence.
    Exit into space and fumble around helplessly. Then use our new stabilizer thrusters to re-orient yourself.
    Randomize your space ship.

    I haven't yet updated from 3.8.1 to the newest SGT, but I hope too soon!
     
    Darkcoder and dmenefee like this.
  31. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    The new gas giant modular backgrounds look great!
    Would it be possible in the future for SGTJovian to look similar to it?
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    It would be possible to convert the gas giant textures to jovian textures. However, the resolution would be slightly lower. In the gas giant asset, the textures are slightly tiled, which is hard to notice. Whereas with jovian they must be cylindrical/equirectangular textures that wrap around the whole planet, and tiling like this doesn't work. When I finish the Modular Background asset series I will look into this and see how it turns out.
     
    raydekk and dmenefee like this.
  33. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    Hello, I just imported SGT and got this problem.
    Reimporting assets didn't help.
    Has anyone experienced this and a solution?
    Thank you in advance :)

    upload_2023-3-7_14-23-35.png
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
  35. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    Thank you very much!
     
    Darkcoder likes this.
  36. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    Does anyone know how to make the CloudSphere visible from planetside? What is the best approach here?
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The cloudsphere is only visible from outside the planet. If I were made dual sided then it wouldn't render properly from the outside, unless it were fully volumetric or something which is a lot of work.
     
  38. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    That's unfortunate... for full immersion within atmosphere, we need a solution for that. Is this within scope of the Devs, or has anyone thought about a solution? Maybe Shaderwise?
     
    PsigenVision likes this.
  39. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    So, I am playing around with a second atmosphere used as sub sea level ambience. Setting the correct height and camera offset plus adding the new atmosphere as shared magterial to the terrain made it cover the ocean. Now, I only miss a water animation on the top! :)
    upload_2023-3-14_15-21-51.png View attachment 1212168 upload_2023-3-14_16-24-29.png upload_2023-3-14_16-49-53.png
     
    Last edited: Mar 14, 2023
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
  41. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    Hello again. I could not tell if my original question was answered or not, but I'm still seeing a problem with the background starfield and planets from the older planet asset. I've attached a screenshot showing the issue. The stars are being drawn over the planet... is there a rendering queue setting I should change for them or for the planet?

    Edit: To clarify, I've added both a nebula background asset and the associated starfield background to a scene which already had one of the planet assets. I also did adjust the render queue value for the starfield. When I set it to the transparent level (3000) the planet was correctly rendered, but it began to flicker. Settings of the render queue higher than 2000 but less than 3000 gave less flickering. Please forgive my ignorance on this.
     

    Attached Files:

    Last edited: Mar 16, 2023
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The render queue settings are only useful for transparent objects that are in the background, and if they flicker it's possible they aren't transparent.

    If not, you can adjust the draw order by changing the scale.

    In SGT, the example scenes all have the Background GameObject, and all background objects are attached to this. You can adjust the scale of this root object to control the actual distance to the stars/clouds. The stars/clouds can also have their own size set in SgtBackground.Radius for example. In the example scenes this is 100 and 1000, for a total of 100000 units radius.

    In Modular Backgrounds it's similar, where there is a Background GameObject with the CwBackground component attached. Just like with SGT you can adjust the scale of this root object to change the background distance. By default it's 500 units radius.
     
    dmenefee likes this.
  43. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    Are there any negative side effects of not using the radius property of the scripts and instead scale a parent game object?
     
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Should be the same!
     
  45. Susihiisi

    Susihiisi

    Joined:
    Jan 11, 2018
    Posts:
    32
    Is there any way to use SGT Shadow Sphere with multiple Directional Lights? It seems only the latest activated Directional Light is interacting properly with the atmosphere when I have it on my planet. Without the Shadow Sphere all the lights are working properly, but I can't figure out any other way to prevent objects being lit through the planet.

    //Edit: I'm using URP and I have 1 bright Directional Light for the sun and 2 dim Directional Lights for moon and ambient light to the nightside of the planet. Only the sun really needs to be affected by the SGT Shadow Sphere, but currently it's making it so that only one of the Directional Lights can interact properly with the atmosphere.
     
    Last edited: Mar 23, 2023
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Each SgtLight casts one light, and each SgtShadow casts one shadow. Making each shadow cast once per light is possible with some modification, but making the final blending work as expected is not possible without rewriting the shadow system and making it more complex+slower.
     
  47. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    When I make my own Script that uses SGT Floating Object and SGT Position, how can I save the positions? (I need it for my Octree System)
     
  48. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Hello, I am using Unity 2021 and a fresh install of SGT 4.1.0. I added the 'SGT Simple Orbit' component to a game object and set it up, but I don't see the debug lines that show me the orbit and distance from the center. I have used SGT 3.x on Unity 2020 and the debug lines show, so I know it should work.

    Is this an issue or setting in SGT or is it something in Unity? Thank you, Matt
     
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I don't remember off the top of my head if SgtPosition is marked as serializable. If it is, then you should be able to save it like anything else. If not, you can mark it, or manually save each element.


    I don't remember if this component has a gizmo, if it does then you must select the GameObject the orbit is on, and you also must have this component's gizmo enabled in the gizmo settings.
     
  50. nighty2

    nighty2

    Joined:
    Dec 29, 2020
    Posts:
    29
    Hi,

    I just wanted to remind you to please take a look after the NearTex not working in Builds.
    You should've received a simple example scene via mail a while ago.

    Cheers