Search Unity

Space Graphics Toolkit & Planets

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

  1. astearon

    astearon

    Joined:
    May 9, 2016
    Posts:
    18
    i am stuck on 2018.2 due to console restrictions
     
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Alright, I managed to get it to build in 2018.2.21f1. It probably works in earlier versions too, here's what I did:

    1 - Download the latest SGT in a new project. This will install packages and break your project, but that doesn't matter.
    2 - Export the SGT folder as a new unitypackage, and then delete the project. This package won't include any package dependancies.
    3 - Make a new project, with C# 4 backend, and with the following package versions:

    Code (CSharp):
    1.     "com.unity.burst": "0.2.4-preview.48",
    2.     "com.unity.collections": "0.0.9-preview.10",
    3.     "com.unity.mathematics": "0.0.12-preview.20",
    You may be able to use slightly newer versions, but I found that the latest mathematics package at least doesn't work in 2018.2... fun times.

    4 - Install the previously exported SGT unitypackage, and then replace the default; with default(SgtPosition), math.PI with (float)math.PI, and math.PI_DBL with math.PI.

    5 - It should now mostly work. I can then run the "Earth Sized Planet" demo scene without issue.

    However, I notice that scenes that make use of more advanced UI features like "Water Level" cause Unity to crash. This may be due to some sort of serialization difference between 2018.2 and 2018.4. To fix this you can probably delete the UI from 2018.4, then export a package you then import into 2018.2, but I didn't have time to test this.

    I think I will remove all package dependencies from the next version, and implement some kind of popup that tells you want to import, because it seems like a huge mess allowing Unity to 'automatically' import these.
     
    astearon likes this.
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Hey everyone, I made a short video showing off the new terrain and black hole features:



    This time I actually saved the scenes used to make these, so I can eventually make some kind of download pack that includes them. I also made a little script to move the camera with the origin shifting system along a preset path, which makes recording these kinds of clips smoothly so much easier.

    Anyway, there's a new version coming out soon with some small fixes :D
     
    Last edited: Sep 24, 2022
  4. astearon

    astearon

    Joined:
    May 9, 2016
    Posts:
    18
    Thank you so much for the guide, I will test this now. Glad at least something good came out of my issue.
    not having an autoimport seems better in my opinion. At least until Unity fixes this.
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Indeed, though considering the Package Manager has been out for over 2 years I'm not holding out any hope. I investigated this some more yesterday and I think the best solution is to just tell users they must manually install these packages, as writing 'clever code' to detect and automatically do this seems a little tedious and may cause problems.
     
  6. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Hi,

    I am currently using the Space Graphics Toolkit to render my space backgrounds (amongst other things) and I have run into an issue when trying to render out my background to a cubemap.

    I want to do this because I want to use the cubemap as a background for the atmosphere and sky rendering system when the player is on a planet.

    This is the issue:

    https://forum.unity.com/threads/2019-1-converting-cubemap-to-equirect-problem.722771/#post-5764888

    Basically, when rendering the nebulae, seams are generated. This seems to be because the nebula clouds are billboarded, and they rotate with the camera.

    I know this is a long shot, but is there any kind of solution for this?

    Thanks!
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    I sent you a private message with a modified shader that rotates the billboards based on position rather than the camera rotation. As you can see, when moving across the poles of the billboards you get an undesirable 'rolling' effect, which is why I implemented them based rotation. In your scenario though this issue isn't visible.
     
  8. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    25
    Hello Darkcoder! This is a image that You asked on Reviews, regarding more realistic accretion disk for Black Hole. Can You Make it in the future version?
    thanks.
    a-black-holes-accretion-disk-swirls-around-it-emitting-x-rays.jpeg
     
  9. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Hi,

    Thanks a lot for your response, and the modified shader.

    I have imported it, and it does seem to solve the camera rotation problem, but I am getting some issues with the transparency on the nebula clouds.

    This image shows what I mean:

    https://imgur.com/Ud3ebHH

    I have experimented with the settings (turning off follow camera, etc) but I can't seem to resolve this.

    Do you have any idea what is causing this?
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    That's from Space Engine right? I'm not sure how that is rendered, perhaps I should try it out again and see. It almost looks like the accretion disk itself isn't flat, and is bending up as it goes past the black hole relative to the camera, which might make sense. The SgtLens uses a cubemap which renders from a single point, and since the accretion disk is a flat disk, it's not visible from this single point. If I were to bend it up then it would be visible, not sure how it would look though. I need to experiment some more :D


    Interesting, this issue is from a normal camera and not a rendered cubemap right? If so, does your scene only contain SgtStarfieldNebula and perhaps SgtBackdrop components? If so, can you show me the settings for them?
     
    P_Jong likes this.
  11. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Hi,

    This is just from the normal camera, yes. It happens in the editor and the build. I've changed nothing else, just added the new shader. If I switch back to the old shader, everything looks fine again (although obviously the rotation issue is still present).

    I am using several SGT Elliptical starfield objects for stars and nebulae, that's it. I am using other assets like Aura 2 volumetric lighting, but I don't think that would be causing any issues.

    This is the setup for one of the nebula clouds:

    https://imgur.com/csSjznP

    The issue occurs with all of them.

    Thanks for your help!
     
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Hmm, it looks like you're using a pretty old version of SGT, so that might be the cause of the issue. SgtEllipticalStarfield was replaced by SgtStarfieldElliptical almost a year ago, and since then I may have changed some variables that get sent to the shader, making this new shader incompatible. Since this is just for background cubemaps and you don't need SGT to render them, you can just make a new project with the latest version of SGT + the billboard package and render them, then use the rendered cubemaps in your current project?
     
  13. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Ah, that could be it.

    Yeah, I am using an old version.

    The problem is that my project is pretty complex, and I basically need both shaders.

    I am working on a space exploration sim, where the player can land on planets. I am using SGT for the space scenes, and then when the user transitions to a planet, I am baking a cubemap from the space scene into the atmosphere background, so that I can see the nebula, stars, etc, at night, but still get atmospheric effects like clouds, etc, etc. This actually works really well, except for the seaming issue that I was having.

    I am planning to use the existing shader for every situation where the player is moving, and then swapping to the new, modified, shader to generate the cubemap, then swapping back. I'm not sure if that will work, but that was my plan.

    I may need to wait until I have time to update the SGT. I suspect it will be tricky to do that in the middle of a project, due to code changes, etc.

    EDIT:

    I just tried to update the SGT in another project, and it causes a whole host of errors, sifting through those would take a considerable amount of work.
     
    Last edited: Apr 30, 2020
  14. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13


    How do I create a terrain on my planets like this. I bought sgt but I cant create terrains like this. I tried everything.
     
  15. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    Hello, new user to the SGT. really liking it so far, im wondering how do I get the distance between 2 objects if they are using the floating origin system. many thanks
     
    onemicmusic101 likes this.
  16. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    418
    Hi, calculating the distance is the same with or without floating origin. The floating origin is moving everything in the scene. It moves the player back to 0,0,0 and everything else relative to the players position, so you can use Vector3.Distance or calculate it manually.
     
  17. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    ah ok I thought there might be some method using the global position vector, thanks for the help
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    If you let me know the exact version of SGT you're using then I can modify the shader for it.

    I've attached the demo scenes used to record the first 3 clips.


    If your objects aren't too far apart then you can use Transform.position and normal Vector3 math. If your objects are very distant and/or you want very accurate distances, then you can use the SgtFloatingObject.Position or SgtFloatingCamera.Position, and feed them into SgtPosition.Distance(...) which will give you a double of the distance between them in meters.
     

    Attached Files:

  19. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    >If you let me know the exact version of SGT you're using then I can modify the shader for it.

    Thank you very much for that, that would be extremely helpful.

    I looked at the change log (is that where I would get the latest version?) and the latest version there is 3.3.1.

    I could send you the starfieldelliptical shader that I have currently, if that would help?
     
  20. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13
    @Darkcoder When will you be adding trees, grass, water that you can actually dive in, rocks, flowers, plants ect?
     
  21. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13
    @Darkcoder Also I think you should make more tutorials so that its easier for us to make things without asking a bunch of questions. Visuals are much easier then reading tbh.
     
  22. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    219
    If you want that, have a look at Gaia.
     
    onemicmusic101 likes this.
  23. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    hello All thanks for the help ive got the distances now, so im onto making some way for players to select distant stars. ive got a telescope on my spaceship (a camera using a render texture to draw it onto a panel in the cockpit) and ive been trying to hack the warp pin script to select the star the telescope is pointing, it does select stars but not the one im looking at, so im stuck on the bit where it measures from the mouse click on the screen in 2d as im using a render texture and theres no mouse click just want to select whats ahead of the camera in the center of the render texture, anyone got any ideas on how to get this working, also I see elsewhere on the thread references to using a starfield for a star map. is there any example or resource I could use to get started on a starmap. cheers

    btw I just noticed the above post can you use gaia to populate the planet terrain ?
     
    Last edited: May 4, 2020
  24. Robert_bechara

    Robert_bechara

    Joined:
    Jun 29, 2019
    Posts:
    2
    Hello DarkCoder,
    I have just bought you package SGT and i am using unity 2019.1.2f1, and every time I import it I am getting an error in Job,Burst and Mathematics namespace is not found, yet i would have imported them before importing the package how can I fix this problem, because one of the major thing I need is the dynamically generated planets. How can I fix the problem?
     
  25. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13
    I'm trying to create grass, trees and water on @Darkcoder planets not just a terrain. If you have used the asset Gaia to create what I'm talking about then please share some images because I highly doubt that Gaia will be effective. I bought @Darkcoder SGT package and now I dont have any trees, grass, water or any earth like materials. So what now just a planet with mountains. Also how do you add assets on the planet without it going through the mountains once they generate in the gameplay?
     
  26. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13
    What spaceship controls asset are you using?
     
  27. dajnooo

    dajnooo

    Joined:
    Feb 22, 2019
    Posts:
    12
    I've been trying out URP but I get dark terrains. I can only get them lit by changing the light to a directional light. Does anyone know what the issue is, or are point lights not currently working with URP?

     
    onemicmusic101 likes this.
  28. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    41
  29. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    418
    JFI66 likes this.
  30. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    418
    The other more tricky way is using Space Engine. Space Engine has a planet editor and with Space Engine Pro you can export high resolution textures.
     
    JFI66 likes this.
  31. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    41
    Hi,
    thanks a lot for the links. I'm looking for the additional files like heightmap, and details map.
    I will have a look into the ressources!
     
    dirkjacobasch likes this.
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    I sent you another shader. This time I pasted the changes into the 3.3.1 version, and it seems to work in the few demo scenes I tried. If it breaks in your scene still then you can try reducing the SgtEllipticalStarfield.Radius.

    I plan to add some low detail rocks and plants as example media, but I won't spend too much time on it because there are many assets out there that offer these things with immense quality that I can never match, I'll stick to the tricky terrain code :D

    I don't plan to add water because like procedural terrain it's another can of worms that has a never ending feature list. I may eventually add some rudimentary water sphere with depth fading, but nothing complex like oceans or waves or shoreline stuff.


    I agree, though typing is much easier for me than making videos :D

    You will have to implement your own selection system in this scenario. You can see the SgtFloatingWarpPin.Pick method, which finds the screen point of each target from its camera-relative position.

    There's no support for Gaia.

    If they didn't install automatically with SGT then you must manually install these from the package manager window. Installing Burst alone should automatically install the other two though.
    The Planet/Dynamic Planet/Spawner demo scene shows you how to spawn meshes on the surface of your planet as you approach. Once I add some more media I can make some better examples, so that example just spawns asteroids. You can change the Rotate setting to improve the rotation, and you can set the Splat texture so this prefab only appears in the areas you want.

    Hmm, not sure what's causing this. I can't seem to get get it to light up at all with a point light
    , I'll look into it. Directional lights are better if you can use them though.
     
  33. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Thank you very much for that! It seems to work extremely well!

    Out of interest, what were the issues that you were talking about when you mentioned a "rolling" effect?

    I am also using the new shader with a moving space ship in my game, and I don't see any rolling effect.
     
  34. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    HI DC thanks for the help I managed to get it working and I gotta say it is cool inspecting stuff at distance, for reference if anyone else wants to make a telescope, I made it work by forcing the pick coordinate to half the width and height of the render texture. works a treat

    the warp pin searches a list of floating targets for the one closest to the pick. but im wondering is there any performance issues or limits you would advise on how many floating targets I can use at one time ?

    sorry one more thing, im using basic unity physics to fly my ship around and it seems to work ok except the sgt speedometer varies a lot. should I be using the SGT thruster, does it do things differently for the floating point system ?

    thanks
     
    Last edited: May 6, 2020
  35. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13
    Does anyone know an asset I can use to add grass, trees and rocks?
     
  36. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    41
    Hi,
    did anybody used SGT with android and got this effect:

    There are scratches between the planes of the atmosphere
     
  37. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    41
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    If you try a scene like the spiral/elliptical galaxy one and move the camera around the top or bottom of the galaxy then you will see the billboards twist as the camera passes over their poles.


    The less objects you have in your scene the better. To achieve this you must carefully design the SgtFloatingSpawn__ components so they only spawn stars/planets/etc as you approach them, and if done right you can have a full galaxy with only a few hundred active objects at once (e.g. nearby stars + local planets + orbiting planet moons). I will make some more advanced demos of this soon :)

    In the latest version I added the SgtFloatingSpeedometer.UpdateIn setting, which can be changed depending on your setup. You may also want to change the Rigidbody.Interpolate setting so it updates every frame. If I copy+paste the speedometer into the "Terrestrial Planet" and drop the spaceship into the SgtFloatingSpeedometer.Point setting then it works as expected.

    I'll send you an updated shader via private message.
     
    PhoenixAdvanced and JFI66 like this.
  39. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    Cool thanks for the tips. ill take my time on this gonna build a solar system and get that right I do need some persistence in my design and want to take on the scale that is possible thanks to your kit. I found this video with a coder who made the elite dangerous galaxy, its very interesting he basicly takes you through the whole process they used. EVERYONE making a space sim with SGT should watch this.



    and Dark Coder any chance of knocking up a stellar forge with features like this your kit ? it feels like a natural evolution building on the SGT random generation tools.

    cheers
     
    michaljabrzyk, JFI66 and MasonWheeler like this.
  40. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    219
    Just imported SGT and Planet Pack 1 in a 2019.3.10 project, standard render pipeline, and all of the planet scenes from Planet Pack 1 appear to be missing a prefab. All of them have this at the top of their hierarchy:

    upload_2020-5-10_10-50-13.png
     
  41. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    219
    Also, importing Planet Pack 1 causes all sorts of script errors. It appears that since its last update it's gotten badly out of sync with later evolutions of the SGT code.
     
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Cool video, I'll watch it thoroughly when working on this. There will indeed be more universe demo scenes coming.

    The planet pack hasn't been updated to the new SGT planet features yet, I'll try and get it done this week. You can use the planet materials on existing planet example setups and then tweak the mesh generation settings though.
     
    JFI66 likes this.
  43. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    219
    Thanks. Any idea what's going on with the missing prefab errors, BTW?

    Also, in SGT itself, I'm trying to figure out the Dynamic Planet system and particularly the atmosphere. In the scene "\Features\Planet\17 Larger Planet", the atmospheric haze is shown to be green in some parts, but mostly purple. And I don't see how that derives from the color selections given:
    upload_2020-5-11_8-2-24.png

    Can you clarify?
     
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The missing prefab is probably the UI canvas, which I think I replaced between the last update to Planet Pack and the latest SGT.

    The atmosphere color is mostly defined by the SgtAtmosphereDepthTex.InnerColor (center to horizon), and the .HorizonColor. The .OuterColor (horizon to sky/space) can also have some influence with a high enough .OuterColorSharpness setting.

    The SgtAtmosphereLightingTex.SunsetSharpnessR/G/B settings can also greatly influence the color based on the direction to the light.

    In this demo scene the green comes from the SgtAtmosphereScatteringTex.SunsetSharpnessR/G/B values, specially the Rayleigh scattering contribution. You can control this from SgtAtmosphere.ScatteringRayleigh (Lit > Scattering > ScatteringRayleigh). Like the sunset color this is also based on the light angle, but it's bi-directional.
     
    MasonWheeler likes this.
  45. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    219
    Thanks, that makes a lot more sense!

    BTW is there any good way to have a skybox while on the ground, and fade it out into SGT Backdrop as you ascend? I'm trying to set up a seamless transition between the surface and space.
     
  46. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    139
    Is there a Discord for this?
     
  47. ArthurHoeke

    ArthurHoeke

    Joined:
    Nov 27, 2014
    Posts:
    12
    Does the asset support planetary landings?
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The easiest way to do this is to calculate the camera altitude relative to the atmosphere height, and cross fade between SgtBackdrop and your skybox (or just draw your skybox on top of the backdrop).

    Nope.

    Yep.
     
    JFI66 likes this.
  49. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    13
    Does anyone know how to add trees, grass and water to these planets?
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The Dynamic Planet/Spawner demo scene shows you how to spawn things on the surface. Once I add some more media I can make better example scenes, but for now you can just replace the SgtDynamicPlanetSpawner component's Prefab setting with your own prefabs (e.g. trees, grass), you can also use multiple of these components to spawn different kinds of things, and use the Splat texture to control where they spawn.

    There's no way to spawn water (e.g. rivers) on the surface though, only the solid water that is a part of the SGT Planet shader.