Search Unity

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
    The video looks like a backdrop.
     
  2. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    When I want make some Real Stars, that are exists in Real Life, how can I spawn the Object in the correct Position?
     
    Last edited: Nov 27, 2022
  3. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    What does that mean?
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    What kind of object?

    You cannot assign the Prefabs list because it's a read only property. You must read the list property and manipulate it directly using the list methods. You need to study more C# if you don't understand.
     
  5. RetnuhStudio

    RetnuhStudio

    Joined:
    Jan 4, 2013
    Posts:
    28
    Hey Carlos

    Just noticed a bit of a graphical bug with the shared material feature of the atmosphere. I've managed to recreate it in a new project with the earth sized planet scene. You can see in the below gif it is not smoothy blending the material but rather cutting off about 3/4 the way up the tower.

    This is in scene view but it also happens in game view / build.



    I am using Unity 2021.3.5f1 - URP 12.1.7

    Cheers
    Matt
     
  6. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Stars.
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    This is how the atmosphere calculation is implemented. Basically, at the horizon the ground and sky should have the same opacity for the effect to look consistent. However, at the horizon the ground is half the distance compared to the sky, so the atmosphere density is halved to keep the values the same. The atmosphere ground effect (rather than sky) is applied to objects, because objects are usually on the ground, and so in the extreme scenario if your video it highlights the calculation difference. The 'proper' way to calculate atmosphere colors is of course with light in-scattering and out-scattering and multiple samples, but this is very expensive to calculate so it's not possible to get physically correct lighting in all scenarios. Plus, in real life you usually don't get such thin atmospheres and such large objects that go from the ground to the sky, so the simpler calculations of the atmosphere shader are usually fine, but they can break down in some ways as you see.



    If you mean the starfield then you can look at the SgtStarfieldCustom component, which allows you to manually specify a list of stars (this is also a getter-only property). Just call the DirtyMesh() method after so the mesh updates.
     
  8. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    No, i mean how can I spawn a object to a position with SgtFloatingSpawner. Like I creating a gameobject at the center 0,0,0 and i want another object at 0,5,2, i am giving the gameobject SgtFloatingSpawnerSphere, and the spawned object will be spawned procedurall not at 0,5,2. How can I do that? If you know what i mean.
     
  9. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The SgtFloatingObject component has the SetPosition method, which you can call with a new position. You can make this position using new SgtPosition(xyz, scale) where scale=1 is meters. The SgtFloatingSpawnerSphere component handles spawning itself based on the spawn Radius you specify, so you can't specify exact positions.
     
  10. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    ok thx, btw 4.1.0 is out, but there is still stands
    Space Graphics Toolkit - Documentation - 4.0.9 - Carlos Wilkes
     
  11. RetnuhStudio

    RetnuhStudio

    Joined:
    Jan 4, 2013
    Posts:
    28
    Ah ok, thanks for the reply. Yea I have a lot of large objects that move from the surface to out of the atmosphere and it's very noticeable but I'll try fake it somehow. Cheers
     
    Darkcoder likes this.
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
  13. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    I apologize if this has been asked before, but I couldn't find anything related to it:

    In my scene, I have multiple cameras and billboards. It appears that although only one of the cameras has the SGT Camera component, the billboard rotations are affected by the other camera positions as well, causing the billboards to fail to rotate toward the SGT Camera, sometimes (depending on where the other cameras are). What would you suggest as a fix?
    thanks!

    Edit: the billboards rotate for the scene camera when the scene view is active, but NOT for the SGT Camera. Odd.
     
    Last edited: Dec 2, 2022
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Which render pipeline are you using?

    The SgtBillboard component is designed to rotate to all cameras before they render the scene (including scene view). The SRPs have fewer camera events available than BiRP though, so it's possible the billboard code gets run before any of the cameras actually render anything, therefore leaving the billboards at the rotation of the last camera. If so, it would be best if I added some setting to manually specify which cameras the billboard should rotate to.
     
  15. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    Actually, I’m running builtin. Interestingly enough, some of the billboards appear to rotate correctly, and some don’t. I’m still digging to figure out why…
     
    Last edited: Dec 3, 2022
  16. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Nice! How is it looking from the bottom and inside the galaxy?
     
  17. TheGonzoGamer

    TheGonzoGamer

    Joined:
    Apr 24, 2019
    Posts:
    35
    First off, Love the kit. Been tearing into it for a few weeks now. Love the included pieces as well * chef kiss*
    Feature request:
    I know there is a black hole model in the kit and it's ...."cool"..... is it possible to add (Or if there is a way one can create) THIS as a black hole
    https://hackaday.com/wp-content/uploads/2021/03/black-hole.jpeg
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Hmm strange, it appears to work fine for me. If you could prepare a really simple demo scene that breaks on your end all the time then could you send it to me and let me know your Unity versions so I can try to replicate it?


    It's a squashed sphere so it looks the same on both sides and mostly disappears up close. You can combine it with a normal galaxy starfield to give it volume inside.


    To do this properly the black hole shader would need to be very complex and implement ray marching/tracing, which I have no plans to do. You may be able to get something close with something like the Accretion Disk demo scene as a base with different colors and such.
     
  19. TheGonzoGamer

    TheGonzoGamer

    Joined:
    Apr 24, 2019
    Posts:
    35
    Your advice gave me the direction I needed to create this

    upload_2022-12-6_10-28-0.png

    You have to see it in motion. It's a thing of beauty

     
    Last edited: Dec 6, 2022
    Darkcoder, hopeful and dirkjacobasch like this.
  20. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Hi,
    I love your asset, i'm a happy owner definitely.
    I would like to integrate invector.
    My goal is to seamlessly go from the outside of the ship, while in space, to invector controller while inspace. In order to live in the ship during the travel...hope i'm clear enough..Sorry...
    Is it possible?
    thanks
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Wow, very nice and close to the reference material! Maybe I should make a demo scene like this for the next version now that I know it's possible :D


    I have no experience with invector. Most of SGT is normal GameObjects with normal MeshColliders, so in theory it should work with most other assets. The main difficulty is that the 'up' direction in space changes based on the planet or spaceship you're on, so any character controller you use must have the ability to change this direction. It may also require a custom script to adjust this direction, but it depends on how they're all implemented.

    The larger example scenes in SGT also use the Universe feature, which likely won't directly work with any character controller without custom code to handle the origin shift. To start with I recommend not implementing the Universe feature so you can just focus on getting the up direction changes working, then you can later worry about the Universe feature with origin shifting.
     
    eaque likes this.
  22. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Many thanks. It's too complex for me:confused:, but now i know where to start.
    Forgive my daring, but if it's easy for you ...could you show an example based on the free third person asset from unity?:p
    i'm gonna ask to the GameKitController dev, it's controller seems to use a close "no gravity" feature...
    thanks again
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    There are so many character controllers out there that I have no plans to modify or support any of them. Same thing with multiplayer. It's up to you :)
     
    eaque likes this.
  24. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Of course, i do understand. :)
    I edited the post cause the gkc dev answered this question.
    I'll go back toying around with sgt ...
    Many thanks
     
    Last edited: Dec 8, 2022
    Darkcoder likes this.
  25. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    i’m sorry I haven’t gotten back to you. I’ve got pneumonia, so it might be awhile before I can provide this. But thank you! I will make a repro scene if possible as soon as I’m able.
     
  26. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    No problem, take as long as you need!
     
  27. vistaero

    vistaero

    Joined:
    Mar 23, 2017
    Posts:
    10
    Hi there! I recently finally got this amazing asset. But I've been exploring the demo scenes and found two issues.

    In the Saturn scene from the Solar System pack, when flying around there's sometimes a depth sorting issue with the rings that I can't reproduce with the Ring examples from the main package. Maybe it's something specific about the Saturn scene?

    Saturn.png

    And then in the Earth Sized Planet demo scene there's this glitch with the shore texture, like it's tiling correctly in one axis but not the other?

    Shore Texture.png

    Is there anything I can do on my side to fix these? Or I'll have to wait for the next version? Thanks!
     
  28. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Hi, when I add 2 Lights with SGT Light Component and adding a Sphere and Ring with Shadow Feature, there will be only showing 1 Shadow Ring, why? Screenshot_20221215_204708.png

    And SGT Floating Massive doesn´t work with SGT Floating Scaler, SGT Simple Scaler and Near Texs.
     
    Last edited: Dec 18, 2022
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Can you attach a modified .unity scene file with the camera already in a location that causes this ring sorting issue?

    Thanks, the tiling will be fixed in the next version coming out very soon!


    Each SgtShadowSphere/Ring component adds one shadow. Making it cast once per light would probably make sense, I'll add it to the to-do list to investigate.

    SgtFloatingMassive takes over the position and scale of the object so it won't work with these other components.
     
  30. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    So its impossible to scale a billboard with SGTFloatingMassive or is there an another way?
     
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    You can adjust the SgtFloatingMassive component's Scale or Size setting, or make your billboard a child GameObject and use the SgtFloatingScaler component's Target setting to change the scale of it so the two component's don't conflict.
     
  32. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    I figured it out before I read this. Thx for the Info!
     
    Darkcoder likes this.
  33. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Hi, I need an another help. Why does my Near Tex not work on Build? On Editor its on.
     

    Attached Files:

  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Could you modify one of the example demo scenes so the camera is in the correct spot to replicate this issue, and then send it to me?
     
  35. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    Hi. I want to combine your SGT Backdrop stars with standard unity skybox material. The problem is that the stars (SGT Backdrop) are visible only with render queue at 3000 and higher, if I use skybox material. Without it, I can set it to 1000 and it is fine but then the starts are behind the skybox. It does not matter what render queue the skybox material has really, the stars need at least 3000 to be in front of it but with that value, they are in front of every other mesh. I really dont know how to combine Unity standard skybox material with SGT backdrop.
    Thanks for the help.
     

    Attached Files:

  36. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    You mean to check if its work with one of you Demo Scene? If yes it doesnt work.
     
  37. Darkcoder

    Darkcoder

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

    Version 4.1.0 of Space Graphics Toolkit is now out!
    • Moved main build to Unity 2020.3.0f1.
    • Fixed Terrain shader's shore texture being stretched.
    • Fixed Jovian demo scene's aurora effect.
    • Added new Nebula feature.
    • Added new Galaxy feature.
    • Replaced Star Pack with new Galaxy Pack and Nebula Pack (see documentation).

    Packs.png

    For the new Nebula and Galaxy features I made the new Galaxy Pack and Nebula Pack, which you can get from the documentation HERE.

    Also, the SPACESHIPS asset is currently 50% off and works great with SGT!

    Merry Christmas :)


    If changing the render queue doesn't fix it then the issue is likely to be the blending mode, or perhaps the backdrop stars are too far away relative to the skybox?


    The Saturn demo scene works fine for me, but perhaps there's a specific camera angle required to replicate this issue. Therefore, I need you to prepare and send a modified demo scene to me so I can see the issue.
     
  38. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    Could you please test it out on your scene ? Just use any material for skybox (Lighting - Environment - skybox material) and try to have both things visible at the same time but the render queue of stars cant be higher than 2000 since 2001 would overlay geometry layer that is meant for meshes. So ideally skybox material at 1000 and stars at 2k.
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    You're using an older version of SGT so it's hard to test. In the current version if I enable the default skybox then it appears to render as expected:

    upload_2022-12-23_23-39-55.png
     
  40. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    How can the Object Spawn after X Time? I can´t get it really.
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Either write a custom spawner that somehow implements this, or make the existing spawners spawn a placeholder object that has a script on it that spawns the real object after some time. Either way, you must write some custom code that I can't help you with.
     
  42. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    Hi. I imported the update and got 17 errors in the console.
    Assets\Source of asssets and scripts\Space Graphics Toolkit\Features\Shared\Scripts\SgtOcclusionScaler.cs(86,15): error CS0101: The namespace 'SpaceGraphicsToolkit' already contains a definition for 'SgtDepthScale_Editor'


    Assets\Source of asssets and scripts\Space Graphics Toolkit\Features\Flare\Scripts\SgtFlareMaterial.cs(10,27): error CS0246: The type or namespace name 'SgtFlare' could not be found (are you missing a using directive or an assembly reference?)

    Assets\Source of asssets and scripts\Space Graphics Toolkit\Features\Billboard\Scripts\SgtDepthScale.cs(91,15): error CS0263: Partial declarations of 'SgtDepthScale_Editor' must not specify different base classes


    Assets\Source of asssets and scripts\Space Graphics Toolkit\Features\Billboard\Scripts\SgtDepthScale.cs(93,27): error CS0115: 'SgtDepthScale_Editor.OnInspector()': no suitable method found to override

    Assets\Source of asssets and scripts\Space Graphics Toolkit\Features\Ring\Scripts\SgtRingMesh.cs(11,27): error CS0246: The type or namespace name 'SgtRing' could not be found (are you missing a using directive or an assembly reference?)

    And many others. Do you know what went wrong ? Thanks.
     
  43. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    It wasn´t really hard to implement that Time in SgtFloatingSpawner.
    Bild_2022-12-26_232004245.png
    (Sry for the very little little Code, if its not allowed)

    But when I add a Variable for the "Time" it won´t show in the Script. Even on the Ring, Sphere and Orbit Script doesn´t work. Why and how can I fix it?
     
    Darkcoder likes this.
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    It sounds like you moved the folder of the old SGT version before you updated? If so, this may break the update and split the asset in two.


    All SGT components have a custom inspector at the bottom of the script file. You can add your Draw("Time"); line to it.
     
  45. Nekojin116

    Nekojin116

    Joined:
    May 13, 2019
    Posts:
    1
    How do you make a "terrain planet" with colliders ?? I've been trying for days now please can someone tell me how they managed to make it, because I want the player (a spaceship) to land on the planet BUT I fly through it

    Like if I wanna make a terrain planet right , with terrain colliders , how should the terrain value depending on the planet scale (raduis) ?
     
    Last edited: Dec 27, 2022
  46. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    Yes, that's what I did. So should I move it back to the "Assets" folder, update it and then I can move it elsewhere, right ? Thanks.
     
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Check out the "Terrestrial Planet" demo scene, and compare its setup to yours.



    That should work, assuming you're updating from an an earlier 4.X.X version.
     
  48. Darkcoder

    Darkcoder

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

    I'm proud to announce the release of a new asset:



    Cover (1).png

    This asset comes with a bunch of incredibly high resolution planets you can put in the background of your scene. Unlike planets in SGT or SGP, these planets are only visible in the background (i.e. no landing), which allows for some really interesting shader tricks for higher detail and higher performance.

    I made an extra special temporary discount for any existing customers of SGT, SGP, or Spaceships, so get it while you can ;)

    If you decide to get it then please write a review, it really helps out!

    Thanks for reading, and enjoy the holidays!

    >> GET ORBIT HERE <<
     
    Last edited: Dec 27, 2022
    hjohnsen and hopeful like this.
  49. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    It worked, thx!
     
    Darkcoder likes this.
  50. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    May I ask you about the new CW Orbit, is there a way to make them behave as if they were part of the background ? Like the player would never reach them. In my game where player can travel 2000m/s, he could reach the planet quickly and I just can't go and scale it 1000 times because camera far clipping would have to go quite far and that would ruin the shadow quality. Thanks.