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
    Thanks for pointing this out. Replace the "Space Graphics Toolkit\Basic Pack\Scripts\SgtFloatingCamera.cs" with the attached file and it should work.

    When I originally designed this code I didn't have this kind of third person camera controls in mind, but it should work now.
     

    Attached Files:

  2. allakazan5555

    allakazan5555

    Joined:
    Mar 17, 2018
    Posts:
    10
    @Darkcoder thanks, now are working as well.

    One question, are better to move my character by the transform.position or by the floating point local values ?
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Both are fine, adjusting the transform.position is probably easier though.
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Hey everyone, in what was the fastest new asset submission acceptance in history, I present:


    The Planet Pack takes the planet features from Space Graphics Toolkit, and puts them in their own standalone asset. This new asset also includes over 20 high detail PBR planet scenes. This means users that only want the planet features and don't want to buy the whole package can get them at a lower price, and it also means users that already have SGT can get a big pack of high detail PBR planets already setup with SGT!

    I plan to include even more planets (e.g. gas giants) in a future version, as well as make a few small improvements that didn't make it into the initial version.


    During development of this pack I also improved many parts of SGT. The code/component "Pack" folders were renamed to "Toolkit", to make the distinction between media packs and feature packs clearer. The origin shifting system was moved out of the "Basic Pack/Toolkit" to "Universe Pack/Toolkit". A lot of dependencies were removed to make the packs/toolkits more modular. I developed the "SGT Plater Shader", which adds much better detail maps than the standard shader, as well as allows for runtime water level control. I will be updating the free media packs to use this shader soon!
     
    Last edited: Sep 24, 2022
    Igualop and John-G like this.
  5. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Heh, I know of someone else who had their asset approved in one day, today. I wonder if somebody is making a mistake in the asset store and just passing things through, or if they've made a substantial change in the review process?
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Second fastest then, as mine was two days. Hopefully it's the latter!
     
  7. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    The idea of them rushing things through made me think of this:

     
    Darkcoder likes this.
  8. allakazan5555

    allakazan5555

    Joined:
    Mar 17, 2018
    Posts:
    10
    @Darkcoder You have plans to make the SGT shaders (AKA Atmosphere, Flares, and stuff) compatible with new Unity Render Pipeline ?
    I'm so excited to use the Shader Graph in some features of my game, but i don't know if it's possible to upgrade my project.
     
    Last edited: Oct 23, 2018
  9. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    I will look into it more thoroughly soon, since it affects all my assets.

    However, my understanding is that it's a bit of a mess right now. Since the current cg shaders only work with the legacy pipeline, the Shader Graph only works with the LWRP, and you must write new HLSL shaders for the HDRP, and you can't have shaders from different pipelines in your project at the same time. Last time I checked, Unity recommended implementing multiple 'shader packages' into assets that users then manually import, which sounds like a stupid solution.

    I'm currently updating some core stuff in SGT, so that will have to come first.
     
  10. allakazan5555

    allakazan5555

    Joined:
    Mar 17, 2018
    Posts:
    10
    Yep, you need to use just standard shaders ou HDRP shaders, not both.
    But if you can launch a HDRP version of your shaders in the future it will be really awesome :)
    I'm working in a cool stuff for it in Shader Graph, like a terrain shader who change color/texture based in the terrain height, different planet biomes using some noise, it will be really cool to implement in SGT planets.
    But i don't have too much knowledge to make those in script, i don't know even if that functions i used in shader graph are supported in surface shaders lol
     
  11. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    SGT doesn't use standard shaders though, so I would need to write 2 additional versions of each shader to support LWRP and HDRP. If/when Shader Graph supports HDRP I may make graph versions of the shaders, assuming it supports keywords and other features extensively used by SGT. But this will likely not be for 6+ months.
     
  12. Razmot

    Razmot

    Joined:
    Apr 27, 2013
    Posts:
    346
  13. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
  14. Razmot

    Razmot

    Joined:
    Apr 27, 2013
    Posts:
    346
    P_Jong likes this.
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Thanks, that's very cool. I could easily copy+paste the meat of these shaders using this system and end up with a fairly simple looking graph without being to silly and making it all just one node.
     
    P_Jong likes this.
  16. Quarior

    Quarior

    Joined:
    Aug 28, 2017
    Posts:
    23
    Hi, I have a problem for update your package. In my assets, I see the description is correct but the date and when I import isn't the lasted version.
    But in the page of the package, is correct (in package preview).
    I used the Unity 2017 but I update to 2018 if there are also the problem but I see a comment said maybe is a bug :
    upload_2018-10-25_19-25-56.png
    Anyone have this problem ?
    Have a nice day.

    Edit : After the update in Unity 2018, I can update.
     
    Last edited: Oct 25, 2018
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The latest version of SGT requires you to use at least Unity 2017.3.0f3. From time to time users get issues where the latest version doesn't download even when they have the right version of Unity installed, in this case you need to delete the package from the Roaming/Unity folder, and re-download it from the asset store.
     
  18. Quarior

    Quarior

    Joined:
    Aug 28, 2017
    Posts:
    23
    Before I update, I have made this method but doesn’t work so maybe I haven’t the good version of Unity.
    Also some questions :
    • I see you made star clusters so do you think with the method of Floating Spawers we can made a procedural galaxy (ie replace particle by a procedural system).
    • Any plan to made procedural textures for planets (because you made already procedural heightmap) ? Else, I see other in the asset store.
    • The warp can be disable by example the player doesn't have in his ship yet the warp technology and active by progress (like Elite Dangerous with the "warp module") when is have ?
     
    Last edited: Oct 27, 2018
  19. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    104
    Hey man, any chance I could get a copy of the planet shader from the previous versions (the one with different textures depending on height)? Cheers.
     
  20. michaljabrzyk

    michaljabrzyk

    Joined:
    Apr 15, 2013
    Posts:
    57
    Hi. I need some think like orbit creator (orbit path creator). I need to see where the gameobject will go in next frames.
     
    Last edited: Oct 27, 2018
  21. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Hey Darkcoder, just a heads-up. Using SGT with ECS throws a warning if an object has multiple instances of the same component, which is the case when I'm using multiple SgtFloatingLod components:

    "GameObject contains multiple instances of the same component type. Only one instance of each component type will be added to the corresponding ECS entity."

    Wouldn't it be better if SgtFloatingLod had a list of prefabs and their settings?

    Anyway, I love SGT. The floating point and spawn LOD systems are beautiful.
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    1 - It depends how accurate you want to be. Real galaxies have billions of stars, and there's no way to render billions of stars at the same time. To do this you must make the galaxy spawn a limited amount of large clusters (e.g. 50), and when you approach one it should split into smaller clusters, and when you get closer those should split into even smaller ones, until eventually you end up with actual stars. This means you only have a small amount of objects active at the same time (e.g. less than 500), but can have billions of total stars in the galaxy.

    2 - No plans yet, it's a lot of work.

    3 - The current warp system is activated by pressing the warp button. You can disable warp by just hiding the button.


    Sure, I've attached it.


    The simple orbit system used in the origin shifting system comes with a path rendering system (used in the demo scenes).


    Using one component for each LOD made the code shorter so I did that. I didn't think about ECS or anything else when designing it. Changing this will break every origin shifting scene though, so I'll only change this when making the next major update to it.
     

    Attached Files:

    Last edited: Sep 24, 2022
    joshua_42 likes this.
  23. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    104
    Thanks for the shader. Having the same problem as before though - the seams on the terrain are highly visible.
    It works fine in 5.6.5.
     
    Last edited: Oct 29, 2018
  24. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Just installed SGT into a Unity 2018.3b project. The SgtDebris script was a bit of a mess, with duplicate usage of both a local debris variable and a global debris variable that needed fixing before that script would compile. Honestly I don't know why this would have ever worked in the past as that is a C# issue and not a Unity Version issue.
     
  25. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Would be really great to get like one or two of these planets included in the SGT package as an example of how to built a complete planet with the various features. I have come back to this toolkit time and again and always leave unsatisfied not because the asset is bad but because I simply can't figure out how to use it to make good assets.

    Or maybe sell the assets as a standalone thing without the planet features? I mean I want the planets but I don't want to also be paying for code that I already bought once before.
     
  26. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    I still haven't had time to go through the terrain code. Does this still occur when Normals = Normalized in SgtTerrain?


    Are you talking about a different script? SgtDebris is really simple, and only contains 8 public fields, none of which are static. I don't really see how this could conflict or fail to compile. Perhaps you installed the latest version of SGT alongside an older version and had duplicated scripts?


    The "Planet Toolkit" root folder includes a few planets with different setups. The free "Solar System Pack" & "Alien Worlds Pack" also include planets. These planets don't use the new SGT Planet shader though, because these require a slightly different PBR texture setup that I didn't get around to updating yet. You can get an early copy of the new "Alien Worlds Pack" HERE though. This will be linked to in the next version of SGT coming shortly.
     
  27. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Ok I don't know what the heck happened. I had imported this into a brand new project so no there couldn't have been anything old in there. But I deleted it and re-imported it and now everything is correct and the SgtDebris file specifically is vastly different.

    I think Unity was trying to mess with my head.
     
    Darkcoder likes this.
  28. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    104
     
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Here's a sneak peak of the upcoming version of SGT (currently pending review):



    This is a new planet demonstrating the recently added Planet shader. There are also many new demo scenes for each feature, allowing you to more easily understand what steps are needed to build the example scenes.

    Also, here's a sneak peak of the version after that, which I will submit soon:



    This demonstrates the new procedurally animated prominence feature. In addition to making stars and vortexes look cool, this feature can also be used to make relativistic jets!
     
  30. Quarior

    Quarior

    Joined:
    Aug 28, 2017
    Posts:
    23
    Nice update and feature.
    I have some questions :
    • For the water feature, is planned also to make possible for Terrain and maybe a layor for lava ?
    • How is determined light source when they have multiple SgtLight for SgtAtmosphere ? I test to put second star to the scene « Planet\Terrestrial Planet » with different distance and for test orbit the 2 « stars » around the planet with different eccentricity and angle/sec for a « star » (so the close « star » isn’t the same) and put color for star, one blue and other red, the atmosphere is illuminated by one star, no 2 and the light source doesn’t change related to the distance. Maybe you planned this ?
     
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    You can already change the water into lava by changing the 'Water Color' texture. The "Planet/Examples" folder comes with 4 water textures, one is for lava. To make the dark side of the planet glow, just increase the "Water Emission" setting. An upcoming version will add a new terrain shader suitable for the terrain feature.

    There's currently no code to prioritize lights by distance or brightness, but I will add it. The SgtLight.cs:56 (Find) method is responsible for this, and it simply copies all lights directly from the SgtLight linked list.
     
  32. Quarior

    Quarior

    Joined:
    Aug 28, 2017
    Posts:
    23
    OK so for the moment, I waiting the new update for made this.
    Have a nice day.
     
  33. michaljabrzyk

    michaljabrzyk

    Joined:
    Apr 15, 2013
    Posts:
    57
    Hi. I need to do somethink like that :

    And I see in SgtGravityReceiver we have a Acceleration equas a = cachedRigidbody.AddForce(vector.normalized * force * Time.fixedDeltaTime, ForceMode.Acceleration); (a = gravitySource.Mass * force * Time.fixedDeltaTime) becouse a = F * m; => F = m * a.
    But gravitational acceleration equals a = -G*M1/r*r =>
    And my question is Rigidbody has in stucture constans like G = 6.674×10−11 N·kg–2·m ?
    RGDS
     
    Last edited: Nov 8, 2018
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    I've attached an updated gravity receiver script. While it doesn't use the gravitational constant, it now no longer multiplies the time step twice. There's also the 'Visual' setting, which allows you to set a LineRenderer that will show the trajectory of the Rigidbody 'Visual Steps' ahead of time. If you're using the origin shifting system you need to hook the 'RebuildVisual' method into the camera moved event.
     

    Attached Files:

    Last edited: Sep 24, 2022
  35. michaljabrzyk

    michaljabrzyk

    Joined:
    Apr 15, 2013
    Posts:
    57

    Thx. Works perfect :)
     
    Darkcoder likes this.
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412


    Hey everyone, SGT is currently in Unity's "Singles Day" sale. If you live in Japan/Korea/China, you can get 50% by using coupon code: SINGLESDAY2018

    スペース グラフィック ツールキットが11月11日am01~pm23:59限定で50%OFF! バウチャーコード「SINGLESDAY2018」を入力してゲットしてね!
     
  37. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    That plant shader looks really nice. Their isn't a way to make that into a terrain planet right? Cause I wish I could, cause that looks way better than the current terrain stuff.
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Unfortunately there's no plant shader :D

    You're right, currently the Planet shader isn't compatible with SgtTerrain. Making it compatible isn't difficult, the problem is that the planets now look so detailed that generating an adequate mesh for them is beyond the capabilities of the current SgtTerrain implementation. Especially when you see the improvements I've made and will be coming out in the next update too. Here's a sneak peak:

    1x zoom (FOV 40):




    5x zoom:




    10x zoom:



    50x zoom:



    This exact planet scene will be part of the upcoming Planet Pack update which should come out in a few days.

    When I add support for SgtTerrain I will also be updating it to be much faster, but I still have to do lots of experiments with the code to see how far I can take it.
     
  39. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Ahaha, woops. I meant planet shader. But that looks really good, can't wait to see that as SgtTerrain. That'll be a good update.
     
    Darkcoder likes this.
  40. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Looking at your terrain sample scenes I noticed seams on darker areas of the planet. I searched the thread for fixes but couldn't find any.
    seams.jpg
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    It's mathematically impossible to map the normals, tangents, and UVs on a sphere in a way that avoids any seams unless you properly triplanar map everything, but that's difficult to do with surface shaders and fairly expensive. However, I've come up with a good compromise and have already implemented it, and it will be out in the next version of SGT.
     
    SONB and hopeful like this.
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Here's a sneak peak of the SgtTerrain optimizations, it's approximately amazing% faster than before. While not shown in this video, it also fully supports the SGT Planet shader.

     
    P_Jong, hjohnsen, joshua_42 and 4 others like this.
  43. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Nice! Can't wait for the next update.

    I was experimenting with the SgtFollow component in your demo scene and noticed that when it's set to follow in LateUpdate the camera rotates but doesn't move, no matter what dampening I set. UpdatePosition in the Editor works though.
     
    Darkcoder likes this.
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Are you sure the rotation isn't being controlled by another component? SgtFollow is pretty simple, assuming you enabled "Rotation" and have "Target" set, it should work.
     
  45. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    No no, the issue is in FollowIn of SgtFollow. I just loaded your example scene "03 Third Person" and only changed FollowIn from Update to LateUpdate. After that the camera stopped moving but it's still rotating. I didn't modify anything else. I know, it's weird, because SgtFollow is so simple, but I can't figure out why movement doesn't work in LateUpdate.
     
  46. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Welcome to the Matrix. I want to try that update, it looks nice. If need a bug reporter / tester, let me know ;). Just wish the atmosphere height adjusted in realtime, so I can have player jumping and wont jump out of the atmosphere by a tiny jump. eek.
     
    Last edited: Nov 22, 2018
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    The attached file should fix this. I think I'll simplify the origin shifting system too in the next update.

    It may look visually weird if the atmosphere height changes as you approach, but I can experiment with this in a separate component. I'll send you a test build soon!
     

    Attached Files:

    Last edited: Sep 24, 2022
    SONB and Natalynn like this.
  48. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Yay, thanks :). Please do! Would love both of those. I prefer low atmospheres in space, otherwise it looks super unrealistic and cartoony.
     
  49. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Thanks! It works now.
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    Hey everyone, version 3.5.7 of SGT was just released!

    It has many new features, including:

    • Upgraded Planet Shader
    The way detail textures are handled with this shader has been rewritten, giving much more impressive visuals up close, as well as a more impressive ocean.


    • Upgraded SgtTerrain (Dynamic LOD) + Planet Shader Compatibility
    Upgraded is an understatement, this component has now been rewritten to do all vertex processing on the GPU via compute shaders. This of course means it now only supports modern GPUs and APIs, but the performance increase is mind blowing. It's now so fast that I went back to calculating UV in equirectangular projection, allowing you to use simple single textures for your planets, which makes it compatible with the SGT Planet shader. There are still some optimizations left to go, but you can now simulate more modest sized planets.

    NOTE: I removed the displacement stack components (e.g. SgtTerrainSimplex) because I don't think it was easy to get good results with them. In fact, I think the way most terrain systems generate noise is confusing, so I went a completely different route. The SgtTerrain system's height data is now derived from the same way the Planet Shader's detail system works, and in a future version I will make them linked together to make editing even easier. This means the 'procedural' terrain is now derived from a selection of detail textures blended in some magic way. This works quite nicely now, but in a future version I will enhance this a lot to include biomes, and other more complex features.

    NOTE: If you're upgrading from an older version, keep in mind you must delete the child GameObjects called NegativeX/Y/Z and PositiveX/Y/Z, and then select "Rebuild" from the context menu.


    • Upgraded SgtAtmosphere & SgtCorona
    I improved the optical density calculations, so if you have mountains and other features on your planet, they now look much more impressive and accurate from space and from the ground. These changes also fix a minor visual glitch with the SgtDepthCamera component, and allow objects (e.g. spaceships) travelling through the atmosphere to look better.


    • Upgraded SgtCloudsphere
    You now finally have the option to add a detail texture to the cloudsphere. This means you can use a lower resolution cloud texture and still have it look better up close.

    • Upgraded SgtProminence
    This component now has animation via the new Distort and Detail settings. The settings are perhaps not so intuitive, so I recommend you check out the new Prominence demo scenes, which go through them step by step.


    Simplified Origin Shifting System (Universe)
    It became clear that most users didn't need the full feature set I originally provided, and allowing for this full feature set made certain simple things more complex, so you now no longer need to use the SgtFloatingPoint component. This means adding support for the origin shifting system in your scene can be as simple as adding the SgtFloatingCamera component to your camera, the SgtFloatingObject to each scene object that moves, and that's it! I also added extra code to allow for camera parenting with this simplified system, so most scenes should be upgradable very quickly without any modification. If you need the advanced features then you still need to use SgtFloatingPoint and understand how the system works in more depth, but I think that's fine.


    • Much More!
    There are also a lot of minor changes and additions. I recommend you try the updated "Planet/Terrestrial Planet" demo scene to see most of them.

     
    Last edited: Sep 24, 2022